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
9ec8efa5
Commit
9ec8efa5
authored
Oct 17, 2019
by
罗超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/madara
# Conflicts: # src/renderer/components/msssage/index.vue
parents
93156bb9
0bc25050
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
417 additions
and
402 deletions
+417
-402
index.vue
src/renderer/components/index.vue
+144
-116
login.vue
src/renderer/components/login.vue
+1
-0
chateditor.vue
src/renderer/components/msssage/chateditor.vue
+8
-10
chatitem.vue
src/renderer/components/msssage/chatitem.vue
+8
-7
index.vue
src/renderer/components/msssage/index.vue
+67
-91
msgs.js
src/store/actions/msgs.js
+5
-8
team.js
src/store/actions/team.js
+169
-168
index.js
src/store/mutations/index.js
+15
-2
No files found.
src/renderer/components/index.vue
View file @
9ec8efa5
<
template
>
<
template
>
<transition
name=
"el-zoom-in-top"
>
<transition
name=
"el-zoom-in-top"
>
<div
class=
"homebox"
id=
'homebox'
:class=
"
{'full':isMaxed}">
<div
class=
"homebox"
id=
"homebox"
:class=
"
{'full':isMaxed}">
<div
class=
"leftPannel"
>
<div
class=
"leftPannel"
>
<div
class=
"head"
>
<div
class=
"head"
>
<img
:src=
"user.Icon"
draggable=
"false"
@
click
.
stop=
"showCard"
>
<img
:src=
"user.Icon"
draggable=
"false"
@
click
.
stop=
"showCard"
/
>
</div>
</div>
<ul
class=
"menu"
>
<ul
class=
"menu"
>
<li
:class=
"
{'active':chosenState.val==0}">
<li
:class=
"
{'active':chosenState.val==0}">
...
@@ -51,29 +51,38 @@
...
@@ -51,29 +51,38 @@
</div>
</div>
<div
class=
"error-msg"
>
<div
class=
"error-msg"
>
当前网络不稳定,你已经和组织失去联系,稍后系统将自动链接或者
当前网络不稳定,你已经和组织失去联系,稍后系统将自动链接或者
<span
class=
"goconnect"
v-if=
"!reconnecloading"
@
click=
"reconnect"
>
手动呼叫组织
</span>
<span
class=
"goconnect"
v-if=
"!reconnecloading"
@
click=
"reconnect"
>
手动呼叫组织
</span>
<span
v-else
>
正在呼叫组织
</span>
<span
v-else
>
正在呼叫组织
</span>
</div>
</div>
</div>
</div>
<div
class=
"contentarea"
>
<div
class=
"contentarea"
>
<msg
:user=
user
v-show=
"chosenState.val==0"
></msg>
<msg
:user=
"user"
v-show=
"chosenState.val==0"
></msg>
<mail
v-show=
"chosenState.val==1"
></mail>
<mail
v-show=
"chosenState.val==1"
></mail>
<empty
v-show=
"chosenState.val==2"
></empty>
<empty
v-show=
"chosenState.val==2"
></empty>
<Collection
v-if=
"chosenState.val==3"
></Collection>
<Collection
v-if=
"chosenState.val==3"
></Collection>
</div>
</div>
</div>
</div>
<user-card
v-if=
'usercardInfo.searchName!=""'
:usercard=
'usercardInfo'
></user-card>
<user-card
v-if=
"usercardInfo.searchName!=''"
:usercard=
"usercardInfo"
></user-card>
<div
class=
"at-him-box"
:style=
"
{'top': atInfo.top+'px','left': atInfo.left+'px'}" v-if="atInfo.atName!=''" @click="atMsg">@
{{
atInfo
.
atName
}}
</div>
<div
class=
"at-him-box"
:style=
"
{'top': atInfo.top+'px','left': atInfo.left+'px'}"
v-if="atInfo.atName!=''"
@click="atMsg"
>@
{{
atInfo
.
atName
}}
</div>
</div>
</div>
</transition>
</transition>
</
template
>
</
template
>
<
script
>
<
script
>
import
msg
from
'./msssage/index'
import
msg
from
"./msssage/index"
;
import
mail
from
'./team/maillist'
import
mail
from
"./team/maillist"
;
import
userCard
from
'./team/usercard'
import
userCard
from
"./team/usercard"
;
import
empty
from
'./tools/emptyPage'
import
empty
from
"./tools/emptyPage"
;
import
Collection
from
'./tools/Collection'
import
Collection
from
"./tools/Collection"
;
import
{
setInterval
}
from
'timers'
import
{
setInterval
}
from
"timers"
;
export
default
{
export
default
{
components
:
{
components
:
{
msg
,
msg
,
...
@@ -94,35 +103,35 @@ export default {
...
@@ -94,35 +103,35 @@ export default {
left
:
0
,
left
:
0
,
top
:
0
,
top
:
0
,
atId
:
0
,
atId
:
0
,
atName
:
''
,
atName
:
""
,
scene
:
''
,
scene
:
""
},
},
noticeObj
:{},
noticeObj
:
{},
isMaxed
:
false
,
isMaxed
:
false
,
usercardInfo
:{
usercardInfo
:
{
searchName
:
''
,
searchName
:
""
,
top
:
0
,
top
:
0
,
left
:
0
,
left
:
0
,
currentAccount
:
''
currentAccount
:
""
},
},
reconnecloading
:
false
,
reconnecloading
:
false
,
isdissconnection
:
false
isdissconnection
:
false
};
};
},
},
mounted
()
{
mounted
()
{
const
updateOnlineStatus
=
()
=>
{
const
updateOnlineStatus
=
()
=>
{
if
(
navigator
.
onLine
&&
this
.
isdissconnection
)
{
if
(
navigator
.
onLine
&&
this
.
isdissconnection
)
{
this
.
isdissconnection
=
false
this
.
isdissconnection
=
false
;
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
reconnect
()
this
.
reconnect
();
},
5000
);
},
5000
);
}
else
if
(
!
navigator
.
onLine
){
}
else
if
(
!
navigator
.
onLine
)
{
this
.
isdissconnection
=
true
this
.
isdissconnection
=
true
;
}
}
}
window
.
addEventListener
(
'online'
,
updateOnlineStatus
)
};
window
.
addEventListener
(
'offline'
,
updateOnlineStatus
)
window
.
addEventListener
(
"online"
,
updateOnlineStatus
);
updateOnlineStatus
()
window
.
addEventListener
(
"offline"
,
updateOnlineStatus
);
updateOnlineStatus
();
// var devInnerHeight = 658.0;
// var devInnerHeight = 658.0;
// var devDevicePixelRatio = 1.5;
// var devDevicePixelRatio = 1.5;
// var devScaleFactor = 1.5;
// var devScaleFactor = 1.5;
...
@@ -134,103 +143,122 @@ export default {
...
@@ -134,103 +143,122 @@ export default {
// scaleFactor;
// scaleFactor;
// this.$electron.webFrame.setZoomFactor(zoomFactor);
// this.$electron.webFrame.setZoomFactor(zoomFactor);
this
.
user
=
this
.
$electron
.
remote
.
getGlobal
(
"LOGINUSER"
);
this
.
user
=
this
.
$electron
.
remote
.
getGlobal
(
"LOGINUSER"
);
this
.
usercardInfo
.
currentAccount
=
this
.
user
.
ImAccount
this
.
usercardInfo
.
currentAccount
=
this
.
user
.
ImAccount
;
this
.
$electron
.
ipcRenderer
.
send
(
'create-session'
)
this
.
$electron
.
ipcRenderer
.
send
(
"create-session"
);
let
that
=
this
let
that
=
this
;
this
.
MsgBus
.
$on
(
"open-card"
,
function
(
name
,
top
,
left
,
id
,
openChat
)
{
this
.
MsgBus
.
$on
(
"open-card"
,
function
(
name
,
top
,
left
,
id
,
openChat
)
{
if
(
id
&&
that
.
usercardInfo
.
currentAccount
!==
id
)
{
if
(
id
&&
that
.
usercardInfo
.
currentAccount
!==
id
)
{
that
.
usercardInfo
.
searchName
=
""
that
.
usercardInfo
.
searchName
=
""
;
}
}
setTimeout
(()
=>
{
setTimeout
(()
=>
{
that
.
usercardInfo
=
{
that
.
usercardInfo
=
{
searchName
:
name
,
searchName
:
name
,
top
,
top
,
left
,
left
,
currentAccount
:
id
?
id
:
that
.
user
.
ImAccount
,
currentAccount
:
id
?
id
:
that
.
user
.
ImAccount
,
openChat
:
openChat
?
openChat
:
false
openChat
:
openChat
?
openChat
:
false
}
}
;
that
.
atInfo
.
atName
=
''
that
.
atInfo
.
atName
=
""
;
},
10
)
},
10
)
;
});
});
this
.
MsgBus
.
$on
(
"open-atBox"
,
function
(
name
,
top
,
left
,
id
,
scene
)
{
this
.
MsgBus
.
$on
(
"open-atBox"
,
function
(
name
,
top
,
left
,
id
,
scene
)
{
if
(
id
&&
that
.
atInfo
.
atId
!==
id
)
{
if
(
id
&&
that
.
atInfo
.
atId
!==
id
)
{
that
.
atInfo
.
atName
=
""
that
.
atInfo
.
atName
=
""
;
}
}
setTimeout
(()
=>
{
setTimeout
(()
=>
{
that
.
atInfo
=
{
that
.
atInfo
=
{
atName
:
name
,
atName
:
name
,
top
,
top
,
left
,
left
,
atId
:
id
?
id
:
that
.
user
.
ImAccount
,
atId
:
id
?
id
:
that
.
user
.
ImAccount
,
scene
:
scene
,
scene
:
scene
}
}
;
that
.
usercardInfo
.
searchName
=
''
that
.
usercardInfo
.
searchName
=
""
;
},
10
)
},
10
)
;
});
});
this
.
MsgBus
.
$on
(
"change-create-session"
,
function
(
obj
)
{
this
.
MsgBus
.
$on
(
"change-create-session"
,
function
(
obj
)
{
that
.
chosenState
=
{
that
.
chosenState
=
{
val
:
0
,
val
:
0
,
name
:
"消息"
name
:
"消息"
}
};
that
.
MsgBus
.
$emit
(
'create-session'
,
obj
)
that
.
MsgBus
.
$emit
(
"create-session"
,
obj
);
});
this
.
$electron
.
ipcRenderer
.
on
(
"openMsgBox"
,
(
event
,
session
)
=>
{
that
.
changeMenu
(
0
,
"消息"
);
this
.
MsgBus
.
$emit
(
"set-current-session"
,
session
);
});
this
.
$electron
.
ipcRenderer
.
on
(
"ignore-all-unRead"
,
(
event
,
session
)
=>
{
this
.
MsgBus
.
$emit
(
"ignore-all-unRead"
);
});
});
this
.
$electron
.
ipcRenderer
.
on
(
'openMsgBox'
,
(
event
,
session
)
=>
{
this
.
$electron
.
ipcRenderer
.
on
(
"new-screen-hot"
,
(
event
,
dataurl
)
=>
{
that
.
changeMenu
(
0
,
'消息'
)
this
.
MsgBus
.
$emit
(
"set-current-session"
,
session
)
})
this
.
$electron
.
ipcRenderer
.
on
(
'ignore-all-unRead'
,
(
event
,
session
)
=>
{
this
.
MsgBus
.
$emit
(
"ignore-all-unRead"
)
})
this
.
$electron
.
ipcRenderer
.
on
(
'new-screen-hot'
,
(
event
,
dataurl
)
=>
{
this
.
$electron
.
remote
.
getCurrentWindow
().
show
();
this
.
$electron
.
remote
.
getCurrentWindow
().
show
();
this
.
MsgBus
.
$emit
(
"new-screen-hot"
,
dataurl
)
this
.
MsgBus
.
$emit
(
"new-screen-hot"
,
dataurl
);
})
})
;
//
//
this
.
$electron
.
ipcRenderer
.
on
(
'save-team-members'
,
(
event
,
obj
)
=>
{
this
.
$electron
.
ipcRenderer
.
on
(
"save-team-members"
,
(
event
,
obj
)
=>
{
if
(
obj
.
action
==
'add'
)
{
if
(
obj
.
action
==
"add"
)
{
this
.
MsgBus
.
$emit
(
"save-members"
,
obj
.
teamMembers
)
this
.
MsgBus
.
$emit
(
"save-members"
,
obj
.
teamMembers
);
}
else
if
(
obj
.
action
==
'delete'
)
{
}
else
if
(
obj
.
action
==
"delete"
)
{
this
.
MsgBus
.
$emit
(
"delete-members"
,
obj
.
teamMembers
)
this
.
MsgBus
.
$emit
(
"delete-members"
,
obj
.
teamMembers
);
}
else
if
(
obj
.
action
==
'create'
)
{
}
else
if
(
obj
.
action
==
"create"
)
{
this
.
MsgBus
.
$emit
(
"create-group"
,
obj
.
teamMembers
)
this
.
MsgBus
.
$emit
(
"create-group"
,
obj
.
teamMembers
);
}
else
if
(
obj
.
action
==
'forward'
)
{
}
else
if
(
obj
.
action
==
"forward"
)
{
this
.
MsgBus
.
$emit
(
"goForward"
,
obj
.
sessions
)
this
.
MsgBus
.
$emit
(
"goForward"
,
obj
.
sessions
);
}
}
//
//
})
});
document
.
getElementById
(
'homebox'
).
addEventListener
(
"click"
,
function
(
e
)
{
document
.
getElementById
(
"homebox"
).
addEventListener
(
"click"
,
function
(
e
)
{
if
((
that
.
usercardInfo
.
searchName
!=
""
||
that
.
atInfo
.
atName
!=
''
)
&&
e
.
target
.
className
.
indexOf
(
'u-circle'
)
==
-
1
)
{
if
(
that
.
usercardInfo
.
searchName
=
""
(
that
.
usercardInfo
.
searchName
!=
""
||
that
.
atInfo
.
atName
!=
""
)
&&
that
.
atInfo
.
atName
=
''
e
.
target
.
className
.
indexOf
(
"u-circle"
)
==
-
1
)
{
that
.
usercardInfo
.
searchName
=
""
;
that
.
atInfo
.
atName
=
""
;
}
}
that
.
MsgBus
.
$emit
(
"close-copy"
)
that
.
MsgBus
.
$emit
(
"close-copy"
)
;
that
.
MsgBus
.
$emit
(
"hide-this-winShow"
)
that
.
MsgBus
.
$emit
(
"hide-this-winShow"
)
;
});
});
this
.
listenAts
();
},
},
methods
:
{
methods
:
{
reconnect
(){
listenAts
(){
this
.
reconnecloading
=
true
let
that
=
this
var
orignalSetItem
=
localStorage
.
setItem
localStorage
.
setItem
=
function
(
key
,
newValue
){
var
setItemEvent
=
new
Event
(
"setItemEvent"
);
setItemEvent
.
key
=
key
;
setItemEvent
.
newValue
=
newValue
;
window
.
dispatchEvent
(
setItemEvent
);
orignalSetItem
.
apply
(
this
,
arguments
);
}
window
.
addEventListener
(
"setItemEvent"
,
function
(
e
)
{
if
(
e
.
key
==
'currentAts'
){
that
.
MsgBus
.
$emit
(
'changeAts'
)
}
});
},
reconnect
()
{
this
.
reconnecloading
=
true
;
this
.
$store
.
dispatch
(
"logout"
);
this
.
$store
.
dispatch
(
"logout"
);
this
.
$store
.
dispatch
(
"connect"
);
this
.
$store
.
dispatch
(
"connect"
);
this
.
$electron
.
ipcRenderer
.
send
(
'reconnect'
)
this
.
$electron
.
ipcRenderer
.
send
(
"reconnect"
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
reconnecloading
=
false
this
.
reconnecloading
=
false
;
},
8
*
1000
);
},
8
*
1000
);
},
},
atMsg
(){
atMsg
()
{
this
.
MsgBus
.
$emit
(
'send-at-name'
,
this
.
atInfo
.
atName
)
this
.
MsgBus
.
$emit
(
"send-at-name"
,
this
.
atInfo
.
atName
);
},
},
showCard
(
e
){
showCard
(
e
)
{
this
.
MsgBus
.
$emit
(
'open-card'
,
this
.
user
.
emName
,
e
.
clientY
,
e
.
clientX
)
this
.
MsgBus
.
$emit
(
"open-card"
,
this
.
user
.
emName
,
e
.
clientY
,
e
.
clientX
);
},
},
changeMenu
(
i
,
n
)
{
changeMenu
(
i
,
n
)
{
this
.
chosenState
=
{
this
.
chosenState
=
{
val
:
i
,
val
:
i
,
name
:
n
name
:
n
};
};
if
(
i
!=
0
)
{
if
(
i
!=
0
)
{
this
.
MsgBus
.
$emit
(
"dispose-session"
)
this
.
MsgBus
.
$emit
(
"dispose-session"
)
;
}
}
},
},
minWin
()
{
minWin
()
{
...
@@ -247,13 +275,13 @@ export default {
...
@@ -247,13 +275,13 @@ export default {
}
}
},
},
hideWin
()
{
hideWin
()
{
this
.
MsgBus
.
$emit
(
"dispose-session"
)
this
.
MsgBus
.
$emit
(
"dispose-session"
)
;
this
.
$electron
.
remote
.
getCurrentWindow
().
hide
();
this
.
$electron
.
remote
.
getCurrentWindow
().
hide
();
}
}
},
},
computed
:
{
computed
:
{
netState
(){
netState
()
{
return
this
.
$store
.
state
.
isNetError
return
this
.
$store
.
state
.
isNetError
;
}
}
}
}
};
};
...
@@ -267,7 +295,7 @@ export default {
...
@@ -267,7 +295,7 @@ export default {
box-shadow
:
0
0
2px
#333
;
box-shadow
:
0
0
2px
#333
;
margin
:
0px
;
margin
:
0px
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
border
:
1px
solid
#ccc
;
border
:
1px
solid
#ccc
;
}
}
.homebox.full
{
.homebox.full
{
width
:
100%
;
width
:
100%
;
...
@@ -308,7 +336,7 @@ export default {
...
@@ -308,7 +336,7 @@ export default {
padding
:
0
;
padding
:
0
;
position
:
relative
;
position
:
relative
;
}
}
.homebox
.leftPannel
.last
{
.homebox
.leftPannel
.last
{
left
:
0
;
left
:
0
;
bottom
:
8px
;
bottom
:
8px
;
position
:
absolute
;
position
:
absolute
;
...
@@ -316,7 +344,7 @@ export default {
...
@@ -316,7 +344,7 @@ export default {
text-align
:
center
;
text-align
:
center
;
color
:
#eee
;
color
:
#eee
;
}
}
.homebox
.leftPannel
.last
i
{
.homebox
.leftPannel
.last
i
{
font-size
:
24px
;
font-size
:
24px
;
}
}
.homebox
.leftPannel
.menu
li
{
.homebox
.leftPannel
.menu
li
{
...
@@ -349,24 +377,24 @@ export default {
...
@@ -349,24 +377,24 @@ export default {
}
}
.homebox
.rightPannel
.navtool
{
.homebox
.rightPannel
.navtool
{
height
:
40px
;
height
:
40px
;
box-shadow
:
1px
2px
8px
0px
rgba
(
0
,
0
,
0
,
.1
);
box-shadow
:
1px
2px
8px
0px
rgba
(
0
,
0
,
0
,
0
.1
);
display
:
flex
;
display
:
flex
;
-webkit-app-region
:
drag
!important
;
-webkit-app-region
:
drag
!important
;
}
}
.homebox
.rightPannel
.navtool
.error-msg
{
.homebox
.rightPannel
.navtool
.error-msg
{
display
:
none
;
display
:
none
;
top
:
0px
;
top
:
0px
;
left
:
0px
;
left
:
0px
;
height
:
40px
;
height
:
40px
;
line-height
:
40px
;
line-height
:
40px
;
margin
:
0
130px
;
margin
:
0
130px
;
text-align
:
center
;
text-align
:
center
;
font-size
:
12px
;
font-size
:
12px
;
font-family
:
'microsoft yahei'
;
font-family
:
"microsoft yahei"
;
color
:
#f5f5f5
;
color
:
#f5f5f5
;
position
:
absolute
;
position
:
absolute
;
}
}
.homebox
.rightPannel
.navtool
.error-msg
.goconnect
{
.homebox
.rightPannel
.navtool
.error-msg
.goconnect
{
margin-left
:
10px
;
margin-left
:
10px
;
color
:
yellow
!important
;
color
:
yellow
!important
;
text-decoration
:
underline
;
text-decoration
:
underline
;
...
@@ -374,13 +402,13 @@ export default {
...
@@ -374,13 +402,13 @@ export default {
-webkit-app-region
:
no-drag
!important
;
-webkit-app-region
:
no-drag
!important
;
}
}
.homebox
.rightPannel
.navtool.errornet
{
.homebox
.rightPannel
.navtool.errornet
{
background
:
#d25050
!important
;
background
:
#d25050
!important
;
}
}
.homebox
.rightPannel
.navtool.errornet
.error-msg
{
.homebox
.rightPannel
.navtool.errornet
.error-msg
{
display
:
block
;
display
:
block
;
}
}
.homebox
.rightPannel
.navtool.errornet
*
{
.homebox
.rightPannel
.navtool.errornet
*
{
color
:
#f1f1f1
!important
;
color
:
#f1f1f1
!important
;
}
}
.homebox
.rightPannel
.navtool
.child__item
{
.homebox
.rightPannel
.navtool
.child__item
{
...
@@ -417,7 +445,7 @@ export default {
...
@@ -417,7 +445,7 @@ export default {
background
:
#eb3b5a
;
background
:
#eb3b5a
;
color
:
#f1f1f1
;
color
:
#f1f1f1
;
}
}
.homebox
.rightPannel
.navtool
.child__item
.header__opera
.close
{
.homebox
.rightPannel
.navtool
.child__item
.header__opera
.close
{
font-size
:
18px
;
font-size
:
18px
;
}
}
.homebox
.homebox
...
@@ -428,8 +456,8 @@ export default {
...
@@ -428,8 +456,8 @@ export default {
.opera__item.min
:hover
{
.opera__item.min
:hover
{
background
:
rgba
(
0
,
0
,
0
,
0.1
);
background
:
rgba
(
0
,
0
,
0
,
0.1
);
}
}
.homebox
.rightPannel
.contentarea
{
.homebox
.rightPannel
.contentarea
{
position
:
absolute
;
position
:
absolute
;
top
:
40px
;
top
:
40px
;
z-index
:
0
;
z-index
:
0
;
bottom
:
0
;
bottom
:
0
;
...
@@ -449,7 +477,7 @@ export default {
...
@@ -449,7 +477,7 @@ export default {
font-size
:
14px
;
font-size
:
14px
;
padding
:
5px
10px
;
padding
:
5px
10px
;
}
}
.at-him-box
:hover
{
.at-him-box
:hover
{
background
:
#eeeeee
;
background
:
#eeeeee
;
}
}
</
style
>
</
style
>
src/renderer/components/login.vue
View file @
9ec8efa5
...
@@ -129,6 +129,7 @@ export default {
...
@@ -129,6 +129,7 @@ export default {
if
(
!
localStorage
.
currentAts
){
if
(
!
localStorage
.
currentAts
){
localStorage
.
currentAts
=
'{}'
localStorage
.
currentAts
=
'{}'
}
}
localStorage
.
selfNam
=
userData
.
emName
if
(
this
.
usermodel
.
remeber
)
{
if
(
this
.
usermodel
.
remeber
)
{
this
.
usermodel
.
userpic
=
userData
.
Icon
;
this
.
usermodel
.
userpic
=
userData
.
Icon
;
this
.
usermodel
.
username
=
userData
.
emName
;
this
.
usermodel
.
username
=
userData
.
emName
;
...
...
src/renderer/components/msssage/chateditor.vue
View file @
9ec8efa5
...
@@ -406,28 +406,26 @@ export default {
...
@@ -406,28 +406,26 @@ export default {
let
accids
=
[]
let
accids
=
[]
ats
.
forEach
(
x
=>
{
ats
.
forEach
(
x
=>
{
if
(
x
==
'@全体成员(all)'
){
if
(
x
==
'@全体成员(all)'
){
accids
.
push
({
accids
.
push
(
'-1'
)
account
:
'-1'
,
alias
:
'@全体成员(all)'
})
}
else
{
}
else
{
this
.
members
.
forEach
(
y
=>
{
this
.
members
.
forEach
(
y
=>
{
if
(
x
==
`@
${
y
.
alias
}
`
){
if
(
x
==
`@
${
y
.
alias
}
`
){
accids
.
push
({
accids
.
push
(
`
${
y
.
account
}
`
)
account
:
y
.
account
,
alias
:
'@'
+
y
.
alias
})
}
}
})
})
}
}
})
})
let
apns
=
{
accounts
:
accids
,
content
:
`
${
localStorage
.
selfNam
}
在群里@了你`
,
forcePush
:
true
}
this
.
$store
.
dispatch
(
"sendMsg"
,
{
this
.
$store
.
dispatch
(
"sendMsg"
,
{
type
:
"at"
,
type
:
"at"
,
scene
:
this
.
scene
,
scene
:
this
.
scene
,
to
:
this
.
to
,
to
:
this
.
to
,
text
:
this
.
msgToSent
,
text
:
this
.
msgToSent
,
content
:
accids
,
apns
callbackTeam
:
this
.
callBackTeam
});
});
}
else
{
}
else
{
console
.
log
(
'in start...........'
,
new
Date
())
console
.
log
(
'in start...........'
,
new
Date
())
...
...
src/renderer/components/msssage/chatitem.vue
View file @
9ec8efa5
...
@@ -512,13 +512,14 @@ export default {
...
@@ -512,13 +512,14 @@ export default {
// 文本消息
// 文本消息
item
.
showText
=
util
.
escape
(
item
.
text
);
item
.
showText
=
util
.
escape
(
item
.
text
);
let
ats
=
item
.
showText
.
replace
(
/ /ig
,
" "
).
match
(
/@
[^\s
@$
]
+/g
)
let
ats
=
item
.
showText
.
replace
(
/ /ig
,
" "
).
match
(
/@
[^\s
@$
]
+/g
)
if
(
ats
&&
item
.
scene
==
'team'
&&
item
.
custom
){
if
(
ats
&&
item
.
scene
==
'team'
&&
item
.
apns
&&
item
.
apns
.
accounts
&&
item
.
apns
.
accounts
.
length
>
0
){
let
atUser
=
JSON
.
parse
(
item
.
custom
)
//let atUser=item.apns
console
.
log
(
item
)
ats
.
forEach
(
at
=>
{
ats
.
forEach
(
at
=>
{
let
isExsit
=
atUser
.
find
(
x
=>
{
//
let isExsit=atUser.find(x=>{
return
x
.
alias
==
at
//
return x.alias==at
})
//
})
if
(
isExsit
)
//
if(isExsit)
item
.
showText
=
item
.
showText
.
replace
(
at
,
`<p class='at-user'>
${
at
}
</p>`
)
item
.
showText
=
item
.
showText
.
replace
(
at
,
`<p class='at-user'>
${
at
}
</p>`
)
})
})
}
}
...
...
src/renderer/components/msssage/index.vue
View file @
9ec8efa5
...
@@ -78,58 +78,13 @@
...
@@ -78,58 +78,13 @@
</div>
</div>
</li>
</li>
</
template
>
</
template
>
<
template
v-for=
"(session, index) in sessionlist"
>
<li
:class=
"
{'active':currentSession.id==session.id}"
style="background:rgb(238,238,238)"
v-if="session.top
&&
(sessionKey=='' || session.name.indexOf(sessionKey)!=-1)"
:key="index"
@contextmenu.prevent='showMenu(session,$event)'
@click="enterChat(session)"
>
<el-badge
:value=
"session.unread"
:max=
"99"
class=
"item"
:hidden=
"session.unread==0"
:is-dot=
"session.isMute && session.unread>0"
>
<div
class=
"headinfo"
:class=
"
{'notice':!session.avatar,'blue':session.groupType==0,'green':session.groupType==1,'user':session.groupType==-1}"
>
<img
:src=
"session.avatar"
v-if=
"session.avatar"
>
<i
class=
"iconfont icontaolun"
v-else-if=
"session.groupType == 0"
></i>
<i
class=
"iconfont iconqunzu"
v-else-if=
"session.groupType == 1"
></i>
<i
class=
"iconfont iconyonghutouxiang"
v-else
></i>
</div>
</el-badge>
<div
class=
"baseinfo"
>
<div
class=
"userbase"
>
<div
class=
"name"
>
{{
session
.
name
}}
</div>
<div
class=
"time"
>
{{
session
.
updateTimeShow
}}
</div>
</div>
<div
class=
"msgbase"
>
<div
class=
"last"
>
<span
class=
"at-me"
v-if=
"session.atId"
>
[有人@我]
</span>
<template
v-if=
"session.isMute && session.unread>0 && !session.historiMsg"
>
<span>
[
{{
session
.
unread
}}
]
</span>
</
template
>
<span
v-if=
"!session.historiMsg"
>
{{session.lastMsgShow}}
</span>
<span
v-if=
"session.historiMsg && currentSession.id !== session.id"
style=
"color: red"
>
[草稿]
</span>
{{session.historiMsg}}
</div>
<div
class=
"no-tip"
v-if=
"session.isMute"
>
<i
class=
"iconfont iconmiandarao-kai"
></i>
</div>
</div>
</div>
</li>
</template>
<
template
v-for=
"(session, index) in sessionlist"
>
<
template
v-for=
"(session, index) in sessionlist"
>
<!-- && session.lastMsgShow!== '[未知消息类型]' -->
<!-- && session.lastMsgShow!== '[未知消息类型]' -->
<li
<li
:class=
"
{'active':currentSession.id==session.id}"
:class=
"
{'active':currentSession.id==session.id}"
v-if="!session.top
&&
(sessionKey=='' || session.name.indexOf(sessionKey)!=-1)
&&
session.name!== ''"
v-if="(sessionKey=='' || session.name.indexOf(sessionKey)!=-1)
&&
session.name!== ''"
:style="{background: session.top ? 'rgb(238,238,238)' : ''}"
:key="index"
:key="index"
@contextmenu.prevent='showMenu(session,$event)'
@contextmenu.prevent='showMenu(session,$event)'
@click="enterChat(session)"
@click="enterChat(session)"
...
@@ -158,7 +113,7 @@
...
@@ -158,7 +113,7 @@
</div>
</div>
<div
class=
"msgbase"
>
<div
class=
"msgbase"
>
<div
class=
"last"
>
<div
class=
"last"
>
<span
class=
"at-me"
v-if=
"session.atId"
>
[有人@我]
</span>
<span
class=
"at-me"
v-if=
"session.atId
&& session.unread>0
"
>
[有人@我]
</span>
<template
v-if=
"session.isMute && session.unread>0 && !session.historiMsg"
>
<template
v-if=
"session.isMute && session.unread>0 && !session.historiMsg"
>
<span>
[
{{
session
.
unread
}}
]
</span>
<span>
[
{{
session
.
unread
}}
]
</span>
</
template
>
</
template
>
...
@@ -235,7 +190,8 @@ export default {
...
@@ -235,7 +190,8 @@ export default {
atIds
:
null
,
atIds
:
null
,
forwardMsgInfo
:{},
forwardMsgInfo
:{},
sessionlistArr
:
[],
sessionlistArr
:
[],
initSessionList
:[]
initSessionList
:[],
localAts
:{}
};
};
},
},
updated
()
{
updated
()
{
...
@@ -383,33 +339,38 @@ export default {
...
@@ -383,33 +339,38 @@ export default {
}
}
},
},
clearAtMe
(){
clearAtMe
(){
let
teamInfo
=
null
;
if
(
this
.
currentSession
.
scene
===
"team"
)
{
if
(
this
.
currentSession
.
scene
===
"team"
)
{
t
eamInfo
=
this
.
$store
.
state
.
teamlist
.
find
(
team
=>
{
t
his
.
$store
.
state
.
teamlist
.
forEach
(
team
=>
{
return
team
.
teamId
===
this
.
currentSession
.
to
;
if
(
team
.
teamId
===
this
.
currentSession
.
to
){
});
delete
team
.
atId
}
}
if
(
teamInfo
&&
teamInfo
.
custom
){
});
let
custom
=
JSON
.
parse
(
teamInfo
.
custom
)
this
.
localAts
=
JSON
.
parse
(
localStorage
.
currentAts
)
if
(
custom
.
ats
){
if
(
this
.
localAts
[
this
.
currentSession
.
to
])
custom
.
ats
=
custom
.
ats
.
filter
(
x
=>
{
delete
this
.
localAts
[
this
.
currentSession
.
to
]
if
(
x
.
account
==
this
.
$store
.
state
.
userUID
)
localStorage
.
currentAts
=
JSON
.
stringify
(
this
.
localAts
)
return
}
return
x
// if(teamInfo && teamInfo.custom){
})
// let custom=JSON.parse(teamInfo.custom)
// if(custom.ats){
// custom.ats=custom.ats.filter(x=>{
// if(x.account==this.$store.state.userUID)
// return
// return x
// })
this
.
$store
.
dispatch
(
"delegateTeamFunction"
,
{
//
this.$store.dispatch("delegateTeamFunction", {
functionName
:
'updateTeam'
,
//
functionName: 'updateTeam',
options
:
{
//
options: {
teamId
:
teamInfo
.
teamId
,
//
teamId: teamInfo.teamId,
custom
:
JSON
.
stringify
(
custom
),
//
custom: JSON.stringify(custom),
done
:
(
error
,
team
)
=>
{
//
done: (error, team) => {
// console.log('serverCustom Error:',error)
//
// console.log('serverCustom Error:',error)
}
//
}
}
//
}
})
//
})
}
//
}
}
//
}
},
},
openNotice
(){
openNotice
(){
this
.
$store
.
dispatch
(
"resetCurrSession"
)
this
.
$store
.
dispatch
(
"resetCurrSession"
)
...
@@ -496,6 +457,7 @@ export default {
...
@@ -496,6 +457,7 @@ export default {
},
},
mounted
()
{
mounted
()
{
this
.
audio_base
=
this
.
$electron
.
remote
.
getGlobal
(
"AUDIO_PATH"
)
+
'audio/'
this
.
audio_base
=
this
.
$electron
.
remote
.
getGlobal
(
"AUDIO_PATH"
)
+
'audio/'
this
.
localAts
=
JSON
.
parse
(
localStorage
.
currentAts
)
if
(
window
.
localStorage
.
top
)
{
if
(
window
.
localStorage
.
top
)
{
this
.
TOPSESSION
=
JSON
.
parse
(
window
.
localStorage
.
top
);
this
.
TOPSESSION
=
JSON
.
parse
(
window
.
localStorage
.
top
);
}
}
...
@@ -543,17 +505,18 @@ export default {
...
@@ -543,17 +505,18 @@ export default {
this
.
MsgBus
.
$on
(
"create-session"
,
function
(
obj
)
{
this
.
MsgBus
.
$on
(
"create-session"
,
function
(
obj
)
{
that
.
createSession
(
obj
)
that
.
createSession
(
obj
)
});
});
this
.
MsgBus
.
$on
(
'reload-ats'
,
function
(){
this
.
localAts
=
JSON
.
parse
(
localStorage
.
currentAts
)
})
//
//
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
initSessionList
=
this
.
sessionlist
.
filter
(
x
=>
{
this
.
initSessionList
=
this
.
sessionlist
.
filter
(
x
=>
{
console
.
log
(
x
.
lastMsg
)
if
(
x
.
scene
==
'team'
&&
x
.
unread
>
0
&&
x
.
unread
<
100
&&
!
this
.
localAts
[
x
.
to
]){
if
(
x
.
scene
==
'team'
&&
x
.
unread
>
0
&&
x
.
unread
<
100
){
return
x
return
x
}
else
{
}
else
{
return
false
return
false
}
}
})
})
console
.
log
(
this
.
initSessionList
)
if
(
this
.
initSessionList
.
length
>
0
){
if
(
this
.
initSessionList
.
length
>
0
){
this
.
getAts
()
this
.
getAts
()
}
}
...
@@ -622,23 +585,35 @@ export default {
...
@@ -622,23 +585,35 @@ export default {
?
this
.
myGroupIcon
?
this
.
myGroupIcon
:
this
.
myAdvancedIcon
);
:
this
.
myAdvancedIcon
);
item
.
isMute
=
teamInfo
.
usermute
?
teamInfo
.
usermute
:
false
;
item
.
isMute
=
teamInfo
.
usermute
?
teamInfo
.
usermute
:
false
;
try
{
// try {
if
(
teamInfo
.
custom
){
// if(teamInfo.custom){
let
custom
=
JSON
.
parse
(
teamInfo
.
custom
)
// let custom=JSON.parse(teamInfo.custom)
if
(
custom
.
ats
){
// if(custom.ats){
let
atme
=
custom
.
ats
.
find
(
x
=>
{
// let atme =custom.ats.find(x=>{
return
x
.
account
==
this
.
$store
.
state
.
userUID
// return x.account==this.$store.state.userUID
})
// })
if
(
atme
&&
this
.
currentSession
.
id
!=
item
.
id
){
// if(atme && this.currentSession.id!=item.id){
item
.
atId
=
atme
.
id
// item.atId=atme.id
}
else
if
(
atme
&&
this
.
currentSession
.
id
==
item
.
id
){
// }else if(atme && this.currentSession.id==item.id){
setTimeout
(()
=>
{
// setTimeout(() => {
this
.
clearAtMe
()
// this.clearAtMe()
},
1000
);
// }, 1000);
// }
// }
// }
// } catch (error) {}
if
(
item
.
lastMsg
.
apns
&&
item
.
lastMsg
.
apns
.
accounts
&&
(
item
.
lastMsg
.
apns
.
accounts
.
indexOf
(
localStorage
.
imAccount
)
!=
-
1
||
item
.
lastMsg
.
apns
.
accounts
[
0
]
==
-
1
)){
item
.
atId
=
item
.
lastMsg
.
idServer
}
else
{
if
(
teamInfo
.
atId
){
item
.
atId
=
teamInfo
.
atId
}
else
{
item
.
atId
=
null
if
(
this
.
localAts
[
item
.
to
]){
item
.
atId
=
this
.
localAts
[
item
.
to
]
}
}
}
}
}
}
}
catch
(
error
)
{}
}
else
{
}
else
{
return
;
return
;
item
.
groupType
=
"normal"
;
item
.
groupType
=
"normal"
;
...
@@ -751,6 +726,7 @@ export default {
...
@@ -751,6 +726,7 @@ export default {
this
.
newMsgList
=
unreadList
;
this
.
newMsgList
=
unreadList
;
sessionlist
.
sort
((
a
,
b
)
=>
b
.
top
-
a
.
top
)
return
sessionlist
;
return
sessionlist
;
}
}
// netState(){
// netState(){
...
...
src/store/actions/msgs.js
View file @
9ec8efa5
...
@@ -233,7 +233,6 @@ export function sendMsg({ state, commit }, obj) {
...
@@ -233,7 +233,6 @@ export function sendMsg({ state, commit }, obj) {
done
:
onSendMsgDone
,
done
:
onSendMsgDone
,
needMsgReceipt
:
obj
.
needMsgReceipt
||
false
needMsgReceipt
:
obj
.
needMsgReceipt
||
false
})
})
console
.
log
(
'start sdk.........'
)
util
.
getDate
()
util
.
getDate
()
break
break
case
'at'
:
case
'at'
:
...
@@ -241,13 +240,11 @@ export function sendMsg({ state, commit }, obj) {
...
@@ -241,13 +240,11 @@ export function sendMsg({ state, commit }, obj) {
scene
:
obj
.
scene
,
scene
:
obj
.
scene
,
to
:
obj
.
to
,
to
:
obj
.
to
,
text
:
obj
.
text
,
text
:
obj
.
text
,
done
:
function
(
err
,
msg
)
{
apns
:
obj
.
apns
,
obj
.
callbackTeam
(
obj
.
content
,
msg
.
idServer
)
done
:
onSendMsgDone
,
onMsg
(
msg
)
needMsgReceipt
:
obj
.
needMsgReceipt
||
false
},
needMsgReceipt
:
obj
.
needMsgReceipt
||
false
,
custom
:
JSON
.
stringify
(
obj
.
content
)
})
})
util
.
getDate
()
break
break
case
'custom'
:
case
'custom'
:
nim
.
sendCustomMsg
({
nim
.
sendCustomMsg
({
...
...
src/store/actions/team.js
View file @
9ec8efa5
...
@@ -7,16 +7,16 @@ export function onTeams(teams) {
...
@@ -7,16 +7,16 @@ export function onTeams(teams) {
}
}
teams
=
teams
.
filter
(
item
=>
!!
item
)
teams
=
teams
.
filter
(
item
=>
!!
item
)
let
teamIds
=
[]
let
teamIds
=
[]
teams
.
forEach
(
team
=>
{
teams
.
forEach
(
team
=>
{
teamIds
.
push
(
team
.
teamId
)
teamIds
.
push
(
team
.
teamId
)
if
(
team
.
validToCurrentUser
===
undefined
)
{
if
(
team
.
validToCurrentUser
===
undefined
)
{
team
.
validToCurrentUser
=
true
team
.
validToCurrentUser
=
true
}
}
if
(
team
.
avatar
&&
team
.
avatar
.
indexOf
(
'nim.nosdn.127'
)
>
0
&&
team
.
avatar
.
indexOf
(
'?imageView'
)
===
-
1
)
{
if
(
team
.
avatar
&&
team
.
avatar
.
indexOf
(
'nim.nosdn.127'
)
>
0
&&
team
.
avatar
.
indexOf
(
'?imageView'
)
===
-
1
)
{
team
.
avatar
=
team
.
avatar
+
'?imageView&thumbnail=300y300'
team
.
avatar
=
team
.
avatar
+
'?imageView&thumbnail=300y300'
}
}
})
})
getNotifyForNewTeamMsg
(
store
,
teamIds
)
getNotifyForNewTeamMsg
(
store
,
teamIds
)
store
.
commit
(
'updateTeamList'
,
teams
)
store
.
commit
(
'updateTeamList'
,
teams
)
}
}
...
@@ -35,7 +35,7 @@ export function onCreateTeam(team) {
...
@@ -35,7 +35,7 @@ export function onCreateTeam(team) {
})
})
}
}
export
function
onSynCreateTeam
(
team
){
export
function
onSynCreateTeam
(
team
)
{
onTeams
(
team
)
onTeams
(
team
)
}
}
...
@@ -46,10 +46,11 @@ export function onDismissTeam(obj) {
...
@@ -46,10 +46,11 @@ export function onDismissTeam(obj) {
}
}
export
function
onUpdateTeam
(
team
)
{
export
function
onUpdateTeam
(
team
)
{
console
.
log
(
'team update..........'
)
onTeams
(
team
)
onTeams
(
team
)
}
}
export
function
onTeamNotificationMsg
({
state
,
commit
},
msg
)
{
export
function
onTeamNotificationMsg
({
state
,
commit
},
msg
)
{
if
(
msg
.
attach
.
type
===
'updateTeam'
&&
msg
.
attach
.
team
)
{
if
(
msg
.
attach
.
type
===
'updateTeam'
&&
msg
.
attach
.
team
)
{
store
.
commit
(
'updateTeamInfo'
,
msg
.
attach
.
team
)
store
.
commit
(
'updateTeamInfo'
,
msg
.
attach
.
team
)
}
}
...
@@ -62,7 +63,7 @@ export function onTeamNotificationMsg({state, commit}, msg) {
...
@@ -62,7 +63,7 @@ export function onTeamNotificationMsg({state, commit}, msg) {
}
}
export
function
onAddTeamMembers
(
obj
)
{
export
function
onAddTeamMembers
(
obj
)
{
obj
.
accounts
.
forEach
(
account
=>
{
obj
.
accounts
.
forEach
(
account
=>
{
// 自己被拉入群时更新群列表
// 自己被拉入群时更新群列表
if
(
account
===
store
.
state
.
userUID
)
{
if
(
account
===
store
.
state
.
userUID
)
{
let
team
=
[
obj
.
team
]
let
team
=
[
obj
.
team
]
...
@@ -120,7 +121,7 @@ export function onTeamMsgReceipt(obj) {
...
@@ -120,7 +121,7 @@ export function onTeamMsgReceipt(obj) {
}
}
// 进入可配置的群信息设置页,进入前改变state中的配置信息,进入页面后读取配置信息更新视图
// 进入可配置的群信息设置页,进入前改变state中的配置信息,进入页面后读取配置信息更新视图
export
function
enterSettingPage
({
commit
},
obj
)
{
export
function
enterSettingPage
({
commit
},
obj
)
{
commit
(
'updateTeamSettingConfig'
,
obj
)
commit
(
'updateTeamSettingConfig'
,
obj
)
// setTimeout(() => {
// setTimeout(() => {
// location.href = `#/teamsetting`
// location.href = `#/teamsetting`
...
@@ -129,16 +130,16 @@ export function enterSettingPage({commit}, obj) {
...
@@ -129,16 +130,16 @@ export function enterSettingPage({commit}, obj) {
/*
/*
* 代理nim sdk中对群组的操作方法
* 代理nim sdk中对群组的操作方法
* @functionName nim sdk中的方法名
* @functionName nim sdk中的方法名
* @options 传递给sdk方法的参数
* @options 传递给sdk方法的参数
*/
*/
export
function
delegateTeamFunction
({
state
},
{
functionName
,
options
})
{
export
function
delegateTeamFunction
({
state
},
{
functionName
,
options
})
{
const
nim
=
state
.
nim
const
nim
=
state
.
nim
if
(
functionName
&&
nim
[
functionName
]
&&
typeof
nim
[
functionName
]
===
'function'
)
{
if
(
functionName
&&
nim
[
functionName
]
&&
typeof
nim
[
functionName
]
===
'function'
)
{
nim
[
functionName
](
options
)
nim
[
functionName
](
options
)
}
else
{
}
else
{
throw
(
`There is not property of '
${
functionName
}
' in nim or '
${
functionName
}
' is not a function`
)
throw
(
`There is not property of '
${
functionName
}
' in nim or '
${
functionName
}
' is not a function`
)
}
}
}
}
...
@@ -168,26 +169,26 @@ export function getTeamMembers({ state }, teamId) {
...
@@ -168,26 +169,26 @@ export function getTeamMembers({ state }, teamId) {
})
})
}
}
export
function
getNotifyForNewTeamMsg
({
state
,
commit
},
teamIds
)
{
export
function
getNotifyForNewTeamMsg
({
state
,
commit
},
teamIds
)
{
const
nim
=
state
.
nim
const
nim
=
state
.
nim
nim
.
notifyForNewTeamMsg
({
nim
.
notifyForNewTeamMsg
({
teamIds
:
teamIds
,
teamIds
:
teamIds
,
done
:
(
err
,
obj
)
=>
{
done
:
(
err
,
obj
)
=>
{
commit
(
'updateTeamUserMute'
,
obj
)
commit
(
'updateTeamUserMute'
,
obj
)
}
}
})
})
}
}
export
function
checkTeamMsgReceipt
({
state
},
msgs
)
{
export
function
checkTeamMsgReceipt
({
state
},
msgs
)
{
var
result
=
/team-
(\d
+
)
/
.
exec
(
state
.
currSessionId
)
var
result
=
/team-
(\d
+
)
/
.
exec
(
state
.
currSessionId
)
if
(
!
result
)
{
if
(
!
result
)
{
return
null
return
null
}
}
var
teamId
=
result
[
1
]
var
teamId
=
result
[
1
]
var
needToPeceiptList
=
getMsgNeedToReceipt
(
state
,
teamId
,
msgs
)
var
needToPeceiptList
=
getMsgNeedToReceipt
(
state
,
teamId
,
msgs
)
if
(
needToPeceiptList
&&
needToPeceiptList
.
length
>
0
)
{
if
(
needToPeceiptList
&&
needToPeceiptList
.
length
>
0
)
{
nim
.
sendTeamMsgReceipt
({
nim
.
sendTeamMsgReceipt
({
teamMsgReceipts
:
needToPeceiptList
,
teamMsgReceipts
:
needToPeceiptList
,
done
:
(
err
,
obj
,
content
)
=>
{
done
:
(
err
,
obj
,
content
)
=>
{
...
@@ -225,8 +226,8 @@ export function getTeamMsgReads({ state }, needQuery) {
...
@@ -225,8 +226,8 @@ export function getTeamMsgReads({ state }, needQuery) {
done
:
(
error
,
obj
,
content
)
=>
{
done
:
(
error
,
obj
,
content
)
=>
{
if
(
error
)
{
if
(
error
)
{
//console.log('获取群组消息已读' + error)
//console.log('获取群组消息已读' + error)
let
a
=
0
;
let
a
=
0
;
}
else
{
}
else
{
//('获取群组消息已读:', content)
//('获取群组消息已读:', content)
store
.
commit
(
'updateTeamMsgReads'
,
content
)
store
.
commit
(
'updateTeamMsgReads'
,
content
)
}
}
...
...
src/store/mutations/index.js
View file @
9ec8efa5
...
@@ -260,12 +260,25 @@ export default {
...
@@ -260,12 +260,25 @@ export default {
// 装入未读消息
// 装入未读消息
unreadListHis
(
state
,
obj
)
{
unreadListHis
(
state
,
obj
)
{
let
currentAts
=
JSON
.
parse
(
localStorage
.
currentAts
)
let
currentAts
=
JSON
.
parse
(
localStorage
.
currentAts
)
let
tempteamlist
=
store
.
state
.
teamlist
let
teamObj
=
[]
obj
.
msgs
.
forEach
(
x
=>
{
obj
.
msgs
.
forEach
(
x
=>
{
if
(
x
.
apns
&&
x
.
apns
.
accounts
&&
x
.
apns
.
accounts
.
indexOf
(
localStorage
.
imAccount
)
!=
-
1
)
{
if
(
x
.
apns
&&
x
.
apns
.
accounts
&&
(
x
.
apns
.
accounts
.
indexOf
(
localStorage
.
imAccount
)
!=
-
1
||
x
.
apns
.
accounts
[
0
]
==
-
1
))
{
console
.
log
(
x
.
apns
)
currentAts
[
obj
.
to
]
=
x
.
idServer
currentAts
[
obj
.
to
]
=
x
.
idServer
localStorage
.
setItem
(
"currentAts"
,
JSON
.
stringify
(
currentAts
)
||
{});
tempteamlist
.
forEach
(
t
=>
{
if
(
t
.
teamId
==
obj
.
to
)
{
t
.
atId
=
x
.
idServer
}
teamObj
.
push
(
t
)
})
}
}
})
})
localStorage
.
currentAts
=
JSON
.
stringify
(
currentAts
)
||
{}
if
(
teamObj
.
length
>
0
)
{
store
.
commit
(
'updateTeamList'
,
teamObj
)
}
},
},
// clearMsgs(state, obj) {
// clearMsgs(state, obj) {
// state.msgs = []
// state.msgs = []
...
...
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