getTreeData2() {
let parentArr = columnData.filter(l = > l.PARENTID === "");
this.columnData = this.getTreeData(columnData, parentArr)
},
getTreeData(list, dataArr) {
dataArr.map((pNode) = > {
let childObj = [];
list.map((cNode) = > {
if (pNode.ID_ === cNode.PARENTID) {
childObj.push(cNode)
}
});
pNode.children = childObj;
if (childObj.length > 0) {
this.getTreeData(list, childObj)
}
});
return dataArr
}
网友评论