From d6ce996fbad3bd124814f2f9311802d59b72095d Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 28 Jun 2019 16:29:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=8D=E9=80=89multilayertree=E7=9A=84getValue?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../multilayerselecttree.leveltree.js | 10 +++++++--- .../multilayersingletree.leveltree.js | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js b/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js index 74d8792fa..49319ea9d 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js @@ -111,9 +111,9 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Pane, { el: { type: "bi.loader", isDefaultInit: o.itemsCreator !== BI.emptyFn, - chooseType: o.chooseType, el: { type: "bi.button_tree", + chooseType: o.chooseType, behaviors: o.behaviors, layouts: [{ type: "bi.vertical" @@ -150,8 +150,12 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Pane, { }, setValue: function (v) { - this.storeValue = v; - this.tree.setValue(v); + // getValue依赖于storeValue, 那么不选的时候就不要更新storeValue了 + if(this.options.chooseType === BI.Selection.None) { + } else { + this.storeValue = v; + this.tree.setValue(v); + } }, getValue: function () { diff --git a/src/widget/multilayersingletree/multilayersingletree.leveltree.js b/src/widget/multilayersingletree/multilayersingletree.leveltree.js index f067f2ef0..9a06dccb0 100644 --- a/src/widget/multilayersingletree/multilayersingletree.leveltree.js +++ b/src/widget/multilayersingletree/multilayersingletree.leveltree.js @@ -110,9 +110,9 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Pane, { el: { type: "bi.loader", isDefaultInit: o.itemsCreator !== BI.emptyFn, - chooseType: o.chooseType, el: { type: "bi.button_tree", + chooseType: o.chooseType, behaviors: o.behaviors, layouts: [{ type: "bi.vertical" @@ -149,8 +149,12 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Pane, { }, setValue: function (v) { - this.storeValue = v; - this.tree.setValue(v); + // getValue依赖于storeValue, 那么不选的时候就不要更新storeValue了 + if(this.options.chooseType === BI.Selection.None) { + } else { + this.storeValue = v; + this.tree.setValue(v); + } }, getValue: function () {