联动删除

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

@@ -28,10 +28,10 @@ export function updateGroup(data) {
}
// 删除节点
export function delGroup(id) {
export function delGroup(id, type) {
return request({
url: '/test/group/del',
method: 'post',
data: {id}
data: {id, type}
})
}

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)
})
},

View File

@@ -87,8 +87,12 @@ export default {
},
methods: {
folderHandleSelected(id) {
this.queryParams.groupId = id;
this.getList();
if (id) {
this.queryParams.groupId = id;
this.getList();
} else {
this.apiList = [];
}
},
/** 查询接口列表 */
getList() {