From 00b8eb7be808d124871fe85cac6b1e7e172b45be 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=20fix:=20=E3=80=90=E6=9D=A5=E6=BA=90P?= =?UTF-8?q?T=E9=A1=B9=E7=9B=AE=E3=80=91BI=E7=BB=91=E5=AE=9A=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=96=87=E6=9C=AC=E4=B8=8B=E6=8B=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/widget/multiselect/loader.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/fineui/src/widget/multiselect/loader.js b/packages/fineui/src/widget/multiselect/loader.js index db341ce95..f7146250f 100644 --- a/packages/fineui/src/widget/multiselect/loader.js +++ b/packages/fineui/src/widget/multiselect/loader.js @@ -72,7 +72,8 @@ export class MultiSelectInnerLoader extends 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; @@ -204,6 +205,16 @@ export class MultiSelectInnerLoader extends Widget { this.button_group.addItems(...arguments); } + _composeItems(items) { + const cacheValue = this.cachGroup.getValue(); + return items.map(item => { + return { + ...item, + selected: cacheValue.includes(item.value || item.id) + }; + }); + } + _populate(items) { const self = this, o = this.options;