页面按钮权限
This commit is contained in:
@@ -38,13 +38,15 @@ export const useMenuStore = defineStore('menu', () => {
|
||||
/**
|
||||
* 取岗位某功能的数据权限级别(仅按 WorkPostName)
|
||||
* @returns {'view'|'edit'|null} null 表示无菜单权限
|
||||
* - WorkPostName 在权限表中:按表配置
|
||||
* - 不在表中:不限制(edit)
|
||||
* - WorkPostName 为空:仅可查看(view)
|
||||
* - 在权限表中:按表配置
|
||||
* - 有岗位名但不在表中:不限制(edit)
|
||||
*/
|
||||
const getPostFuncLevel = (funcKey) => {
|
||||
if (!funcKey) return null
|
||||
const userStore = useUserStore()
|
||||
const postName = String(userStore.userInfo?.WorkPostName || '').trim()
|
||||
if (!postName) return 'view'
|
||||
const map = postMenuPermissions[postName]
|
||||
if (!map) return 'edit'
|
||||
return map[funcKey] || null
|
||||
|
||||
Reference in New Issue
Block a user