NEZ-2824 feat:列表字段显示顺序支持用户自定义页面开发

This commit is contained in:
zyh
2023-05-17 16:43:27 +08:00
parent c1f00b2f1f
commit 198fc02ee7
71 changed files with 239 additions and 110 deletions

View File

@@ -1344,6 +1344,14 @@ export default {
let localStorageTableTitle = localStorage.getItem('nz-tableTitle-' + localStorage.getItem('nz-username') + '-' + this.tableId)
localStorageTableTitle = localStorageTableTitle ? JSON.parse(localStorageTableTitle) : tableTitle
if (tableTitle) {
// 先根据本地缓存中的prop进行排序
tableTitle.sort(function (a, b) {
return localStorageTableTitle.findIndex(function (c) {
return c.prop === a.prop
}) - localStorageTableTitle.findIndex(function (c) {
return c.prop === b.prop
})
})
this.tools.customTableTitle = tableTitle.map((item, index) => { // 修复切换中英文的问题
item.show = localStorageTableTitle[index].show
return item