From b5785e88e163bc8e5664741e82ae111cc25c15e9 Mon Sep 17 00:00:00 2001 From: yyy <2605810609@qq.com> Date: Tue, 15 Jul 2025 11:39:40 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=A7=86=E5=8F=A3=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E5=8F=AA=E6=B8=B2=E6=9F=93=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E5=8F=AF=E8=A7=81=E5=8C=BA=E5=9F=9F=E7=9A=84=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E5=92=8C=E8=B7=AF=E7=BA=BF=EF=BC=8C=E5=9C=A8=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E5=92=8C=E7=BC=A9=E6=94=BE=E6=97=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=A7=86=E5=8F=A3=E4=BF=A1=E6=81=AF=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E8=BE=B9=E7=95=8C=E6=89=A9=E5=B1=95=E7=A1=AE=E4=BF=9D?= =?UTF-8?q?=E6=8B=96=E5=8A=A8=E6=97=B6=E4=B8=8D=E4=BC=9A=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E9=97=AA=E7=83=81=E3=80=82=202=E3=80=81=E7=A9=BA=E9=97=B4?= =?UTF-8?q?=E7=B4=A2=E5=BC=95=E4=BC=98=E5=8C=96=EF=BC=9A=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=BC=8F=E7=A9=BA=E9=97=B4=E7=B4=A2=E5=BC=95?= =?UTF-8?q?=E5=B0=86=E5=9C=B0=E5=9B=BE=E5=88=92=E5=88=86=E4=B8=BA=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E5=8D=95=E5=85=83=EF=BC=8C=E6=A0=B9=E6=8D=AE=E5=9D=90?= =?UTF-8?q?=E6=A0=87=E5=B0=86=E7=82=B9=E4=BD=8D=E5=88=86=E9=85=8D=E5=88=B0?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=BD=91=E6=A0=BC=EF=BC=8C=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=97=B6=E5=8F=AA=E6=A3=80=E6=9F=A5=E7=9B=B8=E5=85=B3=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E4=B8=AD=E7=9A=84=E7=82=B9=E4=BD=8D=E3=80=82=203?= =?UTF-8?q?=E3=80=81=E6=94=B9=E8=BF=9B=E9=BC=A0=E6=A0=87=E6=BB=9A=E8=BD=AE?= =?UTF-8?q?=E6=94=BE=E5=A4=A7=E7=BC=A9=E5=B0=8F=E5=9C=B0=E5=9B=BE=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E6=94=B9=E4=B8=BA=E4=BF=9D=E6=8C=81=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E6=8C=87=E5=90=91=E7=82=B9=E4=B8=8D=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/locationSelectionDialog.vue | 20 +- src/views/mapPage/realTimeMap/editMap.vue | 648 ++++++++++++++---- 2 files changed, 525 insertions(+), 143 deletions(-) diff --git a/src/views/mapPage/components/locationSelectionDialog.vue b/src/views/mapPage/components/locationSelectionDialog.vue index ee7b00f7..ab6299b5 100644 --- a/src/views/mapPage/components/locationSelectionDialog.vue +++ b/src/views/mapPage/components/locationSelectionDialog.vue @@ -271,8 +271,9 @@ const getAllNodeList = async () => { positionMapId: imgBgObj.positionMapId }) allMapPointInfo.value = [] - list.forEach((item) => { + item.locationX = convertActualToBrowser(item.actualLocationX, item.actualLocationY).x + item.locationY = convertActualToBrowser(item.actualLocationX, item.actualLocationY).y //只要库位 if (locationTypeNumber.value == 1 && item.type === 2) { item.locationX = Number(item.locationX) * (imgBgObj.showWidth / imgBgObj.width) @@ -420,6 +421,23 @@ const handleWheel = (event) => { const emit = defineEmits(['locationSelectionDialogSuccess']) defineExpose({ open }) // 提供 open 方法,用于打开弹窗 + +// 传入实际现场的数据,转换成浏览器坐标的数据 +const convertActualToBrowser = (pointX, pointY) => { + const y1 = Number(imgBgObj.origin[1]) + Number(imgBgObj.height) * Number(imgBgObj.resolution) + let x = + Math.round( + (Math.max(Number(pointX) - Number(imgBgObj.origin[0]), 0) / Number(imgBgObj.resolution)) * + 10000 + ) / 10000 + let y = + Math.round((Math.max(y1 - Number(pointY), 0) / Number(imgBgObj.resolution)) * 10000) / 10000 + + return { + x, + y + } +}