瀏覽代碼

feat: gs错误日志增加请求类型和对应查询

xyh 2 年之前
父節點
當前提交
6ce6a1f155

+ 2 - 0
packages/app/src/models/request/gs.ts

@@ -211,4 +211,6 @@ export type ReSendErrorParams = {
   errorInfo: string;
   /** 数据 */
   dataVal: string;
+  /** 请求类型 */
+  type: string;
 };

+ 2 - 0
packages/app/src/models/request/queryList.ts

@@ -164,4 +164,6 @@ export type GetGSErrorLogListParams = {
   errorInfo: string;
   /** 内容 */
   dataVal: string;
+  /** 请求类型 */
+  type: string;
 } & ListParams;

+ 2 - 0
packages/app/src/models/response/queryList.ts

@@ -330,4 +330,6 @@ export type GSErrorListData = {
   scrq: string;
   /** 是否重传 1未重传 0重传 */
   transmissionType: 0 | 1;
+  /** 请求类型 */
+  type: string;
 };

+ 1 - 0
packages/app/src/pages/gs-error-log/context.ts

@@ -13,5 +13,6 @@ export const contextState: OriginalListParams<GetGSErrorLogListParams> = {
   url: '',
   errorInfo: '',
   dataVal: '',
+  type: '',
 };
 export const context = createTableSearchContext(contextState);

+ 7 - 0
packages/app/src/pages/gs-error-log/filter/index.tsx

@@ -20,6 +20,7 @@ const Filter: FC = function () {
       url: '',
       errorInfo: '',
       dataVal: '',
+      type: '',
     },
     true,
   );
@@ -60,6 +61,12 @@ const Filter: FC = function () {
           onChange={onChange('dataVal')}
           name='dataVal'
         />
+        <FilterField
+          value={fields.type}
+          onChange={onChange('type')}
+          label='请求类型'
+          name='type'
+        />
         <FilterDatePicker
           value={dates}
           onChange={onDatesChange}

+ 8 - 1
packages/app/src/pages/gs-error-log/table/hooks.tsx

@@ -1,7 +1,12 @@
 import {retryErrorInterface} from '@apis';
 import {GSErrorListData} from '@models';
 import {useMutation} from '@tanstack/react-query';
-import {NORMAL_TABLE_WIDTH, HUGE_TABLE_WIDTH, SMALL_TABLE_WIDTH} from '@utils';
+import {
+  NORMAL_TABLE_WIDTH,
+  HUGE_TABLE_WIDTH,
+  SMALL_TABLE_WIDTH,
+  MIDDLE_TABLE_WIDTH,
+} from '@utils';
 import {Button, message} from 'antd';
 import {ColumnsType} from 'antd/es/table';
 import {useState} from 'react';
@@ -10,6 +15,8 @@ const columns: ColumnsType<GSErrorListData> = [
   {title: '请求地址', dataIndex: 'url', width: NORMAL_TABLE_WIDTH},
   {title: '错误信息', dataIndex: 'errorInfo', width: HUGE_TABLE_WIDTH},
   {title: '请求内容', dataIndex: 'dataVal', width: HUGE_TABLE_WIDTH},
+  {title: '请求类型', dataIndex: 'type', width: SMALL_TABLE_WIDTH},
+  {title: '请求时间', dataIndex: 'scrq', width: MIDDLE_TABLE_WIDTH},
 ];
 
 function useRetry(refetch: () => void) {