From f102934f1d6277e2b5b12c34e2ccd9eceaff24ba Mon Sep 17 00:00:00 2001 From: Renzo Date: Fri, 3 Feb 2023 15:37:11 +0800 Subject: [PATCH] =?UTF-8?q?JSY-26289=20fix:=20=E7=BB=9F=E4=B8=80setValue?= =?UTF-8?q?=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 () {