codegen.data.ts 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
  2. const { t } = useI18n() // 国际化
  3. // 表单校验
  4. export const rules = reactive({
  5. title: [required],
  6. type: [required],
  7. status: [required]
  8. })
  9. // CrudSchema
  10. const crudSchemas = reactive<VxeCrudSchema>({
  11. primaryKey: 'id',
  12. primaryType: 'seq',
  13. action: true,
  14. actionWidth: '400px',
  15. columns: [
  16. {
  17. title: '表名称',
  18. field: 'tableName',
  19. isSearch: true
  20. },
  21. {
  22. title: '表描述',
  23. field: 'tableComment',
  24. isSearch: true
  25. },
  26. {
  27. title: '实体',
  28. field: 'className',
  29. isSearch: true
  30. },
  31. {
  32. title: t('common.createTime'),
  33. field: 'createTime',
  34. formatter: 'formatDate',
  35. isForm: false,
  36. search: {
  37. show: true,
  38. itemRender: {
  39. name: 'XDataTimePicker'
  40. }
  41. }
  42. },
  43. {
  44. title: t('common.updateTime'),
  45. field: 'updateTime',
  46. formatter: 'formatDate',
  47. isForm: false
  48. }
  49. ]
  50. })
  51. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)