From 67086c47ca74a120e366de64d1d5f5e98d8cd4dd Mon Sep 17 00:00:00 2001 From: jmal Date: Tue, 18 Jul 2023 17:04:16 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=8F=96=E6=B6=88=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E6=B7=BB=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/share/index.vue | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/views/share/index.vue b/src/views/share/index.vue index de61b82..f770d69 100644 --- a/src/views/share/index.vue +++ b/src/views/share/index.vue @@ -443,23 +443,30 @@ }, // 取消分享 cancelShare(row) { - let shareIds = [] - if(row){ - shareIds.push(row.id) - } else { - this.selectRowData.forEach(row => { - shareIds.push(row.id) - }) - } - api.cancelShareLink({ - userId: this.$store.state.user.userId, - shareId: shareIds + let title = row === false ? '确定要取消选中的' + this.selectRowData.length + '项分享吗?' : '确定要取消分享 "' + row.fileName + '" 吗?' + this.$confirm(title, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' }).then(() => { - if(shareIds.length === 1){ - this.fileList.splice(row.index,1) - }else{ - this.getFileList() + let shareIds = [] + if(row){ + shareIds.push(row.id) + } else { + this.selectRowData.forEach(row => { + shareIds.push(row.id) + }) } + api.cancelShareLink({ + userId: this.$store.state.user.userId, + shareId: shareIds + }).then(() => { + if(shareIds.length === 1){ + this.fileList.splice(row.index,1) + }else{ + this.getFileList() + } + }) }) }, // 点击文件或文件夹