| | |
| | | } from '@mui/material'; |
| | | import { useNotification } from '../../Notification'; |
| | | import AgvThree from './AgvThree'; |
| | | import { getAgvInfo } from '../../http'; |
| | | import { handleRestoreAgvAll } from '../../http'; |
| | | import BoolValueIcon from '../BoolValueIcon'; |
| | | import ConfirmButton from '../../../page/components/ConfirmButton'; |
| | | |
| | |
| | | return endThree; |
| | | }, [info]); |
| | | |
| | | const handleReset = () => { |
| | | alert(1) |
| | | const handleRestoreAll = () => { |
| | | handleRestoreAgvAll({ agvNo: info.agvNo }); |
| | | } |
| | | |
| | | const updateStatus = (status) => { |
| | | const updateStatus = () => { |
| | | dataProvider.update('agv', { |
| | | id: info.agvId, |
| | | data: { |
| | | status: status === 0 ? 1 : 0 |
| | | status: info.status === 0 ? 1 : 0 |
| | | } |
| | | }).then(({ data }) => { |
| | | fetchAgvInfo(curAgvNo); |
| | |
| | | }} |
| | | /> |
| | | <ConfirmButton |
| | | label="page.map.action.reset" |
| | | label="page.map.action.restoreALl" |
| | | color="primary" |
| | | variant="contained" |
| | | onConfirm={() => { |
| | | handleReset(); |
| | | handleRestoreAll(); |
| | | }} |
| | | /> |
| | | {info && ( |
| | | info.status === 1 |
| | | ? <Button variant="contained" color="error" fullWidth onClick={() => { |
| | | updateStatus(info.status); |
| | | updateStatus(); |
| | | }}> |
| | | {translate('page.map.action.disable')} |
| | | </Button> |
| | | : <Button variant="contained" fullWidth onClick={() => { |
| | | updateStatus(info.status); |
| | | updateStatus(); |
| | | }}> |
| | | {translate('page.map.action.enable')} |
| | | </Button> |