category.data.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. export const columns: BasicColumn[] = [
  4. {
  5. title: '类型名称',
  6. dataIndex: 'itemText',
  7. width: 350,
  8. align: 'left',
  9. },
  10. {
  11. title: '值',
  12. dataIndex: 'itemValue',
  13. },
  14. {
  15. title: 'sortOrder',
  16. dataIndex: 'code',
  17. },
  18. {
  19. title: '描述',
  20. dataIndex: 'description',
  21. },
  22. ];
  23. export const searchFormSchema: FormSchema[] = [
  24. {
  25. label: '类型名称',
  26. field: 'itemText',
  27. component: 'Input',
  28. colProps: { span: 6 },
  29. },
  30. ];
  31. export const formSchema: FormSchema[] = [
  32. {
  33. label: '',
  34. field: 'id',
  35. component: 'Input',
  36. show: false,
  37. },
  38. {
  39. label: '父级类型',
  40. field: 'dictId',
  41. component: 'TreeSelect',
  42. componentProps: {
  43. replaceFields: {
  44. value: 'key',
  45. },
  46. dropdownStyle: {
  47. maxHeight: '50vh',
  48. },
  49. getPopupContainer: () => document.body,
  50. },
  51. show: ({ values }) => {
  52. return values.dictId !== '0';
  53. },
  54. dynamicDisabled: ({ values }) => {
  55. return !!values.id;
  56. },
  57. },
  58. {
  59. label: '类型名称',
  60. field: 'itemText',
  61. required: true,
  62. component: 'Input',
  63. },
  64. {
  65. label: '值',
  66. field: 'itemValue',
  67. required: true,
  68. component: 'Input',
  69. },
  70. {
  71. label: '排序',
  72. field: 'sortOrder',
  73. component: 'InputNumber',
  74. },
  75. {
  76. label: '描述',
  77. field: 'description',
  78. component: 'InputTextArea',
  79. },
  80. ];