From 6ea7dfb6342285086b932b50a8190ca24c7710a0 Mon Sep 17 00:00:00 2001 From: yyy <2605810609@qq.com> Date: Tue, 18 Mar 2025 14:56:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=96=E6=8B=BD=E5=AE=BD=E9=AB=98=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 2 +- src/views/mapPage/realTimeMap/editMap.vue | 24 ++++++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.env.dev b/.env.dev index cd36402f..fb9b85ed 100644 --- a/.env.dev +++ b/.env.dev @@ -6,7 +6,7 @@ VITE_DEV=true # 请求路径 # VITE_BASE_URL='http://192.168.0.66:48080' # VITE_BASE_URL='http://192.168.0.189:48080' -VITE_BASE_URL='http://127.0.0.1:48080' +VITE_BASE_URL='http://192.168.0.45:48080' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server diff --git a/src/views/mapPage/realTimeMap/editMap.vue b/src/views/mapPage/realTimeMap/editMap.vue index 547acba9..238f2ff0 100644 --- a/src/views/mapPage/realTimeMap/editMap.vue +++ b/src/views/mapPage/realTimeMap/editMap.vue @@ -760,10 +760,15 @@ const resizeEnd = (locationX, locationY, w, h, item, index) => { nextTick(() => { let x = Number(locationX) + Number(item.locationWidePx) / 2 let y = Number(locationY) + Number(item.locationDeepPx) / 2 + let width = Number(w) * imgBgObj.resolution * 100 //实际的宽高cm + let height = Number(h) * imgBgObj.resolution * 100 + let actualPoint = disposeEventPoint(x, y) state.allMapPointInfo[index].locationX = x state.allMapPointInfo[index].locationY = y + state.allMapPointInfo[index].locationWide = width + state.allMapPointInfo[index].locationDeep = height state.allMapPointInfo[index].locationWidePx = w state.allMapPointInfo[index].locationDeepPx = h state.allMapPointInfo[index].actualLocationX = actualPoint.actualLocationX @@ -781,8 +786,8 @@ const resizeEnd = (locationX, locationY, w, h, item, index) => { if (item.id === route.endPointId) { route.endPointX = x route.endPointY = y - route.endHigh = Number(item.locationDeep) - route.endWidth = Number(item.locationDeep) + route.endHigh = Number(item.locationDeepPx) + route.endWidth = Number(item.locationWidePx) route.actualEndPointX = actualPoint.actualLocationX route.actualEndPointY = actualPoint.actualLocationY } @@ -2515,7 +2520,20 @@ const saveMap = async () => { const saveNodeList = async () => { let list = state.allMapPointInfo list.forEach((item) => { - if (item.type === 7) { + if (item.type === 2) { + // 库位点 类型为数组 + item.dataList.forEach((node) => { + node.locationDeep = item.locationDeep + node.locationWide = item.locationWide + }) + item.dataJson = JSON.stringify(item.dataList) + } else if (item.type === 3 || item.type === 4) { + //设备类型 + item.dataObj.locationWide = item.locationWide + item.dataObj.locationDeep = item.locationDeep + item.dataJson = JSON.stringify(item.dataObj) + } else if (item.type === 7) { + //文字类型 item.dataObj.positionMapId = imgBgObj.positionMapId item.dataObj.text = item.text item.dataObj.fontColor = item.fontColor