account.data.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import { getAllRoleList } from '/@/api/demo/system';
  2. import { BasicColumn } from '/@/components/Table';
  3. import { FormSchema } from '/@/components/Table';
  4. export const columns: BasicColumn[] = [
  5. {
  6. title: '用户名',
  7. dataIndex: 'account',
  8. width: 120,
  9. },
  10. {
  11. title: '昵称',
  12. dataIndex: 'nickname',
  13. width: 120,
  14. },
  15. {
  16. title: '邮箱',
  17. dataIndex: 'email',
  18. width: 120,
  19. },
  20. {
  21. title: '创建时间',
  22. dataIndex: 'createTime',
  23. width: 180,
  24. },
  25. {
  26. title: '角色',
  27. dataIndex: 'role',
  28. width: 200,
  29. },
  30. {
  31. title: '备注',
  32. dataIndex: 'remark',
  33. },
  34. ];
  35. export const searchFormSchema: FormSchema[] = [
  36. {
  37. field: 'account',
  38. label: '用户名',
  39. component: 'Input',
  40. colProps: { span: 8 },
  41. },
  42. {
  43. field: 'nickname',
  44. label: '昵称',
  45. component: 'Input',
  46. colProps: { span: 8 },
  47. },
  48. ];
  49. export const accountFormSchema: FormSchema[] = [
  50. {
  51. field: 'account',
  52. label: '用户名',
  53. component: 'Input',
  54. required: true,
  55. },
  56. {
  57. field: 'pwd',
  58. label: '密码',
  59. component: 'InputPassword',
  60. required: true,
  61. ifShow: false,
  62. },
  63. {
  64. label: '角色',
  65. field: 'role',
  66. component: 'ApiSelect',
  67. componentProps: {
  68. api: getAllRoleList,
  69. labelField: 'roleName',
  70. valueField: 'roleValue',
  71. },
  72. required: true,
  73. },
  74. {
  75. field: 'dept',
  76. label: '所属部门',
  77. component: 'TreeSelect',
  78. componentProps: {
  79. replaceFields: {
  80. title: 'deptName',
  81. key: 'id',
  82. value: 'id',
  83. },
  84. getPopupContainer: () => document.body,
  85. },
  86. required: true,
  87. },
  88. {
  89. field: 'nickname',
  90. label: '昵称',
  91. component: 'Input',
  92. required: true,
  93. },
  94. {
  95. label: '邮箱',
  96. field: 'email',
  97. component: 'Input',
  98. required: true,
  99. },
  100. {
  101. label: '备注',
  102. field: 'remark',
  103. component: 'InputTextArea',
  104. },
  105. ];