role.data.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. import { RoleEnum } from '/@/enums/roleEnum';
  4. export enum KeysTypeEnum {
  5. DISABLED = 'disabled',
  6. ENABLED = 'enabled',
  7. }
  8. export const RoleMenuDictEnum: Recordable<{ key: string; keyType: KeysTypeEnum }> = {
  9. [RoleEnum.PLATFORM_ADMIN]: { key: 'enabled_platform_admin_auth', keyType: KeysTypeEnum.ENABLED },
  10. [RoleEnum.SYS_ADMIN]: { key: 'enabled_sysadmin_auth', keyType: KeysTypeEnum.ENABLED },
  11. [RoleEnum.TENANT_ADMIN]: { key: 'disabled_tenant_auth', keyType: KeysTypeEnum.DISABLED },
  12. [RoleEnum.CUSTOMER_USER]: { key: 'disabled_tenant_auth', keyType: KeysTypeEnum.DISABLED },
  13. };
  14. export const columns: BasicColumn[] = [
  15. {
  16. title: '角色名称',
  17. dataIndex: 'groupName',
  18. width: 200,
  19. },
  20. {
  21. title: '角色Code',
  22. dataIndex: 'groupid',
  23. width: 200,
  24. },
  25. {
  26. title: '类型',
  27. dataIndex: 'groupType',
  28. width: 120,
  29. },
  30. {
  31. title: '备注',
  32. dataIndex: 'memo',
  33. width: 240,
  34. },
  35. {
  36. title: '排序',
  37. dataIndex: 'sort',
  38. width: 180,
  39. },
  40. ];
  41. export const searchFormSchema: FormSchema[] = [
  42. {
  43. field: 'roleName',
  44. label: '角色名称',
  45. component: 'Input',
  46. colProps: { span: 6 },
  47. componentProps: {
  48. maxLength: 255,
  49. },
  50. },
  51. {
  52. field: 'status',
  53. label: '状态',
  54. component: 'Select',
  55. componentProps: {
  56. options: [
  57. { label: '启用', value: 1 },
  58. { label: '停用', value: 0 },
  59. ],
  60. },
  61. colProps: { span: 6 },
  62. },
  63. ];
  64. export const formSchema: FormSchema[] = [
  65. {
  66. field: 'groupName',
  67. label: '角色名称',
  68. required: true,
  69. component: 'Input',
  70. componentProps: {
  71. maxLength: 255,
  72. placeholder: '请输入角色名称',
  73. },
  74. },
  75. {
  76. label: '排序',
  77. field: 'sort',
  78. component: 'Input',
  79. componentProps: {
  80. maxLength: 255,
  81. placeholder: '请输入排序',
  82. },
  83. }
  84. ];