index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <div class="table-box">
  3. <ProTable ref="proTable" :columns="columns" row-key="operId" :request-api="listOperlogApi" :init-param="initParam"> </ProTable>
  4. </div>
  5. </template>
  6. <script setup lang="tsx" name="Operog">
  7. import ProTable from '@/components/ProTable/index.vue'
  8. import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
  9. import { listOperlogApi } from '@/api/modules/monitor/operlog'
  10. // ProTable 实例
  11. const proTable = ref<ProTableInstance>()
  12. // 如果表格需要初始化请求参数,直接定义传给 ProTable (之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据)
  13. const initParam = reactive({ type: 1 })
  14. // 表格配置项
  15. const columns = reactive<ColumnProps<any>[]>([
  16. { prop: 'operId', label: '日志主键' },
  17. {
  18. prop: 'title',
  19. label: '模块标题',
  20. search: {
  21. el: 'input'
  22. }
  23. },
  24. {
  25. prop: 'businessType',
  26. label: '业务类型',
  27. search: {
  28. el: 'input'
  29. }
  30. },
  31. {
  32. prop: 'method',
  33. label: '方法名称',
  34. search: {
  35. el: 'input'
  36. }
  37. },
  38. {
  39. prop: 'requestMethod',
  40. label: '请求方式',
  41. search: {
  42. el: 'input'
  43. }
  44. },
  45. {
  46. prop: 'operatorType',
  47. label: '操作类别',
  48. search: {
  49. el: 'input'
  50. }
  51. },
  52. {
  53. prop: 'operName',
  54. label: '操作人员',
  55. search: {
  56. el: 'input'
  57. }
  58. },
  59. {
  60. prop: 'deptName',
  61. label: '部门名称',
  62. search: {
  63. el: 'input'
  64. }
  65. },
  66. {
  67. prop: 'operUrl',
  68. label: '请求URL',
  69. search: {
  70. el: 'input'
  71. }
  72. },
  73. {
  74. prop: 'operIp',
  75. label: '主机地址',
  76. search: {
  77. el: 'input'
  78. }
  79. },
  80. {
  81. prop: 'operLocation',
  82. label: '操作地点',
  83. search: {
  84. el: 'input'
  85. }
  86. },
  87. {
  88. prop: 'operParam',
  89. label: '请求参数',
  90. search: {
  91. el: 'input'
  92. }
  93. },
  94. {
  95. prop: 'jsonResult',
  96. label: '返回参数',
  97. search: {
  98. el: 'input'
  99. }
  100. },
  101. {
  102. prop: 'status',
  103. label: '操作状态',
  104. search: {
  105. el: 'input'
  106. }
  107. },
  108. {
  109. prop: 'errorMsg',
  110. label: '错误消息',
  111. search: {
  112. el: 'input'
  113. }
  114. },
  115. {
  116. prop: 'operTime',
  117. label: '操作时间',
  118. search: {
  119. el: 'date-picker',
  120. props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
  121. }
  122. },
  123. {
  124. prop: 'costTime',
  125. label: '消耗时间',
  126. search: {
  127. el: 'input'
  128. }
  129. }
  130. ])
  131. </script>