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
5507e229
Commit
5507e229
authored
Sep 26, 2019
by
华国豪
🙄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
58659b8e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
136 additions
and
39 deletions
+136
-39
index.vue
src/renderer/components/index.vue
+73
-10
chat.vue
src/renderer/components/msssage/chat.vue
+2
-2
chatitem.vue
src/renderer/components/msssage/chatitem.vue
+35
-23
addNewUser.vue
src/renderer/components/team/addNewUser.vue
+1
-0
maillist.vue
src/renderer/components/team/maillist.vue
+4
-1
usercard.vue
src/renderer/components/team/usercard.vue
+21
-3
No files found.
src/renderer/components/index.vue
View file @
5507e229
...
@@ -52,8 +52,8 @@
...
@@ -52,8 +52,8 @@
</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>
</div>
</transition>
</transition>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -61,6 +61,7 @@ import msg from './msssage/index'
...
@@ -61,6 +61,7 @@ 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
{
setInterval
}
from
'timers'
export
default
{
export
default
{
components
:
{
components
:
{
msg
,
msg
,
...
@@ -76,6 +77,13 @@ export default {
...
@@ -76,6 +77,13 @@ export default {
val
:
0
,
val
:
0
,
name
:
"消息"
name
:
"消息"
},
},
atInfo
:
{
left
:
0
,
top
:
0
,
atId
:
0
,
atName
:
''
,
scene
:
''
,
},
noticeObj
:{},
noticeObj
:{},
isMaxed
:
false
,
isMaxed
:
false
,
usercardInfo
:{
usercardInfo
:{
...
@@ -101,13 +109,35 @@ export default {
...
@@ -101,13 +109,35 @@ export default {
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
)
{
this
.
MsgBus
.
$on
(
"open-card"
,
function
(
name
,
top
,
left
,
id
,
openChat
)
{
that
.
usercardInfo
=
{
if
(
id
&&
that
.
usercardInfo
.
currentAccount
!==
id
)
{
searchName
:
name
,
that
.
usercardInfo
.
searchName
=
""
top
,
}
left
,
setTimeout
(()
=>
{
currentAccount
:
that
.
user
.
ImAccount
that
.
usercardInfo
=
{
searchName
:
name
,
top
,
left
,
currentAccount
:
id
?
id
:
that
.
user
.
ImAccount
,
openChat
:
openChat
?
openChat
:
false
}
that
.
atInfo
.
atName
=
''
},
10
)
});
this
.
MsgBus
.
$on
(
"open-atBox"
,
function
(
name
,
top
,
left
,
id
,
scene
)
{
if
(
id
&&
that
.
atInfo
.
atId
!==
id
)
{
that
.
atInfo
.
atName
=
""
}
}
setTimeout
(()
=>
{
that
.
atInfo
=
{
atName
:
name
,
top
,
left
,
atId
:
id
?
id
:
that
.
user
.
ImAccount
,
scene
:
scene
,
}
that
.
usercardInfo
.
searchName
=
''
},
10
)
});
});
this
.
MsgBus
.
$on
(
"change-create-session"
,
function
(
obj
)
{
this
.
MsgBus
.
$on
(
"change-create-session"
,
function
(
obj
)
{
that
.
chosenState
=
{
that
.
chosenState
=
{
...
@@ -137,13 +167,30 @@ export default {
...
@@ -137,13 +167,30 @@ export default {
}
}
//
//
})
})
document
.
getElementById
(
'homebox'
).
addEventListener
(
"click"
,
function
()
{
document
.
getElementById
(
'homebox'
).
addEventListener
(
"click"
,
function
(
e
)
{
if
(
that
.
usercardInfo
.
searchName
!=
""
)
{
console
.
log
(
e
.
target
.
className
.
indexOf
(
'u-circle'
))
that
.
usercardInfo
.
searchName
=
""
if
((
that
.
usercardInfo
.
searchName
!=
""
||
that
.
atInfo
.
atName
!=
''
)
&&
e
.
target
.
className
.
indexOf
(
'u-circle'
)
==
-
1
)
{
that
.
usercardInfo
.
searchName
=
""
that
.
atInfo
.
atName
=
''
}
}
});
});
},
},
methods
:
{
methods
:
{
atMsg
(){
console
.
log
(
this
.
atInfo
)
accids
.
push
({
account
:
this
.
atInfo
.
atId
,
alias
:
'@'
+
this
.
atInfo
.
atName
})
this
.
$store
.
dispatch
(
"sendMsg"
,
{
type
:
"at"
,
scene
:
this
.
scene
,
to
:
this
.
to
,
text
:
this
.
msgToSent
,
content
:
accids
,
callbackTeam
:
this
.
callBackTeam
});
},
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
)
},
},
...
@@ -323,4 +370,20 @@ export default {
...
@@ -323,4 +370,20 @@ export default {
left
:
0
;
left
:
0
;
right
:
0
;
right
:
0
;
}
}
.at-him-box
{
position
:
absolute
;
top
:
0
;
left
:
0
;
z-index
:
5
;
padding
:
10px
;
background
:
rgba
(
255
,
255
,
255
,
1
);
box-shadow
:
0px
2px
5px
0px
rgba
(
170
,
170
,
170
,
0.75
);
border
:
1px
solid
rgb
(
170
,
170
,
170
,
0.65
);
cursor
:
pointer
;
font-size
:
14px
;
padding
:
5px
10px
;
}
.at-him-box
:hover
{
background
:
#eeeeee
;
}
</
style
>
</
style
>
src/renderer/components/msssage/chat.vue
View file @
5507e229
...
@@ -402,7 +402,7 @@ export default {
...
@@ -402,7 +402,7 @@ export default {
return
;
return
;
})
})
}
}
console
.
log
(
msgs
)
//
console.log(msgs)
return
msgs
;
return
msgs
;
},
},
teamInfo
()
{
teamInfo
()
{
...
@@ -551,7 +551,7 @@ export default {
...
@@ -551,7 +551,7 @@ export default {
},
},
changeAtShow
(){
changeAtShow
(){
this
.
showAt
=
false
this
.
showAt
=
false
console
.
log
(
this
.
idServer
)
//
console.log(this.idServer)
if
(
this
.
idServer
&&
this
.
idServer
!=
''
){
if
(
this
.
idServer
&&
this
.
idServer
!=
''
){
if
(
this
.
isNotExsitAtMsg
()){
if
(
this
.
isNotExsitAtMsg
()){
...
...
src/renderer/components/msssage/chatitem.vue
View file @
5507e229
...
@@ -39,8 +39,8 @@
...
@@ -39,8 +39,8 @@
<v-contextmenu-item
@
click=
"revocateMsg"
v-if=
"msg.flow==='out'"
>
撤回消息
</v-contextmenu-item>
<v-contextmenu-item
@
click=
"revocateMsg"
v-if=
"msg.flow==='out'"
>
撤回消息
</v-contextmenu-item>
</v-contextmenu>
</v-contextmenu>
<!-- v-touch:hold="revocateMsg" -->
<!-- v-touch:hold="revocateMsg" -->
<a
class=
"msg-head"
v-if=
"msg.avatar"
>
<a
class=
"msg-head"
v-if=
"msg.avatar"
@
click=
"headAtBoxShow"
@
contextmenu=
"AtHim"
>
<img
class=
"icon u-circle"
:src=
"msg.avatar"
>
<img
class=
"icon u-circle"
:
data-id=
"msg.from"
:data-name=
"msg.fromNick"
:data-scene=
"msg.scene"
:
src=
"msg.avatar"
>
</a>
</a>
<div
class=
"msg-info"
>
<div
class=
"msg-info"
>
<div
class=
"u-member-name"
v-if=
"msg.flow=='in' && msg.scene==='team'"
>
{{
msg
.
fromNick
}}
</div>
<div
class=
"u-member-name"
v-if=
"msg.flow=='in' && msg.scene==='team'"
>
{{
msg
.
fromNick
}}
</div>
...
@@ -58,12 +58,12 @@
...
@@ -58,12 +58,12 @@
<span
v-else-if=
"msg.type==='custom-type1'"
class=
"msg-text"
ref=
"mediaMsg"
></span>
<span
v-else-if=
"msg.type==='custom-type1'"
class=
"msg-text"
ref=
"mediaMsg"
></span>
<span
v-else-if=
"msg.type==='custom-type3'"
class=
"msg-text"
ref=
"mediaMsg"
></span>
<span
v-else-if=
"msg.type==='custom-type3'"
class=
"msg-text"
ref=
"mediaMsg"
></span>
<span
<span
v-else-if=
"msg.type==='image'"
v-else-if=
"msg.type==='image'"
class=
"msg-text"
class=
"msg-text"
style=
"width: 170px; overflow: hidden;"
style=
"width: 170px; overflow: hidden;"
@
click=
"openPreviwerImg(msg.file.url)"
@
click=
"openPreviwerImg(msg.file.url)"
v-contextmenu:msg-contextmenu
v-contextmenu:msg-contextmenu
>
>
<img
<img
class=
"imimage"
class=
"imimage"
:src=
"msg.file.url"
:src=
"msg.file.url"
...
@@ -81,25 +81,24 @@
...
@@ -81,25 +81,24 @@
</div>
</div>
</span>
</span>
<span
<span
v-else-if=
"msg.type==='video'"
v-else-if=
"msg.type==='video'"
class=
"msg-text video"
class=
"msg-text video"
@
click=
"openPreviwerVideo(msg.file.url)"
@
click=
"openPreviwerVideo(msg.file.url)"
v-contextmenu:msg-contextmenu
v-contextmenu:msg-contextmenu
>
>
<div
class=
"process-box"
v-if=
"progess!=-1"
>
<div
class=
"process-box"
v-if=
"progess!=-1"
>
<el-progress
type=
"circle"
:percentage=
"progess"
:stroke-width=
"3"
:width=
"50"
></el-progress>
<el-progress
type=
"circle"
:percentage=
"progess"
:stroke-width=
"3"
:width=
"50"
></el-progress>
</div>
</div>
<video
:src=
"msg.file.url"
loop
muted
width=
"200"
ref=
"msgvideo"
></video>
<video
:src=
"msg.file.url"
loop
muted
width=
"200"
ref=
"msgvideo"
></video>
</span>
</span>
<span
<span
v-else-if=
"msg.type==='audio'"
v-else-if=
"msg.type==='audio'"
class=
"msg-text msg-audio"
class=
"msg-text msg-audio"
:class=
"
{'unreadAudio': msg.unreadAudio}"
:class=
"
{'unreadAudio': msg.unreadAudio}"
:style="'width: ' + msg.width"
:style="'width: ' + msg.width"
:id="`audio_${msg.idClient}`"
:id="`audio_${msg.idClient}`"
@click="playAudio(msg, $event)"
@click="playAudio(msg, $event)"
v-contextmenu:msg-contextmenu
v-contextmenu:msg-contextmenu
>
>
{{
msg
.
showText
}}
{{
msg
.
showText
}}
<div
class=
"play-box"
>
<div
class=
"play-box"
>
<img
src=
"../../assets/img/im/gif-left.png"
v-if=
"msg.flow==='in' && !playState"
>
<img
src=
"../../assets/img/im/gif-left.png"
v-if=
"msg.flow==='in' && !playState"
>
...
@@ -205,7 +204,8 @@ export default {
...
@@ -205,7 +204,8 @@ export default {
progess
:
-
1
,
progess
:
-
1
,
douTimer
:
null
,
douTimer
:
null
,
playState
:
false
,
playState
:
false
,
idClient
:
""
idClient
:
""
,
user
:
{},
};
};
},
},
computed
:
{
computed
:
{
...
@@ -240,6 +240,7 @@ export default {
...
@@ -240,6 +240,7 @@ export default {
this
.
computedItem
();
this
.
computedItem
();
},
},
mounted
()
{
mounted
()
{
let
that
=
this
let
item
=
this
.
msg
;
let
item
=
this
.
msg
;
if
(
if
(
window
.
localStorage
.
errorMsg
&&
window
.
localStorage
.
errorMsg
&&
...
@@ -290,6 +291,13 @@ export default {
...
@@ -290,6 +291,13 @@ export default {
});
// end this.nextTick
});
// end this.nextTick
},
},
methods
:
{
methods
:
{
AtHim
(
e
){
this
.
MsgBus
.
$emit
(
'open-atBox'
,
e
.
target
.
dataset
.
name
,
e
.
clientY
,
e
.
clientX
,
e
.
target
.
dataset
.
id
,
e
.
target
.
dataset
.
scene
)
},
headAtBoxShow
(
e
){
console
.
log
(
e
)
this
.
MsgBus
.
$emit
(
'open-card'
,
e
.
target
.
dataset
.
name
,
e
.
clientY
-
30
,
e
.
clientX
+
30
,
e
.
target
.
dataset
.
id
,
true
)
},
showMenu
()
{
showMenu
()
{
let
dom
=
document
.
querySelector
(
"#chat-list"
);
let
dom
=
document
.
querySelector
(
"#chat-list"
);
if
(
dom
.
scrollHeight
>
dom
.
clientHeight
)
{
if
(
dom
.
scrollHeight
>
dom
.
clientHeight
)
{
...
@@ -1013,6 +1021,9 @@ export default {
...
@@ -1013,6 +1021,9 @@ export default {
width
:
74%
;
width
:
74%
;
flex-direction
:
row-reverse
;
flex-direction
:
row-reverse
;
}
}
.item-you
.in
.msg-head
{
cursor
:
pointer
;
}
.item-you
.in
.msg-head
,
.item-you
.in
.msg-head
,
.item-me
.out
.msg-head
{
.item-me
.out
.msg-head
{
display
:
inline-block
;
display
:
inline-block
;
...
@@ -1257,4 +1268,5 @@ export default {
...
@@ -1257,4 +1268,5 @@ export default {
right: 0;
right: 0;
top: 0;
top: 0;
} */
} */
</
style
>
</
style
>
\ No newline at end of file
src/renderer/components/team/addNewUser.vue
View file @
5507e229
...
@@ -417,6 +417,7 @@ export default {
...
@@ -417,6 +417,7 @@ export default {
top
:
2
px
;
top
:
2
px
;
left
:
0
;
left
:
0
;
padding
-
left
:
7
px
;
padding
-
left
:
7
px
;
max
-
width
:
24
px
!
important
;
}
}
.
addNewUser
.
content
.
panle
.
search__user_box
.
seach_ctr
.
seach__item__icon
i
{
.
addNewUser
.
content
.
panle
.
search__user_box
.
seach_ctr
.
seach__item__icon
i
{
font
-
size
:
12
px
;
font
-
size
:
12
px
;
...
...
src/renderer/components/team/maillist.vue
View file @
5507e229
...
@@ -170,7 +170,10 @@ export default {
...
@@ -170,7 +170,10 @@ export default {
this
.
loadingUser
=
true
;
this
.
loadingUser
=
true
;
this
.
apipost
(
this
.
apipost
(
"admin_Get_Chat_All_SelectEmpName"
,
"admin_Get_Chat_All_SelectEmpName"
,
{
EmName
:
data
.
Name
},
{
EmName
:
data
.
Name
,
EmpId
:
data
.
EmpId
},
res
=>
{
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
createUserInf
(
res
.
data
.
data
[
0
]);
this
.
createUserInf
(
res
.
data
.
data
[
0
]);
...
...
src/renderer/components/team/usercard.vue
View file @
5507e229
...
@@ -22,8 +22,8 @@
...
@@ -22,8 +22,8 @@
<span
class=
"label"
>
职务
</span>
<span
class=
"label"
>
职务
</span>
<span
class=
"val"
>
{{
user
.
postName
}}
</span>
<span
class=
"val"
>
{{
user
.
postName
}}
</span>
</div>
</div>
<div
class=
"items btn"
v-if=
"usercard.currentAccount!=user.account"
>
<div
class=
"items btn"
v-if=
"usercard.currentAccount!=user.account
|| usercard.openChat
"
>
<el-button
type=
"primary"
:disabled=
"!user.account"
icon=
"iconfont iconliaotian"
size=
"small"
>
和TA聊聊
</el-button>
<el-button
type=
"primary"
:disabled=
"!user.account"
icon=
"iconfont iconliaotian"
size=
"small"
@
click=
"openChat"
>
和TA聊聊
</el-button>
<div
class=
"err"
v-if=
"!user.account"
>
对方还未开通IM账户,无法和他聊天
</div>
<div
class=
"err"
v-if=
"!user.account"
>
对方还未开通IM账户,无法和他聊天
</div>
</div>
</div>
</div>
</div>
...
@@ -39,7 +39,20 @@ export default {
...
@@ -39,7 +39,20 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
user
:
null
,
user
:
{
id
:
''
,
account
:
''
,
avatar
:
''
,
alias
:
''
,
name
:
''
,
companyName
:
''
,
departmentName
:
''
,
postName
:
''
,
unread
:
0
,
isMute
:
false
,
top
:
false
,
lastMsgShow
:
""
},
loading
:
false
loading
:
false
};
};
},
},
...
@@ -48,6 +61,11 @@ export default {
...
@@ -48,6 +61,11 @@ export default {
console
.
log
(
this
.
usercard
)
console
.
log
(
this
.
usercard
)
},
},
methods
:
{
methods
:
{
openChat
(){
let
_this
=
this
console
.
log
(
_this
.
user
.
id
)
this
.
MsgBus
.
$emit
(
"change-create-session"
,
_this
.
user
);
},
getUserInfo
()
{
getUserInfo
()
{
this
.
loading
=
true
this
.
loading
=
true
if
(
this
.
usercard
.
searchName
)
{
if
(
this
.
usercard
.
searchName
)
{
...
...
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