log.data.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. import { BasicColumn, FormSchema } from '/@/components/Table';
  2. export const columns: BasicColumn[] = [
  3. {
  4. title: '日志内容',
  5. dataIndex: 'logContent',
  6. width: 100,
  7. align: 'left',
  8. },
  9. {
  10. title: '操作人ID',
  11. dataIndex: 'userid',
  12. width: 80,
  13. },
  14. {
  15. title: '操作人',
  16. dataIndex: 'username',
  17. width: 80,
  18. },
  19. {
  20. title: 'IP',
  21. dataIndex: 'ip',
  22. width: 80,
  23. },
  24. {
  25. title: '耗时(毫秒)',
  26. dataIndex: 'costTime',
  27. width: 80,
  28. },
  29. {
  30. title: '创建时间',
  31. dataIndex: 'createTime',
  32. sorter: true,
  33. width: 80,
  34. },
  35. {
  36. title: '客户端类型',
  37. dataIndex: 'clientType_dictText',
  38. width: 60,
  39. },
  40. ];
  41. /**
  42. * 操作日志需要操作类型
  43. */
  44. export const operationLogColumn: BasicColumn[] = [
  45. ...columns,
  46. {
  47. title: '操作类型',
  48. dataIndex: 'operateType_dictText',
  49. width: 40,
  50. },
  51. ];
  52. export const exceptionColumns: BasicColumn[] = [
  53. {
  54. title: '异常标题',
  55. dataIndex: 'logContent',
  56. width: 100,
  57. align: 'left',
  58. },
  59. {
  60. title: '请求地址',
  61. dataIndex: 'requestUrl',
  62. width: 100,
  63. },
  64. {
  65. title: '请求参数',
  66. dataIndex: 'method',
  67. width: 60,
  68. },
  69. {
  70. title: '操作人',
  71. dataIndex: 'username',
  72. width: 60,
  73. customRender: ({ record }) => {
  74. let pname = record.username;
  75. let pid = record.userid;
  76. if(!pname && !pid){
  77. return "";
  78. }
  79. return pname + " (账号: "+ pid + " )";
  80. },
  81. },
  82. {
  83. title: 'IP',
  84. dataIndex: 'ip',
  85. width: 60,
  86. },
  87. {
  88. title: '创建时间',
  89. dataIndex: 'createTime',
  90. sorter: true,
  91. width: 60,
  92. },
  93. {
  94. title: '客户端类型',
  95. dataIndex: 'clientType_dictText',
  96. width: 60,
  97. },
  98. ];
  99. export const searchFormSchema: FormSchema[] = [
  100. {
  101. field: 'keyWord',
  102. label: '搜索日志',
  103. component: 'Input',
  104. colProps: { span: 8 },
  105. },
  106. {
  107. field: 'fieldTime',
  108. component: 'RangePicker',
  109. label: '创建时间',
  110. componentProps: {
  111. valueType: 'Date',
  112. },
  113. colProps: {
  114. span: 6,
  115. },
  116. },
  117. ];
  118. export const operationSearchFormSchema: FormSchema[] = [
  119. ...searchFormSchema,
  120. {
  121. field: 'operateType',
  122. label: '操作类型',
  123. component: 'JDictSelectTag',
  124. colProps: { span: 4 },
  125. componentProps: {
  126. dictCode: 'operate_type',
  127. },
  128. },
  129. ];