diff --git a/src/views/inspection/cockpit/components/MapCanvas.vue b/src/views/inspection/cockpit/components/MapCanvas.vue index 3d15dfc..38bc2bc 100644 --- a/src/views/inspection/cockpit/components/MapCanvas.vue +++ b/src/views/inspection/cockpit/components/MapCanvas.vue @@ -350,9 +350,12 @@ const centerCanvasView = () => { } const loadSourceMap = async () => { + const connectedRobot = props.robotList.find(item => item.connectStatus == 1); + if (!connectedRobot) return; + const res = await getMapJson({ - robotId: props.robotList[0].id, - mapName: props.robotList[0].robotMapName + robotId: connectedRobot.id, + mapName: connectedRobot.robotMapName }); if (res.code === 200) { try { diff --git a/src/views/inspection/cockpit/components/MapOverview.vue b/src/views/inspection/cockpit/components/MapOverview.vue index f99b580..4ba008f 100644 --- a/src/views/inspection/cockpit/components/MapOverview.vue +++ b/src/views/inspection/cockpit/components/MapOverview.vue @@ -112,7 +112,7 @@ const getRobot = async () => { if (res.code === 200) { robotList.value = res.rows - getRobot() + // getRobot() } }