fix: table 添加 toggled: false 的列不参与持久化存储 (#5236)

Co-authored-by: tooeast <liuzedong02@baidu.com>
This commit is contained in:
sansiro 2022-08-25 20:46:59 +08:00 committed by GitHub
parent 4154368e98
commit e7c909b277
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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),
// 列排序namelabel可能不存在
columnOrder: self.columnsData.map(
item => item.name || item.label || item.rawIndex