From 49e50f0a5ca02ff951aca5cfb4d39c60deabd198 Mon Sep 17 00:00:00 2001 From: Renzo Date: Fri, 3 Feb 2023 10:49:33 +0800 Subject: [PATCH 1/4] =?UTF-8?q?JSY-26262=20fix:=20multi=5Fselect=5Finsert?= =?UTF-8?q?=5Fno=5Fbar=5Flist=20=E7=BB=93=E6=9E=9C=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=8F=90=E7=A4=BA=E5=B1=85=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/multiselect.loader.nobar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widget/multiselect/multiselect.loader.nobar.js b/src/widget/multiselect/multiselect.loader.nobar.js index dde974df8..4b6970d25 100644 --- a/src/widget/multiselect/multiselect.loader.nobar.js +++ b/src/widget/multiselect/multiselect.loader.nobar.js @@ -99,9 +99,9 @@ BI.MultiSelectNoBarLoader = BI.inherit(BI.Widget, { }, opts.el)); BI.createWidget({ - type: "bi.vertical", + type: "bi.absolute", element: this, - items: [this.button_group], + items: [{el: this.button_group, inset: 0}], vgap: 5 }); From 5125e3211a2827e2131c96080236fbf29d46bce1 Mon Sep 17 00:00:00 2001 From: Renzo Date: Fri, 3 Feb 2023 13:45:28 +0800 Subject: [PATCH 2/4] =?UTF-8?q?JSY-26289=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E5=85=A8=E9=80=89=E6=8C=89=E9=92=AE=E6=97=B6=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E9=9D=A2=E6=9D=BF=E5=8B=BE=E9=80=89=E4=B8=8D=E7=94=9F?= =?UTF-8?q?=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 () { From f102934f1d6277e2b5b12c34e2ccd9eceaff24ba Mon Sep 17 00:00:00 2001 From: Renzo Date: Fri, 3 Feb 2023 15:37:11 +0800 Subject: [PATCH 3/4] =?UTF-8?q?JSY-26289=20fix:=20=E7=BB=9F=E4=B8=80setVal?= =?UTF-8?q?ue=E5=92=8CgetValue=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/search/multiselect.search.loader.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/widget/multiselect/search/multiselect.search.loader.js b/src/widget/multiselect/search/multiselect.search.loader.js index 7ccda9374..a4a3d8ed5 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.value); + self.setValue(self.storeValue); } }); }, @@ -191,9 +191,11 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { }, setValue: function (v) { + v || (v = {}); + var o = this.options; // 暂存的值一定是新的值,不然v改掉后,storeValue也跟着改了 this.storeValue = BI.deepClone(v); - this.button_group.setValue(v); + o.allowSelectAll ? (this.button_group.setValue(v)) : (this.button_group.setValue(v.value)); }, getValue: function () { From d5bcff9a0a87b4d964ed89d5b374792f0dd891bb Mon Sep 17 00:00:00 2001 From: Renzo Date: Fri, 3 Feb 2023 15:39:13 +0800 Subject: [PATCH 4/4] =?UTF-8?q?JSY-26262=20fix:=20=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/multiselect.loader.nobar.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/widget/multiselect/multiselect.loader.nobar.js b/src/widget/multiselect/multiselect.loader.nobar.js index 4b6970d25..274d51f6c 100644 --- a/src/widget/multiselect/multiselect.loader.nobar.js +++ b/src/widget/multiselect/multiselect.loader.nobar.js @@ -98,13 +98,15 @@ BI.MultiSelectNoBarLoader = BI.inherit(BI.Widget, { value: this.storeValue }, opts.el)); - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{el: this.button_group, inset: 0}], + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top), BI.extend({ + scrolly: true, vgap: 5 - }); - + }, opts.logic, { + items: BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top, this.button_group) + })))); + this.button_group.on(BI.Controller.EVENT_CHANGE, function () { self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); });