From 2e88cddefd3fb98be557fdd1b78a50b541718132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=BF=90=E6=A8=A1?= <1724894114@qq.com> Date: Tue, 30 Jul 2024 20:06:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=B8=8A=E4=BC=A0=E5=88=B7=E6=96=B0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/docsManager/uploadFile.vue | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/views/docsManager/uploadFile.vue b/src/views/docsManager/uploadFile.vue index b360c22..0c5f73a 100644 --- a/src/views/docsManager/uploadFile.vue +++ b/src/views/docsManager/uploadFile.vue @@ -94,11 +94,7 @@ export default { }, watch:{ - visible(val){ - if(!val){ - this.$TOOL.data.set('docsList', this.listProgress); - } - } + }, mounted() { eventBus.$on('sockBack', this.getWsResult); @@ -110,24 +106,22 @@ export default { getWsResult(res){ if(res.data && (res.data.type == 12)){ this.progressShow = true; - - if(this.listProgress.length == 0){ - const docsList = this.$TOOL.data.get('docsList'); - this.listProgress = docsList; + if(this.listProgress.length==0){ + this.listProgress.push(res.data); + } + let ids = this.listProgress.map(em=>em.file_unique_id); + if(!ids.includes(res.data.file_unique_id)){ + this.listProgress.push(res.data); } this.listProgress.forEach(em=>{ - if(em.uuid == res.data.file_unique_id){ + if(em.file_unique_id == res.data.file_unique_id){ em.rate = res.data.rate - // if(res.data.status == 1){ - // this.listProgress.splice(index,1); - // } } }) let list = this.listProgress.filter(em=> em.rate != 100); if(list.length==0 && res.data.status == 1){ this.progressShow = false; - this.$TOOL.data.set('docsList', []); } if(res.data.status == 1){ this.fileList.splice(this.fileList[0],1); @@ -183,7 +177,6 @@ export default { if (res.code == 200) { this.$message.success('提交成功,正在上传'); this.uploadShow = false; - this.listProgress = res.data.files; } }, handleExceed(){ @@ -192,7 +185,7 @@ export default { handleRemove(file,fileList,isArr=false){ if(isArr){ fileList = []; - this.listProgress = []; + // this.listProgress = []; }else{ const index = fileList.findIndex(f => f.uid === file.uid); if (index !== -1) {