From e7c909b277084ba81917365947cab9c80b3851ed Mon Sep 17 00:00:00 2001 From: sansiro Date: Thu, 25 Aug 2022 20:46:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20table=20=E6=B7=BB=E5=8A=A0=20toggled:=20?= =?UTF-8?q?false=20=E7=9A=84=E5=88=97=E4=B8=8D=E5=8F=82=E4=B8=8E=E6=8C=81?= =?UTF-8?q?=E4=B9=85=E5=8C=96=E5=AD=98=E5=82=A8=20(#5236)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: tooeast --- packages/amis-core/src/store/table.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/amis-core/src/store/table.ts b/packages/amis-core/src/store/table.ts index b2a7a8700..9c96ae48d 100644 --- a/packages/amis-core/src/store/table.ts +++ b/packages/amis-core/src/store/table.ts @@ -1337,8 +1337,10 @@ export const TableStore = iRendererStore localStorage.setItem( key, JSON.stringify({ - // 可显示列index - toggledColumnIndex: self.activeToggaleColumns.map(item => item.index), + // 可显示列index, 原始配置中存在 toggled: false 的列不持久化 + toggledColumnIndex: self.activeToggaleColumns + .filter(item => !(item.pristine?.toggled === false)) + .map(item => item.index), // 列排序,name,label可能不存在 columnOrder: self.columnsData.map( item => item.name || item.label || item.rawIndex