model.data.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
  2. const { t } = useI18n() // 国际化
  3. // 表单校验
  4. export const rules = reactive({
  5. key: [required],
  6. name: [required],
  7. category: [required],
  8. formType: [required],
  9. formId: [required],
  10. formCustomCreatePath: [required],
  11. formCustomViewPath: [required]
  12. })
  13. // CrudSchema
  14. const crudSchemas = reactive<VxeCrudSchema>({
  15. primaryKey: 'key',
  16. primaryType: null,
  17. action: true,
  18. actionWidth: '540px',
  19. columns: [
  20. {
  21. title: '流程标识',
  22. field: 'key',
  23. isSearch: true,
  24. table: {
  25. width: 120
  26. }
  27. },
  28. {
  29. title: '流程名称',
  30. field: 'name',
  31. isSearch: true,
  32. table: {
  33. width: 120,
  34. slots: {
  35. default: 'name_default'
  36. }
  37. }
  38. },
  39. {
  40. title: '流程分类',
  41. field: 'category',
  42. dictType: DICT_TYPE.BPM_MODEL_CATEGORY,
  43. dictClass: 'number',
  44. isSearch: true
  45. },
  46. {
  47. title: '表单信息',
  48. field: 'formId',
  49. table: {
  50. width: 180,
  51. slots: {
  52. default: 'formId_default'
  53. }
  54. }
  55. },
  56. {
  57. title: '最新部署的流程定义',
  58. field: 'processDefinition',
  59. isForm: false,
  60. table: {
  61. children: [
  62. {
  63. title: '流程版本',
  64. field: 'version',
  65. slots: {
  66. default: 'version_default'
  67. },
  68. width: 80
  69. },
  70. {
  71. title: '激活状态',
  72. field: 'status',
  73. slots: {
  74. default: 'status_default'
  75. },
  76. width: 80
  77. },
  78. {
  79. title: '部署时间',
  80. field: 'processDefinition.deploymentTime',
  81. formatter: 'formatDate',
  82. width: 180
  83. }
  84. ]
  85. }
  86. },
  87. {
  88. title: t('common.createTime'),
  89. field: 'createTime',
  90. isForm: false,
  91. formatter: 'formatDate',
  92. table: {
  93. width: 180
  94. }
  95. }
  96. ]
  97. })
  98. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)