Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Madara
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
Madara
Commits
ebacf562
Commit
ebacf562
authored
Sep 26, 2019
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复BUG
parent
5de2722d
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1562 additions
and
951 deletions
+1562
-951
index.js
src/main/index.js
+936
-894
index.vue
src/renderer/components/index.vue
+2
-0
chatitem.vue
src/renderer/components/msssage/chatitem.vue
+4
-0
index.vue
src/renderer/components/msssage/index.vue
+16
-1
forwardMsg.vue
src/renderer/components/team/forwardMsg.vue
+544
-0
contenteditor.vue
src/renderer/components/tools/contenteditor.vue
+2
-2
index.js
src/renderer/router/index.js
+57
-53
msgs.js
src/store/actions/msgs.js
+1
-1
No files found.
src/main/index.js
View file @
ebacf562
'use strict'
import
{
app
,
BrowserWindow
,
protocol
,
desktopCapturer
,
systemPreferences
}
from
'electron'
import
{
app
,
BrowserWindow
,
protocol
,
desktopCapturer
,
systemPreferences
}
from
'electron'
const
cp
=
require
(
'child_process'
)
...
...
@@ -13,7 +13,7 @@ const SDK = require('../../static/sdk/NIM_Web_NIM_nodejs_v5.9.1.js')
const
http
=
require
(
'http'
)
const
ipc
=
electron
.
ipcMain
const
shell
=
electron
.
shell
const
shell
=
electron
.
shell
const
Menu
=
electron
.
Menu
const
Tray
=
electron
.
Tray
const
dialog
=
electron
.
dialog
...
...
@@ -30,11 +30,11 @@ global.FILEURL = ''
global
.
VERSION
=
''
global
.
ISCUSTOM
=
false
global
.
PREVIWERURL
=
''
global
.
PREVIWERVIDEOURL
=
''
global
.
PREVIWERVIDEOURL
=
''
global
.
PREVIWERIMGS
=
[]
global
.
PREVIWERIMG
=
0
global
.
DIALOG_MESSAGE
=
''
global
.
CURRENT_TEAM_MEMBERS
=
{}
global
.
DIALOG_MESSAGE
=
''
global
.
CURRENT_TEAM_MEMBERS
=
{}
let
updateTimer
let
loginWindow
let
mainWindow
...
...
@@ -47,6 +47,7 @@ let scrollerhotWindows
let
addNewUserWinodes
let
dialogWindows
let
noticeWindows
let
forwardWindows
let
appIcon
=
null
let
isLogin
=
false
let
timeout
=
null
...
...
@@ -59,12 +60,12 @@ let mainEvent = null
let
screenEvent
=
null
let
messageEvent
=
null
let
messageProtocol
=
null
let
CAP_IMG
=
''
let
nim
=
null
let
SCREENCOUNT
=
0
global
.
defaultdownloaddir
=
require
(
'os'
).
userInfo
().
homedir
+
'
\\
Downloads
\
\'
global.DEFAULT_SCREENSHOT_PATH
=require('
os
').userInfo().homedir+
'
\\
Pictures
\\
demo
.
png
'
global.AUDIO_PATH
=
process.execPath.substring(0, process.execPath.lastIndexOf('
\\
') + 1)
let
CAP_IMG
=
''
let
nim
=
null
let
SCREENCOUNT
=
0
global
.
defaultdownloaddir
=
require
(
'os'
).
userInfo
().
homedir
+
'
\\
Downloads
\
\'
global.DEFAULT_SCREENSHOT_PATH
= require('
os
').userInfo().homedir +
'
\\
Pictures
\\
demo
.
png
'
global.AUDIO_PATH
=
process.execPath.substring(0, process.execPath.lastIndexOf('
\\
') + 1)
const winURL = process.env.NODE_ENV === '
development
' ? `http://localhost:9080` : `file://${__dirname}/index.html`
...
...
@@ -76,13 +77,14 @@ const dialogUrl = process.env.NODE_ENV === 'development' ? `http://localhost:908
const noticeUrl = process.env.NODE_ENV === '
development
' ? `http://localhost:9080/#/notice` : `file://${__dirname}/index.html#/notice`
const addnewuserUrl = process.env.NODE_ENV === '
development
' ? `http://localhost:9080/#/addnewuser` : `file://${__dirname}/index.html#/addnewuser`
const appXmlPath = process.execPath.substring(0, process.execPath.lastIndexOf('
\\
') + 1) + '
app
.
json
'
const forwardUrl = process.env.NODE_ENV === '
development
' ? `http://localhost:9080/#/forwardMsg` : `file://${__dirname}/index.html#/forwardMsg`
if (process.env.NODE_ENV !== '
development
') {
global.__static = require('
path
').join(__dirname, '
/
static
').replace(/
\\
/g, '
\\\\
')
}
let windowIcon = nativeImage.createFromPath(path.join(__static, '
.
/
icons
/
logo
.
png
'))
fs.readFile(appXmlPath, '
utf
-
8
', function
(err, result) {
fs.readFile(appXmlPath, '
utf
-
8
', function(err, result) {
if (result) {
let version
try {
...
...
@@ -125,7 +127,7 @@ const isSecondInstance = app.makeSingleInstance((commandLine, workingDirectory)
mainEvent.sender.send('
openMsgBox
')
}
if (messageEvent) {
setTimeout(function
() {
setTimeout(function
() {
if (messageEvent) {
if (messageProtocol) {
messageEvent.sender.send('
openCurrentNewMessage
', '
p2p
-
' + messageProtocol)
...
...
@@ -147,7 +149,8 @@ const isSecondInstance = app.makeSingleInstance((commandLine, workingDirectory)
if (isSecondInstance) {
app.exit(0)
}
function createWindow () {
function createWindow() {
if (process.argv.length > 1) {
if (process.argv[1] && process.argv[1].indexOf('
woyou
:
') != -1) {
try {
...
...
@@ -176,13 +179,10 @@ function createWindow () {
let pathAll = folderpath + `
\\
` + downloadname
item.setSavePath(pathAll)
item.on('
updated
', (event, state) => {
if (state === '
interrupted
') {
} else if (state === '
progressing
') {
if (item.isPaused()) {
} else {
}
if (state === '
interrupted
') {} else if (state === '
progressing
') {
if (item.isPaused()) {} else {}
mainWindow.setProgressBar(item.getReceivedBytes() / totalBytes)
downloadObj.sender.send('
downloading
', (parseFloat(item.getReceivedBytes()) / parseFloat(totalBytes))*
100)
downloadObj.sender.send('
downloading
', (parseFloat(item.getReceivedBytes()) / parseFloat(totalBytes)) *
100)
}
})
item.once('
done
', (event, state) => {
...
...
@@ -206,7 +206,7 @@ function createWindow () {
const iconPath = path.join(__static, iconName)
appIcon = new Tray(iconPath)
appIcon.setToolTip('
麦子助手
')
appIcon.on('
click
', function
() {
appIcon.on('
click
', function
() {
if (global.NEWMESSAGE && global.NEWMESSAGE.length > 0) {
//getNewMsgWindows()
newMsgWindow.show()
...
...
@@ -224,7 +224,7 @@ function createWindow () {
}
}
})
appIcon.on('
double
-
click
', function
() {
appIcon.on('
double
-
click
', function
() {
if (isLogin) {
mainWindow.show()
} else {
...
...
@@ -237,7 +237,7 @@ function createWindow () {
})
const contextMenu = Menu.buildFromTemplate([{
label: '
打开主界面
',
click: function
() {
click: function
() {
if (isLogin) {
mainWindow.show()
} else {
...
...
@@ -251,10 +251,11 @@ function createWindow () {
},
{
label: '
退出
',
click: function
() {
click: function
() {
app.exit(0)
}
}])
}
])
appIcon.setContextMenu(contextMenu)
Menu.setApplicationMenu(null)
...
...
@@ -265,10 +266,10 @@ function createWindow () {
let updateDir = startDir + '
update
\\
'
let pa = fs.readdirSync(updateDir)
if (pa) {
pa.forEach(function
(ele, index) {
pa.forEach(function
(ele, index) {
var info = fs.statSync(updateDir + ele)
if (!info.isDirectory()) {
fs.rename(updateDir + ele, startDir + ele, function
(err) {
fs.rename(updateDir + ele, startDir + ele, function
(err) {
// if (ele.indexOf('
UpdateAuthority
.
exe
') != -1 && startDir.toLowerCase().indexOf('
c
:
') != -1) {
// shell.openItem(startDir + '
UpdateAuthority
.
exe
')
// }
...
...
@@ -279,19 +280,19 @@ function createWindow () {
}
}
app.on('
ready
', createWindow)
// app.on('
window
-
all
-
closed
', () => {
// if (process.platform !== '
darwin
') {
// app.exit(0)
// }
// })
// app.on('
window
-
all
-
closed
', () => {
// if (process.platform !== '
darwin
') {
// app.exit(0)
// }
// })
app.on('
activate
', () => {
if (loginWindow === null) {
createWindow()
}
})
ipc.on('
loginSuccess
', function
(event, userInfo) {
initNIM(userInfo.ImAccount,
userInfo.ImToken)
ipc.on('
loginSuccess
', function(event, userInfo) {
initNIM(userInfo.ImAccount,
userInfo.ImToken)
registScrollerHotKey()
getScrollerhotWindows()
global.LOGINUSER = userInfo
...
...
@@ -301,7 +302,7 @@ ipc.on('loginSuccess', function (event, userInfo) {
isLogin = true
const contextMenu = Menu.buildFromTemplate([{
label: '
打开主界面
',
click: function
() {
click: function
() {
if (isLogin) {
if (!mainWindow.isDestroyed()) {
mainWindow.show()
...
...
@@ -319,7 +320,7 @@ ipc.on('loginSuccess', function (event, userInfo) {
},
{
label: '
注销
',
click: function
() {
click: function
() {
global.ISSIGNOUT = true
global.LOGINUSER = null
global.LOGINTYPE = null
...
...
@@ -334,7 +335,7 @@ ipc.on('loginSuccess', function (event, userInfo) {
} catch (error) {}
const contextMenu = Menu.buildFromTemplate([{
label: '
打开主界面
',
click: function
() {
click: function
() {
if (isLogin) {
if (!mainWindow.isDestroyed()) {
mainWindow.show()
...
...
@@ -352,10 +353,11 @@ ipc.on('loginSuccess', function (event, userInfo) {
},
{
label: '
退出
',
click: function
() {
click: function
() {
app.exit(0)
}
}])
}
])
appIcon.setContextMenu(contextMenu)
loginWindow.show()
}
...
...
@@ -363,15 +365,16 @@ ipc.on('loginSuccess', function (event, userInfo) {
{
label: '
退出
',
click: function
() {
click: function
() {
app.exit(0)
}
}])
}
])
appIcon.setContextMenu(contextMenu)
if (process.env.NODE_ENV !== '
development
') {
let startDir = process.execPath.substring(0, process.execPath.lastIndexOf('
\\
') + 1)
fs.readFile(appXmlPath, '
utf
-
8
', function
(err, result) {
fs.readFile(appXmlPath, '
utf
-
8
', function
(err, result) {
let version
try {
version = JSON.parse(result)
...
...
@@ -380,7 +383,7 @@ ipc.on('loginSuccess', function (event, userInfo) {
version = JSON.parse(result)
}
version.CurrentUser = userInfo.ImAccount
fs.writeFile(appXmlPath, JSON.stringify(version), function
(err) {
fs.writeFile(appXmlPath, JSON.stringify(version), function
(err) {
//setTimeout(function () {
// shell.openItem(startDir + '
AutoUpdate
.
exe
')
// }, 1000 * 60 * 5)
...
...
@@ -393,10 +396,10 @@ ipc.on('loginSuccess', function (event, userInfo) {
})
})
}
setTimeout(function
() {
setTimeout(function
() {
try {
const RUN_LOCATION = '
\\
Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Run
'
let key = new WinReg({hive: WinReg.HKCU, key: RUN_LOCATION
})
let key = new WinReg({ hive: WinReg.HKCU, key: RUN_LOCATION
})
key.set('
WYOFFICE
', WinReg.REG_SZ, process.execPath, (err) => {
//console.log('
设置自动启动
' + err)
})
...
...
@@ -407,14 +410,14 @@ ipc.on('loginSuccess', function (event, userInfo) {
}
}, 1000 * 60 * 10)
})
ipc.on('
newMessage
', function
(event, data) {
ipc.on('
newMessage
', function(event, data) {
global.NEWMESSAGE = data
if (data && data.length > 0) {
var count = 0
if (timeout) {
clearInterval(timeout)
}
timeout = setInterval(function
() {
timeout = setInterval(function
() {
if (count++ % 2 == 0) {
appIcon.setImage(path.join(__static, '
.
/
icons
/
logo
.
png
'))
} else {
...
...
@@ -434,7 +437,7 @@ ipc.on('newMessage', function (event, data) {
newMsgWindow.hide()
}
})
ipc.on('
openSystemNotice
', function
(event, sessionid) {
ipc.on('
openSystemNotice
', function(event, sessionid) {
if (!xNoticeWindow || xNoticeWindow.isDestroyed()) {
sNoticeWindow = new BrowserWindow({
y: electron.screen.getPrimaryDisplay().workAreaSize.height - 190,
...
...
@@ -462,45 +465,45 @@ ipc.on('openSystemNotice', function (event, sessionid) {
})
}
})
ipc.on('
openNewMessage
', function
(event, currentSession) {
ipc.on('
openNewMessage
', function(event, currentSession) {
mainWindow.show()
mainWindow.setAlwaysOnTop(true)
mainWindow.setAlwaysOnTop(false)
global.NEWMESSAGE.splice(global.NEWMESSAGE.indexOf(currentSession), 1)
mainEvent.sender.send('
openMsgBox
',
currentSession)
mainEvent.sender.send('
openMsgBox
',
currentSession)
if (global.NEWMESSAGE && global.NEWMESSAGE.length == 0) {
clearInterval(timeout)
appIcon.setImage(path.join(__static, '
.
/
icons
/
logo
.
png
'))
newMsgWindow.hide()
}
})
ipc.on('
openNewMessageOther
', function
(event, IMid) {
ipc.on('
openNewMessageOther
', function(event, IMid) {
mainWindow.show()
mainEvent.sender.send('
openMsgBox
')
messageEvent.sender.send('
openCurrentNewMessage
', '
p2p
-
' + IMid)
})
ipc.on('
clearMessage
', function
(event) {
ipc.on('
clearMessage
', function(event) {
global.USER_CURRENTSESSION = null
// mainWindow.show()
})
ipc.on('
ignore
-
all
-
message
', function
(event) {
ipc.on('
ignore
-
all
-
message
', function(event) {
clearInterval(timeout)
appIcon.setImage(path.join(__static, '
.
/
icons
/
logo
.
png
'))
newMsgWindow.hide()
mainEvent.sender.send('
ignore
-
all
-
unRead
')
global.NEWMESSAGE.length = 0
})
ipc.on('
create
-
session
', function
(event) {
ipc.on('
create
-
session
', function(event) {
mainEvent = event
if (messageProtocol) {
mainEvent.sender.send('
openMsgBox
')
}
})
ipc.on('
create
-
message
-
session
', function
(event) {
ipc.on('
create
-
message
-
session
', function(event) {
messageEvent = event
if (messageProtocol) {
setTimeout(function
() {
setTimeout(function
() {
messageEvent.sender.send('
openCurrentNewMessage
', '
p2p
-
' + messageProtocol)
messageProtocol = null
}, 3000)
...
...
@@ -521,7 +524,7 @@ ipc.on('download', (evt, pdownloadpath, pfolderpath, dfileName, pmsgId) => {
})
ipc.on('
OpenFile
', (evt, filePaht) => {
var a = shell.openItem(filePaht)
let isHave=
true
let isHave =
true
if (!a) {
dialog.showErrorBox('
打开文件
', '
此文件不存在,可能被删除或者移动到其它位置
')
isHave = false
...
...
@@ -534,10 +537,10 @@ ipc.on('showItemInFolder', (evt, filePaht) => {
ipc.on('
openUrl
', (evt, url) => {
shell.openExternal(url)
})
ipc.on('
exit
', function
(event) {
ipc.on('
exit
', function(event) {
app.exit(0)
})
ipc.on('
signOut
', function
(event) {
ipc.on('
signOut
', function(event) {
global.ISSIGNOUT = true
global.LOGINUSER = null
global.LOGINTYPE = null
...
...
@@ -582,7 +585,7 @@ ipc.on('signOut', function (event) {
loginWindow.show()
const contextMenu = Menu.buildFromTemplate([{
label: '
打开主界面
',
click: function
() {
click: function
() {
if (isLogin) {
mainWindow.show()
} else {
...
...
@@ -596,54 +599,55 @@ ipc.on('signOut', function (event) {
},
{
label: '
退出
',
click: function
() {
click: function
() {
app.exit(0)
}
}])
}
])
appIcon.setContextMenu(contextMenu)
loginWindow.show()
})
ipc.on('
openPreviwerfile
', function
(event,
url) {
global.PREVIWERURL=
url
ipc.on('
openPreviwerfile
', function
(event,
url) {
global.PREVIWERURL =
url
getPreviwerFileWindow()
})
ipc.on('
openPreviwerfile
', function
(event,
url) {
global.PREVIWERURL=
url
ipc.on('
openPreviwerfile
', function
(event,
url) {
global.PREVIWERURL =
url
getPreviwerFileWindow()
})
ipc.on('
clearPrevImgs
', function
(event) {
global.PREVIWERIMGS=
[]
ipc.on('
clearPrevImgs
', function(event) {
global.PREVIWERIMGS =
[]
})
ipc.on('
addPrevImgs
', function
(event,
url) {
ipc.on('
addPrevImgs
', function
(event,
url) {
global.PREVIWERIMGS.push(url)
})
ipc.on('
openPreviwerImg
', function
(event,
url) {
global.PREVIWERIMG=
global.PREVIWERIMGS.indexOf(url)
ipc.on('
openPreviwerImg
', function
(event,
url) {
global.PREVIWERIMG =
global.PREVIWERIMGS.indexOf(url)
getPreviwerImgWindow()
})
ipc.on('
openPreviwerVideo
', function
(event,
url) {
global.PREVIWERVIDEOURL=
url
ipc.on('
openPreviwerVideo
', function
(event,
url) {
global.PREVIWERVIDEOURL =
url
getPreviwerVideoWindow()
})
ipc.on('
addClipboard
', function
(event,
content) {
ipc.on('
addClipboard
', function
(event,
content) {
let img = nativeImage.createFromDataURL(content)
mainEvent.sender.send('
new
-
screen
-
hot
',
content)
mainEvent.sender.send('
new
-
screen
-
hot
',
content)
clipboard.writeImage(img)
})
ipc.on('
setClipboard
', function
(event,content,
type) {
if(type==1)
{
ipc.on('
setClipboard
', function
(event, content,
type) {
if (type == 1)
{
clipboard.writeText(content)
}
})
ipc.on('
getNetworkImage
', function
(event,
url) {
http.get(url, function
(res) {
ipc.on('
getNetworkImage
', function
(event,
url) {
http.get(url, function
(res) {
var chunks = [];
var size = 0;
res.on('
data
', function
(chunk) {
res.on('
data
', function
(chunk) {
chunks.push(chunk);
size += chunk.length;
//累加缓冲数据的长度
size += chunk.length;
//累加缓冲数据的长度
});
res.on('
end
', function
(err) {
res.on('
end
', function
(err) {
var data = Buffer.concat(chunks, size);
var base64Img = data.toString('
base64
');
let img = nativeImage.createFromDataURL(`data:image/png;base64,${base64Img}`)
...
...
@@ -652,31 +656,31 @@ ipc.on('getNetworkImage', function (event,url) {
});
});
})
ipc.on('
screens
-
session
', function
(event) {
screenEvent=
event
ipc.on('
screens
-
session
', function(event) {
screenEvent =
event
})
ipc.on('
open
-
screenhot
', function
(event) {
ipc.on('
open
-
screenhot
', function(event) {
screenHotBegin()
})
ipc.on('
delete
-
file
', function
(event,
p) {
fs.unlink(p, function(err)
{})
ipc.on('
delete
-
file
', function
(event,
p) {
fs.unlink(p, function(err)
{})
})
ipc.on('
send
-
file
', function
(event,
obj) {
let {scene, to, filePath, name,size,md5,type,file
} = obj
ipc.on('
send
-
file
', function
(event,
obj) {
let { scene, to, filePath, name, size, md5, type, file
} = obj
let customMsg = {
"msgtype":
"custom_file",
"data":
{
"pushContent":
name,
"Height":
"84",
"content":
{
"fileType":name.substring(name.lastIndexOf('
.
')+1,
name.length),
"fileUrl":
"-1",
"fileName":
name,
"fileSize":
size,
'
md5
':
md5
"msgtype":
"custom_file",
"data":
{
"pushContent":
name,
"Height":
"84",
"content":
{
"fileType": name.substring(name.lastIndexOf('
.
') + 1,
name.length),
"fileUrl":
"-1",
"fileName":
name,
"fileSize":
size,
'
md5
':
md5
},
"recentContent":
name,
"Width":
"210"
"recentContent":
name,
"Width":
"210"
}
}
nim.sendFile({
...
...
@@ -685,70 +689,80 @@ ipc.on('send-file', function (event,obj) {
type,
filePath,
custom: JSON.stringify(customMsg),
uploadprogress: function(data)
{
file.progess=
data.percentage
event.sender.send('
sending
-
process
',
file)
uploadprogress: function(data)
{
file.progess =
data.percentage
event.sender.send('
sending
-
process
',
file)
},
uploaderror: function
() {
uploaderror: function
() {
},
uploaddone: function
(error, file) {
file.progess=
100
event.sender.send('
sending
-
process
',
file)
uploaddone: function
(error, file) {
file.progess =
100
event.sender.send('
sending
-
process
',
file)
},
beforesend: function
(msg) {},
done: function
(error, msg) {
beforesend: function
(msg) {},
done: function
(error, msg) {
//onSendMsgDone(error, msg)
}
})
})
ipc.on('
read
-
clip
', function
(event) {
ipc.on('
read
-
clip
', function(event) {
const rawFilePath = clipboard.readBuffer('
FileNameW
').toString('
ucs2
');
let filePath = rawFilePath.replace(new RegExp(String.fromCharCode(0), '
g
'), '');
if(filePath && filePath.length>0)
{
fs.stat(filePath,function(error,stats)
{
if(!error)
{
if(stats.size<=100*1024*1024)
{
event.sender.send('
new
-
send
-
file
',filePath,
stats.size)
if (filePath && filePath.length > 0)
{
fs.stat(filePath, function(error, stats)
{
if (!error)
{
if (stats.size <= 100 * 1024 * 1024)
{
event.sender.send('
new
-
send
-
file
', filePath,
stats.size)
return '
finish
'
}else
{
global.DIALOG_MESSAGE=
'
发送的文件不能大于
100
M
'
} else
{
global.DIALOG_MESSAGE =
'
发送的文件不能大于
100
M
'
getDialogWindows()
}
}else
{
} else
{
console.log(error)
}
})
}
return '
end
'
})
ipc.on('
auto
-
update
-
clip
', function
(event) {
ipc.on('
auto
-
update
-
clip
', function(event) {
let text = clipboard.readText();
if(text && text.length>0)
{
text=
escapeHTML(text)
if (text && text.length > 0)
{
text =
escapeHTML(text)
clipboard.writeText(text)
}
})
//global.CURRENT_TEAM_MEMBERS
ipc.on('
createo
-
or
-
open
-
team
', function
(event,
obj) {
global.CURRENT_TEAM_MEMBERS=
obj
})
//global.CURRENT_TEAM_MEMBERS
ipc.on('
createo
-
or
-
open
-
team
', function
(event,
obj) {
global.CURRENT_TEAM_MEMBERS =
obj
getAddNewUserWinodes()
})
ipc.on('
close
-
team
-
box
', function (event,obj) {
if(addNewUserWinodes && !addNewUserWinodes.isDestroyed()){
ipc.on('
open
-
forward
-
msg
', function(event, obj) {
global.FORWARD_MSG = obj
getForwardWindows()
})
ipc.on('
close
-
team
-
box
', function(event, obj) {
if (addNewUserWinodes && !addNewUserWinodes.isDestroyed()) {
addNewUserWinodes.close()
}
})
ipc.on('
save
-
team
-
members
', function (event,obj) {
mainEvent.sender.send('
save
-
team
-
members
',obj)
ipc.on('
close
-
forward
', function(event, obj) {
if (forwardWindows && !forwardWindows.isDestroyed()) {
forwardWindows.close()
}
})
ipc.on('
save
-
team
-
members
', function(event, obj) {
mainEvent.sender.send('
save
-
team
-
members
', obj)
})
ipc.on('
load
-
notice
', function
(event) {
ipc.on('
load
-
notice
', function(event) {
getNoticeWindows()
})
function escapeHTML(a) {
return a.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/ /g, " ").replace(/"/g, "
\
"").replace(/'
/
g
,
"'"
)
}
let
getLoginWindow
=
function
()
{
let
getLoginWindow
=
function
()
{
loginWindow
=
new
BrowserWindow
({
transparent
:
systemPreferences
.
isAeroGlassEnabled
(),
frame
:
false
,
...
...
@@ -758,7 +772,7 @@ let getLoginWindow=function(){
height
:
470
,
width
:
330
,
icon
:
windowIcon
,
alwaysOnTop
:
true
alwaysOnTop
:
true
})
loginWindow
.
loadURL
(
winURL
)
loginWindow
.
setMenu
(
null
)
...
...
@@ -766,8 +780,8 @@ let getLoginWindow=function(){
loginWindow
.
show
()
})
}
let
getMainWinodw
=
function
(
isLoad
)
{
if
(
!
mainWindow
||
mainWindow
.
isDestroyed
())
{
let
getMainWinodw
=
function
(
isLoad
)
{
if
(
!
mainWindow
||
mainWindow
.
isDestroyed
())
{
mainWindow
=
new
BrowserWindow
({
transparent
:
systemPreferences
.
isAeroGlassEnabled
(),
frame
:
false
,
...
...
@@ -777,16 +791,16 @@ let getMainWinodw=function(isLoad){
height
:
600
,
width
:
900
,
icon
:
windowIcon
,
minWidth
:
850
,
minHeight
:
580
,
webPreferences
:{
webSecurity
:
false
},
minWidth
:
850
,
minHeight
:
580
,
webPreferences
:
{
webSecurity
:
false
},
})
mainWindow
.
on
(
'close'
,
(
e
)
=>
{
mainWindow
.
hide
()
e
.
preventDefault
()
})
}
if
(
isLoad
==
0
)
{
if
(
isLoad
==
0
)
{
mainWindow
.
loadURL
(
mainUrl
)
mainWindow
.
once
(
'ready-to-show'
,
()
=>
{
mainWindow
.
show
()
...
...
@@ -797,7 +811,7 @@ let getMainWinodw=function(isLoad){
})
}
//加载隐藏窗口防止用户关闭
if
(
!
hideWindow
||
hideWindow
.
isDestroyed
())
{
if
(
!
hideWindow
||
hideWindow
.
isDestroyed
())
{
hideWindow
=
new
BrowserWindow
({
transparent
:
systemPreferences
.
isAeroGlassEnabled
(),
frame
:
false
,
...
...
@@ -812,8 +826,8 @@ let getMainWinodw=function(isLoad){
hideWindow
.
webContents
.
closeDevTools
()
}
}
let
getPreviwerFileWindow
=
function
()
{
if
(
!
previewfileWindow
||
previewfileWindow
.
isDestroyed
())
{
let
getPreviwerFileWindow
=
function
()
{
if
(
!
previewfileWindow
||
previewfileWindow
.
isDestroyed
())
{
previewfileWindow
=
new
BrowserWindow
({
transparent
:
systemPreferences
.
isAeroGlassEnabled
(),
frame
:
false
,
...
...
@@ -821,9 +835,9 @@ let getPreviwerFileWindow=function(){
resizable
:
false
,
show
:
false
,
icon
:
windowIcon
,
width
:
electron
.
screen
.
getPrimaryDisplay
().
workAreaSize
.
width
-
40
,
height
:
electron
.
screen
.
getPrimaryDisplay
().
workAreaSize
.
height
-
40
,
skipTaskbar
:
true
width
:
electron
.
screen
.
getPrimaryDisplay
().
workAreaSize
.
width
-
40
,
height
:
electron
.
screen
.
getPrimaryDisplay
().
workAreaSize
.
height
-
40
,
skipTaskbar
:
true
})
}
previewfileWindow
.
loadURL
(
previewfileUrl
)
...
...
@@ -834,8 +848,8 @@ let getPreviwerFileWindow=function(){
previewfileWindow
.
show
()
})
}
let
getPreviwerImgWindow
=
function
()
{
if
(
!
previwerImgWindow
||
previwerImgWindow
.
isDestroyed
())
{
let
getPreviwerImgWindow
=
function
()
{
if
(
!
previwerImgWindow
||
previwerImgWindow
.
isDestroyed
())
{
previwerImgWindow
=
new
BrowserWindow
({
transparent
:
systemPreferences
.
isAeroGlassEnabled
(),
frame
:
false
,
...
...
@@ -843,9 +857,9 @@ let getPreviwerImgWindow=function(){
resizable
:
false
,
show
:
false
,
icon
:
windowIcon
,
width
:
electron
.
screen
.
getPrimaryDisplay
().
workAreaSize
.
width
-
40
,
height
:
electron
.
screen
.
getPrimaryDisplay
().
workAreaSize
.
height
-
40
,
skipTaskbar
:
true
width
:
electron
.
screen
.
getPrimaryDisplay
().
workAreaSize
.
width
-
40
,
height
:
electron
.
screen
.
getPrimaryDisplay
().
workAreaSize
.
height
-
40
,
skipTaskbar
:
true
})
}
previwerImgWindow
.
loadURL
(
previewfileImg
)
...
...
@@ -857,8 +871,8 @@ let getPreviwerImgWindow=function(){
})
}
let
getPreviwerVideoWindow
=
function
()
{
if
(
!
previwerVideoWindow
||
previwerVideoWindow
.
isDestroyed
())
{
let
getPreviwerVideoWindow
=
function
()
{
if
(
!
previwerVideoWindow
||
previwerVideoWindow
.
isDestroyed
())
{
previwerVideoWindow
=
new
BrowserWindow
({
transparent
:
systemPreferences
.
isAeroGlassEnabled
(),
frame
:
false
,
...
...
@@ -866,9 +880,9 @@ let getPreviwerVideoWindow=function(){
resizable
:
false
,
show
:
false
,
icon
:
windowIcon
,
width
:
400
,
height
:
600
,
skipTaskbar
:
true
width
:
400
,
height
:
600
,
skipTaskbar
:
true
})
}
previwerVideoWindow
.
loadURL
(
previewfVideoUrl
)
...
...
@@ -878,10 +892,10 @@ let getPreviwerVideoWindow=function(){
previwerVideoWindow
.
once
(
'ready-to-show'
,
()
=>
{
previwerVideoWindow
.
show
()
})
}
//dialogWindows
let
getDialogWindows
=
function
()
{
if
(
!
dialogWindows
||
dialogWindows
.
isDestroyed
())
{
}
//dialogWindows
let
getDialogWindows
=
function
()
{
if
(
!
dialogWindows
||
dialogWindows
.
isDestroyed
())
{
dialogWindows
=
new
BrowserWindow
({
transparent
:
systemPreferences
.
isAeroGlassEnabled
(),
frame
:
false
,
...
...
@@ -889,10 +903,10 @@ let getDialogWindows=function(){
resizable
:
false
,
show
:
false
,
icon
:
windowIcon
,
width
:
300
,
height
:
150
,
skipTaskbar
:
true
,
alwaysOnTop
:
true
width
:
300
,
height
:
150
,
skipTaskbar
:
true
,
alwaysOnTop
:
true
})
}
dialogWindows
.
loadURL
(
dialogUrl
)
...
...
@@ -900,10 +914,10 @@ let getDialogWindows=function(){
dialogWindows
.
once
(
'ready-to-show'
,
()
=>
{
dialogWindows
.
show
()
})
}
//noticeWindows
let
getNoticeWindows
=
function
()
{
if
(
!
noticeWindows
||
noticeWindows
.
isDestroyed
())
{
}
//noticeWindows
let
getNoticeWindows
=
function
()
{
if
(
!
noticeWindows
||
noticeWindows
.
isDestroyed
())
{
noticeWindows
=
new
BrowserWindow
({
transparent
:
systemPreferences
.
isAeroGlassEnabled
(),
frame
:
false
,
...
...
@@ -911,10 +925,10 @@ let getNoticeWindows=function(){
resizable
:
false
,
show
:
false
,
icon
:
windowIcon
,
width
:
300
,
height
:
115
,
skipTaskbar
:
true
,
alwaysOnTop
:
true
width
:
300
,
height
:
115
,
skipTaskbar
:
true
,
alwaysOnTop
:
true
})
noticeWindows
.
setBounds
({
y
:
electron
.
screen
.
getPrimaryDisplay
().
workAreaSize
.
height
-
115
,
...
...
@@ -929,8 +943,8 @@ let getNoticeWindows=function(){
noticeWindows
.
show
()
})
}
let
getAddNewUserWinodes
=
function
()
{
if
(
!
addNewUserWinodes
||
addNewUserWinodes
.
isDestroyed
())
{
let
getAddNewUserWinodes
=
function
()
{
if
(
!
addNewUserWinodes
||
addNewUserWinodes
.
isDestroyed
())
{
addNewUserWinodes
=
new
BrowserWindow
({
transparent
:
systemPreferences
.
isAeroGlassEnabled
(),
frame
:
false
,
...
...
@@ -938,24 +952,49 @@ let getAddNewUserWinodes=function(){
resizable
:
false
,
show
:
false
,
icon
:
windowIcon
,
width
:
500
,
height
:
430
,
skipTaskbar
:
true
,
alwaysOnTop
:
true
width
:
500
,
height
:
430
,
skipTaskbar
:
true
,
alwaysOnTop
:
true
})
addNewUserWinodes
.
loadURL
(
addnewuserUrl
)
addNewUserWinodes
.
setMenu
(
null
)
addNewUserWinodes
.
once
(
'ready-to-show'
,
()
=>
{
addNewUserWinodes
.
show
()
})
}
else
{
}
else
{
addNewUserWinodes
.
focus
()
}
}
let
getNewMsgWindows
=
function
(){
if
(
!
newMsgWindow
||
newMsgWindow
.
isDestroyed
()){
let
getForwardWindows
=
function
()
{
if
(
!
forwardWindows
||
forwardWindows
.
isDestroyed
())
{
forwardWindows
=
new
BrowserWindow
({
transparent
:
systemPreferences
.
isAeroGlassEnabled
(),
frame
:
false
,
maximizable
:
true
,
resizable
:
false
,
show
:
false
,
icon
:
windowIcon
,
width
:
500
,
height
:
430
,
skipTaskbar
:
true
,
alwaysOnTop
:
true
})
forwardWindows
.
loadURL
(
forwardUrl
)
forwardWindows
.
setMenu
(
null
)
forwardWindows
.
once
(
'ready-to-show'
,
()
=>
{
forwardWindows
.
show
()
})
}
else
{
forwardWindows
.
focus
()
}
}
let
getNewMsgWindows
=
function
()
{
if
(
!
newMsgWindow
||
newMsgWindow
.
isDestroyed
())
{
newMsgWindow
=
new
BrowserWindow
({
transparent
:
systemPreferences
.
isAeroGlassEnabled
(),
frame
:
false
,
...
...
@@ -966,13 +1005,13 @@ let getNewMsgWindows=function(){
alwaysOnTop
:
true
,
width
:
260
,
icon
:
windowIcon
,
skipTaskbar
:
true
skipTaskbar
:
true
})
}
let
urls
=
process
.
env
.
NODE_ENV
===
'development'
?
`http://localhost:9080/#/newmsg`
:
`file://
${
__dirname
}
/index.html#newmsg`
newMsgWindow
.
loadURL
(
urls
)
}
let
getScrollerhotWindows
=
function
()
{
let
getScrollerhotWindows
=
function
()
{
// let scroll_info=electron.screen.getAllDisplays()
scrollerhotWindows
=
new
BrowserWindow
({
transparent
:
systemPreferences
.
isAeroGlassEnabled
(),
...
...
@@ -982,50 +1021,50 @@ let getScrollerhotWindows=function(){
show
:
false
,
alwaysOnTop
:
true
,
icon
:
windowIcon
,
webPreferences
:{
webSecurity
:
false
},
skipTaskbar
:
true
webPreferences
:
{
webSecurity
:
false
},
skipTaskbar
:
true
})
let
urls
=
process
.
env
.
NODE_ENV
===
'development'
?
`http://localhost:9080/#/scrollerhot`
:
`file://
${
__dirname
}
/index.html#scrollerhot`
scrollerhotWindows
.
loadURL
(
urls
)
scrollerhotWindows
.
setFullScreen
(
true
)
}
let
screenHotBegin
=
function
()
{
let
p
=
process
.
execPath
.
substring
(
0
,
process
.
execPath
.
lastIndexOf
(
'
\
\'
) + 1)+
'
PrintScr
.
exe
'
let
screenHotBegin
=
function
()
{
let
p
=
process
.
execPath
.
substring
(
0
,
process
.
execPath
.
lastIndexOf
(
'
\
\'
) + 1) +
'
PrintScr
.
exe
'
var screen_window = cp.execFile(p)
screen_window.on('
exit
', function
(code) {
screen_window.on('
exit
', function
(code) {
// 执行成功返回 1,返回 0 没有截图
if (code)
{
mainEvent.sender.send('
new
-
screen
-
hot
',
clipboard.readImage().toDataURL())
if (code)
{
mainEvent.sender.send('
new
-
screen
-
hot
',
clipboard.readImage().toDataURL())
}
})
}
let registScrollerHotKey
=function()
{
globalShortcut.register('
CommandOrControl
+
Alt
+
Q
', function
() {
let registScrollerHotKey
= function()
{
globalShortcut.register('
CommandOrControl
+
Alt
+
Q
', function
() {
screenHotBegin()
})
}
let formatDate
=function(date,format){
let formatDate
= function(date, format) {
var o = {
"M+" : date.getMonth()+
1, //month
"d+"
: date.getDate(), //day
"h+"
: date.getHours(), //hour
"m+"
: date.getMinutes(), //minute
"s+"
: date.getSeconds(), //second
"q+" : Math.floor((date.getMonth()+3)/
3), //quarter
"S"
: date.getMilliseconds() //millisecond
"M+": date.getMonth() +
1, //month
"d+"
: date.getDate(), //day
"h+"
: date.getHours(), //hour
"m+"
: date.getMinutes(), //minute
"s+"
: date.getSeconds(), //second
"q+": Math.floor((date.getMonth() + 3) /
3), //quarter
"S"
: date.getMilliseconds() //millisecond
};
if(/(y+)/.test(format)) {
format = format.replace(RegExp.$1, (date.getFullYear()+"").substr(4 - RegExp.$1.length));
if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for(var k in o) {
if(new RegExp("("+ k +")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));
for (var k in o) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
}
}
return format;
};
let initNIM
=function(uid,token)
{
let initNIM
= function(uid, token)
{
try {
nim = SDK.getInstance({
debug: false,
...
...
@@ -1042,10 +1081,12 @@ let initNIM=function(uid,token){
function onConnect() {
}
function onWillReconnect(obj) {
// 此时说明 SDK 已经断开连接, 请开发者在界面上提示用户连接已断开, 而且正在重新建立连接
}
function onDisconnect(error) {
// 此时说明 SDK 处于断开状态, 开发者此时应该根据错误码提示相应的错误信息, 并且跳转到登录页面
...
...
@@ -1065,6 +1106,7 @@ let initNIM=function(uid,token){
}
}
}
function onError(error) {
console.log(error);
}
...
...
src/renderer/components/index.vue
View file @
ebacf562
...
...
@@ -164,6 +164,8 @@ export default {
this
.
MsgBus
.
$emit
(
"delete-members"
,
obj
.
teamMembers
)
}
else
if
(
obj
.
action
==
'create'
){
this
.
MsgBus
.
$emit
(
"create-group"
,
obj
.
teamMembers
)
}
else
if
(
obj
.
action
==
'forward'
){
this
.
MsgBus
.
$emit
(
"goForward"
,
obj
.
sessions
)
}
//
})
...
...
src/renderer/components/msssage/chatitem.vue
View file @
ebacf562
...
...
@@ -35,6 +35,7 @@
v-if=
"msg.type=='image' || msg.type=='video' || msg.type=='audio'"
@
click=
"downloadFile(msg,1)"
>
另存为...
</v-contextmenu-item>
<v-contextmenu-item
@
click=
"forwardMsg(msg)"
>
转发
</v-contextmenu-item>
<v-contextmenu-item
divider
v-if=
"msg.flow==='out'"
></v-contextmenu-item>
<v-contextmenu-item
@
click=
"revocateMsg"
v-if=
"msg.flow==='out'"
>
撤回消息
</v-contextmenu-item>
</v-contextmenu>
...
...
@@ -770,6 +771,9 @@ export default {
// 在会话聊天页
this
.
$store
.
dispatch
(
"revocateMsg"
,
this
.
msg
);
},
forwardMsg
(
msg
){
this
.
MsgBus
.
$emit
(
"forward"
,
msg
);
},
sendRobotBlockMsg
(
msg
,
originMsg
)
{
if
(
this
.
isHistory
)
{
// 在历史消息中,不进行机器人交互
...
...
src/renderer/components/msssage/index.vue
View file @
ebacf562
...
...
@@ -225,7 +225,8 @@ export default {
noticeLastTime
:
0
,
isNetError
:
true
,
audio_base
:
''
,
atIds
:
null
atIds
:
null
,
forwardMsgInfo
:{}
};
},
updated
()
{
...
...
@@ -455,6 +456,20 @@ export default {
this
.
MsgBus
.
$on
(
"create-group"
,
function
(
members
)
{
that
.
createGroup
(
members
);
});
this
.
MsgBus
.
$on
(
"forward"
,
function
(
msg
){
that
.
forwardMsgInfo
=
msg
console
.
log
(
that
.
forwardMsgInfo
)
that
.
$electron
.
ipcRenderer
.
send
(
"open-forward-msg"
,
that
.
sessionlist
);
})
this
.
MsgBus
.
$on
(
"goForward"
,
function
(
sessions
){
sessions
.
forEach
(
x
=>
{
that
.
$store
.
dispatch
(
"forwardMsg"
,
{
scene
:
x
.
scene
,
to
:
x
.
to
,
msg
:
that
.
forwardMsgInfo
});
})
})
this
.
MsgBus
.
$on
(
"dispose-session"
,
function
()
{
that
.
$store
.
dispatch
(
"resetCurrSession"
);
that
.
currentSession
=
{
...
...
src/renderer/components/team/forwardMsg.vue
0 → 100644
View file @
ebacf562
<
template
>
<div
class=
"forward-msg"
>
<div
class=
"header__opera"
>
<span
class=
"opera__item close"
@
click=
"close"
>
<i
class=
"iconfont iconguanbi"
></i>
</span>
</div>
<div
class=
"split"
></div>
<div
class=
"content"
>
<div
class=
"panle"
>
<div
class=
"search__user_box"
>
<div
class=
"seach_ctr"
>
<span
class=
"seach__item__icon"
>
<i
class=
"iconfont iconsearch"
></i>
</span>
<input
type=
"text"
@
keyup=
"getSearch"
class=
"seach__item__input"
v-model=
"searchMember"
placeholder=
"搜索"
>
</div>
</div>
<ul
class=
"members"
style=
"bottom:0px;top:37px;"
>
<li
class=
"split-title"
v-if=
"searchMember!=''"
>
最近会话
</li>
<template
v-for=
"(item, index) in sessions"
>
<li
:key=
"index"
v-if=
"searchMember=='' || item.name.indexOf(searchMember)!=-1"
>
<img
:src=
"item.avatar"
class=
"h"
v-if=
"item.avatar"
>
<i
class=
"iconfont icontaolun head-i"
v-else-if=
"item.groupType == 0"
></i>
<i
class=
"iconfont iconqunzu head-i"
v-else-if=
"item.groupType == 1"
></i>
<i
class=
"iconfont iconyonghutouxiang head-i"
v-else
></i>
<div
class=
"u"
>
{{
item
.
name
}}
</div>
<div>
<el-checkbox
:checked=
"isExsitmember(item.to)"
@
change=
"checked=>chosenChange(index,item,checked)"
></el-checkbox>
</div>
</li>
</
template
>
<li
class=
"split-title"
v-if=
"searchResults && searchResults.length>0"
>
同事
</li>
<
template
v-for=
"(item, index) in searchResults"
>
<li
:key=
"index"
>
<img
:src=
"item.avatar"
class=
"h"
v-if=
"item.avatar"
>
<img
src=
"../../assets/img/litheader.png"
class=
"h"
v-else
>
<div
class=
"u"
>
{{
item
.
name
}}
</div>
<div>
<el-checkbox
:checked=
"isExsitmember(item.to)"
@
change=
"checked=>chosenChange(index,item,checked)"
></el-checkbox>
</div>
</li>
</
template
>
</ul>
</div>
<div
class=
"panle"
>
<div
class=
"remark"
>
分别转发给:
</div>
<ul
class=
"members"
v-loading=
"isLoading"
>
<
template
v-for=
"(item, index) in checkNodes"
>
<li
:key=
"index"
>
<img
:src=
"item.avatar"
class=
"h"
v-if=
"item.avatar"
>
<i
class=
"iconfont icontaolun head-i"
v-else-if=
"item.groupType == 0"
></i>
<i
class=
"iconfont iconqunzu head-i"
v-else-if=
"item.groupType == 1"
></i>
<img
src=
"../../assets/img/litheader.png"
class=
"h"
v-else
>
<div
class=
"u"
>
{{
item
.
name
}}
</div>
</li>
</
template
>
</ul>
<div
class=
"bnt-box"
>
<el-button
type=
"primary"
:disabled=
"checkNodes.length==0"
size=
"mini"
@
click=
"save"
>
确定
</el-button>
<el-button
size=
"mini"
@
click=
"close"
>
取消
</el-button>
</div>
</div>
</div>
</div>
</template>
<
script
>
export
default
{
data
()
{
return
{
groupboxSearch
:
0
,
webAllpartList
:
[],
searchMember
:
""
,
checkNodes
:
[],
sessions
:
[],
searchResults
:
[],
isLoading
:
false
,
action
:
'forward'
,
deleteCount
:
0
};
},
mounted
()
{
this
.
sessions
=
this
.
$electron
.
remote
.
getGlobal
(
"FORWARD_MSG"
)
},
methods
:
{
save
(){
let
obj
=
{
action
:
this
.
action
,
sessions
:
this
.
checkNodes
}
this
.
$electron
.
ipcRenderer
.
send
(
'save-team-members'
,
obj
)
this
.
close
()
},
chosenChange
(
index
,
item
,
checked
){
if
(
checked
)
{
this
.
checkNodes
.
push
(
item
)
}
else
{
let
i
=
0
this
.
checkNodes
.
forEach
((
x
,
index
)
=>
{
if
(
x
.
to
==
item
.
to
){
i
=
index
return
false
}
})
this
.
checkNodes
.
splice
(
i
,
1
)
}
},
handleChosenChange
(
index
,
item
,
checked
)
{
if
(
item
)
{
item
.
isCheck
=
checked
;
this
.
$set
(
this
.
searchResults
,
index
,
item
);
if
(
!
checked
)
{
this
.
delMember
(
item
.
imAccount
);
}
else
{
if
(
item
.
imAccount
&&
!
this
.
isExsitmember
(
item
.
imAccount
).
h
)
{
let
member
=
{
account
:
item
.
imAccount
,
alias
:
item
.
name
,
avatar
:
item
.
icon
,
isExsit
:
false
};
if
(
this
.
teamMembers
.
length
<
200
)
this
.
teamMembers
.
push
(
member
);
}
}
}
},
getSearch
()
{
this
.
searchResults
=
[]
if
(
this
.
searchMember
!=
""
)
{
this
.
apipost
(
"admin_Get_Chat_All_SelectEmpName"
,
{
EmName
:
this
.
searchMember
},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
searchResults
=
res
.
data
.
data
.
filter
(
x
=>
{
if
(
!
x
.
imAccount
)
{
return
;
}
x
.
scene
=
'p2p'
x
.
to
=
x
.
imAccount
x
.
avatar
=
x
.
icon
x
.
groupType
=
3
return
x
;
});
console
.
log
(
this
.
searchResults
)
}
},
err
=>
{}
);
}
},
isExsitmember
(
account
)
{
let
isExsit
=
false
this
.
checkNodes
.
forEach
(
x
=>
{
if
(
x
.
to
==
account
){
isExsit
=
true
return
false
}
})
return
isExsit
;
},
close
()
{
this
.
$electron
.
remote
.
getCurrentWindow
().
close
();
},
handleCheckChange
(
data
,
checked
,
indeterminate
)
{
this
.
checkNodes
=
this
.
$refs
.
tree
.
getCheckedNodes
();
}
}
};
</
script
>
<
style
>
.forward-msg
{
width
:
100%
;
height
:
100%
;
box-sizing
:
border-box
;
border
:
1px
solid
#ddd
;
box-shadow
:
0
0
2px
#ccc
;
background
:
#fff
;
padding-top
:
20px
;
-webkit-app-region
:
drag
!important
;
}
.forward-msg
.members
.head-i
{
width
:
40px
;
height
:
40px
;
border-radius
:
100%
;
margin-right
:
10px
;
background
:
#2d98da
;
line-height
:
40px
;
text-align
:
center
;
font-size
:
22px
;
color
:
#FFF
;
}
.forward-msg
.el-tree
{
cursor
:
default
;
background
:
#fff
;
padding-left
:
12px
;
border
:
none
;
}
.forward-msg
.el-tree-node__content
:hover
{
background
:
transparent
;
}
.el-tree-node__content
{
line-height
:
30px
;
}
.forward-msg
.header__opera
{
position
:
absolute
;
top
:
0px
;
right
:
0px
;
text-align
:
right
;
}
.forward-msg
.split
{
position
:
absolute
;
top
:
3px
;
left
:
50%
;
bottom
:
3px
;
width
:
1px
;
background
:
#eee
;
z-index
:
3
;
}
.forward-msg
.content
{
display
:
flex
;
position
:
absolute
;
top
:
23px
;
left
:
3px
;
right
:
3px
;
bottom
:
3px
;
-webkit-app-region
:
no-drag
!important
;
}
.forward-msg
.content
.panle
{
flex
:
1
;
position
:
relative
;
}
.forward-msg
.content
.split-title
{
height
:
20px
!important
;
line-height
:
20px
!important
;
padding
:
0
10px
!important
;
font-size
:
12px
;
color
:
#777
;
background
:
#f1f1f1
;
font-family
:
'microsoft yahei'
!important
;
}
.forward-msg
.content
.panle
.remark
{
margin
:
0
20px
10px
20px
;
font-size
:
12px
;
}
.forward-msg
.content
.panle
.search__user_box
{
display
:
flex
;
margin
:
0
20px
10px
20px
;
}
.forward-msg
.content
.panle
.search__user_box
.seach_ctr
{
flex
:
1
;
position
:
relative
;
}
.forward-msg
.content
.panle
.search__user_box
.seach_ctr
.seach__item__input
{
width
:
100%
;
text-indent
:
23px
;
height
:
23px
;
line-height
:
23px
;
border
:
none
;
border
:
1px
solid
rgb
(
225
,
225
,
225
);
outline
:
none
;
font-size
:
12px
;
color
:
#000
;
background
:
transparent
;
box-sizing
:
border-box
;
background
:
rgb
(
225
,
225
,
225
);
border-radius
:
2px
;
}
.forward-msg
.content
.panle
.search__user_box
.seach_ctr
.seach__item__input
:focus
{
background
:
#fff
;
}
.forward-msg
.content
.panle
.search__user_box
.seach_ctr
.seach__item__icon
{
font-size
:
14px
;
color
:
#999
;
position
:
absolute
;
top
:
2px
;
left
:
0
;
padding-left
:
7px
;
max-width
:
24px
!important
;
}
.forward-msg
.content
.panle
.search__user_box
.seach_ctr
.seach__item__icon
i
{
font-size
:
12px
;
}
.forward-msg
.content
.panle
.members
{
position
:
absolute
;
top
:
26px
;
left
:
0
;
right
:
0
;
bottom
:
30px
;
overflow-y
:
auto
;
margin
:
0
;
padding
:
0
;
}
.forward-msg
.content
.panle
.members
li
{
padding
:
0
20px
;
height
:
58px
;
display
:
flex
;
align-items
:
center
;
cursor
:
default
;
}
.forward-msg
.content
.panle
.members
li
.el-checkbox__inner
{
width
:
20px
;
height
:
20px
;
border-radius
:
100%
;
}
.forward-msg
.content
.panle
.members
li
.el-checkbox__inner
::after
{
left
:
7px
;
top
:
4px
;
}
.forward-msg
.content
.panle
.members
li
.h
{
width
:
40px
;
height
:
40px
;
border-radius
:
100%
;
margin-right
:
10px
;
}
.forward-msg
.content
.panle
.members
li
.u
{
flex
:
1
;
font-size
:
14px
;
word-break
:
break-all
;
display
:
-webkit-box
;
-webkit-line-clamp
:
1
;
-webkit-box-orient
:
vertical
;
overflow
:
hidden
;
}
.forward-msg
.content
.panle
.members
li
.i
{
width
:
20px
;
cursor
:
pointer
;
}
.forward-msg
.content
.panle
.members
li
.i
i
{
font-size
:
14px
;
color
:
#ddd
;
}
.forward-msg
.content
.panle
.members
li
:hover
{
background
:
rgb
(
241
,
241
,
241
);
}
.forward-msg
.content
.panle
.members
li
.i
i
:hover
{
color
:
#999
;
}
.forward-msg
.content
.panle
.bnt-box
{
text-align
:
right
;
position
:
absolute
;
bottom
:
0px
;
left
:
0
;
right
:
0
;
height
:
30px
;
line-height
:
30px
;
padding
:
0
20px
;
}
.forward-msg
.content
.panle
.bnt-box
.el-button--mini
,
.forward-msg
.content
.panle
.bnt-box
.el-button--mini.is-round
{
padding
:
4px
12px
;
}
.forward-msg
.header__opera
.opera__item
{
padding
:
2px
5px
;
color
:
#aaa
;
cursor
:
pointer
;
display
:
inline-block
;
-webkit-app-region
:
no-drag
!important
;
}
.forward-msg
.header__opera
.opera__item
i
{
font-size
:
14px
;
}
.forward-msg
.header__opera
.close
:hover
{
color
:
#f1f1f1
;
background
:
#eb3b5a
;
}
.forward-msg
.header__opera
.opera__item.min
:hover
{
background
:
rgba
(
255
,
255
,
255
,
0.2
);
}
.forward-msg
.new-group-name
.search-input
{
width
:
100%
;
height
:
30px
;
line-height
:
30px
;
padding
:
5px
;
box-sizing
:
border-box
;
border
:
1.5px
solid
#ddd
;
border-radius
:
1.5px
;
color
:
#666
;
}
.forward-msg
.group-body
{
width
:
100%
;
display
:
flex
;
height
:
360px
;
overflow
:
hidden
;
}
.forward-msg
.group-foot
{
width
:
100%
;
display
:
block
;
height
:
40px
;
text-align
:
right
;
}
.forward-msg
.search-input
{
width
:
100%
;
height
:
30px
;
line-height
:
30px
;
padding
:
5px
;
box-sizing
:
border-box
;
border
:
1.5px
solid
#ddd
;
border-radius
:
1.5px
;
color
:
#666
;
}
.forward-msg
.search-input
:focus
,
.forward-msg
.new-group-name
.search-input
:focus
{
border
:
1.5px
solid
#bbb
;
border-radius
:
1.5px
;
}
.forward-msg
.search-result-box
{
height
:
calc
(
100%
-
34px
);
font-size
:
14px
;
position
:
relative
;
color
:
#000
;
font-weight
:
600
;
}
/* .forward-msg .search-result-box .tree-box .el-tree *:not(i) {
font-family: 'Microsoft YaHei' !important;
} */
.forward-msg
.search-result-box
.tree-box
{
overflow-y
:
auto
;
position
:
absolute
;
top
:
0
;
bottom
:
35px
;
left
:
0
;
right
:
0
;
}
.forward-msg
.search-result-box
.sure-bottom
{
position
:
absolute
;
bottom
:
0px
;
left
:
0
;
right
:
0
;
height
:
30px
;
background
:
#ddd
;
color
:
#999
;
text-align
:
center
;
line-height
:
30px
;
font-size
:
14px
;
font-weight
:
300
;
cursor
:
pointer
;
}
.forward-msg
.search-result-box
.sure-bottom.active
{
background
:
#409eff
;
color
:
#f1f1f1
;
}
.forward-msg
.search-result-box
.el-tree-node__content
{
height
:
auto
!important
;
}
.forward-msg
.search-result-box
.IM_messageList
{
top
:
0px
;
bottom
:
0px
;
}
.forward-msg
.search-result-box
.IM_messageList
ul
li
{
height
:
40px
;
padding
:
5px
;
}
.forward-msg
.search-result-box
.IM_messageList
ul
li
img
{
height
:
30px
;
width
:
30px
;
}
.forward-msg
.search-result-box
.IM_messageList
ul
li
.close
{
visibility
:
hidden
;
position
:
absolute
;
top
:
7px
;
right
:
10px
;
}
.forward-msg
.search-result-box
.IM_messageList
ul
li
:hover
.close
{
visibility
:
visible
;
}
.forward-msg
.group-body
.team-member-box
{
position
:
absolute
;
left
:
0
;
top
:
0px
;
right
:
0
;
height
:
200px
;
padding
:
10px
;
border-bottom
:
1px
solid
#d9d9d9
;
background-color
:
#fff
;
box-shadow
:
none
;
z-index
:
2
;
}
.forward-msg
.group-body
.team-member-box
ul
{
width
:
100%
;
height
:
100%
;
display
:
flex
;
overflow-y
:
auto
;
flex-wrap
:
wrap
;
padding-top
:
10px
;
}
.forward-msg
.group-body
.team-member-box
ul
li
{
width
:
120px
;
text-align
:
center
;
height
:
100px
;
position
:
relative
;
}
.forward-msg
.group-body
.team-member-box
ul
li
img
{
width
:
48px
;
height
:
48px
;
border-radius
:
100%
;
}
.forward-msg
.group-body
.team-member-box
ul
li
span
{
display
:
block
;
padding
:
0
3px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
font-size
:
14px
;
}
.forward-msg
.group-body
.team-member-box
ul
li
.icon-close1
{
position
:
absolute
;
top
:
-11px
;
right
:
28px
;
cursor
:
pointer
;
}
.forward-msg
.group-body
.team-member-box
ul
li
.icon-close1
:hover
{
color
:
#ef4455
;
}
.forward-msg
.cl-name
{
padding
:
5px
0
;
font-size
:
14px
;
color
:
#999
;
font-family
:
PingFangSC-Semibold
!important
;
margin
:
15px
0
0
0
;
}
</
style
>
src/renderer/components/tools/contenteditor.vue
View file @
ebacf562
...
...
@@ -17,7 +17,7 @@
></div>
<div
class=
"tool-copy"
:style=
"{'top': toolTop+'px','left': toolLeft+'px'}"
v-if=
"toolShow"
>
<!-- <li>复制</li> -->
<li
@
click
=
"toolPaste"
>
粘贴
</li>
<li
@
paste
=
"toolPaste"
>
粘贴
</li>
</div>
</at>
</template>
...
...
@@ -206,7 +206,7 @@ export default {
methods: {
toolPaste: function (e) {
let clipboardData = 1
console.log(e)
console.log(
'111111111',
e)
},
copyBox: function (e) {
this.toolTop = e.offsetY
...
...
src/renderer/router/index.js
View file @
ebacf562
...
...
@@ -3,8 +3,7 @@ import Router from 'vue-router'
Vue
.
use
(
Router
)
export
default
new
Router
({
routes
:
[
{
routes
:
[{
path
:
'/'
,
name
:
'landing-page'
,
component
:
require
(
'@/components/login'
)
...
...
@@ -53,6 +52,11 @@ export default new Router({
path
:
'/notice'
,
name
:
'notice'
,
component
:
require
(
'@/components/tools/notice'
)
},
{
path
:
'/forwardMsg'
,
name
:
'forwardMsg'
,
component
:
require
(
'@/components/team/forwardMsg'
)
}
]
})
\ No newline at end of file
src/store/actions/msgs.js
View file @
ebacf562
...
...
@@ -92,7 +92,7 @@ export function forwardMsg({ state, commit }, obj) {
nim
.
forwardMsg
({
scene
:
obj
.
scene
,
to
:
obj
.
to
,
msg
:
obj
.
tip
,
msg
:
obj
.
msg
,
done
:
function
(
err
,
msg
)
{
onMsg
(
msg
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment