operatelog.data.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. import { reactive } from 'vue'
  2. import { DICT_TYPE } from '@/utils/dict'
  3. import { useI18n } from '@/hooks/web/useI18n'
  4. import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
  5. const { t } = useI18n() // 国际化
  6. const crudSchemas = reactive<CrudSchema[]>([
  7. {
  8. label: t('common.index'),
  9. field: 'id',
  10. type: 'index',
  11. form: {
  12. show: false
  13. }
  14. },
  15. {
  16. label: '操作模块',
  17. field: 'module',
  18. search: {
  19. show: true
  20. }
  21. },
  22. {
  23. label: '操作名',
  24. field: 'name'
  25. },
  26. {
  27. label: '操作类型',
  28. field: 'type',
  29. dictType: DICT_TYPE.SYSTEM_OPERATE_TYPE,
  30. search: {
  31. show: true
  32. }
  33. },
  34. {
  35. label: '请求方法名',
  36. field: 'requestMethod'
  37. },
  38. {
  39. label: '请求地址',
  40. field: 'requestUrl'
  41. },
  42. {
  43. label: '操作人员',
  44. field: 'userNickname',
  45. search: {
  46. show: true
  47. }
  48. },
  49. {
  50. label: '操作明细',
  51. field: 'content',
  52. table: {
  53. show: false
  54. }
  55. },
  56. {
  57. label: '用户 IP',
  58. field: 'userIp',
  59. table: {
  60. show: false
  61. }
  62. },
  63. {
  64. label: 'userAgent',
  65. field: 'userAgent'
  66. },
  67. {
  68. label: '操作结果',
  69. field: 'resultCode',
  70. search: {
  71. show: true,
  72. component: 'Select',
  73. componentProps: {
  74. options: [
  75. { label: '成功', value: true },
  76. { label: '失败', value: false }
  77. ]
  78. }
  79. }
  80. },
  81. {
  82. label: '操作日期',
  83. field: 'startTime',
  84. form: {
  85. show: false
  86. },
  87. search: {
  88. show: true,
  89. component: 'DatePicker',
  90. componentProps: {
  91. type: 'datetimerange',
  92. valueFormat: 'YYYY-MM-DD HH:mm:ss'
  93. }
  94. }
  95. },
  96. {
  97. label: '执行时长',
  98. field: 'duration'
  99. },
  100. {
  101. label: t('table.action'),
  102. field: 'action',
  103. width: '120px',
  104. form: {
  105. show: false
  106. },
  107. detail: {
  108. show: false
  109. }
  110. }
  111. ])
  112. export const { allSchemas } = useCrudSchemas(crudSchemas)