@lx-frontend/wrap-element-ui 1.0.24-beta.4 → 1.0.24-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lx-frontend/wrap-element-ui",
3
- "version": "1.0.24-beta.4",
3
+ "version": "1.0.24-beta.6",
4
4
  "description": "wrap-element-ui",
5
5
  "author": "",
6
6
  "main": "src/components/index.ts",
@@ -66,16 +66,17 @@ export function useViewSetting({
66
66
  await nextTick()
67
67
  localStorage.setItem(storageKey.value, JSON.stringify({
68
68
  config: {
69
- fields: props.columnConfig.reduce((acc, curr) => {
69
+ fields: props.columnConfig.reduce((acc, curr, index) => {
70
+ const _index = showingColumns.value.findIndex(v => v === curr.prop)
70
71
  acc[curr.prop] = {
71
- hidden: showingColumns.value.find(v => v === curr.prop) ? false : curr.defaultHide ?? false,
72
- order: showingColumns.value.findIndex(v => v === curr.prop) ?? 0,
72
+ hidden: showingColumns.value.find(v => v === curr.prop) ? false : true,
73
+ order: _index === -1 ? index : _index,
73
74
  }
74
75
  return acc;
75
76
  }, {} as Record<string, { hidden: boolean, order: number }>),
76
77
  leftFixedColumnCount: leftFixedColumnCount.value,
77
78
  },
78
- version: (props.settingStorgeMigrationConfigs ?? []).pop()?.version,
79
+ version: (props.settingStorgeMigrationConfigs ?? []).pop()?.version.to,
79
80
  schemaVersion: 1
80
81
  }))
81
82
  };
@@ -118,10 +119,9 @@ export function useViewSetting({
118
119
  const handleMigration = (_cache: any) => {
119
120
  const schemaVersion = _cache?.schemaVersion ?? 0
120
121
  if (!storgeSchemaMigrationConfig[schemaVersion]) { // 没有 schema 变动时,查找需要处理的业务迁移配置
121
- const bizMigrationConfigs = (props.settingStorgeMigrationConfigs ?? [])
122
- .filter(v => (v.schemaVersion ?? 1) === _cache.schemaVersion)
122
+ const bizMigrationConfigs = (props.settingStorgeMigrationConfigs ?? []).filter(v => (v.schemaVersion ?? 1) === _cache.schemaVersion)
123
123
 
124
- const _versionIndex = bizMigrationConfigs.findIndex(v => v.version)
124
+ const _versionIndex = bizMigrationConfigs.findIndex(v => v.version.form === _cache.version)
125
125
  if (_versionIndex > -1) {
126
126
  for (let i = _versionIndex; i < bizMigrationConfigs.length; i++) {
127
127
  const curr = bizMigrationConfigs[i]
@@ -169,7 +169,10 @@ export type SettingStorgeConfig = {
169
169
 
170
170
  export type SettingStorgeMigrationConfigs = {
171
171
  schemaVersion?: number
172
- version: string
172
+ version: {
173
+ form: string
174
+ to: string
175
+ }
173
176
  migration: (currentConfig: any, columns: IColumnConfig[]) => SettingStorgeConfig
174
177
  }[]
175
178