|
@@ -44,7 +44,7 @@ let tree_Data_Helper = {
|
|
|
if (nextNode === null || nextNode === undefined) {
|
|
|
//备注: 考虑到实际数据的健壮性,有些节点会掉链子,需要用 parentItem[SUB_ID] 比对已经加上的节点,如发现加上的节点数量不够,那就得在这里补充上去
|
|
|
if (parentItem) {
|
|
|
- if (parentItem[SUB_ID].length > iter.length) {
|
|
|
+ if (parentItem[SUB_ID] && parentItem[SUB_ID].length > iter.length) {
|
|
|
for (let subId of parentItem[SUB_ID]) {
|
|
|
if (pushedIds.indexOf(subId) < 0) {
|
|
|
let restNode = tmpNodes[prefix + subId];
|
|
@@ -109,7 +109,11 @@ let tree_Data_Helper = {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (parseInt(data[i][P_ID]) !== EMPTY_ID_VAL) {
|
|
|
+ // if (parseInt(data[i][P_ID]) !== EMPTY_ID_VAL && !(tmpNodes[prefix + data[i][P_ID]])) {
|
|
|
+ // console.log(data[i][NODE_ID]);
|
|
|
+ // }
|
|
|
+ if (parseInt(data[i][P_ID]) !== EMPTY_ID_VAL && tmpNodes[prefix + data[i][P_ID]] ) {
|
|
|
+ //断链情况下,tmpNodes[prefix + data[i][P_ID]有可能找不到!
|
|
|
tmpNodes[prefix + data[i][P_ID]][SUB_ID].push(data[i][NODE_ID]);
|
|
|
}
|
|
|
}
|