#
luxiaotao1123
2024-11-09 87fda255732e4709e923f5b4c1e6b401e20c6002
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 { handleRestoreAgvAll } from '../../http';
import { handleRestoreAgvAll, handleAgvPatrol } from '../../http';
import BoolValueIcon from '../BoolValueIcon';
import ConfirmButton from '../../../page/components/ConfirmButton';
import { grey } from '@mui/material/colors';
@@ -122,6 +122,13 @@
        });
    }
    const patrolControl = async () => {
        const res = await handleAgvPatrol({ agvNo: info.agvNo })
        if (res) {
            fetchAgvInfo(curAgvNo);
        }
    }
    return (
        <Box display="flex" height="100%">
            <Box
@@ -193,7 +200,8 @@
                    }}>
                        <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"
@@ -203,8 +211,33 @@
                                    >
                                        {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();
                                            }}>
@@ -216,6 +249,7 @@
                                                {translate('page.map.action.enable')}
                                            </Button>
                                    )}
                                    {/* restore all */}
                                    <ConfirmButton
                                        label="page.map.action.restoreALl"
                                        color="inherit"