apiErrorLog.data.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import { reactive } from 'vue'
  2. import { useI18n } from '@/hooks/web/useI18n'
  3. import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
  4. import { DICT_TYPE } from '@/utils/dict'
  5. const { t } = useI18n() // 国际化
  6. // CrudSchema
  7. const crudSchemas = reactive<CrudSchema[]>([
  8. {
  9. label: t('common.index'),
  10. field: 'id',
  11. type: 'index'
  12. },
  13. {
  14. label: '链路追踪',
  15. field: 'traceId'
  16. },
  17. {
  18. label: '用户编号',
  19. field: 'userId',
  20. search: {
  21. show: true
  22. }
  23. },
  24. {
  25. label: '用户类型',
  26. field: 'userType',
  27. dictType: DICT_TYPE.USER_TYPE,
  28. search: {
  29. show: true
  30. }
  31. },
  32. {
  33. label: '应用名',
  34. field: 'applicationName',
  35. search: {
  36. show: true
  37. }
  38. },
  39. {
  40. label: '请求方法名',
  41. field: 'requestMethod'
  42. },
  43. {
  44. label: '请求地址',
  45. field: 'requestUrl',
  46. search: {
  47. show: true
  48. }
  49. },
  50. {
  51. label: '异常发生时间',
  52. field: 'exceptionTime',
  53. search: {
  54. show: true,
  55. component: 'DatePicker',
  56. componentProps: {
  57. type: 'datetimerange',
  58. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  59. defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]
  60. }
  61. }
  62. },
  63. {
  64. label: '异常名',
  65. field: 'exceptionName'
  66. },
  67. {
  68. label: '处理状态',
  69. field: 'processStatus',
  70. dictType: DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS,
  71. search: {
  72. show: true
  73. }
  74. },
  75. {
  76. label: '处理人',
  77. field: 'processUserId'
  78. },
  79. {
  80. label: '处理时间',
  81. field: 'processTime'
  82. },
  83. {
  84. label: t('table.action'),
  85. field: 'action',
  86. width: '300px',
  87. form: {
  88. show: false
  89. },
  90. detail: {
  91. show: false
  92. }
  93. }
  94. ])
  95. export const { allSchemas } = useCrudSchemas(crudSchemas)