แก้ฟังก์ชั่นลบโครงสร้าง
This commit is contained in:
parent
c73e8d5d23
commit
574b6dd354
1 changed files with 4 additions and 1 deletions
|
|
@ -170,9 +170,12 @@ async function deleteUpdate(rootId: string, treeId: string) {
|
||||||
|
|
||||||
function deleteNode(treeNode: any, rootId: string, treeId: string): boolean {
|
function deleteNode(treeNode: any, rootId: string, treeId: string): boolean {
|
||||||
if (treeNode.orgTreeId === rootId) {
|
if (treeNode.orgTreeId === rootId) {
|
||||||
|
const childrenNew = treeNode.children.filter(
|
||||||
|
(x: any) => x.orgTreeId != treeId
|
||||||
|
);
|
||||||
let newData = {
|
let newData = {
|
||||||
...treeNode,
|
...treeNode,
|
||||||
children: [],
|
children: childrenNew,
|
||||||
};
|
};
|
||||||
Object.assign(treeNode, newData);
|
Object.assign(treeNode, newData);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue