|
|
@ -726,6 +726,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
var self = this; |
|
|
|
var self = this; |
|
|
|
var findParentNode; |
|
|
|
var findParentNode; |
|
|
|
var index = 0; |
|
|
|
var index = 0; |
|
|
|
|
|
|
|
var currentParent = this.tree.getRoot(); |
|
|
|
this.tree.traverse(function (node) { |
|
|
|
this.tree.traverse(function (node) { |
|
|
|
if (self.tree.isRoot(node)) { |
|
|
|
if (self.tree.isRoot(node)) { |
|
|
|
return; |
|
|
|
return; |
|
|
@ -733,14 +734,27 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { |
|
|
|
if (index > parentValues.length) { |
|
|
|
if (index > parentValues.length) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 一个树结构。要找root_1_3的子节点 |
|
|
|
|
|
|
|
* {root: { 1: {1: {}, 2: {}, 3: {}}, 3: {1: {}, 2: {}} } } |
|
|
|
|
|
|
|
* 当遍历到root_1节点时,index++,而下一个节点root_3时,符合下面的if逻辑,这样找到的节点就是root_3节点了,需要加步判断是否是root_1的子节点 |
|
|
|
|
|
|
|
*/ |
|
|
|
if (index === parentValues.length && node.value === v) { |
|
|
|
if (index === parentValues.length && node.value === v) { |
|
|
|
|
|
|
|
if (node.getParent() !== currentParent) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
findParentNode = node; |
|
|
|
findParentNode = node; |
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
if (node.value === parentValues[index]) { |
|
|
|
if (node.value === parentValues[index]) { |
|
|
|
index++; |
|
|
|
index++; |
|
|
|
|
|
|
|
currentParent = node; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
}); |
|
|
|
}); |
|
|
|
return findParentNode; |
|
|
|
return findParentNode; |
|
|
|