fix: borrow/return/records permissionMap 基础列改为 null 始终可见,对齐 inbound 模式,移除 records alwaysVisible 硬编码

This commit is contained in:
yueli
2026-07-21 09:40:58 +08:00
parent 35690c5b8f
commit 4ab7b6f541
3 changed files with 36 additions and 32 deletions

View File

@ -275,17 +275,22 @@ import { useUserStore } from '@/stores/user'
const userStore = useUserStore()
// 列与权限Code的映射关系
const permissionMap: Record<string, string> = {
borrower_name: 'op_borrow:borrower_name',
sku: 'op_borrow:sku',
available_quantity: 'op_borrow:available_quantity',
out_quantity: 'op_borrow:out_quantity',
const permissionMap: Record<string, string | null> = {
// 基础显示列 — 始终可见
name: null,
spec_model: null,
sku: null,
borrower_name: null,
available_quantity: null,
out_quantity: null,
}
const hasColumnPermission = (prop: string) => {
if (userStore.role === 'SUPER_ADMIN' || userStore.username === 'IRIS') return true
if (!(prop in permissionMap)) return false
const code = permissionMap[prop]
return code ? userStore.hasPermission(code) : false
if (code === null || code === undefined) return true
return userStore.hasPermission(code)
}
// --- 状态定义 ---