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() }