data.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
  2. import type { VbenFormSchema } from '#/adapter/form';
  3. import type { SystemModel } from '#/api/method/system';
  4. import { listEnterpriseTypeDictMethod } from '#/api';
  5. import { $t } from '#/locales';
  6. export function useEnterpriseSearchFormSchema(): VbenFormSchema[] {
  7. return [
  8. {
  9. component: 'Input',
  10. fieldName: 'name',
  11. label: $t('system.enterprise.name'),
  12. },
  13. {
  14. component: 'ApiSelect',
  15. fieldName: 'enterpriseType',
  16. label: $t('system.enterprise.type'),
  17. componentProps: {
  18. allowClear: true,
  19. api: listEnterpriseTypeDictMethod,
  20. class: 'w-full',
  21. labelField: 'dictName',
  22. valueField: 'dictValue',
  23. },
  24. },
  25. ];
  26. }
  27. export function useEnterpriseTableColumns(): VxeTableGridOptions<SystemModel.Enterprise>['columns'] {
  28. return [
  29. { type: 'seq', title: $t('table.column.seq'), width: 50 },
  30. {
  31. field: 'name',
  32. title: $t('system.enterprise.name'),
  33. minWidth: 120,
  34. },
  35. {
  36. field: 'code',
  37. title: $t('system.enterprise.code'),
  38. minWidth: 100,
  39. },
  40. {
  41. field: 'type',
  42. title: $t('system.enterprise.type'),
  43. minWidth: 120,
  44. },
  45. {
  46. field: 'remark',
  47. title: $t('system.enterprise.remark'),
  48. minWidth: 100,
  49. },
  50. {
  51. field: 'createTime',
  52. title: $t('system.enterprise.createTime'),
  53. minWidth: 160,
  54. },
  55. {
  56. field: 'createUser',
  57. title: $t('system.enterprise.createUser'),
  58. minWidth: 100,
  59. },
  60. ];
  61. }
  62. export function useEnterpriseFormSchema(): VbenFormSchema[] {
  63. return [];
  64. }