From 6e6b7206612d739d6b26e5b28e516d0da6ccd6be Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 24 Apr 2020 14:48:51 +0800 Subject: [PATCH] =?UTF-8?q?BI-64107=20fix:=20assertShowValue=E6=9B=B4?= =?UTF-8?q?=E6=96=B0value=E7=9A=84=E6=97=B6=E5=80=99=E4=B9=9F=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E4=B8=8Bassist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/multiselect.combo.js | 12 +++++++++++- src/widget/multiselect/multiselect.combo.nobar.js | 11 ++++++++++- src/widget/multiselect/multiselect.insert.combo.js | 11 ++++++++++- .../multiselect/multiselect.insert.combo.nobar.js | 11 ++++++++++- 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index f9f94a9e4..8e1f8b2ef 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/src/widget/multiselect/multiselect.combo.js @@ -23,7 +23,17 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { var self = this, o = this.options; var assertShowValue = function () { - BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue)); + if (BI.isKey(self._startValue)) { + if (self.storeValue.type === BI.Selection.All) { + BI.remove(self.storeValue.value, self._startValue); + self.storeValue.assist = self.storeValue.assist || []; + self.storeValue.assist.pushDistinct(self._startValue); + } else { + BI.pushDistinct(self.storeValue.value, self._startValue); + BI.remove(self.storeValue.assist, self._startValue); + } + } + self.trigger.getSearcher().setState(self.storeValue); self.numberCounter.setButtonChecked(self.storeValue); }; diff --git a/src/widget/multiselect/multiselect.combo.nobar.js b/src/widget/multiselect/multiselect.combo.nobar.js index 79b6a1474..fbc70a66a 100644 --- a/src/widget/multiselect/multiselect.combo.nobar.js +++ b/src/widget/multiselect/multiselect.combo.nobar.js @@ -22,7 +22,16 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, { var self = this, o = this.options; var assertShowValue = function () { - BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue)); + if (BI.isKey(self._startValue)) { + if (self.storeValue.type === BI.Selection.All) { + BI.remove(self.storeValue.value, self._startValue); + self.storeValue.assist = self.storeValue.assist || []; + self.storeValue.assist.pushDistinct(self._startValue); + } else { + BI.pushDistinct(self.storeValue.value, self._startValue); + BI.remove(self.storeValue.assist, self._startValue); + } + } self.trigger.getSearcher().setState(self.storeValue); self.numberCounter.setButtonChecked(self.storeValue); }; diff --git a/src/widget/multiselect/multiselect.insert.combo.js b/src/widget/multiselect/multiselect.insert.combo.js index 7fdc71c35..a08f590ad 100644 --- a/src/widget/multiselect/multiselect.insert.combo.js +++ b/src/widget/multiselect/multiselect.insert.combo.js @@ -23,7 +23,16 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { var self = this, o = this.options; var assertShowValue = function () { - BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue)); + if (BI.isKey(self._startValue)) { + if(self.storeValue.type === BI.Selection.All) { + BI.remove(self.storeValue.value, self._startValue); + self.storeValue.assist = self.storeValue.assist || []; + self.storeValue.assist.pushDistinct(self._startValue); + } else { + BI.pushDistinct(self.storeValue.value, self._startValue); + BI.remove(self.storeValue.assist, self._startValue); + } + } self.trigger.getSearcher().setState(self.storeValue); self.numberCounter.setButtonChecked(self.storeValue); }; diff --git a/src/widget/multiselect/multiselect.insert.combo.nobar.js b/src/widget/multiselect/multiselect.insert.combo.nobar.js index cb7ac6c12..52fbbb4ff 100644 --- a/src/widget/multiselect/multiselect.insert.combo.nobar.js +++ b/src/widget/multiselect/multiselect.insert.combo.nobar.js @@ -22,7 +22,16 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { var self = this, o = this.options; var assertShowValue = function () { - BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue)); + if (BI.isKey(self._startValue)) { + if (self.storeValue.type === BI.Selection.All) { + BI.remove(self.storeValue.value, self._startValue); + self.storeValue.assist = self.storeValue.assist || []; + self.storeValue.assist.pushDistinct(self._startValue); + } else { + BI.pushDistinct(self.storeValue.value, self._startValue); + BI.remove(self.storeValue.assist, self._startValue); + } + } self.trigger.getSearcher().setState(self.storeValue); self.numberCounter.setButtonChecked(self.storeValue); };