process.data.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import { reactive } from 'vue'
  2. import { useI18n } from '@/hooks/web/useI18n'
  3. import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
  4. import { DICT_TYPE } from '@/utils/dict'
  5. const { t } = useI18n() // 国际化
  6. // CrudSchema
  7. const crudSchemas = reactive<VxeCrudSchema>({
  8. primaryKey: 'id',
  9. primaryType: null,
  10. primaryTitle: '编号',
  11. action: true,
  12. actionWidth: '200px',
  13. columns: [
  14. {
  15. title: '编号',
  16. field: 'id',
  17. table: {
  18. width: 320
  19. }
  20. },
  21. {
  22. title: '流程名',
  23. field: 'name',
  24. isSearch: true
  25. },
  26. {
  27. title: '所属流程',
  28. field: 'processDefinitionId',
  29. isSearch: true,
  30. isTable: false
  31. },
  32. {
  33. title: '流程分类',
  34. field: 'category',
  35. dictType: DICT_TYPE.BPM_MODEL_CATEGORY,
  36. dictClass: 'number',
  37. isSearch: true
  38. },
  39. {
  40. title: '当前审批任务',
  41. field: 'tasks',
  42. table: {
  43. width: 140,
  44. slots: {
  45. default: 'tasks_default'
  46. }
  47. }
  48. },
  49. {
  50. title: t('common.status'),
  51. field: 'status',
  52. dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS,
  53. dictClass: 'number',
  54. isSearch: true
  55. },
  56. {
  57. title: '结果',
  58. field: 'result',
  59. dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
  60. dictClass: 'number',
  61. isSearch: true
  62. },
  63. {
  64. title: '提交时间',
  65. field: 'createTime',
  66. formatter: 'formatDate',
  67. table: {
  68. width: 180
  69. },
  70. isForm: false,
  71. isSearch: true,
  72. search: {
  73. show: true,
  74. itemRender: {
  75. name: 'XDataTimePicker'
  76. }
  77. }
  78. },
  79. {
  80. title: '结束时间',
  81. field: 'endTime',
  82. formatter: 'formatDate',
  83. table: {
  84. width: 180
  85. },
  86. isForm: false
  87. }
  88. ]
  89. })
  90. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)