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-tool/editNodeProperties.vue b/src/views/mapPage/realTimeMap/components-tool/editNodeProperties.vue index 5b7ac522..b56efab9 100644 --- a/src/views/mapPage/realTimeMap/components-tool/editNodeProperties.vue +++ b/src/views/mapPage/realTimeMap/components-tool/editNodeProperties.vue @@ -43,7 +43,13 @@ > - + { form.value.inDirection = null form.value.outDirection = null form.value.locationNumber = null - form.value.locationDeep = 50 - form.value.locationWide = 50 - form.value.locationDeepPx = 10 - form.value.locationWidePx = 10 + form.value.locationDeep = 40 + form.value.locationWide = 40 + form.value.locationDeepPx = 8 + form.value.locationWidePx = 8 } else if (type === 2) { - form.value.locationNumber = 1 + form.value.locationNumber = null + if (!form.value.id) { + form.value.locationDeep = 150 + form.value.locationWide = 150 + form.value.locationDeepPx = 30 + form.value.locationWidePx = 30 + } } else if (type === 3) { form.value.direction = null form.value.inDirection = null form.value.outDirection = null form.value.locationNumber = null + if (!form.value.id) { + form.value.locationDeep = 150 + form.value.locationWide = 150 + form.value.locationDeepPx = 30 + form.value.locationWidePx = 30 + } } else if (type === 4) { form.value.direction = null form.value.inDirection = null form.value.outDirection = null form.value.locationNumber = null + if (!form.value.id) { + form.value.locationDeep = 150 + form.value.locationWide = 150 + form.value.locationDeepPx = 30 + form.value.locationWidePx = 30 + } } else if (type === 5) { form.value.layersNumber = null form.value.direction = null diff --git a/src/views/mapPage/realTimeMap/components/indexPage.vue b/src/views/mapPage/realTimeMap/components/indexPage.vue index 54871492..090b6185 100644 --- a/src/views/mapPage/realTimeMap/components/indexPage.vue +++ b/src/views/mapPage/realTimeMap/components/indexPage.vue @@ -83,9 +83,13 @@ :key="index" :style="{ left: item.realX * radio + 'px', - top: item.realY * radio + 'px', - width: legendObj.carShow ? carWidth / nowObject.showYamlJson.resolution / 100 * radio + 'px' : '0', - height: legendObj.carShow ? carHeight / nowObject.showYamlJson.resolution / 100 * radio + 'px' : '0', + top: item.realY * radio + 'px', + width: legendObj.carShow + ? (carWidth / nowObject.showYamlJson.resolution / 100) * radio + 'px' + : '0', + height: legendObj.carShow + ? (carHeight / nowObject.showYamlJson.resolution / 100) * radio + 'px' + : '0', transform: 'rotate(' + radianToDegree(item.data.pose2d.yaw) + 'deg)', transition: 'all 0.2s linear', zIndex: 9999 @@ -438,14 +442,20 @@ const props = defineProps({ isAllBoard: propTypes.bool.def(false) }) const convertActualToBrowser = (pointX, pointY) => { -  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) @@ -654,7 +664,6 @@ const getPositionMapListFun = async (positionMapId) => { } else if (item.type === 7) { } }) - } const draggableElement = ref(null) const resetPosition = () => { @@ -830,12 +839,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..9c5598a5 100644 --- a/src/views/mapPage/realTimeMap/editMap.vue +++ b/src/views/mapPage/realTimeMap/editMap.vue @@ -1,5 +1,5 @@