From af964f7921ec8480d5bd05950dc4043a9154ab6b Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期一, 11 八月 2025 14:03:50 +0800 Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop --- rsf-admin/src/page/dashboard/NbCard.jsx | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 107 insertions(+), 0 deletions(-) diff --git a/rsf-admin/src/page/dashboard/NbCard.jsx b/rsf-admin/src/page/dashboard/NbCard.jsx new file mode 100644 index 0000000..eb22c20 --- /dev/null +++ b/rsf-admin/src/page/dashboard/NbCard.jsx @@ -0,0 +1,107 @@ +import * as React from 'react'; +import { + Avatar, + Box, + Button, + List, + ListItem, + ListItemAvatar, + ListItemButton, + ListItemText, +} from '@mui/material'; +import CommentIcon from '@mui/icons-material/Comment'; +import { Link } from 'react-router-dom'; +import { + ReferenceField, + FunctionField, + useGetList, + useTranslate, + useIsDataLoaded, +} from 'react-admin'; +import CardWithIcon from '../components/CardWithIcon'; + +const NbCard = (props) => { + const { list, ...rest } = props; + const translate = useTranslate(); + const { + data: reviews, + total, + isPending, + } = useGetList('reviews', { + filter: { status: 'pending' }, + sort: { field: 'date', order: 'DESC' }, + pagination: { page: 1, perPage: 100 }, + }); + + const display = 'display'; + const newList = list.concat(list); + + return ( + <CardWithIcon + icon={CommentIcon} + title={translate('pos.dashboard.pending_reviews')} + subtitle={total} + {...rest} + > + <List sx={{ display }}> + {newList?.map((record) => ( + <ListItem key={record.id} disablePadding> + <ListItemButton + alignItems="flex-start" + component={Link} + to={`/task/${record.id}`} + > + {/* <ListItemAvatar> + <Avatar + sx={{ + // bgcolor: 'primary.main', + bgcolor: '#a2beeaff', + color: 'primary.contrastText', // 閬垮厤鐧藉瓧鐧藉簳 + // width: 40, + // height: 40, + // fontSize: 16, + }} + > + {record.id} + </Avatar> + </ListItemAvatar> */} + + <ListItemText + // primary={ + // <StarRatingField + // record={record} + // source="rating" + // /> + // } + primary={record.date + record.date} + secondary={record.total} + sx={{ + overflowY: 'hidden', + height: '3em', + display: '-webkit-box', + WebkitLineClamp: 2, + WebkitBoxOrient: 'vertical', + paddingRight: 0, + }} + /> + </ListItemButton> + </ListItem> + ))} + </List> + <Box flexGrow={1}> </Box> + <Button + sx={{ borderRadius: 0 }} + component={Link} + to="/task" + size="small" + color="primary" + > + <Box p={1} sx={{ color: 'primary.main' }}> + {translate('pos.dashboard.all_reviews')} + </Box> + </Button> + </CardWithIcon> + ); +}; + +export default NbCard; -- Gitblit v1.9.1