Browse Source

chore: 优化

es6
guy 2 years ago
parent
commit
b1dd1b0954
  1. 6
      src/component/treevaluechooser/abstract.treevaluechooser.js
  2. 3
      src/component/treevaluechooser/pane.treevaluechooser.js

6
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) {

3
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();

Loading…
Cancel
Save