Commit a0ce4755 authored by yaya's avatar yaya

feat: 优化

parent fc64df05
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
</el-menu>--> </el-menu>-->
<el-container v-loading="loading" style="width: 100%;height: 100%; border: 1px solid #eee"> <el-container v-loading="loading" style="width: 100%;height: 100%; border: 1px solid #eee">
<el-aside style="width: 20%;background-color: white;padding: 0;min-width: 240px"> <el-aside style="width: 20%;background-color: white;padding: 0;min-width: 240px">
<div class="top-tabs" style="background: white;position: fixed; width: 19%;min-width: 200px"> <div class="top-tabs" style="background: white;position: fixed; width: 20%;min-width: 240px">
<el-tabs style="padding: 10px 10px 0;" @tab-click="handleClick"> <el-tabs style="padding: 5px 10px 0;min-width: 240px" @tab-click="handleClick">
<el-tab-pane v-for="(item) in customerList" :key="item.code" > <el-tab-pane v-for="(item) in customerList" :key="item.code" >
<div slot="label"> <div slot="label">
<div class="span-box"> <div class="span-box">
...@@ -123,7 +123,7 @@ export default { ...@@ -123,7 +123,7 @@ export default {
}, },
computed: { computed: {
sendDisabled() { sendDisabled() {
return !this.messageContent || this.messageContent.length === 0 || !this.chatUserInfo.intervened || !this.currentConversationItem.conversationID return !this.messageContent.trim() || this.messageContent.trim().length === 0 || !this.chatUserInfo.intervened || !this.currentConversationItem.conversationID
}, },
serviceTip() { serviceTip() {
if (!this.chatUserInfo.aiAssistant) { if (!this.chatUserInfo.aiAssistant) {
...@@ -536,6 +536,9 @@ export default { ...@@ -536,6 +536,9 @@ export default {
const topList = [] const topList = []
if (list && list.length > 0) { if (list && list.length > 0) {
imResponse.data.messageList.map((item) => { imResponse.data.messageList.map((item) => {
if (!item.payload.text.trim()) {
return
}
const object = { const object = {
id: item.ID, id: item.ID,
messageContent: item.payload.text, messageContent: item.payload.text,
...@@ -580,6 +583,21 @@ export default { ...@@ -580,6 +583,21 @@ export default {
* 发送消息 * 发送消息
* */ * */
sendMessage() { sendMessage() {
if (!this.currentConversationItem.conversationID) {
this.$message.error('请选择会话')
this.messageContent = this.messageContent.trim()
return
}
if (this.messageContent.length > 0 && !this.messageContent.trim()) {
this.$message.error('请勿输入空格')
this.messageContent = ''
return
}
if (!this.chatUserInfo.intervened) {
this.$message.error('请先人工介入')
return
}
let reqId = genID() let reqId = genID()
if (this.messageList && this.messageList.length > 0) { if (this.messageList && this.messageList.length > 0) {
reqId = this.messageList[this.messageList.length - 1].reqId || genID() reqId = this.messageList[this.messageList.length - 1].reqId || genID()
...@@ -778,7 +796,7 @@ export default { ...@@ -778,7 +796,7 @@ export default {
height: 100%; height: 100%;
.chat-message-top { .chat-message-top {
height: 50px; height: 58px;
background: white; background: white;
padding: 8px; padding: 8px;
} }
......
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
}, },
methods: { methods: {
handleBlur() { handleBlur() {
if (this.chatUserInfo && this.chatUserInfo.user && this.chatUserInfo.user.remark && this.chatUserInfo.user.remark !== this.preRemark) { if (this.chatUserInfo.user.remark !== this.preRemark) {
const params = { const params = {
user: this.chatUserInfo.user.id, user: this.chatUserInfo.user.id,
remark: this.chatUserInfo.user.remark remark: this.chatUserInfo.user.remark
......
...@@ -82,6 +82,7 @@ export default { ...@@ -82,6 +82,7 @@ export default {
}, },
methods: { methods: {
handleReset() { handleReset() {
this.value2 = ''
this.listQuery = { this.listQuery = {
page: 1, page: 1,
limit: 20 limit: 20
......
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 to comment