apiAccessLog.data.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. isTable: false
  14. },
  15. {
  16. title: '用户编号',
  17. field: 'userId',
  18. isSearch: true
  19. },
  20. {
  21. title: '用户类型',
  22. field: 'userType',
  23. dictType: DICT_TYPE.USER_TYPE,
  24. dictClass: 'number',
  25. isSearch: true
  26. },
  27. {
  28. title: '应用名',
  29. field: 'applicationName',
  30. isSearch: true
  31. },
  32. {
  33. title: '请求方法名',
  34. field: 'requestMethod'
  35. },
  36. {
  37. title: '请求地址',
  38. field: 'requestUrl',
  39. isSearch: true
  40. },
  41. {
  42. title: '请求时间',
  43. field: 'beginTime',
  44. formatter: 'formatDate',
  45. search: {
  46. show: true,
  47. itemRender: {
  48. name: 'XDataTimePicker'
  49. }
  50. }
  51. },
  52. {
  53. title: '执行时长',
  54. field: 'duration',
  55. table: {
  56. slots: {
  57. default: 'duration_default'
  58. }
  59. }
  60. },
  61. {
  62. title: '操作结果',
  63. field: 'resultCode',
  64. isSearch: true,
  65. table: {
  66. slots: {
  67. default: 'resultCode_default'
  68. }
  69. }
  70. }
  71. ]
  72. })
  73. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)