@lx-frontend/wrap-element-ui 1.0.24-beta.6 → 1.0.24
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
|
@@ -64,6 +64,11 @@ export function useViewSetting({
|
|
|
64
64
|
|
|
65
65
|
const saveSettingToStorge = async() => {
|
|
66
66
|
await nextTick()
|
|
67
|
+
|
|
68
|
+
const settingStorgeMigrationConfigs = props.settingStorgeMigrationConfigs ?? []
|
|
69
|
+
const len = settingStorgeMigrationConfigs.length
|
|
70
|
+
const version = len ? settingStorgeMigrationConfigs[len - 1].version.to : undefined
|
|
71
|
+
|
|
67
72
|
localStorage.setItem(storageKey.value, JSON.stringify({
|
|
68
73
|
config: {
|
|
69
74
|
fields: props.columnConfig.reduce((acc, curr, index) => {
|
|
@@ -76,7 +81,7 @@ export function useViewSetting({
|
|
|
76
81
|
}, {} as Record<string, { hidden: boolean, order: number }>),
|
|
77
82
|
leftFixedColumnCount: leftFixedColumnCount.value,
|
|
78
83
|
},
|
|
79
|
-
version
|
|
84
|
+
version,
|
|
80
85
|
schemaVersion: 1
|
|
81
86
|
}))
|
|
82
87
|
};
|
|
@@ -150,11 +155,12 @@ export function useViewSetting({
|
|
|
150
155
|
const cache = handleMigration(JSON.parse(_cache)) as SettingStorgeConfig;
|
|
151
156
|
|
|
152
157
|
updateShowingColumns(
|
|
153
|
-
|
|
154
|
-
.
|
|
155
|
-
|
|
156
|
-
.
|
|
157
|
-
|
|
158
|
+
val.filter(v => {
|
|
159
|
+
return cache.config.fields[v.prop] ? !cache.config.fields[v.prop].hidden : !v.defaultHide
|
|
160
|
+
}).sort((a, b) => {
|
|
161
|
+
return (cache.config.fields[a.prop]?.order ?? 0) - (cache.config.fields[b.prop]?.order ?? 0)
|
|
162
|
+
}).map(v => v.prop)
|
|
163
|
+
);
|
|
158
164
|
|
|
159
165
|
const _leftFixedColumnCount = Number(cache?.config?.leftFixedColumnCount)
|
|
160
166
|
leftFixedColumnCount.value = isNaN(_leftFixedColumnCount) ? (props.leftFixedCount as number) : _leftFixedColumnCount;
|