Commit fcaf7742 by panjiangyi

快捷回复功能

parent f39f6a9d
Showing with 52 additions and 1 deletions
......@@ -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);
}
......
<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>
......@@ -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({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment