category.data.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. export const columns: BasicColumn[] = [
  4. {
  5. title: '分类名称',
  6. dataIndex: 'name',
  7. width: 350,
  8. align: 'left',
  9. },
  10. {
  11. title: '分类编码',
  12. dataIndex: 'code',
  13. },
  14. ];
  15. export const searchFormSchema: FormSchema[] = [
  16. {
  17. label: '名称',
  18. field: 'name',
  19. component: 'Input',
  20. colProps: { span: 6 },
  21. },
  22. {
  23. label: '编码',
  24. field: 'code',
  25. component: 'Input',
  26. colProps: { span: 6 },
  27. },
  28. ];
  29. export const formSchema: FormSchema[] = [
  30. {
  31. label: '',
  32. field: 'id',
  33. component: 'Input',
  34. show: false,
  35. },
  36. {
  37. label: '父级节点',
  38. field: 'pid',
  39. component: 'TreeSelect',
  40. componentProps: {
  41. //update-begin---author:wangshuai ---date:20230829 for:replaceFields已过期,使用fieldNames代替------------
  42. fieldNames: {
  43. //update-end---author:wangshuai ---date:20230829 for:replaceFields已过期,使用fieldNames代替------------
  44. value: 'key',
  45. },
  46. dropdownStyle: {
  47. maxHeight: '50vh',
  48. },
  49. getPopupContainer: () => document.body,
  50. },
  51. show: ({ values }) => {
  52. return values.pid !== '0';
  53. },
  54. dynamicDisabled: ({ values }) => {
  55. return !!values.id;
  56. },
  57. },
  58. {
  59. label: '分类名称',
  60. field: 'name',
  61. required: true,
  62. component: 'Input',
  63. },
  64. ];