fix: 前端 buy/semi permissionMap 数量字段 null→显式权限码,与后端 RBAC 统一对齐
This commit is contained in:
@ -1089,7 +1089,7 @@ const permissionMap: Record<string, string> = {
|
|||||||
in_quantity: 'inbound_buy:in_quantity',
|
in_quantity: 'inbound_buy:in_quantity',
|
||||||
stock_quantity: 'inbound_buy:stock_quantity',
|
stock_quantity: 'inbound_buy:stock_quantity',
|
||||||
available_quantity: 'inbound_buy:available_quantity',
|
available_quantity: 'inbound_buy:available_quantity',
|
||||||
warehouse_loc: 'inbound_buy:warehouse_loc',
|
warehouse_loc: null,
|
||||||
tax_rate: 'inbound_buy:tax_rate',
|
tax_rate: 'inbound_buy:tax_rate',
|
||||||
unit_price: 'inbound_buy:unit_price',
|
unit_price: 'inbound_buy:unit_price',
|
||||||
total_price: 'inbound_buy:total_price',
|
total_price: 'inbound_buy:total_price',
|
||||||
@ -1117,8 +1117,14 @@ const hasColumnPermission = (prop: string) => {
|
|||||||
if (userStore.role === 'SUPER_ADMIN' || userStore.username === 'IRIS') {
|
if (userStore.role === 'SUPER_ADMIN' || userStore.username === 'IRIS') {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if (!(prop in permissionMap)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
const code = permissionMap[prop]
|
const code = permissionMap[prop]
|
||||||
return code ? userStore.hasPermission(code) : false
|
if (code === null || code === undefined) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return userStore.hasPermission(code)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 初始化列权限(依赖 allColumns / hasColumnPermission / getStorageKey)
|
// 3. 初始化列权限(依赖 allColumns / hasColumnPermission / getStorageKey)
|
||||||
|
|||||||
@ -874,13 +874,10 @@ const permissionMap: Record<string, string> = {
|
|||||||
status: 'inbound_semi:status',
|
status: 'inbound_semi:status',
|
||||||
quality_status: 'inbound_semi:quality_status',
|
quality_status: 'inbound_semi:quality_status',
|
||||||
in_quantity: 'inbound_semi:in_quantity',
|
in_quantity: 'inbound_semi:in_quantity',
|
||||||
in_quantity: 'inbound_semi:in_quantity',
|
|
||||||
stock_quantity: 'inbound_semi:stock_quantity',
|
|
||||||
stock_quantity: 'inbound_semi:stock_quantity',
|
stock_quantity: 'inbound_semi:stock_quantity',
|
||||||
available_quantity: 'inbound_semi:available_quantity',
|
available_quantity: 'inbound_semi:available_quantity',
|
||||||
available_quantity: 'inbound_semi:available_quantity',
|
warehouse_loc: null,
|
||||||
warehouse_location: 'inbound_semi:warehouse_location',
|
warehouse_location: 'inbound_semi:warehouse_location',
|
||||||
warehouse_loc: 'inbound_semi:warehouse_loc',
|
|
||||||
bom_code: 'inbound_semi:bom_code',
|
bom_code: 'inbound_semi:bom_code',
|
||||||
bom_version: 'inbound_semi:bom_version',
|
bom_version: 'inbound_semi:bom_version',
|
||||||
work_order_code: 'inbound_semi:work_order_code',
|
work_order_code: 'inbound_semi:work_order_code',
|
||||||
@ -908,8 +905,14 @@ const hasColumnPermission = (prop: string) => {
|
|||||||
if (userStore.role === 'SUPER_ADMIN' || userStore.username === 'IRIS') {
|
if (userStore.role === 'SUPER_ADMIN' || userStore.username === 'IRIS') {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if (!(prop in permissionMap)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
const code = permissionMap[prop]
|
const code = permissionMap[prop]
|
||||||
return code ? userStore.hasPermission(code) : false
|
if (code === null || code === undefined) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return userStore.hasPermission(code)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 初始化列权限(依赖 allColumns / hasColumnPermission / getStorageKey)
|
// 3. 初始化列权限(依赖 allColumns / hasColumnPermission / getStorageKey)
|
||||||
|
|||||||
Reference in New Issue
Block a user