From 0114b079a32f03f69dfcd4d77ed89b54694126e2 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期日, 29 九月 2024 16:25:03 +0800
Subject: [PATCH] #
---
zy-acs-flow/src/page/action/Action.jsx | 71 +++++++++++++++++++++++------------
1 files changed, 47 insertions(+), 24 deletions(-)
diff --git a/zy-acs-flow/src/page/action/Action.jsx b/zy-acs-flow/src/page/action/Action.jsx
index 4a485b4..50f36e1 100644
--- a/zy-acs-flow/src/page/action/Action.jsx
+++ b/zy-acs-flow/src/page/action/Action.jsx
@@ -3,25 +3,26 @@
Form,
ReferenceField,
useNotify,
- useResourceContext,
+ useTheme,
useTranslate,
} from 'react-admin';
import {
Box,
- Button,
+ Divider,
Stack,
Tooltip,
Typography,
Avatar,
} from '@mui/material';
-import { format } from 'date-fns';
+import { format, formatRelative } from 'date-fns';
import { blueGrey } from '@mui/material/colors';
export const Action = ({ data }) => {
const notify = useNotify();
const translate = useTranslate();
-
+ const theme = useTheme();
const [isHover, setHover] = useState(false);
+ // console.log(data);
return (
<Box
@@ -32,15 +33,15 @@
<Stack direction="row" spacing={1} alignItems="center" width="100%">
<Avatar
sx={{
- width: 30,
- height: 30,
- bgcolor: blueGrey[500],
+ width: 20,
+ height: 20,
+ fontSize: '.9rem'
}}
>
{data.priority}
</Avatar>
<Typography color="text.secondary" variant="body2">
- {data.name}
+ {data.actionType$}
</Typography>
<Box flex={1}></Box>
<Typography
@@ -48,10 +49,13 @@
variant="body2"
component="span"
>
- {format(data.ioTime, 'yyyy-MM-dd HH:mm:ss') || '-'}
+ {/* {formatRelative(new Date(data.ioTime), new Date())} */}
+ {/* {format(data.ioTime, 'yyyy-MM-dd HH:mm:ss') || '-'} */}
+ No.{data.uuid}
</Typography>
</Stack>
<Stack
+ direction="row"
sx={{
paddingTop: '0.5em',
display: 'flex',
@@ -60,21 +64,40 @@
},
}}
>
- {/* {note.text
- ?.split('\n')
- .map((paragraph: string, index: number) => (
- <Typography
- component="p"
- variant="body2"
- lineHeight={1.5}
- margin={0}
- key={index}
- >
- {paragraph}
- </Typography>
- ))}
-
- {note.attachments && <NoteAttachments note={note} />} */}
+ <Typography
+ variant="body2"
+ color="textSecondary"
+ >
+ code: {data.code || '-'}
+ </Typography>
+ <Divider orientation="vertical" flexItem sx={{ marginX: 1 }} />
+ <Typography
+ variant="body2"
+ color="textSecondary"
+ >
+ task: {data.taskId$ || '-'}
+ </Typography>
+ <Divider orientation="vertical" flexItem sx={{ marginX: 1 }} />
+ <Typography
+ variant="body2"
+ color="textSecondary"
+ >
+ status: {data.actionSts$ || '-'}
+ </Typography>
+ <Divider orientation="vertical" flexItem sx={{ marginX: 1 }} />
+ <Typography
+ variant="body2"
+ color="textSecondary"
+ >
+ val: {data.val || '-'}
+ </Typography>
+ <Divider orientation="vertical" flexItem sx={{ marginX: 1 }} />
+ <Typography
+ variant="body2"
+ color="textSecondary"
+ >
+ param: {data.param || '-'}
+ </Typography>
</Stack>
</Box>
);
--
Gitblit v1.9.1