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
fcaf7742
authored
Jul 17, 2021
by
panjiangyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
快捷回复功能
parent
f39f6a9d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
1 deletions
chat.vue
msg-shortcut.vue
store/index.ts
chat.vue
View file @
fcaf7742
...
...
@@ -30,7 +30,11 @@
<el-tab-pane
label=
"备注"
name=
"four"
>
<remarkList
modelName=
"user"
/>
</el-tab-pane>
<el-tab-pane
label=
"回复"
name=
"five"
>
回复
</el-tab-pane>
<el-tab-pane
label=
"回复"
name=
"five"
>
<MsgShortCut
v-for=
"(item, i) in shortCutMsgs"
:key=
"i"
:msg=
"item"
/>
</el-tab-pane>
</el-tabs>
</div>
</div>
...
...
@@ -51,6 +55,7 @@ import ChatRoom from "./chat-room.vue";
import
ChatTitle
from
"./chat-title.vue"
;
import
ChatMembers
from
"./components/chat-members.vue"
;
import
MessageList
from
"./message-list.vue"
;
import
MsgShortCut
from
"./msg-shortcut.vue"
;
import
buttonThrottle
from
"./utils/button-throttle"
;
import
ChatCreator
from
"@/customer-service/create-chat.vue"
;
...
...
@@ -58,6 +63,7 @@ import { ChatStore, chatStore } from "@/customer-service/store/model";
@
Component
({
components
:
{
MsgShortCut
,
MessageList
,
ChatRoom
,
ChatCreator
,
...
...
@@ -84,6 +90,13 @@ export default class Chat extends Vue {
private
currentTab
=
"one"
;
private
shortCutMsgs
=
[
"快捷回复1"
,
"快捷回复2"
,
"快捷回复3"
,
"快捷回复4"
,
]
private
get
chatMembersId
()
{
return
this
.
chatMembers
.
map
((
k
)
=>
+
k
.
eid
);
}
...
...
msg-shortcut.vue
0 → 100644
View file @
fcaf7742
<
template
>
<div
class=
"shortcut pointer"
@
click=
"sendMsg"
>
{{
msg
}}
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
Component
,
Prop
,
Vue
}
from
"vue-property-decorator"
;
import
{
ChatStore
,
chatStore
}
from
"./store/model"
;
import
buttonThrottle
from
"./utils/button-throttle"
;
@
Component
({
components
:
{}
})
export
default
class
MsgShortCut
extends
Vue
{
@
chatStore
.
Action
(
ChatStore
.
ACTION_SEND_MESSAGE
)
private
readonly
_sendMsg
!
:
ChatStore
.
ACTION_SEND_MESSAGE
;
@
chatStore
.
Getter
(
ChatStore
.
STATE_CHAT_SOURCE
)
private
readonly
source
!
:
ChatStore
.
STATE_CHAT_SOURCE
;
@
Prop
({
type
:
String
,
default
:
""
})
private
readonly
msg
!
:
string
;
@
buttonThrottle
()
private
sendMsg
()
{
return
this
.
_sendMsg
({
msgType
:
"text"
,
msg
:
JSON
.
stringify
({
text
:
this
.
msg
,
source
:
this
.
source
}),
});
}
}
</
script
>
<
style
lang=
"less"
scoped
>
.shortcut
{
padding
:
10px
;
font-size
:
16px
;
&:hover
{
background
:
#e4f0ff
;
}
}
</
style
>
store/index.ts
View file @
fcaf7742
...
...
@@ -365,6 +365,7 @@ export default {
state
[
ChatStore
.
STATE_CHAT_CURRENT_CHAT_UNIPLAT_ID
];
if
(
uniplatId
==
null
)
return
;
try
{
console
.
log
(
"fuck send"
,
params
);
const
data
=
await
model
()
.
action
(
"sendMsg"
)
.
updateInitialParams
({
...
...
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