Browse Source

Pull request #1503: BI-71788 fix: 将所有值setValue进入同步复选下拉后触发器不显示全选

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit 'b9c942091af2d0c0a2e4ed3535badc1e80598dee':
  update
  BI-71788 fix: 将所有值setValue进入同步复选下拉后触发器不显示全选
  Revert "无JIRA任务 label提供多行文本溢出显示...(仅webkit)"
  无JIRA任务 label提供多行文本溢出显示...(仅webkit)
es6
windy 4 years ago
parent
commit
94324e866f
  1. 1
      changelog.md
  2. 15
      src/component/valuechooser/abstract.valuechooser.js
  3. 4
      src/component/valuechooser/combo.valuechooser.insert.js
  4. 4
      src/component/valuechooser/combo.valuechooser.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志 # 更新日志
2.0(2020-09) 2.0(2020-09)
- 修复同步复选下拉框系列setValue所有值后触发器不显示全选的问题
- BI.Tree.traversal方法迭代函数增加父节点参数 - BI.Tree.traversal方法迭代函数增加父节点参数
2.0(2020-08) 2.0(2020-08)

15
src/component/valuechooser/abstract.valuechooser.js

@ -88,5 +88,20 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, {
hasNext: self._hasNextByTimes(resultItems, options.times) hasNext: self._hasNextByTimes(resultItems, options.times)
}); });
} }
},
_assertValue: function (v) {
v = v || {};
var value = v;
if (v.type === BI.Selection.Multi && BI.isNotNull(this.items)) {
var isAllSelect = BI.difference(BI.map(this.items, "value"), v.value).length === 0;
if (isAllSelect) {
value = {
type: BI.Selection.All,
value: [],
};
} }
}
return value;
},
}); });

4
src/component/valuechooser/combo.valuechooser.insert.js

@ -26,7 +26,7 @@ BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, {
element: this, element: this,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
text: o.text, text: o.text,
value: o.value, value: this._assertValue(o.value),
itemsCreator: BI.bind(this._itemsCreator, this), itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this), valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width, width: o.width,
@ -66,7 +66,7 @@ BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, {
}, },
setValue: function (v) { setValue: function (v) {
this.combo.setValue(v); this.combo.setValue(this._assertValue(v));
}, },
getValue: function () { getValue: function () {

4
src/component/valuechooser/combo.valuechooser.js

@ -30,7 +30,7 @@ BI.ValueChooserCombo = BI.inherit(BI.AbstractValueChooser, {
element: this, element: this,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
text: o.text, text: o.text,
value: o.value, value: this._assertValue(o.value),
itemsCreator: BI.bind(this._itemsCreator, this), itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this), valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width, width: o.width,
@ -70,7 +70,7 @@ BI.ValueChooserCombo = BI.inherit(BI.AbstractValueChooser, {
}, },
setValue: function (v) { setValue: function (v) {
this.combo.setValue(v); this.combo.setValue(this._assertValue(v));
}, },
getValue: function () { getValue: function () {

Loading…
Cancel
Save