From b1dd1b0954c9af7b4dc652875206a0514e23da11 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 17 Sep 2022 23:24:32 +0800 Subject: [PATCH] =?UTF-8?q?chore=EF=BC=9A=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/treevaluechooser/abstract.treevaluechooser.js | 6 +++--- src/component/treevaluechooser/pane.treevaluechooser.js | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index db31a1500..53e31298f 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -532,7 +532,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { var checkState = op.checkState || {}; var parentValues = op.parentValues || []; var selectedValues = op.selectedValues || {}; - function getResult(parentValues) { + function getResult(parentValues, checkState) { var valueMap = {}; // if (judgeState(parentValues, selectedValues, checkState)) { valueMap = dealWithSelectedValue(parentValues, selectedValues); @@ -557,12 +557,12 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { warningTitle: nodes[i].warningTitle, }); if (openState) { - getResult(parentValues.concat([nodes[i].value])); + getResult(parentValues.concat([nodes[i].value]), {checked: state[0], half: state[1]}); } } } - getResult(parentValues); + getResult(parentValues, checkState); // 如果指定节点全部打开 // if (o.open) { diff --git a/src/component/treevaluechooser/pane.treevaluechooser.js b/src/component/treevaluechooser/pane.treevaluechooser.js index e6fc4f07a..66486711a 100644 --- a/src/component/treevaluechooser/pane.treevaluechooser.js +++ b/src/component/treevaluechooser/pane.treevaluechooser.js @@ -29,6 +29,9 @@ BI.TreeValueChooserPane = BI.inherit(BI.AbstractTreeValueChooser, { this.pane.on(BI.MultiSelectTree.EVENT_CHANGE, function () { self.fireEvent(BI.TreeValueChooserPane.EVENT_CHANGE); }); + if (BI.isNotNull(o.value)) { + this.pane.setSelectedValue(o.value); + } if (BI.isNotNull(o.items)) { this._initData(o.items); this.pane.populate();