From e2546d9e8fba1f6384efd786d1706c1d02c59904 Mon Sep 17 00:00:00 2001 From: yyy <2605810609@qq.com> Date: Thu, 6 Mar 2025 16:17:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=A1=86=E9=80=89=E5=B0=86=E7=82=B9?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E6=88=90=E7=9B=B4=E7=BA=BF=20=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E6=BB=9A=E8=BD=AE=E6=94=BE=E5=A4=A7=E7=BC=A9=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/map/map.ts | 6 + .../realTimeMap/components/indexPage.vue | 75 ++++--- src/views/mapPage/realTimeMap/editMap.vue | 193 +++++++++++++++--- src/views/mapPage/realTimeMap/test.vue | 149 ++++++++------ 4 files changed, 297 insertions(+), 126 deletions(-) diff --git a/src/api/map/map.ts b/src/api/map/map.ts index 7112ab98..eebd7874 100644 --- a/src/api/map/map.ts +++ b/src/api/map/map.ts @@ -148,3 +148,9 @@ export const getAGVPointInformation = async (macAddress) => { url: `/system/position-map-item/getAGVPointInformation?macAddress=` + macAddress }) } +//根据地图id获取车辆列表 +export const getListByMapId = async (mapId) => { + return await request.get({ + url: `/system/robot/information/getListByMapId?mapId=` + mapId + }) +} diff --git a/src/views/mapPage/realTimeMap/components/indexPage.vue b/src/views/mapPage/realTimeMap/components/indexPage.vue index ea6c6c90..a4c87100 100644 --- a/src/views/mapPage/realTimeMap/components/indexPage.vue +++ b/src/views/mapPage/realTimeMap/components/indexPage.vue @@ -42,7 +42,11 @@ :x2="Number(item.endPointX) * radio" :y2="Number(item.endPointY) * radio" :stroke="item.isSelect ? '#f48924' : '#00329F'" - :stroke-width="(5 / nowObject.showYamlJson.resolution / 100 * radio)>1.5?(5 / nowObject.showYamlJson.resolution / 100 * radio):1.5" + :stroke-width=" + (5 / nowObject.showYamlJson.resolution / 100) * radio > 1.5 + ? (5 / nowObject.showYamlJson.resolution / 100) * radio + : 1.5 + " :marker-start="item.direction === 2 ? 'url(#double-arrow-start)' : ''" marker-end="url(#single-arrow)" @click="handleChooseRoute(item, index)" @@ -51,7 +55,11 @@ :d="getLineMidArrowPath(item)" stroke="none" fill="black" - :stroke-width="(5 / nowObject.showYamlJson.resolution / 100 * radio)>1.5?(5 / nowObject.showYamlJson.resolution / 100 * radio):1.5" + :stroke-width=" + (5 / nowObject.showYamlJson.resolution / 100) * radio > 1.5 + ? (5 / nowObject.showYamlJson.resolution / 100) * radio + : 1.5 + " :marker-start="item.direction === 2 ? 'url(#backward-arrow)' : ''" :marker-end=" item.direction === 2 ? 'url(#forward-arrow)' : 'url(#forward-arrow)' @@ -62,7 +70,11 @@
@@ -262,8 +278,8 @@ class="indexpage-container-box-point-item-inner" v-if="item.type == 6" :style="{ - width: item.locationWide / nowObject.showYamlJson.resolution / 100 * radio + 'px', - height: item.locationDeep / nowObject.showYamlJson.resolution / 100 * radio + 'px' + width: (item.locationWide / nowObject.showYamlJson.resolution / 100) * radio + 'px', + height: (item.locationDeep / nowObject.showYamlJson.resolution / 100) * radio + 'px' }" >
@@ -288,8 +304,10 @@ >
{ -  const y1 = Number(nowObject.value.showYamlJson.origin[1]) + Number(nowObject.value.showYamlJson.height) * Number(nowObject.value.showYamlJson.resolution) -  let x = Math.max(Number(pointX) - Number(nowObject.value.showYamlJson.origin[0]), 0) -  let y = Math.max(y1 - Number(pointY), 0) + const y1 = + Number(nowObject.value.showYamlJson.origin[1]) + + Number(nowObject.value.showYamlJson.height) * Number(nowObject.value.showYamlJson.resolution) + let x = Math.max(Number(pointX) - Number(nowObject.value.showYamlJson.origin[0]), 0) + let y = Math.max(y1 - Number(pointY), 0) -  return { -    x :(x / nowObject.value.showYamlJson.resolution) - (carWidth.value / nowObject.value.showYamlJson.resolution / 100/2), -    y: (y / nowObject.value.showYamlJson.resolution) - (carHeight.value / nowObject.value.showYamlJson.resolution / 100/2) -  } + return { + x: + x / nowObject.value.showYamlJson.resolution - + carWidth.value / nowObject.value.showYamlJson.resolution / 100 / 2, + y: + y / nowObject.value.showYamlJson.resolution - + carHeight.value / nowObject.value.showYamlJson.resolution / 100 / 2 + } } //是否可以拖拽 const isDrag = ref(false) @@ -650,7 +674,6 @@ const getPositionMapListFun = async (positionMapId) => { } else if (item.type === 7) { } }) - } const draggableElement = ref(null) const resetPosition = () => { @@ -826,12 +849,12 @@ const getMapData = async (item) => { computedRatio() getMapLineList() } -//偏航率斜率算旋转 -const radianToDegree = (radian) =>{ - // 将弧度转换为角度 - const degree = radian * (180 / Math.PI); - // 返回带有单位 'deg' 的 CSS 角度值 - return `${degree}`; +//偏航率斜率算旋转 +const radianToDegree = (radian) => { + // 将弧度转换为角度 + const degree = radian * (180 / Math.PI) + // 返回带有单位 'deg' 的 CSS 角度值 + return `${degree}` } const heightVal = ref(0) const widthVal = ref(0) diff --git a/src/views/mapPage/realTimeMap/editMap.vue b/src/views/mapPage/realTimeMap/editMap.vue index 92f13c29..201a05f2 100644 --- a/src/views/mapPage/realTimeMap/editMap.vue +++ b/src/views/mapPage/realTimeMap/editMap.vue @@ -1,5 +1,5 @@