Kaynağa Gözat

fix: Merge branch 'master' of http://192.168.0.115:3000/bill/traffic-laser

bill 2 yıl önce
ebeveyn
işleme
56fa320089

Dosya farkı çok büyük olduğundan ihmal edildi
+ 5 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 3 - 2
src/graphic/History/HistoryUtil.js

@@ -843,8 +843,9 @@ export default class HistoryUtil {
 
   setCurveLineInfo(curveLineInfo) {
     let curveLine = dataService.getCurveLine(curveLineInfo.vectorId);
-    curveLine.startId = curveLineInfo.start;
-    curveLine.endId = curveLineInfo.end;
+    curveLine.startId = curveLineInfo.startId;
+    curveLine.endId = curveLineInfo.endId;
+    curveLine.points = [];
     for (let i = 0; i < curveLineInfo.points.length; ++i) {
       curveLine.points[i] = dataService.getCurvePoint(
         curveLineInfo.points[i].vectorId

+ 7 - 1
src/graphic/Layer.js

@@ -369,6 +369,8 @@ export default class Layer {
     }
     selectItem = stateService.getSelectItem();
     stateService.setDraggingItem(selectItem);
+    stateService.clearFocusItem();
+    this.uiControl.focusVector = null;
     // 清除上一个状态
     // 设置当前事件名称
     e.preventDefault();
@@ -460,7 +462,6 @@ export default class Layer {
     this.lastX = X;
     this.lastY = Y;
     const draggingItem = stateService.getDraggingItem();
-
     switch (eventName) {
       case null:
         //监控
@@ -992,6 +993,11 @@ export default class Layer {
     let needAutoRedraw = false;
     switch (eventName) {
       case null:
+        if (e instanceof TouchEvent) {
+          stateService.clearSelectItem();
+          stateService.clearDraggingItem();
+          this.renderer.autoRedraw();
+        }
         return;
       case LayerEvents.PanBackGround:
         needAutoRedraw = true;

+ 46 - 13
src/graphic/ListenLayer.js

@@ -778,21 +778,18 @@ export default class ListenLayer {
         Constant.minAdsorbPix
       );
 
+      let line1 = mathUtil.createLine1(
+        joinInfo.position,
+        leftJoinInfo.position
+      );
+      let position1 = mathUtil.getJoinLinePoint(position, line1);
       if (
-        mathUtil.getDistance(position, leftJoinInfo.position) >
-        mathUtil.getDistance(position, rightJoinInfo.position)
+        mathUtil.isContainForSegment(
+          position1,
+          joinInfo.position,
+          leftJoinInfo.position
+        )
       ) {
-        if (joinInfo.distance < curveRoad.rightWidth) {
-          curveRoadInfo = {
-            curveRoadId: curveRoadId,
-            type: VectorType.CurveRoad,
-            distance: joinInfo.distance,
-            x: joinInfo.position.x,
-            y: joinInfo.position.y,
-          };
-        }
-        curveRoadInfo.dir = "right";
-      } else {
         if (joinInfo.distance < curveRoad.leftWidth) {
           curveRoadInfo = {
             curveRoadId: curveRoadId,
@@ -803,8 +800,44 @@ export default class ListenLayer {
           };
         }
         curveRoadInfo.dir = "left";
+      } else {
+        curveRoadInfo = {
+          curveRoadId: curveRoadId,
+          type: VectorType.CurveRoad,
+          distance: joinInfo.distance,
+          x: joinInfo.position.x,
+          y: joinInfo.position.y,
+        };
+        curveRoadInfo.dir = "right";
       }
 
+      // if (
+      //   mathUtil.getDistance(position, leftJoinInfo.position) >
+      //   mathUtil.getDistance(position, rightJoinInfo.position)
+      // ) {
+      //   if (joinInfo.distance < curveRoad.rightWidth) {
+      //     curveRoadInfo = {
+      //       curveRoadId: curveRoadId,
+      //       type: VectorType.CurveRoad,
+      //       distance: joinInfo.distance,
+      //       x: joinInfo.position.x,
+      //       y: joinInfo.position.y,
+      //     };
+      //   }
+      //   curveRoadInfo.dir = "right";
+      // } else {
+      //   if (joinInfo.distance < curveRoad.leftWidth) {
+      //     curveRoadInfo = {
+      //       curveRoadId: curveRoadId,
+      //       type: VectorType.CurveRoad,
+      //       distance: joinInfo.distance,
+      //       x: joinInfo.position.x,
+      //       y: joinInfo.position.y,
+      //     };
+      //   }
+      //   curveRoadInfo.dir = "left";
+      // }
+
       if (leftJoinInfo.distance < Constant.minAdsorbPix) {
         const index = mathUtil.getCurvesIndexForCurvesPoints(
           leftJoinInfo.position,