修改验证标准是否可以删除

This commit is contained in:
qq787203167
2022-03-11 16:36:27 +08:00
parent 448f2a93ff
commit 2489553640
@@ -92,22 +92,22 @@
{
text: this.$t('CancelCollection'),
ClickEvent: 'Collection',
has:'document:addCollect'
has: 'document:addCollect'
},
{
text: this.$t('CancelSubscribe'),
ClickEvent: 'subscribe',
has:'document:addSubscribe'
has: 'document:addSubscribe'
},
{
text: this.$t('edit'),
ClickEvent: 'editTable',
has:'document:updateInfo'
has: 'document:updateInfo'
},
{
text: this.$t('deleteLib'),
ClickEvent: 'deleteTable',
has:'document:deleteBatch'
has: 'document:deleteBatch'
}
],
selectedRowKeys: [],
@@ -124,7 +124,8 @@
getDocumentInfo: 'document/bussDocumentLibraryEO/getDocumentInfoById', //查看
deleteBatch: 'document/bussDocumentLibraryEO/deleteBatch', //删除
pullMessage: 'document/bussDocumentLibraryEO/pullMessage',//推送
importZipUrl: '/document/bussDocumentLibraryEO/importZip'//导入
importZipUrl: '/document/bussDocumentLibraryEO/importZip',//导入
verifyBind: '/document/bussDocumentLibraryEO/verifyBind' //验证当前的数据是否可以删除
},
idList: []
}
@@ -169,14 +170,17 @@
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
deleteAction(_this.url.deleteBatch, { ids: _this.idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.idList = []
eventBUs.$emit('searchReset')
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
let idList = JSON.parse(JSON.stringify(_this.idList))
_this.verifyBind(idList.join(','), () => {
deleteAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.idList = []
eventBUs.$emit('searchReset')
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
})
}
})
@@ -184,6 +188,15 @@
this.$message.warning(this.$t('selectLeastOne'))
}
},
verifyBind(idList, callBack) {
getAction(this.url.verifyBind, { ids: idList }).then((res) => {
if (res.success) {
callBack && callBack()
} else {
this.$message.warning(res.message)
}
})
},
//推送
handleCompare() {
if (this.idList.length > 0) {
@@ -209,13 +222,15 @@
this.$confirm({
content: _this.$t('ConfirmDelete'),
onOk() {
deleteAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset')
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
_this.verifyBind(val.id, () => {
deleteAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset')
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
})
}
})