skyouc
1 天以前 ccb810bdcabb3a10b7463acbdb0aa66c44d9c0bc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import * as React from 'react';
import {
    Avatar,
    Box,
    Button,
    List,
    Grid,
    ListItem,
    Typography,
    ListItemAvatar,
    ListItemButton,
    ListItemText,
} from '@mui/material';
import CommentIcon from '@mui/icons-material/Comment';
import CardWithIcon from '../components/CardWithIcon';
import { Link } from 'react-router-dom';
import {
    ReferenceField,
    FunctionField,
    useGetList,
    useTranslate,
    useIsDataLoaded,
} from 'react-admin';
 
const NbCard = (props) => {
    const { tasks, total, ...rset } = props;
    const translate = useTranslate();
 
    const display = 'display';
 
    return (
        <>
            <CardWithIcon
                icon={CommentIcon}
                title={translate('page.dashboard.pending_reviews')}
                subtitle={total}
                {...rset}
            >
                <List sx={{ display }}>
                    {tasks?.map((record) => (
                        <ListItem key={record.id} disablePadding>
                            <ListItemButton
                                alignItems="flex-start"
                                component={Link}
                                to={`/task/${record.id}`}
                            >
                                <Grid container item md={12}>
                                    <Box sx={{ display: 'flex' }}>
                                        <Box sx={{ display: 'flex', padding: '1em' }}>
                                            <Typography color="textSecondary">{translate("table.field.task.taskCode")}:</Typography>
                                            <Typography color="textSecondary">{record?.taskCode}</Typography>
                                        </Box>
                                    </Box>
                                    <Box sx={{ display: 'flex' }}>
                                        <Box sx={{ display: 'flex', padding: '1em' }}>
                                            <Typography color="textSecondary">{translate("table.field.task.taskType")}:</Typography>
                                            <Typography color="textSecondary" maxWidth="200" overflow="hidden">{record?.taskType$}</Typography>
                                        </Box>
                                    </Box>
                                    <Box sx={{ display: 'flex' }}>
                                        <Box sx={{ display: 'flex', padding: '1em' }}>
                                            <Typography color="textSecondary">{translate("table.field.task.taskStatus")}:</Typography>
                                            <Typography color="textSecondary">{record?.taskStatus$}</Typography>
                                        </Box>
                                    </Box>
                                    <Box sx={{ display: 'flex' }}>
                                        <Box sx={{ display: 'flex', padding: '1em' }}>
                                            <Typography color="textSecondary">{translate("table.field.task.startTime")}:</Typography>
                                            <Typography color="textSecondary">{record?.createTime}</Typography>
                                        </Box>
                                    </Box>
                                </Grid>
                            </ListItemButton>
                            <Spacer />
                        </ListItem>
                    ))}
                </List>
                <Box flexGrow={1}>&nbsp;</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>
        </>
    );
};
 
const Spacer = () => <span style={{ width: '1em', }} />;
 
 
export default NbCard;