#
luxiaotao1123
2024-10-18 35fd1f14cbe260a2075f8b7df7bc927357e2b16e
zy-acs-flow/src/map/insight/agv/AgvMain.jsx
@@ -14,7 +14,7 @@
} 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';
@@ -99,15 +99,15 @@
        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);
@@ -199,22 +199,22 @@
                                        }}
                                    />
                                    <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>