From 96919cf0ba251c53a94eddebdbd6f200337c8fc1 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 16 Sep 2020 15:30:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?BI-71788=20fix:=20allvaluechoosercombo=20se?= =?UTF-8?q?tValue=E6=89=80=E6=9C=89=E5=80=BCtrigger=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../allvaluechooser/abstract.allvaluechooser.js | 17 ++++++++++++++++- .../allvaluechooser/combo.allvaluechooser.js | 8 ++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/component/allvaluechooser/abstract.allvaluechooser.js b/src/component/allvaluechooser/abstract.allvaluechooser.js index 332a1737dd..1f30e8de8b 100644 --- a/src/component/allvaluechooser/abstract.allvaluechooser.js +++ b/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; + }, }); \ No newline at end of file diff --git a/src/component/allvaluechooser/combo.allvaluechooser.js b/src/component/allvaluechooser/combo.allvaluechooser.js index 3b7306a6ad..8c170867af 100644 --- a/src/component/allvaluechooser/combo.allvaluechooser.js +++ b/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 () { From c8a6dbf4cb7eda4a38461b1e02c96ef5dfeeb28d Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 18 Sep 2020 12:39:41 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20intervals?= =?UTF-8?q?lider=20setEnable=20false=20=E6=BB=91=E5=9D=97=E4=B8=8D?= =?UTF-8?q?=E7=81=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + src/widget/intervalslider/intervalslider.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index d480587b13..c23791f5bb 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-09) +- 修复区间滑块setEnable(false)滑块不灰化的问题 - 修复同步复选下拉框系列setValue所有值后触发器不显示全选的问题 - BI.Tree.traversal方法迭代函数增加父节点参数 diff --git a/src/widget/intervalslider/intervalslider.js b/src/widget/intervalslider/intervalslider.js index e8b09fcc41..ff1b98db23 100644 --- a/src/widget/intervalslider/intervalslider.js +++ b/src/widget/intervalslider/intervalslider.js @@ -483,10 +483,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); } }, From b52dd28b55d8ff69a615c119e767ba16e062e7a1 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 18 Sep 2020 12:40:12 +0800 Subject: [PATCH 3/3] update --- src/widget/intervalslider/intervalslider.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/widget/intervalslider/intervalslider.js b/src/widget/intervalslider/intervalslider.js index ff1b98db23..b7dc379b58 100644 --- a/src/widget/intervalslider/intervalslider.js +++ b/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