perf: 取消分享前提示子分享
This commit is contained in:
parent
fc8b8016dc
commit
7c562f4a66
@ -237,6 +237,17 @@ export default {
|
|||||||
params
|
params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 检测是否含有子分享
|
||||||
|
hasSubShare: function(params) {
|
||||||
|
return request({
|
||||||
|
url: '/share/has-sub-share',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
paramsSerializer: function(params) {
|
||||||
|
return qs.stringify(params, { arrayFormat: 'repeat' })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
// 取消分享
|
// 取消分享
|
||||||
cancelShareLink: function(params) {
|
cancelShareLink: function(params) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@ -340,22 +340,42 @@ export default {
|
|||||||
// 取消分享
|
// 取消分享
|
||||||
cancelShare() {
|
cancelShare() {
|
||||||
this.cancelSharing = true
|
this.cancelSharing = true
|
||||||
let title = '确定要取消分享 "' + this.file.name + '" 吗?'
|
|
||||||
this.$confirm(title, '提示', {
|
api.hasSubShare({shareIds: [this.shareId]}).then(res => {
|
||||||
confirmButtonText: '确定',
|
if (res.data) {
|
||||||
cancelButtonText: '取消',
|
this.$confirm('选择的文件夹下存其他分享,取消分享后其下的所有分享链接都将被删除,是否继续?', '提示', {
|
||||||
type: 'warning'
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.doCancelShareLink()
|
||||||
|
}).catch(() => {
|
||||||
|
this.cancelSharing = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
let title = '确定要取消分享 "' + this.file.name + '" 吗?'
|
||||||
|
this.$confirm(title, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.doCancelShareLink()
|
||||||
|
}).catch(() => {
|
||||||
|
this.cancelSharing = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.cancelSharing = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
doCancelShareLink() {
|
||||||
|
api.cancelShareLink({
|
||||||
|
userId: this.$store.state.user.userId,
|
||||||
|
shareId: [this.shareId]
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
api.cancelShareLink({
|
this.$emit('onCancelShare')
|
||||||
userId: this.$store.state.user.userId,
|
this.shareDialogVisible = false
|
||||||
shareId: [this.shareId]
|
this.shareDialogClose()
|
||||||
}).then(() => {
|
|
||||||
this.$emit('onCancelShare')
|
|
||||||
this.shareDialogVisible = false
|
|
||||||
this.shareDialogClose()
|
|
||||||
}).catch(() => {
|
|
||||||
this.cancelSharing = false
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.cancelSharing = false
|
this.cancelSharing = false
|
||||||
})
|
})
|
||||||
|
|||||||
@ -448,30 +448,47 @@
|
|||||||
},
|
},
|
||||||
// 取消分享
|
// 取消分享
|
||||||
cancelShare(row) {
|
cancelShare(row) {
|
||||||
let title = row === false ? '确定要取消选中的' + this.selectRowData.length + '项分享吗?' : '确定要取消分享 "' + row.fileName + '" 吗?'
|
|
||||||
this.$confirm(title, '提示', {
|
let shareIds = []
|
||||||
confirmButtonText: '确定',
|
if(row){
|
||||||
cancelButtonText: '取消',
|
shareIds.push(row.id)
|
||||||
type: 'warning'
|
} else {
|
||||||
}).then(() => {
|
this.selectRowData.forEach(row => {
|
||||||
let shareIds = []
|
|
||||||
if(row){
|
|
||||||
shareIds.push(row.id)
|
shareIds.push(row.id)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
api.hasSubShare({shareIds: shareIds}).then(res => {
|
||||||
|
if (res.data) {
|
||||||
|
this.$confirm('选择的文件夹下存其他分享,取消分享后其下的所有分享链接都将被删除,是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.doCancelShare(shareIds)
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.selectRowData.forEach(row => {
|
let title = row === false ? '确定要取消选中的' + this.selectRowData.length + '项分享吗?' : '确定要取消分享 "' + row.fileName + '" 吗?'
|
||||||
shareIds.push(row.id)
|
this.$confirm(title, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.doCancelShare(shareIds)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
api.cancelShareLink({
|
})
|
||||||
userId: this.$store.state.user.userId,
|
},
|
||||||
shareId: shareIds
|
doCancelShare(shareIds) {
|
||||||
}).then(() => {
|
api.cancelShareLink({
|
||||||
if(shareIds.length === 1){
|
userId: this.$store.state.user.userId,
|
||||||
this.fileList.splice(row.index,1)
|
shareId: shareIds
|
||||||
}else{
|
}).then(() => {
|
||||||
this.getFileList()
|
if(shareIds.length === 1){
|
||||||
}
|
this.fileList.splice(row.index,1)
|
||||||
})
|
}else{
|
||||||
|
this.getFileList()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onCancelShare() {
|
onCancelShare() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user