#
luxiaotao1123
2024-10-18 769f753ca8581b717bcd27c63c637fe868dd37f1
zy-acs-flow/src/map/insight/agv/AgvMain.jsx
@@ -10,6 +10,7 @@
    Button,
    Divider,
    Stack,
    useTheme,
} from '@mui/material';
import AgvThree from './AgvThree';
import { getAgvInfo } from '../../http';
@@ -66,7 +67,7 @@
                addObject(agvGroup);
                three.rePerspective(350, 450);
                three?.rePerspective(350, 450);
            }).catch((error) => {
                console.error(error);
@@ -76,24 +77,24 @@
}
const AgvMain = (props) => {
    const { data, curAgvNo, setCurAgvNo } = props;
    const { curAgvNo, setCurAgvNo, setJsonData } = props;
    const theme = useTheme();
    const translate = useTranslate();
    const containerRef = useRef();
    const [loading, setLoading] = useState(true);
    const [info, setInfo] = useState(null);
    useEffect(() => {
        if (data) {
            getAgvInfo(data.no, (response) => {
        if (curAgvNo) {
            getAgvInfo(curAgvNo, (response) => {
                setInfo(response);
                setCurAgvNo(data.no);
            });
        }
    }, [data]);
    }, [curAgvNo]);
    useEffect(() => {
        if (info) {
            // console.log(info);
            setJsonData(info);
            endThree();
            setLoading(true);
            setTimeout(() => {
@@ -107,6 +108,10 @@
        }
        return endThree;
    }, [info]);
    const handleReset = () => {
        alert(1)
    }
    return (
        <Box display="flex" height="100%">
@@ -173,10 +178,10 @@
                            <Stack spacing={2} mt={2}>
                                <ConfirmButton
                                    label="page.map.action.reset"
                                    color="info"
                                    color="primary"
                                    variant="contained"
                                    onConfirm={() => {
                                        alert(1)
                                        handleReset();
                                    }}
                                />
                                {info && (
@@ -198,8 +203,6 @@
}
const KeyValuePair = ({ label, value, bool }) => {
    console.log({ label, value, bool });
    return (
        <>
            <Stack direction="row" alignItems="center" spacing={1} sx={{ mb: 1 }}>