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 | 74 ++++++++++++++++++++++++------------
1 files changed, 49 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 50537cc..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 } 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,8 @@
dataIndex: 'request',
valueType: 'text',
hidden: false,
- width: 140,
+ ellipsis: true,
+ copyable: true,
filterDropdown: (props) => <TextFilter
name='request'
{...props}
@@ -190,7 +201,8 @@
dataIndex: 'response',
valueType: 'text',
hidden: false,
- width: 140,
+ ellipsis: true,
+ copyable: true,
filterDropdown: (props) => <TextFilter
name='response'
{...props}
@@ -203,20 +215,21 @@
dataIndex: 'spendTime',
valueType: 'text',
hidden: false,
- width: 140,
filterDropdown: (props) => <TextFilter
name='spendTime'
{...props}
actionRef={actionRef}
setSearchParam={setSearchParam}
/>,
+ render: (_, record) => {
+ return <span><span style={{ fontWeight: 'bold' }}>{_}</span><span> ms</span></span>
+ }
},
{
title: '寮傚父鍐呭',
dataIndex: 'err',
valueType: 'text',
hidden: false,
- width: 140,
filterDropdown: (props) => <TextFilter
name='err'
{...props}
@@ -229,7 +242,7 @@
dataIndex: 'result$',
valueType: 'text',
hidden: false,
- width: 140,
+ width: 100,
filterDropdown: (props) => <SelectFilter
name='result'
{...props}
@@ -240,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'
@@ -260,7 +276,6 @@
dataIndex: 'createTime$',
valueType: 'text',
hidden: false,
- width: 140,
filterDropdown: (props) => <DatetimeRangeFilter
name='createTime'
{...props}
@@ -273,7 +288,6 @@
dataIndex: 'memo',
valueType: 'text',
hidden: false,
- width: 140,
filterDropdown: (props) => <TextFilter
name='memo'
{...props}
@@ -285,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);
@@ -302,6 +317,7 @@
type="link"
danger
key="batchRemove"
+ hidden="true"
onClick={async () => {
Modal.confirm({
title: '鍒犻櫎',
@@ -324,7 +340,11 @@
];
return (
- <PageContainer>
+ <PageContainer
+ header={{
+ breadcrumb: {},
+ }}
+ >
<div style={{ width: '100%', float: 'right' }}>
<ProTable
key="operationRecord"
@@ -335,8 +355,11 @@
cardBordered
scroll={{ x: 1300 }}
dateFormatter="string"
- pagination={{ pageSize: 20 }}
+ pagination={{ pageSize: 16 }}
search={false}
+ style={{
+ marginBottom: '20px'
+ }}
toolbar={{
search: {
onSearch: (value) => {
@@ -358,6 +381,7 @@
<Button
type="primary"
key="save"
+ hidden="true"
onClick={async () => {
setModalVisible(true)
}}
@@ -385,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) {
@@ -402,7 +426,7 @@
/>
</div>
- {selectedRows?.length > 0 && (
+ {selectedRows?.length > 0 && false && (
<FooterToolbar
extra={
<div>
--
Gitblit v1.9.1