model.data.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. table: {
  46. slots: {
  47. default: 'category_default'
  48. }
  49. }
  50. },
  51. {
  52. title: '表单信息',
  53. field: 'formId',
  54. table: {
  55. width: 180,
  56. slots: {
  57. default: 'formId_default'
  58. }
  59. }
  60. },
  61. {
  62. title: '最新部署的流程定义',
  63. field: 'processDefinition',
  64. isForm: false,
  65. table: {
  66. children: [
  67. {
  68. title: '流程版本',
  69. field: 'version',
  70. slots: {
  71. default: 'version_default'
  72. },
  73. width: 80
  74. },
  75. {
  76. title: '激活状态',
  77. field: 'status',
  78. slots: {
  79. default: 'status_default'
  80. },
  81. width: 80
  82. },
  83. {
  84. title: '部署时间',
  85. field: 'processDefinition.deploymentTime',
  86. formatter: 'formatDate',
  87. width: 180
  88. }
  89. ]
  90. }
  91. },
  92. {
  93. title: t('common.createTime'),
  94. field: 'createTime',
  95. isForm: false,
  96. formatter: 'formatDate',
  97. table: {
  98. width: 180
  99. }
  100. }
  101. ]
  102. })
  103. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)