From 03df7542cd456dc3e63a33cdd1f4cced5364f867 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 27 二月 2024 13:27:17 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/system/operationRecord/index.jsx |   69 +++++++++++++++++++++-------------
 1 files changed, 43 insertions(+), 26 deletions(-)

diff --git a/zy-asrs-flow/src/pages/system/operationRecord/index.jsx b/zy-asrs-flow/src/pages/system/operationRecord/index.jsx
index d4f8d2b..2ae088a 100644
--- a/zy-asrs-flow/src/pages/system/operationRecord/index.jsx
+++ b/zy-asrs-flow/src/pages/system/operationRecord/index.jsx
@@ -1,6 +1,6 @@
 
 import React, { useState, useRef, useEffect } from 'react';
-import { Button, message, Modal, Tooltip } from 'antd';
+import { Button, message, Modal, Tag } from 'antd';
 import {
     FooterToolbar,
     PageContainer,
@@ -11,6 +11,20 @@
 import Http from '@/utils/http';
 import Edit from './components/edit'
 import { TextFilter, SelectFilter, DatetimeRangeFilter, LinkFilter } from '@/components/TableSearch'
+import { repairBug } from '@/utils/common-util';
+
+const TABLE_KEY = "pro-table-operationRecord";
+
+const resultMap = {
+    0: {
+        color: '#cd201f',
+        text: '澶辫触',
+    },
+    1: {
+        color: '#3b5999',
+        text: '鎴愬姛',
+    },
+};
 
 const handleSave = async (val) => {
     const hide = message.loading('姝e湪娣诲姞');
@@ -107,11 +121,10 @@
             width: 48,
         },
         {
-            title: '鍚嶇О绌洪棿',
+            title: '鎺ュ彛鍚�',
             dataIndex: 'namespace',
             valueType: 'text',
             hidden: false,
-            width: 140,
             copyable: true,
             filterDropdown: (props) => <TextFilter
                 name='namespace'
@@ -125,7 +138,7 @@
             dataIndex: 'url',
             valueType: 'text',
             hidden: false,
-            width: 140,
+            width: 180,
             filterDropdown: (props) => <TextFilter
                 name='url'
                 {...props}
@@ -138,7 +151,6 @@
             dataIndex: 'appkey',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <TextFilter
                 name='appkey'
                 {...props}
@@ -151,7 +163,6 @@
             dataIndex: 'timestamp',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <TextFilter
                 name='timestamp'
                 {...props}
@@ -164,7 +175,6 @@
             dataIndex: 'clientIp',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <TextFilter
                 name='clientIp'
                 {...props}
@@ -177,7 +187,6 @@
             dataIndex: 'request',
             valueType: 'text',
             hidden: false,
-            width: 140,
             ellipsis: true,
             copyable: true,
             filterDropdown: (props) => <TextFilter
@@ -192,7 +201,6 @@
             dataIndex: 'response',
             valueType: 'text',
             hidden: false,
-            width: 140,
             ellipsis: true,
             copyable: true,
             filterDropdown: (props) => <TextFilter
@@ -207,7 +215,6 @@
             dataIndex: 'spendTime',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <TextFilter
                 name='spendTime'
                 {...props}
@@ -215,7 +222,7 @@
                 setSearchParam={setSearchParam}
             />,
             render: (_, record) => {
-                return <span><span style={{fontWeight:'bold'}}>{_}</span><span> ms</span></span>
+                return <span><span style={{ fontWeight: 'bold' }}>{_}</span><span> ms</span></span>
             }
         },
         {
@@ -223,7 +230,6 @@
             dataIndex: 'err',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <TextFilter
                 name='err'
                 {...props}
@@ -236,7 +242,7 @@
             dataIndex: 'result$',
             valueType: 'text',
             hidden: false,
-            width: 140,
+            width: 100,
             filterDropdown: (props) => <SelectFilter
                 name='result'
                 {...props}
@@ -247,13 +253,16 @@
                     { label: '澶辫触', value: 0 },
                 ]}
             />,
+            render: (_, record) => {
+                const result = resultMap[record.result]
+                return <Tag color={result.color}>{result.text}</Tag>
+            },
         },
         {
             title: '鐢ㄦ埛',
             dataIndex: 'userId$',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <LinkFilter
                 name='userId'
                 major='user'
@@ -267,7 +276,6 @@
             dataIndex: 'createTime$',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <DatetimeRangeFilter
                 name='createTime'
                 {...props}
@@ -280,7 +288,6 @@
             dataIndex: 'memo',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <TextFilter
                 name='memo'
                 {...props}
@@ -292,12 +299,13 @@
         {
             title: '鎿嶄綔',
             dataIndex: 'option',
-            width: 140,
             valueType: 'option',
+            hidden: true,
             render: (_, record) => [
                 <Button
                     type="link"
                     key="edit"
+                    hidden="true"
                     onClick={() => {
                         setModalVisible(true);
                         setCurrentRow(record);
@@ -309,6 +317,7 @@
                     type="link"
                     danger
                     key="batchRemove"
+                    hidden="true"
                     onClick={async () => {
                         Modal.confirm({
                             title: '鍒犻櫎',
@@ -331,7 +340,11 @@
     ];
 
     return (
-        <PageContainer>
+        <PageContainer
+            header={{
+                breadcrumb: {},
+            }}
+        >
             <div style={{ width: '100%', float: 'right' }}>
                 <ProTable
                     key="operationRecord"
@@ -342,8 +355,11 @@
                     cardBordered
                     scroll={{ x: 1300 }}
                     dateFormatter="string"
-                    pagination={{ pageSize: 20 }}
+                    pagination={{ pageSize: 16 }}
                     search={false}
+                    style={{
+                        marginBottom: '20px'
+                    }}
                     toolbar={{
                         search: {
                             onSearch: (value) => {
@@ -365,6 +381,7 @@
                             <Button
                                 type="primary"
                                 key="save"
+                                hidden="true"
                                 onClick={async () => {
                                     setModalVisible(true)
                                 }}
@@ -392,15 +409,15 @@
                             }
                         })
                     }
-                    rowSelection={{
-                        onChange: (ids, rows) => {
-                            setSelectedRows(rows);
-                        }
-                    }}
+                    rowSelection={undefined}
                     columnsState={{
-                        persistenceKey: 'pro-table-operationRecord',
+                        persistenceKey: TABLE_KEY,
                         persistenceType: 'localStorage',
                         defaultValue: {
+                            appkey: { show: repairBug(TABLE_KEY, 'appkey', false) },
+                            err: { show: repairBug(TABLE_KEY, 'err', false) },
+                            timestamp: { show: repairBug(TABLE_KEY, 'timestamp', false) },
+                            memo: { show: repairBug(TABLE_KEY, 'memo', false) },
                             option: { fixed: 'right', disable: true },
                         },
                         onChange(value) {
@@ -409,7 +426,7 @@
                 />
             </div>
 
-            {selectedRows?.length > 0 && (
+            {selectedRows?.length > 0 && false && (
                 <FooterToolbar
                     extra={
                         <div>

--
Gitblit v1.9.1