Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
customer-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e6154502
authored
Aug 31, 2021
by
吴云建
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加批量接待
parent
952dd869
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
19 deletions
components/chat-list-model.vue
components/chat-list-model.vue
View file @
e6154502
...
@@ -11,6 +11,10 @@
...
@@ -11,6 +11,10 @@
@click="goToChatRoom(item)"
@click="goToChatRoom(item)"
>
>
<div
class=
"chat-info"
>
<div
class=
"chat-info"
>
<div
class=
"checkbox-wrap"
@
click
.
stop
v-if=
"showItemCheckbox"
>
<el-checkbox
v-model=
"item.checked"
></el-checkbox>
</div>
<div>
<div
<div
class=
"
class=
"
chat-info-left
chat-info-left
...
@@ -33,6 +37,7 @@
...
@@ -33,6 +37,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
<div
class=
"empty"
class=
"empty"
v-if=
"chatRooms && chatRooms.length
<
=
0
"
v-if=
"chatRooms && chatRooms.length
<
=
0
"
...
@@ -40,10 +45,8 @@
...
@@ -40,10 +45,8 @@
无接待
无接待
</div>
</div>
</el-scrollbar>
</el-scrollbar>
<el-button
class=
"refresh-btn"
title=
"刷新列表"
@
click=
"getList"
>
<i
class=
"el-icon-refresh-right"
></i>
</el-button>
<el-pagination
<el-pagination
class=
"page-comp"
background
background
small
small
@
size-change=
"handleSizeChange"
@
size-change=
"handleSizeChange"
...
@@ -55,6 +58,12 @@
...
@@ -55,6 +58,12 @@
:pager-count=
"5"
:pager-count=
"5"
layout=
"total, prev, pager, next"
layout=
"total, prev, pager, next"
></el-pagination>
></el-pagination>
<div
class=
"action-row"
>
<el-button
@
click=
"getList"
>
刷新
</el-button>
<el-button
v-if=
"!showItemCheckbox"
@
click=
"showItemCheckbox = true"
>
批量接待
</el-button>
<el-button
v-if=
"showItemCheckbox"
@
click=
"batchStartReception"
>
确定接待
</el-button>
<el-button
v-if=
"showItemCheckbox"
@
click=
"showItemCheckbox = false"
>
取消
</el-button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -68,8 +77,8 @@ import { Chat as ChatType } from "@/customer-service/xim/models/chat";
...
@@ -68,8 +77,8 @@ import { Chat as ChatType } from "@/customer-service/xim/models/chat";
import
{
EVENTS
}
from
"@/EventConsts"
import
{
EVENTS
}
from
"@/EventConsts"
export
function
parserMessage
(
type
:
string
,
rawMsg
:
string
)
{
export
function
parserMessage
(
type
:
string
,
rawMsg
:
string
)
{
if
(
!
type
)
return
""
;
if
(
!
type
)
return
"
[空]
"
;
if
(
!
rawMsg
)
return
""
;
if
(
!
rawMsg
)
return
"
[空]
"
;
const
msg
=
JSON
.
parse
(
rawMsg
);
const
msg
=
JSON
.
parse
(
rawMsg
);
if
(
type
===
"text"
)
{
if
(
type
===
"text"
)
{
return
msg
.
text
;
return
msg
.
text
;
...
@@ -82,13 +91,17 @@ export function parserMessage(type: string, rawMsg: string) {
...
@@ -82,13 +91,17 @@ export function parserMessage(type: string, rawMsg: string) {
}
}
}
}
interface
SelectChatType
extends
ChatType
{
checked
?:
boolean
;
}
@
Component
({
components
:
{}
})
@
Component
({
components
:
{}
})
export
default
class
ModelChatList
extends
Vue
{
export
default
class
ModelChatList
extends
Vue
{
@
chatStore
.
Action
(
ChatStore
.
ACTION_CREATE_NEW_CHAT_BY_SERVICE_MAN
)
@
chatStore
.
Action
(
ChatStore
.
ACTION_CREATE_NEW_CHAT_BY_SERVICE_MAN
)
private
readonly
_createChat
!
:
ChatStore
.
ACTION_CREATE_NEW_CHAT_BY_SERVICE_MAN
;
private
readonly
_createChat
!
:
ChatStore
.
ACTION_CREATE_NEW_CHAT_BY_SERVICE_MAN
;
private
chatList
:
ChatType
[]
=
[];
private
chatList
:
Select
ChatType
[]
=
[];
@
chatStore
.
Mutation
(
ChatStore
.
MUTATION_SAVE_MYSELF_ID
)
@
chatStore
.
Mutation
(
ChatStore
.
MUTATION_SAVE_MYSELF_ID
)
private
readonly
saveMyId
!
:
ChatStore
.
MUTATION_SAVE_MYSELF_ID
;
private
readonly
saveMyId
!
:
ChatStore
.
MUTATION_SAVE_MYSELF_ID
;
...
@@ -122,7 +135,7 @@ export default class ModelChatList extends Vue {
...
@@ -122,7 +135,7 @@ export default class ModelChatList extends Vue {
private
total
=
0
;
private
total
=
0
;
private
currentPage
=
1
;
private
currentPage
=
1
;
private
sseTs
=
0
;
private
sseTs
=
0
;
private
showItemCheckbox
=
false
;
private
get
chatRooms
()
{
private
get
chatRooms
()
{
return
this
.
chatList
||
[];
return
this
.
chatList
||
[];
...
@@ -197,6 +210,7 @@ export default class ModelChatList extends Vue {
...
@@ -197,6 +210,7 @@ export default class ModelChatList extends Vue {
if
(
this
.
sseTs
)
{
if
(
this
.
sseTs
)
{
return
return
}
}
this
.
sseTs
=
new
Date
().
getTime
();
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
sseTs
=
0
;
this
.
sseTs
=
0
;
this
.
getList
();
this
.
getList
();
...
@@ -248,6 +262,24 @@ export default class ModelChatList extends Vue {
...
@@ -248,6 +262,24 @@ export default class ModelChatList extends Vue {
`/
${
this
.
$route
.
params
.
project
}
/
${
this
.
$route
.
params
.
entrance
}
/detail/
${
model_name
}
/key/
${
keyvalue
}
`
`/
${
this
.
$route
.
params
.
project
}
/
${
this
.
$route
.
params
.
entrance
}
/detail/
${
model_name
}
/key/
${
keyvalue
}
`
);
);
}
}
private
batchStartReception
()
{
let
chats
=
this
.
chatRooms
.
filter
(
chat
=>
chat
.
checked
);
if
(
chats
.
length
===
0
)
{
this
.
$message
.
warning
(
"请先勾选要接待的会话"
)
return
}
chats
.
forEach
(
chat
=>
{
const
{
model_name
,
obj_id
}
=
chat
.
business_data
;
this
.
sdk
.
model
(
model_name
)
.
chat
(
+
obj_id
,
this
.
global
.
org
.
id
.
toString
())
.
startChat
();
chat
.
checked
=
false
;
})
this
.
showItemCheckbox
=
false
;
this
.
clearActiveId
();
}
}
}
</
script
>
</
script
>
...
@@ -275,7 +307,7 @@ export default class ModelChatList extends Vue {
...
@@ -275,7 +307,7 @@ export default class ModelChatList extends Vue {
padding-top
:
100%
;
padding-top
:
100%
;
}
}
.list-scroll
{
.list-scroll
{
height
:
calc
(
100%
-
88
px
);
height
:
calc
(
100%
-
110
px
);
}
}
}
}
.keyword-input
{
.keyword-input
{
...
@@ -313,13 +345,17 @@ export default class ModelChatList extends Vue {
...
@@ -313,13 +345,17 @@ export default class ModelChatList extends Vue {
margin-right
:
5px
;
margin-right
:
5px
;
}
}
.chat-info
{
.chat-info
{
display
:
inline-block
;
display
:
flex
;
vertical-align
:
middle
;
vertical-align
:
middle
;
width
:
calc
(
100%
-
10px
);
width
:
calc
(
100%
-
10px
);
.chat-name
{
.chat-name
{
line-height
:
35px
;
line-height
:
35px
;
font-size
:
15px
;
font-size
:
15px
;
}
}
.checkbox-wrap
{
padding-top
:
18px
;
padding-right
:
8px
;
}
}
}
.chat-info-left
{
.chat-info-left
{
text-align
:
start
;
text-align
:
start
;
...
@@ -342,22 +378,13 @@ export default class ModelChatList extends Vue {
...
@@ -342,22 +378,13 @@ export default class ModelChatList extends Vue {
text-align
:
start
;
text-align
:
start
;
font-size
:
12px
;
font-size
:
12px
;
margin-top
:
-13px
;
margin-top
:
-13px
;
min-height
:
16px
;
}
}
}
}
}
}
.chat-check-detail
{
.chat-check-detail
{
margin-left
:
10px
;
margin-left
:
10px
;
}
}
.refresh-btn
{
position
:
absolute
;
top
:
0
;
left
:
0
;
border-radius
:
50%
;
width
:
24px
;
height
:
24px
;
padding
:
0
;
border-color
:
#ccc
;
}
.need-update-tip
{
.need-update-tip
{
background
:
#fff2e6
;
background
:
#fff2e6
;
color
:
#e87005
;
color
:
#e87005
;
...
@@ -368,4 +395,13 @@ export default class ModelChatList extends Vue {
...
@@ -368,4 +395,13 @@ export default class ModelChatList extends Vue {
text-align
:
center
;
text-align
:
center
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.page-comp
{
padding
:
15px
0
;
}
.action-row
{
.el-button
{
padding
:
8px
14px
;
border-radius
:
15px
;
}
}
</
style
>
</
style
>
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