From 1102e4c5716690aa3add593de24f8894591a3fc2 Mon Sep 17 00:00:00 2001 From: dailer Date: Fri, 7 Jul 2023 14:19:59 +0800 Subject: [PATCH] =?UTF-8?q?BI-128437=20=20=E6=8F=90=E4=BA=A4Final=20fix:?= =?UTF-8?q?=20=E3=80=90=E6=9D=A5=E6=BA=90PT=E9=A1=B9=E7=9B=AE=E3=80=91BI?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=8F=82=E6=95=B0=E6=96=87=E6=9C=AC=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/loader.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/widget/multiselect/loader.js b/src/widget/multiselect/loader.js index 0101d8908..3649ce8ad 100644 --- a/src/widget/multiselect/loader.js +++ b/src/widget/multiselect/loader.js @@ -51,7 +51,8 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { this.next.setLoading(); if (this.cachItems && this.cachItems.length > 0) { this.next.setLoaded(); - this.addItems(this.cachItems.slice(0, 100)); + const items = this._composeItems(this.cachItems.slice(0, 100)); + this.addItems(items); this.cachItems = this.cachItems.slice(100); return; } @@ -170,6 +171,17 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { this.button_group.addItems.apply(this.button_group, arguments); }, + + _composeItems: function (items) { + const cacheValue = this.cachGroup.getValue(); + return items.map(item => { + return { + ...item, + selected: cacheValue.includes(item.value || item.id) + }; + }); + }, + _populate: function (items) { var self = this, o = this.options; if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) {