فهرست منبع

update: gs实时回传 gs错误日志关闭重试

xyh 2 سال پیش
والد
کامیت
c11a1cbce6

+ 19 - 19
packages/app/src/apis/semiManufactures.ts

@@ -63,16 +63,16 @@ export async function semiManufacturesAdd(
 
   // 成功后触发成功回传
   // 触发向gs回调接口
-  // if (result.msg === '200' && ENABLED_GS) {
-  //   const {realName} = userStore.getState();
+  if (result.msg === '200' && ENABLED_GS) {
+    const {realName} = userStore.getState();
 
-  //   request({
-  //     method: 'GET',
-  //     url: '/gsPlugOut/CreateGRReqInStock',
-  //     data: {removalCode: result.data, realName: realName ?? '李兆峰'},
-  //     skipError: true,
-  //   });
-  // }
+    request({
+      method: 'GET',
+      url: '/gsPlugOut/CreateGRReqInStock',
+      data: {removalCode: result.data, realName: realName ?? '李兆峰'},
+      skipError: true,
+    });
+  }
 
   return result;
 }
@@ -89,16 +89,16 @@ export async function semiManufacturesOut(
 
   // 成功后触发成功回传
   // 触发向gs回调接口
-  // if (result.msg === '200' && ENABLED_GS) {
-  //   const {realName} = userStore.getState();
-
-  //   request({
-  //     method: 'GET',
-  //     url: '/gsPlugOut/plugOutRemoval',
-  //     data: {removalCode: result.data, realName: realName ?? '李兆峰'},
-  //     skipError: true,
-  //   });
-  // }
+  if (result.msg === '200' && ENABLED_GS) {
+    const {realName} = userStore.getState();
+
+    request({
+      method: 'GET',
+      url: '/gsPlugOut/plugOutRemoval',
+      data: {removalCode: result.data, realName: realName ?? '李兆峰'},
+      skipError: true,
+    });
+  }
 
   return result;
 }

+ 2 - 2
packages/app/src/hooks/use-table-row-select/index.tsx

@@ -7,7 +7,7 @@ import {useCallback, useEffect, useState} from 'react';
 
 export function useTableRowSelect<T extends Record<string, unknown>>(
   data: T[],
-  fn: (params: string[]) => BaseResult,
+  fn: (params: string) => BaseResult,
   options: {
     label: string;
     refetch: () => void;
@@ -48,7 +48,7 @@ export function useTableRowSelect<T extends Record<string, unknown>>(
       deleteConfirm(
         label,
         function() {
-          mutate(params);
+          mutate(params.join(','));
         },
         {
           title: `${label}批量删除`,

+ 17 - 3
packages/app/src/pages/gs-error-log/table/index.tsx

@@ -9,11 +9,26 @@ import {context, pageContext, searchContext} from '../context';
 import {exportGSErrorInterface, getGSErrorInterface} from '@apis';
 import {Card} from 'antd';
 import {Table, TableTools} from '@components';
-import {useColumns} from './hooks';
+import {ColumnsType} from 'antd/es/table';
+import {GSErrorListData} from '@models';
+import {
+  NORMAL_TABLE_WIDTH,
+  HUGE_TABLE_WIDTH,
+  SMALL_TABLE_WIDTH,
+  MIDDLE_TABLE_WIDTH,
+} from '@utils';
+
+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},
+];
 
 const TableList: FC = function() {
   const params = useContextSection(context, state => state[0]);
-  const [{data, count}, {refetch}] = useQueryTableList({
+  const [{data, count}] = useQueryTableList({
     queryFn: getGSErrorInterface,
     params,
     pageContext,
@@ -24,7 +39,6 @@ const TableList: FC = function() {
     context,
     fn: exportGSErrorInterface,
   });
-  const columns = useColumns(refetch);
 
   return (
     <Card className="table-wrapper">