apiErrorLog.data.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. dictClass: 'number',
  72. search: {
  73. show: true
  74. }
  75. },
  76. {
  77. label: '处理人',
  78. field: 'processUserId'
  79. },
  80. {
  81. label: '处理时间',
  82. field: 'processTime'
  83. },
  84. {
  85. label: t('table.action'),
  86. field: 'action',
  87. width: '300px',
  88. form: {
  89. show: false
  90. },
  91. detail: {
  92. show: false
  93. }
  94. }
  95. ])
  96. export const { allSchemas } = useCrudSchemas(crudSchemas)