From 8fa9d6b1f5d42de13e554b8415021c92d576d99a Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 5 Aug 2022 17:15:56 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-12341=20fix:=20=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A0=91=E6=8E=A7=E4=BB=B6=E6=90=9C=E7=B4=A2=E9=A1=BA=E5=BA=8F?= =?UTF-8?q?=E4=B8=8E=E6=AD=A3=E5=B8=B8=E7=8A=B6=E6=80=81=E4=BF=9D=E6=8C=81?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 搜索遍历是广度优先的,因此queue要先reverse一下 --- src/widget/multilayerselecttree/multilayerselecttree.trigger.js | 1 + src/widget/multilayersingletree/multilayersingletree.trigger.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js index f59ab6251..179aeeec2 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js @@ -161,6 +161,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { result.push(node); result = result.concat(self._getChildren(node)); }); + queue.reverse(); while (BI.isNotEmptyArray(queue)) { var node = queue.pop(); var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id"); diff --git a/src/widget/multilayersingletree/multilayersingletree.trigger.js b/src/widget/multilayersingletree/multilayersingletree.trigger.js index 8c58b0c8c..e00394a38 100644 --- a/src/widget/multilayersingletree/multilayersingletree.trigger.js +++ b/src/widget/multilayersingletree/multilayersingletree.trigger.js @@ -170,6 +170,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { result.push(node); result = result.concat(self._getChildren(node)); }); + queue.reverse(); while (BI.isNotEmptyArray(queue)) { var node = queue.pop(); var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");