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 |   64 +++++++++++++++++++------------
 1 files changed, 39 insertions(+), 25 deletions(-)

diff --git a/zy-asrs-flow/src/pages/system/operationRecord/index.jsx b/zy-asrs-flow/src/pages/system/operationRecord/index.jsx
index e78ec7c..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,
@@ -14,6 +14,17 @@
 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湪娣诲姞');
@@ -110,11 +121,10 @@
             width: 48,
         },
         {
-            title: '鍚嶇О绌洪棿',
+            title: '鎺ュ彛鍚�',
             dataIndex: 'namespace',
             valueType: 'text',
             hidden: false,
-            width: 140,
             copyable: true,
             filterDropdown: (props) => <TextFilter
                 name='namespace'
@@ -128,7 +138,7 @@
             dataIndex: 'url',
             valueType: 'text',
             hidden: false,
-            width: 140,
+            width: 180,
             filterDropdown: (props) => <TextFilter
                 name='url'
                 {...props}
@@ -141,7 +151,6 @@
             dataIndex: 'appkey',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <TextFilter
                 name='appkey'
                 {...props}
@@ -154,7 +163,6 @@
             dataIndex: 'timestamp',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <TextFilter
                 name='timestamp'
                 {...props}
@@ -167,7 +175,6 @@
             dataIndex: 'clientIp',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <TextFilter
                 name='clientIp'
                 {...props}
@@ -180,7 +187,6 @@
             dataIndex: 'request',
             valueType: 'text',
             hidden: false,
-            width: 140,
             ellipsis: true,
             copyable: true,
             filterDropdown: (props) => <TextFilter
@@ -195,7 +201,6 @@
             dataIndex: 'response',
             valueType: 'text',
             hidden: false,
-            width: 140,
             ellipsis: true,
             copyable: true,
             filterDropdown: (props) => <TextFilter
@@ -210,7 +215,6 @@
             dataIndex: 'spendTime',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <TextFilter
                 name='spendTime'
                 {...props}
@@ -218,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>
             }
         },
         {
@@ -226,7 +230,6 @@
             dataIndex: 'err',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <TextFilter
                 name='err'
                 {...props}
@@ -239,7 +242,7 @@
             dataIndex: 'result$',
             valueType: 'text',
             hidden: false,
-            width: 140,
+            width: 100,
             filterDropdown: (props) => <SelectFilter
                 name='result'
                 {...props}
@@ -250,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'
@@ -270,7 +276,6 @@
             dataIndex: 'createTime$',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <DatetimeRangeFilter
                 name='createTime'
                 {...props}
@@ -283,7 +288,6 @@
             dataIndex: 'memo',
             valueType: 'text',
             hidden: false,
-            width: 140,
             filterDropdown: (props) => <TextFilter
                 name='memo'
                 {...props}
@@ -295,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);
@@ -312,6 +317,7 @@
                     type="link"
                     danger
                     key="batchRemove"
+                    hidden="true"
                     onClick={async () => {
                         Modal.confirm({
                             title: '鍒犻櫎',
@@ -334,7 +340,11 @@
     ];
 
     return (
-        <PageContainer>
+        <PageContainer
+            header={{
+                breadcrumb: {},
+            }}
+        >
             <div style={{ width: '100%', float: 'right' }}>
                 <ProTable
                     key="operationRecord"
@@ -345,8 +355,11 @@
                     cardBordered
                     scroll={{ x: 1300 }}
                     dateFormatter="string"
-                    pagination={{ pageSize: 20 }}
+                    pagination={{ pageSize: 16 }}
                     search={false}
+                    style={{
+                        marginBottom: '20px'
+                    }}
                     toolbar={{
                         search: {
                             onSearch: (value) => {
@@ -368,6 +381,7 @@
                             <Button
                                 type="primary"
                                 key="save"
+                                hidden="true"
                                 onClick={async () => {
                                     setModalVisible(true)
                                 }}
@@ -395,15 +409,15 @@
                             }
                         })
                     }
-                    rowSelection={{
-                        onChange: (ids, rows) => {
-                            setSelectedRows(rows);
-                        }
-                    }}
+                    rowSelection={undefined}
                     columnsState={{
                         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) {
@@ -412,7 +426,7 @@
                 />
             </div>
 
-            {selectedRows?.length > 0 && (
+            {selectedRows?.length > 0 && false && (
                 <FooterToolbar
                     extra={
                         <div>

--
Gitblit v1.9.1