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