apiAccessLog.data.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
  2. // CrudSchema
  3. const crudSchemas = reactive<VxeCrudSchema>({
  4. primaryKey: 'id',
  5. primaryType: 'id',
  6. primaryTitle: '日志编号',
  7. action: true,
  8. actionWidth: '80px',
  9. columns: [
  10. {
  11. title: '链路追踪',
  12. field: 'traceId'
  13. },
  14. {
  15. title: '用户编号',
  16. field: 'userId',
  17. isSearch: true
  18. },
  19. {
  20. title: '用户类型',
  21. field: 'userType',
  22. dictType: DICT_TYPE.USER_TYPE,
  23. dictClass: 'number',
  24. isSearch: true
  25. },
  26. {
  27. title: '应用名',
  28. field: 'applicationName',
  29. isSearch: true
  30. },
  31. {
  32. title: '请求方法名',
  33. field: 'requestMethod'
  34. },
  35. {
  36. title: '请求地址',
  37. field: 'requestUrl',
  38. isSearch: true
  39. },
  40. {
  41. title: '请求时间',
  42. field: 'beginTime',
  43. formatter: 'formatDate',
  44. search: {
  45. show: true,
  46. itemRender: {
  47. name: 'XDataTimePicker'
  48. }
  49. }
  50. },
  51. {
  52. title: '执行时长',
  53. field: 'duration',
  54. table: {
  55. slots: {
  56. default: 'duration_default'
  57. }
  58. }
  59. },
  60. {
  61. title: '操作结果',
  62. field: 'resultCode',
  63. isSearch: true,
  64. table: {
  65. slots: {
  66. default: 'resultCode_default'
  67. }
  68. }
  69. }
  70. ]
  71. })
  72. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)