From 51a599f7df8c4965bb949ab807657ea950886577 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 18 十月 2024 13:46:28 +0800 Subject: [PATCH] # --- zy-acs-flow/src/map/insight/agv/AgvMain.jsx | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/zy-acs-flow/src/map/insight/agv/AgvMain.jsx b/zy-acs-flow/src/map/insight/agv/AgvMain.jsx index f507cd5..efa722f 100644 --- a/zy-acs-flow/src/map/insight/agv/AgvMain.jsx +++ b/zy-acs-flow/src/map/insight/agv/AgvMain.jsx @@ -67,7 +67,7 @@ addObject(agvGroup); - three.rePerspective(350, 450); + three?.rePerspective(350, 450); }).catch((error) => { console.error(error); @@ -77,7 +77,7 @@ } const AgvMain = (props) => { - const { data, curAgvNo, setCurAgvNo } = props; + const { curAgvNo, setCurAgvNo, setJsonData } = props; const theme = useTheme(); const translate = useTranslate(); const containerRef = useRef(); @@ -85,17 +85,16 @@ 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(() => { -- Gitblit v1.9.1