From 8bd64cd6a3f8721c2b1eb4075e61a1d3381e4aa8 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 10 九月 2024 16:09:03 +0800
Subject: [PATCH] #
---
zy-acs-flow/src/page/operationRecord/rowSx.jsx | 2 +-
zy-acs-flow/src/page/operationRecord/OperationDetail.jsx | 28 ++++++++++++++++++++++++++++
zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx | 10 +++++++++-
3 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/zy-acs-flow/src/page/operationRecord/OperationDetail.jsx b/zy-acs-flow/src/page/operationRecord/OperationDetail.jsx
new file mode 100644
index 0000000..c0b92b1
--- /dev/null
+++ b/zy-acs-flow/src/page/operationRecord/OperationDetail.jsx
@@ -0,0 +1,28 @@
+import * as React from 'react';
+import {
+ EditBase,
+ useTranslate,
+ TextInput,
+ SimpleForm,
+ DateField,
+ Labeled,
+} from 'react-admin';
+import { Box, Grid, Stack, IconButton, Typography, Card, CardContent, TextField } from '@mui/material';
+import CloseIcon from '@mui/icons-material/Close';
+
+const OperationDetail = (props) => {
+ const { operation, setDrawerVal, ...rest } = props;
+ console.log(operation);
+
+ return (
+ <>
+ <Card>
+ <CardContent>
+ <TextField value={JSON.stringify(operation)} maxRows={15} multiline />
+ </CardContent>
+ </Card>
+ </>
+ )
+}
+
+export default OperationDetail;
\ No newline at end of file
diff --git a/zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx b/zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx
index cb0d505..022adaf 100644
--- a/zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx
+++ b/zy-acs-flow/src/page/operationRecord/OperationRecordList.jsx
@@ -42,6 +42,7 @@
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': {
@@ -133,7 +134,10 @@
<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)}
>
@@ -162,6 +166,10 @@
drawerVal={drawerVal}
setDrawerVal={setDrawerVal}
>
+ <OperationDetail
+ operation={drawerVal}
+ setDrawerVal={setDrawerVal}
+ />
</PageDrawer>
</Box>
)
diff --git a/zy-acs-flow/src/page/operationRecord/rowSx.jsx b/zy-acs-flow/src/page/operationRecord/rowSx.jsx
index 38587fc..b346e52 100644
--- a/zy-acs-flow/src/page/operationRecord/rowSx.jsx
+++ b/zy-acs-flow/src/page/operationRecord/rowSx.jsx
@@ -7,7 +7,7 @@
if (!record) {
return style;
}
- if (selectedRow && selectedRow === record.id) {
+ if (selectedRow && selectedRow.id === record.id) {
style = {
...style,
backgroundColor: 'action.selected',
--
Gitblit v1.9.1