From 661ce4e5a0e52d35f05cbc8a4fcc8e02f715a61d Mon Sep 17 00:00:00 2001 From: dxc Date: Fri, 27 Feb 2026 10:54:18 +0800 Subject: [PATCH] fix: disable column hiding by permissions in material list view Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) --- inventory-web/src/views/material/list.vue | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/inventory-web/src/views/material/list.vue b/inventory-web/src/views/material/list.vue index f867e6d..cf40c14 100644 --- a/inventory-web/src/views/material/list.vue +++ b/inventory-web/src/views/material/list.vue @@ -528,13 +528,16 @@ const initColumnPermissions = () => { return; } - Object.keys(columns).forEach(key => { - const code = permissionMap[key]; - if (code) { - // 严格执行权限检查:不具备权限的列必须隐藏 - columns[key].visible = !!userStore.hasPermission(code); - } - }); + // 普通用户:不再根据权限隐藏列,而是显示所有列,由后端控制字段值 + // 所以这里不做任何操作,保持columns的默认visible(true) + // 但是,我们也可以选择性地根据权限隐藏列,但用户要求列显示,所以不隐藏 + // 因此,注释掉下面的代码 + // Object.keys(columns).forEach(key => { + // const code = permissionMap[key]; + // if (code) { + // columns[key].visible = !!userStore.hasPermission(code); + // } + // }); }; const companyOptions = ref([]);