联动删除
This commit is contained in:
@@ -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}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user