From d78e7221cb1b3059133b2775a8a301c6939891f1 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 7 Sep 2020 15:01:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-38692=20=E6=A0=91=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=AF=BB=E6=89=BE=E8=8A=82=E7=82=B9=E9=94=99=E8=AF=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../treevaluechooser/abstract.treevaluechooser.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index 79ec70629..d5c76efdf 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -726,6 +726,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { var self = this; var findParentNode; var index = 0; + var currentParent = this.tree.getRoot(); this.tree.traverse(function (node) { if (self.tree.isRoot(node)) { return; @@ -733,14 +734,27 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { if (index > parentValues.length) { 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 (node.getParent() !== currentParent) { + return; + } + findParentNode = node; + return false; } if (node.value === parentValues[index]) { index++; + currentParent = node; return; } + return true; }); return findParentNode; From 5390913d48ddeb12528e2803ebfd06be8a02a592 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 7 Sep 2020 15:46:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?KERNEL-5172=20fix:=20=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=AE=BD=E5=BA=A6=E5=A2=9E=E5=8A=A0=E5=90=8E?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/time/time.combo.js | 4 ++-- src/widget/timeinterval/timeperiods.js | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/widget/time/time.combo.js b/src/widget/time/time.combo.js index 2a671adb2..14bdce095 100644 --- a/src/widget/time/time.combo.js +++ b/src/widget/time/time.combo.js @@ -14,8 +14,8 @@ }, props: { baseCls: "bi-time-combo bi-border bi-border-radius bi-focus-shadow", - width: 78, - height: 22, + // width: 78, + // height: 22, format: "", allowEdit: false }, diff --git a/src/widget/timeinterval/timeperiods.js b/src/widget/timeinterval/timeperiods.js index bc4acd12d..dbc73333e 100644 --- a/src/widget/timeinterval/timeperiods.js +++ b/src/widget/timeinterval/timeperiods.js @@ -9,8 +9,8 @@ constants: { height: 24, width: 24, - lgap: 15, - offset: 0 + hgap: 15, + offset: -15 }, props: { extraCls: "bi-time-interval", @@ -43,6 +43,7 @@ el: { type: "bi.center", height: this.constants.height, + hgap: this.constants.hgap, items: [{ type: "bi.absolute", items: [{ @@ -52,9 +53,9 @@ } }, this._createCombo(o.value.start)), left: this.constants.offset, - right: this.constants.width / 2, + right: 0, top: 0, - bottom: 0 + bottom: 0, }] }, { type: "bi.absolute", @@ -64,10 +65,10 @@ self.right = _ref; } }, this._createCombo(o.value.end)), - left: this.constants.width / 2, + left: 0, right: this.constants.offset, top: 0, - bottom: 0 + bottom: 0, }] }] },