operatelog.data.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import { reactive } from 'vue'
  2. import { DICT_TYPE } from '@/utils/dict'
  3. import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
  4. const crudSchemas = reactive<VxeCrudSchema>({
  5. primaryKey: 'id',
  6. primaryType: 'seq',
  7. action: true,
  8. actionWidth: '80px',
  9. columns: [
  10. {
  11. title: '操作模块',
  12. field: 'module',
  13. isSearch: true
  14. },
  15. {
  16. title: '操作名',
  17. field: 'name'
  18. },
  19. {
  20. title: '操作类型',
  21. field: 'type',
  22. dictType: DICT_TYPE.SYSTEM_OPERATE_TYPE,
  23. isSearch: true
  24. },
  25. {
  26. title: '请求方法名',
  27. field: 'requestMethod'
  28. },
  29. {
  30. title: '请求地址',
  31. field: 'requestUrl'
  32. },
  33. {
  34. title: '操作人员',
  35. field: 'userNickname',
  36. isSearch: true
  37. },
  38. {
  39. title: '操作明细',
  40. field: 'content',
  41. isTable: false
  42. },
  43. {
  44. title: '用户 IP',
  45. field: 'userIp',
  46. isTable: false
  47. },
  48. {
  49. title: 'userAgent',
  50. field: 'userAgent'
  51. },
  52. {
  53. title: '操作结果',
  54. field: 'resultCode',
  55. table: {
  56. slots: {
  57. default: 'resultCode'
  58. }
  59. }
  60. },
  61. {
  62. title: '操作日期',
  63. field: 'startTime',
  64. formatter: 'formatDate',
  65. isForm: false,
  66. search: {
  67. itemRender: {
  68. name: 'XDataTimePicker'
  69. }
  70. }
  71. },
  72. {
  73. title: '执行时长',
  74. field: 'duration',
  75. table: {
  76. slots: {
  77. default: 'duration'
  78. }
  79. }
  80. }
  81. ]
  82. })
  83. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)