#
vincentlu
20 小时以前 6e957352ec0782ca3e3a4f63ba9dba54f3367ec2
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
import * as React from 'react';
import { Box, Card, CardActions, Button, Typography, useTheme } from '@mui/material';
import { useNavigate } from 'react-router-dom';
import { useTranslate } from 'react-admin';
import AssignmentIcon from '@mui/icons-material/Assignment';
import AccountCircleIcon from '@mui/icons-material/AccountCircle';
 
import publishArticleImage from './welcome_illustration.svg';
 
const Welcome = () => {
    const translate = useTranslate();
    const navigate = useNavigate();
    const theme = useTheme();
    const isLight = theme.palette.mode === 'light';
 
    return (
        <Card
            sx={{
                background: theme =>
                    `linear-gradient(45deg, 
                    ${isLight ? theme.palette.secondary.dark : theme.palette.primary.dark} 0%, 
                    ${isLight ? theme.palette.secondary.light : theme.palette.primary.light} 50%, 
                    ${theme.palette.primary.dark} 100%)`,
                color: theme => theme.palette.primary.contrastText,
                padding: '20px',
                // paddingBottom: '50px',
                marginTop: 2,
                marginBottom: '1em',
                width: '100%',
                overflow: 'visible'
            }}
        >
            <Box display="flex">
                <Box flex="1">
                    <Typography variant="h5" component="h2" gutterBottom>
                        {translate('page.dashboard.welcome.title')}
                    </Typography>
                    <Box maxWidth="40em">
                        <Typography variant="body1" component="p" gutterBottom>
                            {translate('page.dashboard.welcome.title')}
                        </Typography>
                    </Box>
                    <CardActions
                        sx={{
                            padding: { xs: 0, xl: null },
                            flexWrap: { xs: 'wrap', xl: null },
                            '& a': {
                                marginTop: { xs: '1em', xl: null },
                                marginLeft: { xs: '0!important', xl: null },
                                marginRight: { xs: '1em', xl: null },
                            },
                            marginTop: 3,
                        }}
                    >
                        <Button
                            variant="contained"
                            startIcon={<AssignmentIcon />}
                            onClick={() => {
                                navigate('/task')
                            }}
                        >
                            {translate('menu.task')}
                        </Button>
                        <Button
                            variant="contained"
                            startIcon={<AccountCircleIcon />}
                            onClick={() => {
                                navigate('/warehouseStock')
                            }}
                        >
                            {translate('menu.warehouseStock')}
                        </Button>
                    </CardActions>
                </Box>
                <Box
                    display={{ xs: 'none', sm: 'none', md: 'block' }}
                    sx={{
                        background: `url(${publishArticleImage}) top right / cover`,
                        marginLeft: 'auto',
                    }}
                    width="16em"
                    height="9em"
                    overflow="hidden"
                />
            </Box>
        </Card>
    );
};
 
export default Welcome;