From 7f70cb15d035f0c233b9e62b9e43aa985317c908 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 04 十一月 2024 10:22:45 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx b/zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx
index cb0d505..940424a 100644
--- a/zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx
+++ b/zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx
@@ -38,10 +38,11 @@
 import MyExportButton from '../components/MyExportButton';
 import PageDrawer from "../components/PageDrawer";
 import MyField from "../components/MyField";
-import { PAGE_DRAWER_WIDTH, OPERATE_MODE } from '@/config/setting';
+import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
 import * as Common from '@/utils/common';
 import rowSx from './rowSx';
 import { format } from 'date-fns';
+import OperationDetail from './OperationDetail'
 
 const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
     '& .css-1vooibu-MuiSvgIcon-root': {
@@ -49,6 +50,12 @@
     },
     '& .RaDatagrid-row': {
         cursor: 'auto'
+    },
+    '& .column-url': {
+        maxWidth: '16em',
+        overflow: 'hidden',
+        textOverflow: 'ellipsis',
+        whiteSpace: 'nowrap',
     },
     '& .column-request': {
         maxWidth: '18em',
@@ -94,7 +101,7 @@
         ]}
     />,
     <ReferenceInput source="userId" reference="user">
-        <AutocompleteInput label="table.field.operationRecord.userId" optionText="nickname" />
+        <AutocompleteInput label="table.field.operationRecord.userId" optionText="nickname" filterToQuery={(val) => ({ nickname: val })} />
     </ReferenceInput>,
 
     <TextInput label="common.field.memo" source="memo" />,
@@ -128,12 +135,15 @@
                         <MyExportButton />
                     </TopToolbar>
                 )}
-                perPage={25}
+                perPage={DEFAULT_PAGE_SIZE}
             >
                 <StyledDatagrid
                     preferenceKey='operationRecord'
                     bulkActionButtons={false}
-                    rowClick={(id, resource, record) => false}
+                    rowClick={(id, resource, record) => {
+                        setDrawerVal(!!drawerVal && drawerVal === record ? null : record);
+                        return false;
+                    }}
                     omit={['appkey', 'statusBool', 'err', 'updateTime', 'createTime', 'memo']}
                     rowSx={rowSx(drawerVal || null)}
                 >
@@ -146,8 +156,8 @@
                     <TextField source="appkey" label="table.field.operationRecord.appkey" />
                     <FormattedTimestampField source="timestamp" label="table.field.operationRecord.timestamp" />
                     <NumberField source="spendTime" label="table.field.operationRecord.spendTime" sx={{ fontWeight: 'bold' }} />
-                    <TextField source="request" label="table.field.operationRecord.request" sortable={false} />
-                    <TextField source="response" label="table.field.operationRecord.response" sortable={false} />
+                    <TextField source="request" label="table.field.operationRecord.request" sortable={false} hidden={!!drawerVal} />
+                    <TextField source="response" label="table.field.operationRecord.response" sortable={false} hidden={!!drawerVal} />
                     <ResultField source="result" label="table.field.operationRecord.result" />
                     <TextField source="err" label="table.field.operationRecord.err" />
                     <TextField source="clientIp" label="table.field.operationRecord.clientIp" />
@@ -162,6 +172,9 @@
                 drawerVal={drawerVal}
                 setDrawerVal={setDrawerVal}
             >
+                <OperationDetail
+                    operation={drawerVal}
+                />
             </PageDrawer>
         </Box>
     )

--
Gitblit v1.9.1