Browse Source

Pull request #1509: BI-71788 fix: allvaluechoosercombo setValue所有值trigger显示部分选择

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

* commit 'b52dd28b55d8ff69a615c119e767ba16e062e7a1':
  update
  无JIRA任务 intervalslider setEnable false 滑块不灰化
  BI-71788 fix: allvaluechoosercombo setValue所有值trigger显示部分选择
es6
windy 4 years ago
parent
commit
3f5e668c42
  1. 1
      changelog.md
  2. 15
      src/component/allvaluechooser/abstract.allvaluechooser.js
  3. 8
      src/component/allvaluechooser/combo.allvaluechooser.js
  4. 9
      src/widget/intervalslider/intervalslider.js

1
changelog.md

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

15
src/component/allvaluechooser/abstract.allvaluechooser.js

@ -82,5 +82,20 @@ BI.AbstractAllValueChooser = BI.inherit(BI.Widget, {
hasNext: false
});
}
},
_assertValue: function (v) {
v = v || {};
var value = v;
if (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;
},
});

8
src/component/allvaluechooser/combo.allvaluechooser.js

@ -33,10 +33,10 @@ BI.AllValueChooserCombo = BI.inherit(BI.AbstractAllValueChooser, {
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height,
value: {
value: this._assertValue({
type: BI.Selection.Multi,
value: o.value || []
}
})
});
this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {
@ -45,10 +45,10 @@ BI.AllValueChooserCombo = BI.inherit(BI.AbstractAllValueChooser, {
},
setValue: function (v) {
this.combo.setValue({
this.combo.setValue(this._assertValue({
type: BI.Selection.Multi,
value: v || []
});
}));
},
getValue: function () {

9
src/widget/intervalslider/intervalslider.js

@ -421,11 +421,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
return (v - this.min) * 100 / (this.max - this.min);
},
_setDraggableEnable: function (enable) {
this.sliderOne.setEnable(enable);
this.sliderTwo.setEnable(enable);
},
_getPrecision: function () {
// 计算每一份值的精度(最大值和最小值的差值保留4为有效数字后的精度)
// 如果差值的整数位数大于4,toPrecision(4)得到的是科学计数法123456 => 1.235e+5
@ -483,10 +478,10 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
this.valueOne = minNumber;
this.valueTwo = maxNumber;
this.precision = this._getPrecision();
this._setDraggableEnable(true);
this.setEnable(true);
}
if (maxNumber === minNumber) {
this._setDraggableEnable(false);
this.setEnable(false);
}
},

Loading…
Cancel
Save