From d131ecece5444e86abcfb8f914f6678e46ca54a9 Mon Sep 17 00:00:00 2001 From: yyy <2605810609@qq.com> Date: Thu, 10 Jul 2025 09:37:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B2=E7=BA=BF=E7=9A=84=E5=AE=9E=E9=99=85?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../realTimeMap/components/indexPage.vue | 3 +- src/views/mapPage/realTimeMap/editMap.vue | 35 +++++++++++++++---- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/views/mapPage/realTimeMap/components/indexPage.vue b/src/views/mapPage/realTimeMap/components/indexPage.vue index 88bf9172..2e04c3e1 100644 --- a/src/views/mapPage/realTimeMap/components/indexPage.vue +++ b/src/views/mapPage/realTimeMap/components/indexPage.vue @@ -598,6 +598,7 @@ const initWebsocket = () => { requestAnimationFrame(() => { let data = JSON.parse(jsonMsg.content) // console.log(data) + // console.log(dayjs().format('HH:mm:ss SSS')) let dataList = Object.entries(data).map(([key, value]) => ({ macAddress: key, @@ -652,7 +653,7 @@ const initWebsocket = () => { const throttledUpdateCarList = throttle((currentList, newDataList, mapInfo) => { return updateCarList(currentList, newDataList, mapInfo) -}, 100) // 100ms 节流 +}, 300) // 100ms 节流 // 优化车辆数据合并逻辑 const mergeArraysWithoutDelete = (arr1, arr2) => { diff --git a/src/views/mapPage/realTimeMap/editMap.vue b/src/views/mapPage/realTimeMap/editMap.vue index cca284f2..fef6b371 100644 --- a/src/views/mapPage/realTimeMap/editMap.vue +++ b/src/views/mapPage/realTimeMap/editMap.vue @@ -4738,13 +4738,34 @@ function getRightAngleControlPoints(direction, start, end) { function setCurveRightAngle(direction) { const curve = state.curveContextMenu.currentCurve if (!curve) return - const start = { x: curve.startPointX, y: curve.startPointY } - const end = { x: curve.endPointX, y: curve.endPointY } - const { beginControl, endControl } = getRightAngleControlPoints(direction, start, end) - curve.beginControlX = beginControl.x - curve.beginControlY = beginControl.y - curve.endControlX = endControl.x - curve.endControlY = endControl.y + + // 计算控制点 + const startPoint = { x: curve.startPointX, y: curve.startPointY } + const endPoint = { x: curve.endPointX, y: curve.endPointY } + const { beginControl, endControl } = getRightAngleControlPoints(direction, startPoint, endPoint) + + // 更新控制点坐标 + Object.assign(curve, { + beginControlX: beginControl.x, + beginControlY: beginControl.y, + endControlX: endControl.x, + endControlY: endControl.y + }) + + // 计算实际控制点位置 + const [beginActual, endActual] = [ + disposeEventPoint(curve.beginControlX, curve.beginControlY), + disposeEventPoint(curve.endControlX, curve.endControlY) + ] + + // 更新实际控制点坐标 + Object.assign(curve, { + actualBeginControlX: beginActual.actualLocationX, + actualBeginControlY: beginActual.actualLocationY, + actualEndControlX: endActual.actualLocationX, + actualEndControlY: endActual.actualLocationY + }) + curve.method = 1 hideCurveContextMenu() }