Browse Source

KERNEL-12341 fix: 下拉树控件搜索顺序与正常状态保持一致

搜索遍历是广度优先的,因此queue要先reverse一下
es6
zsmj 2 years ago
parent
commit
8fa9d6b1f5
  1. 1
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js
  2. 1
      src/widget/multilayersingletree/multilayersingletree.trigger.js

1
src/widget/multilayerselecttree/multilayerselecttree.trigger.js

@ -161,6 +161,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
result.push(node); result.push(node);
result = result.concat(self._getChildren(node)); result = result.concat(self._getChildren(node));
}); });
queue.reverse();
while (BI.isNotEmptyArray(queue)) { while (BI.isNotEmptyArray(queue)) {
var node = queue.pop(); var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id"); var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");

1
src/widget/multilayersingletree/multilayersingletree.trigger.js

@ -170,6 +170,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
result.push(node); result.push(node);
result = result.concat(self._getChildren(node)); result = result.concat(self._getChildren(node));
}); });
queue.reverse();
while (BI.isNotEmptyArray(queue)) { while (BI.isNotEmptyArray(queue)) {
var node = queue.pop(); var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id"); var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");

Loading…
Cancel
Save