|
|
@@ -175,12 +175,10 @@ export default {
|
|
|
repickConfig.id = node.id;
|
|
|
let selfConfig = JSON.parse(JSON.stringify(this.selfConfig));
|
|
|
this.selfConfig = this.deleteNode(selfConfig, node);
|
|
|
+ this.repickDeleteArr(repickConfig);
|
|
|
} else {
|
|
|
- repickConfig.groupId = node.groupPid;
|
|
|
- repickConfig.id = node.groupId;
|
|
|
- this.selfConfig = this.deleteColNode(node);
|
|
|
+ this.deleteColNode(node);
|
|
|
}
|
|
|
- this.selfConfig = this.repickDeleteArr(repickConfig);
|
|
|
},
|
|
|
// 删除节点
|
|
|
deleteNode(selfConfig, node) {
|
|
|
@@ -194,10 +192,15 @@ export default {
|
|
|
i => i.groupId === node.groupId && !i.isRow
|
|
|
);
|
|
|
let deleteArr = [];
|
|
|
+ let repickConfig;
|
|
|
if (nodeArr.length > 2) {
|
|
|
//递归删除所有关联子节点
|
|
|
deleteArr = [node];
|
|
|
this.deleteLoop(selfConfig, node, deleteArr);
|
|
|
+ repickConfig = {
|
|
|
+ id: node.id,
|
|
|
+ groupId: node.groupId
|
|
|
+ };
|
|
|
} else {
|
|
|
//删除整个group
|
|
|
let allCol = selfConfig
|
|
|
@@ -207,14 +210,21 @@ export default {
|
|
|
allCol.forEach(i => {
|
|
|
this.deleteLoop(selfConfig, i, deleteArr);
|
|
|
});
|
|
|
+ repickConfig = {
|
|
|
+ id: node.groupId,
|
|
|
+ groupId: node.groupPid
|
|
|
+ };
|
|
|
}
|
|
|
deleteArr.forEach(i => {
|
|
|
selfConfig = this.deleteNode(selfConfig, i);
|
|
|
});
|
|
|
+ this.selfConfig = selfConfig;
|
|
|
+ this.repickDeleteArr(repickConfig);
|
|
|
return selfConfig;
|
|
|
},
|
|
|
// 循环遍历删除组下关联节点
|
|
|
deleteLoop(selfConfig, node, deleteArr) {
|
|
|
+ console.log(selfConfig, node, "selfConfig");
|
|
|
let currentDeleteArr = selfConfig.filter(i => {
|
|
|
if (i.isRow) {
|
|
|
return i.groupId === node.id;
|
|
|
@@ -241,11 +251,12 @@ export default {
|
|
|
selfConfig.forEach(i => {
|
|
|
if (i.isRow && i.groupId === repickConfig.id) {
|
|
|
i.groupId = repickConfig.groupId;
|
|
|
- } else if (i.groupPid === repickConfig.id) {
|
|
|
+ } else if (!i.isRow && i.groupPid === repickConfig.id) {
|
|
|
i.groupPid = repickConfig.groupId;
|
|
|
}
|
|
|
});
|
|
|
- return selfConfig;
|
|
|
+ this.selfConfig = selfConfig;
|
|
|
+ console.log(selfConfig, repickConfig, "groupPid");
|
|
|
},
|
|
|
//绘制body
|
|
|
drawBody(h, node) {
|