From e4f74602ccffa3bf574e83092c79ac9b9f07329d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=BF=90=E6=A8=A1?= <1724894114@qq.com> Date: Wed, 20 Nov 2024 14:55:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=9C=8D=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E5=8A=A0=E8=BD=BD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/components/attachmentUpload.vue | 37 +++----- src/views/service/components/recordsList.vue | 10 +- src/views/service/infoQuery.vue | 94 ++++++++++++++++--- 3 files changed, 100 insertions(+), 41 deletions(-) diff --git a/src/views/service/components/attachmentUpload.vue b/src/views/service/components/attachmentUpload.vue index 6f6b937..0a3590c 100644 --- a/src/views/service/components/attachmentUpload.vue +++ b/src/views/service/components/attachmentUpload.vue @@ -20,29 +20,6 @@
- - - - - - - - - - - - - - - - - - - - - - - @@ -146,7 +123,7 @@ export default { for (const key in this.upload_data) { formData.append(key, this.upload_data[key]); } - formData.append('to_user_id', this.parentParams['to_user_id']); + formData.append("to_user_id", this.parentParams['to_user_id']); this.params = formData; // 单次 @@ -169,11 +146,19 @@ export default { const res = await this.$API.customer.attachmentMessage.post(this.params); this.saveLoading = false; if (res.code == 200) { + res.data.forEach((item,index)=>{ + item.showLoading = true; + if(['png','jpg','gif','jpeg'].indexOf(item.file_type) !==-1){ + item.file = URL.createObjectURL(this.fileList[index]) + }else{ + item.rate = 1; + } + }) + this.$emit('uploadFileSuccess',res.data); + this.params = {}; this.fileList = []; this.singleFnc = true; - - this.$emit('uploadFileSuccess',res.data); } }, handleExceed(){ diff --git a/src/views/service/components/recordsList.vue b/src/views/service/components/recordsList.vue index ecfc6e2..dbcaf4a 100644 --- a/src/views/service/components/recordsList.vue +++ b/src/views/service/components/recordsList.vue @@ -21,7 +21,7 @@
- + @@ -98,6 +98,13 @@ export default { padding: 0; display: inline-block; text-align: left; + .imgView{ + height: 100%; + display: flex; + align-items: center; + justify-content: flex-start; + margin-bottom: 5px; + } .fileView{ cursor: pointer; color: var(--el-color-primary); @@ -107,6 +114,7 @@ export default { padding: 10px; border-radius: 4px; background: #f8f6f6; + margin-bottom: 5px; } } .textComNoneBack{ diff --git a/src/views/service/infoQuery.vue b/src/views/service/infoQuery.vue index 1cb0a12..9f00bd3 100644 --- a/src/views/service/infoQuery.vue +++ b/src/views/service/infoQuery.vue @@ -17,8 +17,7 @@
{{item.from_user && item.from_user.name==""?'匿名':item.from_user && item.from_user.name}}
{{item.to_message.to_message}}
- 未命名 - + {{item.to_message_list[0].client_file_name?item.to_message_list[0].client_file_name:'未命名'}}
@@ -51,13 +50,18 @@
- - + + + + - + {{em.client_file_name?em.client_file_name:'未命名'}} + + +
@@ -161,8 +165,6 @@ export default { const userInfo = this.$TOOL.data.get("USER_INFO"); this.user_id = userInfo.id; - - setTimeout(()=>{ this.getContactList(); },1000) @@ -171,8 +173,42 @@ export default { }, methods:{ getWsResult(res){ - if(res.data && (res.data.type == 36 || res.data.type == 38)){ + if(res.data && (res.data.type == 12 || res.data.type == 35 || res.data.type == 36 || res.data.type == 38)){ switch(res.data.type) { + case 12: + this.msgList.forEach(item=>{ + if(item.to_message_list && item.to_message_list.length>0){ + item.to_message_list.forEach(em=>{ + if(em.uuid && em.uuid === res.data.file_unique_id){ + em.showLoading = res.data.rate !== 100; + em.rate = res.data.rate; + } + }) + } + }) + break; + case 35: + if(res.data.send_message_type === 2 && res.data.data.to_message){ + res.data.data.to_message_list = JSON.parse(res.data.data.to_message); + } + if(res.data.data){ + let obj = { + created_at: res.data.from_time, + send_message_type: res.data.send_message_type ? res.data.send_message_type : 1, + to_user_id: res.data.to_user_id, + to_message: res.data.data.to_message, + to_message_list: res.data.data.to_message_list, + from_user: { + avatar: res.data.from_avatar, + name: res.data.from_user, + } + }; + this.msgList.push(obj); + setTimeout(()=>{ + this.scrollDown(); + },500); + } + break; case 36: res.data.rows.forEach((item)=>{ if(item.send_message_type == 2){ @@ -191,8 +227,8 @@ export default { case 38: if(res.data.contact_list && res.data.contact_list.length>0){ res.data.contact_list.forEach(item=>{ - if(item.send_message_type ==2){ - item.to_message_list = JSON.parse(item.to_message); + if(item.to_message.send_message_type === 2){ + item.to_message_list = JSON.parse(item.to_message.to_message); } }) } @@ -208,9 +244,7 @@ export default { } } break; - case 12: - break; default: break; } @@ -277,7 +311,6 @@ export default { }) }, uploadFileSuccess(data){ - console.log('接口上传成功',data) const userInfo = this.$TOOL.data.get("USER_INFO"); this.msgList.push({ to_user_id:-1, @@ -290,6 +323,10 @@ export default { to_message_list:data, to_message:'' }); + + setTimeout(()=>{ + this.scrollDown(); + },500) }, recordsShow(){ @@ -306,7 +343,6 @@ export default { const { scrollTop } = event; if(scrollTop === 0 && this.msgList.length>0 && this.page >1){ this.page = this.page -1; - console.log('执行接口数据获取') this.getCustomerMsgList(true) } }, @@ -444,6 +480,27 @@ export default { padding: 10px; display: inline-block; text-align: left; + .imgView{ + height: 100%; + display: flex; + align-items: center; + justify-content: flex-start; + margin-bottom: 5px; + .loadingIcon{ + animation: rotate 1s linear infinite; + } + @keyframes rotate { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } + } + } + .imgViewRight{ + justify-content: flex-end; + } .fileView{ cursor: pointer; color: var(--el-color-primary); @@ -543,4 +600,13 @@ export default { } } } + +.exportPopover{ + margin-bottom: 8px; +} +.exportPopover ::v-deep .el-progress-bar__innerText{ + height: 100%; + display: flex;align-items: center;justify-content: flex-end; + font-size: 10px; +}