联动删除

This commit is contained in:
2025-02-12 17:36:37 +08:00
parent 2215b4bd50
commit 186665beae
15 changed files with 97 additions and 126 deletions

View File

@@ -159,14 +159,13 @@ export default {
},
nodeDelete(node) {
this.$refs.tree.setCurrentKey(this.groupId);
if (node.data.children && node.data.children.length > 0) {
this.$message.error("包含子节点,无法删除")
return
}
this.$modal.confirm('是否确认删除?').then(function () {
return delGroup(node.data.id);
this.$modal.confirm('是否确认删除?会连带删除文件夹下所有内容').then(() => {
return delGroup(node.data.id, this.type);
}).then(() => {
this.$modal.msgSuccess("删除成功");
if (this.groupId === node.data.id) {
this.$emit("click", null);
}
this.$refs.tree.remove(node)
})
},