fix知识库删除

This commit is contained in:
guoyue 2022-12-01 17:28:04 +08:00
parent 8bbeadbdc8
commit 421524edaa
1 changed files with 37 additions and 1 deletions

View File

@ -533,7 +533,43 @@ export default {
this.submitFrom.id = item.id this.submitFrom.id = item.id
this.showPutOnTheShelfFlag2 = true this.showPutOnTheShelfFlag2 = true
}) })
} },
//
deleteHandle2 (id) {
if (id == undefined && this.dataListSelections.length < 1) {
this.$message({
type: 'info',
message: '请选择要删除的数据'
})
} else {
this.$confirm('确认是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const ids = []
if (id) {
ids.push(id)
} else {
if (this.dataListSelections.length > 0) {
this.dataListSelections.forEach(item => {
ids.push(item.id)
})
}
}
this.$http.post('/resource/delete', { ids: ids }).then(res => {
console.log('删除成功', res)
this.$message({
type: 'success',
message: '删除成功!'
})
this.reset()
})
}).catch(() => {
})
}
},
} }
} }
</script> </script>