jobLog.data.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import { reactive } from 'vue'
  2. import { DICT_TYPE } from '@/utils/dict'
  3. import { useI18n } from '@/hooks/web/useI18n'
  4. import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
  5. // 国际化
  6. const { t } = useI18n()
  7. // CrudSchema
  8. const crudSchemas = reactive<VxeCrudSchema>({
  9. primaryKey: 'id',
  10. primaryType: 'seq',
  11. primaryTitle: '日志编号',
  12. action: true,
  13. columns: [
  14. {
  15. title: '任务编号',
  16. field: 'jobId',
  17. isSearch: true
  18. },
  19. {
  20. title: '处理器的名字',
  21. field: 'handlerName',
  22. isSearch: true
  23. },
  24. {
  25. title: '处理器的参数',
  26. field: 'handlerParam'
  27. },
  28. {
  29. title: '第几次执行',
  30. field: 'executeIndex'
  31. },
  32. {
  33. title: '开始执行时间',
  34. field: 'beginTime',
  35. formatter: 'formatDate',
  36. table: {
  37. slots: {
  38. default: 'beginTime_default'
  39. }
  40. },
  41. search: {
  42. show: true,
  43. itemRender: {
  44. name: 'XDataPicker'
  45. }
  46. }
  47. },
  48. {
  49. title: '结束执行时间',
  50. field: 'endTime',
  51. formatter: 'formatDate',
  52. isTable: false,
  53. search: {
  54. show: true,
  55. itemRender: {
  56. name: 'XDataPicker'
  57. }
  58. }
  59. },
  60. {
  61. title: '执行时长',
  62. field: 'duration',
  63. table: {
  64. slots: {
  65. default: 'duration_default'
  66. }
  67. }
  68. },
  69. {
  70. title: t('common.status'),
  71. field: 'status',
  72. dictType: DICT_TYPE.INFRA_JOB_LOG_STATUS,
  73. dictClass: 'number',
  74. isSearch: true
  75. }
  76. ]
  77. })
  78. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)