refactor: 取消分享添加提示

This commit is contained in:
jmal 2023-07-18 17:04:16 +08:00
parent 6b5cb7f736
commit 67086c47ca

View File

@ -443,23 +443,30 @@
}, },
// 取消分享 // 取消分享
cancelShare(row) { cancelShare(row) {
let shareIds = [] let title = row === false ? '确定要取消选中的' + this.selectRowData.length + '项分享吗?' : '确定要取消分享 "' + row.fileName + '" 吗?'
if(row){ this.$confirm(title, '提示', {
shareIds.push(row.id) confirmButtonText: '确定',
} else { cancelButtonText: '取消',
this.selectRowData.forEach(row => { type: 'warning'
shareIds.push(row.id)
})
}
api.cancelShareLink({
userId: this.$store.state.user.userId,
shareId: shareIds
}).then(() => { }).then(() => {
if(shareIds.length === 1){ let shareIds = []
this.fileList.splice(row.index,1) if(row){
}else{ shareIds.push(row.id)
this.getFileList() } 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()
}
})
}) })
}, },
// 点击文件或文件夹 // 点击文件或文件夹