feat: 数据权限

This commit is contained in:
dap
2024-09-25 11:47:55 +08:00
parent 7dbcf02d9a
commit a661afc3e8
5 changed files with 381 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import type { FormSchemaGetter } from '#/adapter';
import { DictEnum } from '@vben/constants';
import { getPopupContainer } from '@vben/utils';
import { getDictOptions } from '#/utils/dict';
@@ -116,3 +117,63 @@ export const drawerSchema: FormSchemaGetter = () => [
label: '备注',
},
];
export const authModalSchemas: FormSchemaGetter = () => [
{
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
fieldName: 'roleId',
label: '角色ID',
},
{
component: 'Radio',
dependencies: {
show: () => false,
triggerFields: [''],
},
fieldName: 'deptCheckStrictly',
label: 'deptCheckStrictly',
},
{
component: 'Input',
componentProps: {
disabled: true,
},
fieldName: 'roleName',
label: '角色名称',
},
{
component: 'Input',
componentProps: {
disabled: true,
},
fieldName: 'roleKey',
label: '权限标识',
},
{
component: 'Select',
componentProps: {
allowClear: false,
getPopupContainer,
options: authScopeOptions,
},
fieldName: 'dataScope',
help: '更改后需要用户重新登录才能生效',
label: '权限范围',
},
{
component: 'TreeSelect',
defaultValue: [],
dependencies: {
show: (values) => values.dataScope === '2',
triggerFields: ['dataScope'],
},
fieldName: 'deptIds',
formItemClass: 'items-baseline',
help: '更改后立即生效',
label: '部门权限',
},
];