| | |
| | | } from '@mui/material'; |
| | | import { useNotification } from '../../Notification'; |
| | | import AgvThree from './AgvThree'; |
| | | import { handleRestoreAgvAll } from '../../http'; |
| | | import { handleRestoreAgvAll, handleAgvPatrol } from '../../http'; |
| | | import BoolValueIcon from '../BoolValueIcon'; |
| | | import ConfirmButton from '../../../page/components/ConfirmButton'; |
| | | import { grey } from '@mui/material/colors'; |
| | |
| | | }); |
| | | } |
| | | |
| | | const patrolControl = async () => { |
| | | const res = await handleAgvPatrol({ agvNo: info.agvNo }) |
| | | if (res) { |
| | | fetchAgvInfo(curAgvNo); |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <Box display="flex" height="100%"> |
| | | <Box |
| | |
| | | }}> |
| | | <Grid container spacing={2} style={{ marginTop: '0px' }}> |
| | | <Grid item xs={12}> |
| | | <Stack spacing={2} mt={2}> |
| | | <Stack spacing={1} mt={2}> |
| | | {/* more */} |
| | | <Button |
| | | color="primary" |
| | | variant="contained" |
| | |
| | | > |
| | | {translate('page.map.settings.map.more.title')} |
| | | </Button> |
| | | {/* patrol */} |
| | | {info && ( |
| | | info.status === 1 |
| | | info.patrol |
| | | ? |
| | | <Button variant="contained" color="error" fullWidth onClick={() => { |
| | | patrolControl(); |
| | | }}> |
| | | {translate('page.map.action.stopPatrol')} |
| | | </Button> |
| | | : |
| | | // <Button variant="contained" fullWidth onClick={() => { |
| | | // patrolControl(); |
| | | // }}> |
| | | // {translate('page.map.action.startPatrol')} |
| | | // </Button> |
| | | <ConfirmButton |
| | | label="page.map.action.startPatrol" |
| | | color="primary" |
| | | variant="contained" |
| | | onConfirm={() => { |
| | | patrolControl(); |
| | | }} |
| | | /> |
| | | )} |
| | | {/* status */} |
| | | {info && ( |
| | | info.status === 0 |
| | | ? <Button variant="contained" color="error" fullWidth onClick={() => { |
| | | updateStatus(); |
| | | }}> |
| | |
| | | {translate('page.map.action.enable')} |
| | | </Button> |
| | | )} |
| | | {/* restore all */} |
| | | <ConfirmButton |
| | | label="page.map.action.restoreALl" |
| | | color="inherit" |