列权限添加
This commit is contained in:
9
web/src/utils/columnPermission.ts
Normal file
9
web/src/utils/columnPermission.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { useColumnPermission } from '/@/stores/columnPermission';
|
||||
|
||||
type permissionType = 'is_create' | 'is_query' | 'is_update';
|
||||
|
||||
export const columnPermission = (key: string, type: permissionType): boolean => {
|
||||
const permissions = useColumnPermission().permission || [];
|
||||
|
||||
return !!permissions.some((i) => i.field_name === key && i[type]);
|
||||
};
|
||||
Reference in New Issue
Block a user