From 5125e3211a2827e2131c96080236fbf29d46bce1 Mon Sep 17 00:00:00 2001 From: Renzo Date: Fri, 3 Feb 2023 13:45:28 +0800 Subject: [PATCH] =?UTF-8?q?JSY-26289=20fix:=20=E4=BF=AE=E5=A4=8D=E6=97=A0?= =?UTF-8?q?=E5=85=A8=E9=80=89=E6=8C=89=E9=92=AE=E6=97=B6=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E5=8B=BE=E9=80=89=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/multiselect.search.loader.js | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/widget/multiselect/search/multiselect.search.loader.js b/src/widget/multiselect/search/multiselect.search.loader.js index 9029a94ed..7ccda9374 100644 --- a/src/widget/multiselect/search/multiselect.search.loader.js +++ b/src/widget/multiselect/search/multiselect.search.loader.js @@ -123,7 +123,7 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { }; callback(firstItems.concat(self._createItems(ob.items)), keyword, context); if (op.times === 1 && self.storeValue) { - self.setValue(self.storeValue); + self.setValue(self.storeValue.value); } }); }, @@ -134,15 +134,10 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { this.button_group.on(BI.Controller.EVENT_CHANGE, function () { self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); }); - if (opts.allowSelectAll) { - this.button_group.on(BI.SelectList.EVENT_CHANGE, function () { - self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE, arguments); - }); - } else { - this.button_group.on(BI.ListPane.EVENT_CHANGE, function (val) { - self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE, val); - }); - } + var searchLoaderEventChangeName = opts.allowSelectAll ? BI.SelectList.EVENT_CHANGE : BI.ListPane.EVENT_CHANGE + this.button_group.on(searchLoaderEventChangeName, function () { + self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE, arguments); + }); }, _createItems: function (items) { @@ -202,7 +197,15 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { }, getValue: function () { - return this.button_group.getValue(); + var o = this.options; + if (o.allowSelectAll) { + return this.button_group.getValue(); + } + return { + type: BI.ButtonGroup.CHOOSE_TYPE_MULTI, + value: this.button_group.getValue(), + assist: this.button_group.getNotSelectedValue() + }; }, getAllButtons: function () {