fix: 入库列表缓存被权限清空时回退到全显示, 防止空表头
This commit is contained in:
@ -1110,8 +1110,11 @@ const initColumnPermissions = () => {
|
||||
if (cachedData) {
|
||||
try {
|
||||
const parsedCache = JSON.parse(cachedData);
|
||||
visibleColumnProps.value = parsedCache.filter((prop: string) => allowedProps.includes(prop));
|
||||
return;
|
||||
const filtered = parsedCache.filter((prop: string) => allowedProps.includes(prop));
|
||||
if (filtered.length > 0) {
|
||||
visibleColumnProps.value = filtered;
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('解析列缓存失败', e);
|
||||
}
|
||||
|
||||
@ -840,8 +840,11 @@ const initColumnPermissions = () => {
|
||||
if (cachedData) {
|
||||
try {
|
||||
const parsedCache = JSON.parse(cachedData);
|
||||
visibleColumnProps.value = parsedCache.filter((prop: string) => allowedProps.includes(prop));
|
||||
return;
|
||||
const filtered = parsedCache.filter((prop: string) => allowedProps.includes(prop));
|
||||
if (filtered.length > 0) {
|
||||
visibleColumnProps.value = filtered;
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('解析列缓存失败', e);
|
||||
}
|
||||
|
||||
@ -922,8 +922,11 @@ const initColumnPermissions = () => {
|
||||
if (cachedData) {
|
||||
try {
|
||||
const parsedCache = JSON.parse(cachedData);
|
||||
visibleColumnProps.value = parsedCache.filter((prop: string) => allowedProps.includes(prop));
|
||||
return;
|
||||
const filtered = parsedCache.filter((prop: string) => allowedProps.includes(prop));
|
||||
if (filtered.length > 0) {
|
||||
visibleColumnProps.value = filtered;
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('解析列缓存失败', e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user