| | |
| | | import request from '@/utils/request'; |
| | | import DiscountIcon from '@mui/icons-material/Discount'; |
| | | import LinkIcon from '@mui/icons-material/Link'; |
| | | import InitModal from "./InitModal"; |
| | | import LocListAside from "./LocListAside"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | const [initDialog, setInitDialog] = useState(false); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.loc"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | empty={<EmptyData |
| | | children={ |
| | | <Box sx={{ gap: 2, display: 'flex' }}> |
| | | <Button |
| | | variant="contained" |
| | | color="primary" |
| | | sx={{ |
| | | fontSize: '1em', |
| | | mt: 2 |
| | | }} |
| | | onClick={() => { setCreateDialog(true) }}> |
| | | {translate('create.empty.button')} |
| | | </Button> |
| | | |
| | | <Button |
| | | variant="contained" |
| | | color="primary" |
| | | sx={{ |
| | | fontSize: '1em', |
| | | mt: 2 |
| | | }} |
| | | onClick={() => { setInitDialog(true) }}> |
| | | {translate('toolbar.locInit')} |
| | | </Button> |
| | | </Box> |
| | | } |
| | | onClick={() => { }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | aside={<LocListAside />} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='loc' |
| | |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | |
| | | <InitModal |
| | | open={initDialog} |
| | | setOpen={setInitDialog} |
| | | /> |
| | | </Box> |
| | | ) |
| | | } |
| | |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | |
| | | return ( |
| | | <> |
| | | <Button onClick={() => setCreateDialog(true)} label={"toolbar.batch"}> |