瀏覽代碼

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

xzw 2 年之前
父節點
當前提交
6b95b2894a

文件差異過大導致無法顯示
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 7 - 7
src/graphic/Controls/AddCrossRoad.js

@@ -248,7 +248,7 @@ export default class AddCrossRoad {
 
   //六岔口
   buildSix(position) {
-    const len = 300;
+    const len = 500;
     const points = mathUtil.createSixPoint(position, len);
     let end = roadPointService.create(position);
     let start1 = roadPointService.create(points[0]);
@@ -267,7 +267,7 @@ export default class AddCrossRoad {
   }
 
   buildExitRamp(position) {
-    const roadLen = 600;
+    const roadLen = 800;
     let startPoint = {
       x: position.x,
       y: position.y + (roadLen * 3) / 5,
@@ -284,7 +284,7 @@ export default class AddCrossRoad {
     roadService.create(startPoint.vectorId, crossPoint.vectorId);
     roadService.create(crossPoint.vectorId, endPoint.vectorId);
     let startPoint2 = {
-      x: startPoint.x + roadLen / 4,
+      x: startPoint.x + roadLen / 3,
       y: startPoint.y,
     };
     startPoint2 = roadPointService.create(startPoint2);
@@ -420,7 +420,7 @@ export default class AddCrossRoad {
     rightEdge.points.push(edgePoints.rightEdgeEnd);
 
     let point1 = {
-      x: position.x + 200,
+      x: position.x + 250,
       y: position.y + height / 2,
     };
     let point2 = {
@@ -432,7 +432,7 @@ export default class AddCrossRoad {
       y: position.y - height / 2 + 50,
     };
     let point4 = {
-      x: position.x + 200,
+      x: position.x + 250,
       y: position.y - height / 2,
     };
 
@@ -476,7 +476,7 @@ export default class AddCrossRoad {
   }
 
   buildImportSmashedRoad(position) {
-    const roadLen = 600;
+    const roadLen = 800;
     let startPoint = {
       x: position.x,
       y: position.y - (roadLen * 3) / 5,
@@ -493,7 +493,7 @@ export default class AddCrossRoad {
     roadService.create(startPoint.vectorId, crossPoint.vectorId);
     roadService.create(crossPoint.vectorId, endPoint.vectorId);
     let startPoint2 = {
-      x: startPoint.x + roadLen / 4,
+      x: startPoint.x + roadLen / 3,
       y: startPoint.y,
     };
     startPoint2 = roadPointService.create(startPoint2);

+ 7 - 2
src/graphic/Controls/UIControl.js

@@ -149,11 +149,16 @@ export default class UIControl {
         key = "setWeight";
       }
 
-      if (focusItem.type == VectorType.Line) {
+      if (focusItem.type == VectorType.Line ) {
         let Line = dataService.getLine(focusItem.vectorId);
         // Line.setStyle(selectUI);
         Line[key](selectUI);
-      } else {
+      } else if( focusItem.type == VectorType.CurveLine){
+        let Line = dataService.getCurveLine(focusItem.vectorId);
+        // Line.setStyle(selectUI);
+        Line[key](selectUI);
+        
+      }else {
         let roadEdge = dataService.getRoadEdge(focusItem.vectorId);
         if (roadEdge) {
           // roadEdge.setStyle(selectUI);

+ 6 - 1
src/graphic/Geometry/Magnifier.js

@@ -111,7 +111,11 @@ export default class Magnifier extends Geometry {
   //     };
   //   }
   // }
-  setPopPosition(positionRaw) {
+  setPopPosition(positionRaw,loadPosition) {
+    if(loadPosition){
+      this.popPosition = loadPosition
+      return
+    }
     const position = coordinate.getScreenXY(this.position);
     const center = coordinate.getScreenXY(coordinate.center);
     let line = mathUtil.createLine1(position, center);
@@ -145,6 +149,7 @@ export default class Magnifier extends Geometry {
     this.photoUrl = src;
   }
 
+
   setImageData() {
     return new Promise(async (resolve, reject) => {
       if (this.photoUrl) {

+ 1 - 1
src/graphic/History/Change.js

@@ -94,7 +94,7 @@ export default class Change {
       this.currentData.curveRoadEdges.length == 0 &&
       this.currentData.curveRoads.length == 0 &&
       this.currentData.crossPoints.length == 0 &&
-      this.currentData.settings
+      !this.currentData.settings
     ) {
       this.saveCurrentInfo();
       return false;

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

@@ -224,9 +224,10 @@ export default class History {
         const preCircle = item.circle;
         let newCircle = circleService.create(
           preCircle.center,
-          preCircle.radius,
+          preCircle.radius || preCircle.radiusX,
           preCircle.id
         );
+
         historyUtil.assignCircleFromCircle(newCircle, preCircle);
       } else if (item.handle == HistoryEvents.ModifyCircle) {
         const preCircle = item.preCircle;
@@ -571,7 +572,7 @@ export default class History {
         const preCircle = item.circle;
         let newCircle = circleService.create(
           preCircle.center,
-          preCircle.radius,
+          preCircle.radius || preCircle.radiusX,
           preCircle.id
         );
         historyUtil.assignCircleFromCircle(newCircle, preCircle);

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

@@ -89,7 +89,8 @@ export default class HistoryUtil {
   isDifferentForMagnifiers(magnifier1, magnifier2) {
     if (
       mathUtil.equalPoint(magnifier1.position, magnifier2.position) &&
-      magnifier1.photoUrl == magnifier2.photoUrl
+      magnifier1.photoUrl == magnifier2.photoUrl &&
+      mathUtil.equalPoint(magnifier1.popPosition, magnifier2.popPosition)
     ) {
       return false;
     } else {
@@ -843,6 +844,8 @@ export default class HistoryUtil {
     circle.center = circleInfo.center;
     circle.radius = circleInfo.radius;
     circle.color = circleInfo.color;
+    circle.radiusX = circleInfo.radiusX;
+    circle.radiusY = circleInfo.radiusY;
     circle.points = circleInfo.points;
     return circle;
   }
@@ -948,7 +951,7 @@ export default class HistoryUtil {
     curveRoad.rightEdgeId = curveRoadInfo.rightEdgeId;
     for (let i = 0; i < curveRoadInfo.points.length; ++i) {
       curveRoad.points[i] = dataService.getCurveRoadPoint(
-        curveRoadInfo.points[i]
+        curveRoadInfo.points[i].vectorId
       );
     }
     //curveRoad.points = JSON.parse(JSON.stringify(curveRoadInfo.points));

+ 6 - 178
src/graphic/Layer.js

@@ -91,7 +91,6 @@ export default class Layer {
     this.canvas.addEventListener("mousewheel", this.onWheel.bind(this));
     this.canvas.addEventListener("DOMMouseScroll", this.onWheel.bind(this));
     this.canvas.addEventListener("resize", this.reSize.bind(this));
-    document.addEventListener("keydown", this.onKeydown.bind(this));
   }
 
   reSize = function () {
@@ -174,6 +173,7 @@ export default class Layer {
       case LayerEvents.AddCircle:
         stateService.setEventName(LayerEvents.AddingCircle);
         addCircle.setCenter(position);
+
         break;
       case LayerEvents.AddText:
         stateService.setEventName(LayerEvents.MoveText);
@@ -306,10 +306,11 @@ export default class Layer {
               }
               curveRoadService.addCPoint(curveRoad, position, index);
             }
-            curveRoadService.updateForMovePoint(
-              curveRoad.points[index + 1].vectorId,
-              position
-            );
+            curveRoadService.setLanes(curveRoad.vectorId);
+            // curveRoadService.updateForMovePoint(
+            //   curveRoad.points[index + 1].vectorId,
+            //   position
+            // );
           } else if (focusItem.type == VectorType.Line) {
             let line = dataService.getLine(focusItem.vectorId);
             const weight = line.getWeight();
@@ -1238,179 +1239,6 @@ export default class Layer {
     }
   }
 
-  //测试用
-  onKeydown(e) {
-    let focusItem = stateService.getFocusItem();
-    let dir = "left";
-    if (focusItem) {
-      console.log("键盘(foucus有效):" + e.code);
-      if (e.code == "Delete") {
-        //删除
-        const road = dataService.getRoad(focusItem.vectorId);
-        roadService.subtraRoadFromIntersect(road.startId, focusItem.vectorId);
-        roadService.subtraRoadFromIntersect(road.endId, focusItem.vectorId);
-        //dataService.deleteCrossPoint()
-        dataService.deleteRoad(focusItem.vectorId);
-        this.renderer.autoRedraw();
-        this.history.save();
-      }
-      //加宽
-      else if (e.code == "KeyA") {
-        let road = dataService.getRoad(focusItem.vectorId);
-        if (road) {
-          roadService.updateForWidth(road.vectorId, road.leftWidth + 50, dir);
-        } else {
-          road = dataService.getCurveRoad(focusItem.vectorId);
-          curveRoadService.updateForWidth(
-            road.vectorId,
-            road.leftWidth + 50,
-            dir
-          );
-        }
-
-        this.renderer.autoRedraw();
-        this.history.save();
-      }
-      //变窄
-      else if (e.code == "KeyB") {
-        let road = dataService.getRoad(focusItem.vectorId);
-        if (road) {
-          roadService.updateForWidth(road.vectorId, road.leftWidth - 25, dir);
-        } else {
-          road = dataService.getCurveRoad(focusItem.vectorId);
-          curveRoadService.updateForWidth(
-            road.vectorId,
-            road.leftWidth - 25,
-            dir
-          );
-        }
-        this.renderer.autoRedraw();
-        this.history.save();
-      }
-      //添加左车道
-      else if (e.code == "KeyQ") {
-        let road = dataService.getRoad(focusItem.vectorId);
-        if (road) {
-          roadService.updateForAddSubtractLanesCount(
-            focusItem.vectorId,
-            road.leftDrivewayCount + 1,
-            "left"
-          );
-        } else {
-          road = dataService.getCurveRoad(focusItem.vectorId);
-          curveRoadService.updateForAddSubtractLanesCount(
-            road,
-            road.leftDrivewayCount + 1, //rightDrivewayCount
-            "left"
-          );
-        }
-        this.renderer.autoRedraw();
-        this.history.save();
-      }
-      //减少左车道
-      else if (e.code == "KeyW") {
-        let road = dataService.getRoad(focusItem.vectorId);
-        if (road) {
-          roadService.updateForAddSubtractLanesCount(
-            focusItem.vectorId,
-            road.leftDrivewayCount - 1,
-            "left"
-          );
-        } else {
-          road = dataService.getCurveRoad(focusItem.vectorId);
-          curveRoadService.updateForAddSubtractLanesCount(
-            road,
-            road.leftDrivewayCount - 1, //rightDrivewayCount
-            "left"
-          );
-        }
-        this.renderer.autoRedraw();
-        this.history.save();
-      }
-      //添加右车道
-      else if (e.code == "KeyE") {
-        let road = dataService.getRoad(focusItem.vectorId);
-        if (road) {
-          roadService.updateForAddSubtractLanesCount(
-            focusItem.vectorId,
-            road.rightDrivewayCount + 1,
-            "right"
-          );
-        } else {
-          road = dataService.getCurveRoad(focusItem.vectorId);
-          curveRoadService.updateForAddSubtractLanesCount(
-            road,
-            road.rightDrivewayCount + 1, //rightDrivewayCount
-            "right"
-          );
-        }
-        this.renderer.autoRedraw();
-        this.history.save();
-      }
-      //减少右车道
-      else if (e.code == "KeyR") {
-        let road = dataService.getRoad(focusItem.vectorId);
-        if (road) {
-          roadService.updateForAddSubtractLanesCount(
-            focusItem.vectorId,
-            road.rightDrivewayCount - 1,
-            "right"
-          );
-        } else {
-          road = dataService.getCurveRoad(focusItem.vectorId);
-          curveRoadService.updateForAddSubtractLanesCount(
-            road,
-            road.rightDrivewayCount - 1, //rightDrivewayCount
-            "right"
-          );
-        }
-        this.renderer.autoRedraw();
-        this.history.save();
-      }
-      //弯路添加控制点
-      else if (e.code == "KeyT") {
-        const curveRoad = dataService.getCurveRoad(focusItem.vectorId);
-        let index = mathUtil.getIndexForCurvesPoints(
-          this.mousePosition,
-          curveRoad.points
-        );
-        if (index != -1) {
-          curveRoadService.addCPoint(curveRoad, this.mousePosition, index);
-        } else {
-          const dis1 = mathUtil.getDistance(
-            curveRoad.points[0],
-            this.mousePosition
-          );
-          const dis2 = mathUtil.getDistance(
-            curveRoad.points[curveRoad.points.length - 1],
-            this.mousePosition
-          );
-          if (dis1 > dis2) {
-            curveRoadService.addCPoint(
-              curveRoad,
-              this.mousePosition,
-              curveRoad.points.length - 2
-            );
-          } else {
-            curveRoadService.addCPoint(curveRoad, this.mousePosition, 1);
-          }
-        }
-        this.renderer.autoRedraw();
-        this.history.save();
-      }
-      //弯路删除控制点
-      else if (e.code == "KeyY") {
-        const curvePoint = dataService.getCurveRoadPoint(focusItem.vectorId);
-        const curveRoad = dataService.getCurveRoad(curvePoint.parent);
-        curveRoadService.subCPoint(curveRoad, curvePoint.getIndex());
-        this.renderer.autoRedraw();
-        this.history.save();
-      }
-    } else {
-      console.log("键盘(foucus无效):" + e.code);
-    }
-  }
-
   setEventName(eventType) {
     let eventName = stateService.getEventName();
 

+ 30 - 23
src/graphic/ListenLayer.js

@@ -227,11 +227,11 @@ export default class ListenLayer {
         continue;
       }
       const point = dataService.getPoint(pointId);
-  
+
       if (point.getCategory() == VectorCategory.Point.TestBasePoint) {
         continue;
       }
-   
+
       const distance = this.getDistance(position, point);
       if (distance < Constant.minAdsorbPix) {
         if (pointInfo.pointId == null) {
@@ -267,8 +267,8 @@ export default class ListenLayer {
       pointInfo.x = linkedPoint.x;
       pointInfo.y = linkedPoint.y;
       //判断当时基准点则要高亮
-      if(linkedPoint.getCategory() ==VectorCategory.Point.BasePoint ){
-        Settings.selectBasePointId = linkedPoint.vectorId
+      if (linkedPoint.getCategory() == VectorCategory.Point.BasePoint) {
+        Settings.selectBasePointId = linkedPoint.vectorId;
       }
     } else {
       if (seqInfo.hasOwnProperty("linkedPointIdX")) {
@@ -287,7 +287,6 @@ export default class ListenLayer {
       }
     }
 
-
     return pointInfo;
   }
 
@@ -730,16 +729,7 @@ export default class ListenLayer {
         curveRoad.curves,
         Constant.minAdsorbPix
       );
-      //选中了路
-      if (joinInfo.distance < Constant.minAdsorbPix) {
-        curveRoadInfo = {
-          curveRoadId: curveRoadId,
-          type: VectorType.CurveRoad,
-          distance: joinInfo.distance,
-          x: joinInfo.position.x,
-          y: joinInfo.position.y,
-        };
-      }
+
       //检查edge
       const leftCurveEdge = dataService.getCurveRoadEdge(curveRoad.leftEdgeId);
       const leftJoinInfo = this.distanceForBezier(
@@ -756,15 +746,32 @@ export default class ListenLayer {
         rightCurveEdge.curves,
         Constant.minAdsorbPix
       );
-      if (curveRoadInfo.curveRoadId) {
-        if (
-          mathUtil.getDistance(position, leftJoinInfo.position) >
-          mathUtil.getDistance(position, rightJoinInfo.position)
-        ) {
-          curveRoadInfo.dir = "right";
-        } else {
-          curveRoadInfo.dir = "left";
+
+      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) {

+ 11 - 1
src/graphic/Load.js

@@ -27,6 +27,11 @@ export default class Load {
   async load(dataLocal, data3d) {
     this.layer.initLocation();
     if (dataLocal) {
+      if(dataLocal.Settings){
+        for(let key in dataLocal.Settings){
+          Settings[key] = dataLocal.Settings[key]
+        }
+      }
       if (dataLocal.backgroundImg) {
         let bgImg = imageService.createBackgroundImg(
           dataLocal.backgroundImg.src,
@@ -57,6 +62,7 @@ export default class Load {
         }
       }
       if (dataLocal.magnifiers) {
+
         for (let key in dataLocal.magnifiers) {
           let magnifier = magnifierService.create(
             dataLocal.magnifiers[key].position,
@@ -64,6 +70,9 @@ export default class Load {
           );
           magnifier.setSrc(dataLocal.magnifiers[key].photoUrl);
           magnifier.setDisplay(dataLocal.magnifiers[key].display);
+     
+          magnifier.setPopPosition(null,dataLocal.magnifiers[key].popPosition)
+      
           try {
             if (dataLocal.magnifiers[key].photoUrl) {
               await magnifier.setImageData();
@@ -298,7 +307,8 @@ export default class Load {
 
     const scale = res / (coordinate.zoom / coordinate.defaultZoom);
     dataService.setScale(scale);
-    return dataService.vectorData;
+    console.log(Settings)
+    return {...dataService.vectorData,Settings};
   }
 
   // 退出页面清除缓存及其他操作

+ 6 - 0
src/graphic/Renderer/Draw.js

@@ -1188,6 +1188,12 @@ export default class Draw {
     const ctx = this.context;
     ctx.save();
     help.setVectorStyle(ctx, vector);
+
+    const lineWidth =
+      Settings.lineWidth *
+      (ctx.lineWidth || 1) *
+      (vector.weight === VectorWeight.Bold ? 2 : 1);
+    ctx.lineWidth = lineWidth
     help.transformCoves([vector.curves]).forEach((coves) => {
       help.drawCoves(ctx, coves);
     });

+ 96 - 62
src/graphic/Service/CurveRoadService.js

@@ -203,77 +203,110 @@ export default class CurveRoadService extends RoadService {
     let rightJoin = null;
     const leftCurveEdge = dataService.getCurveRoadEdge(curveRoad.leftEdgeId);
     const rightCurveEdge = dataService.getCurveRoadEdge(curveRoad.rightEdgeId);
-    let line1 = mathUtil.createLine1(
-      curveRoad.points[startIndex],
-      curveRoad.points[startIndex + 1]
-    );
-    let line2 = mathUtil.createLine1(
-      curveRoad.points[startIndex + 1],
-      curveRoad.points[startIndex + 2]
-    );
 
-    const leftLine = mathUtil.createLine1(
-      leftCurveEdge.points[startIndex],
-      leftCurveEdge.points[startIndex + 1]
-    );
-    let leftLine1 = mathUtil.createLine3(
-      line1,
-      leftCurveEdge.points[startIndex]
-    );
-    let leftLine2 = mathUtil.createLine3(
-      line2,
-      leftCurveEdge.points[startIndex + 1]
-    );
+    if (curveRoad.points[startIndex + 2]) {
+      let line1 = mathUtil.createLine1(
+        curveRoad.points[startIndex],
+        curveRoad.points[startIndex + 1]
+      );
+      let line2 = mathUtil.createLine1(
+        curveRoad.points[startIndex + 1],
+        curveRoad.points[startIndex + 2]
+      );
 
-    const rightLine = mathUtil.createLine1(
-      rightCurveEdge.points[startIndex],
-      rightCurveEdge.points[startIndex + 1]
-    );
-    let rightLine1 = mathUtil.createLine3(
-      line1,
-      rightCurveEdge.points[startIndex]
-    );
-    let rightLine2 = mathUtil.createLine3(
-      line2,
-      rightCurveEdge.points[startIndex + 1]
-    );
+      const leftLine = mathUtil.createLine1(
+        leftCurveEdge.points[startIndex],
+        leftCurveEdge.points[startIndex + 1]
+      );
+      let leftLine1 = mathUtil.createLine3(
+        line1,
+        leftCurveEdge.points[startIndex]
+      );
+      let leftLine2 = mathUtil.createLine3(
+        line2,
+        leftCurveEdge.points[startIndex + 1]
+      );
 
-    const line = mathUtil.createLine1(
-      curveRoad.points[startIndex],
-      curveRoad.points[startIndex + 2]
-    );
+      const rightLine = mathUtil.createLine1(
+        rightCurveEdge.points[startIndex],
+        rightCurveEdge.points[startIndex + 1]
+      );
+      let rightLine1 = mathUtil.createLine3(
+        line1,
+        rightCurveEdge.points[startIndex]
+      );
+      let rightLine2 = mathUtil.createLine3(
+        line2,
+        rightCurveEdge.points[startIndex + 1]
+      );
 
-    if (
-      mathUtil.Angle(
-        curveRoad.points[startIndex + 1],
+      const line = mathUtil.createLine1(
         curveRoad.points[startIndex],
         curveRoad.points[startIndex + 2]
-      ) > Constant.maxAngle
-    ) {
-      const join = mathUtil.getJoinLinePoint(position, line);
-      let dx = position.x - join.x;
-      let dy = position.y - join.y;
-
-      leftJoin = mathUtil.getJoinLinePoint(position, leftLine);
-      leftJoin.x += dx;
-      leftJoin.y += dy;
-      leftCurveEdge.points.splice(startIndex + 1, 0, leftJoin);
-      curveEdgeService.setCurves(leftCurveEdge);
+      );
 
-      rightJoin = mathUtil.getJoinLinePoint(position, rightLine);
-      rightJoin.x += dx;
-      rightJoin.y += dy;
-      rightCurveEdge.points.splice(startIndex + 1, 0, rightJoin);
-      curveEdgeService.setCurves(rightCurveEdge);
+      if (
+        mathUtil.Angle(
+          curveRoad.points[startIndex + 1],
+          curveRoad.points[startIndex],
+          curveRoad.points[startIndex + 2]
+        ) > Constant.maxAngle
+      ) {
+        const join = mathUtil.getJoinLinePoint(position, line);
+        let dx = position.x - join.x;
+        let dy = position.y - join.y;
+
+        leftJoin = mathUtil.getJoinLinePoint(position, leftLine);
+        leftJoin.x += dx;
+        leftJoin.y += dy;
+        leftCurveEdge.points.splice(startIndex + 1, 0, leftJoin);
+        curveEdgeService.setCurves(leftCurveEdge);
+
+        rightJoin = mathUtil.getJoinLinePoint(position, rightLine);
+        rightJoin.x += dx;
+        rightJoin.y += dy;
+        rightCurveEdge.points.splice(startIndex + 1, 0, rightJoin);
+        curveEdgeService.setCurves(rightCurveEdge);
+      } else {
+        leftJoin = mathUtil.getIntersectionPoint(leftLine1, leftLine2);
+        leftCurveEdge.points.splice(startIndex + 1, 0, leftJoin);
+        curveEdgeService.setCurves(leftCurveEdge);
+
+        rightJoin = mathUtil.getIntersectionPoint(rightLine1, rightLine2);
+        rightCurveEdge.points.splice(startIndex + 1, 0, rightJoin);
+        curveEdgeService.setCurves(rightCurveEdge);
+      }
     } else {
-      leftJoin = mathUtil.getIntersectionPoint(leftLine1, leftLine2);
+      curveRoad.endId = point.vectorId;
+      let line = mathUtil.createLine1(
+        curveRoad.points[startIndex],
+        curveRoad.points[startIndex + 1]
+      );
+      let leftLine = mathUtil.createLine3(
+        line,
+        leftCurveEdge.points[startIndex]
+      );
+      let leftJoin = mathUtil.getJoinLinePoint(position, leftLine);
       leftCurveEdge.points.splice(startIndex + 1, 0, leftJoin);
+      leftCurveEdge.points[startIndex] = JSON.parse(
+        JSON.stringify(leftCurveEdge.end)
+      );
+      mathUtil.clonePoint(leftCurveEdge.end, leftJoin);
       curveEdgeService.setCurves(leftCurveEdge);
 
-      rightJoin = mathUtil.getIntersectionPoint(rightLine1, rightLine2);
+      let rightLine = mathUtil.createLine3(
+        line,
+        rightCurveEdge.points[startIndex]
+      );
+      let rightJoin = mathUtil.getJoinLinePoint(position, rightLine);
       rightCurveEdge.points.splice(startIndex + 1, 0, rightJoin);
+      rightCurveEdge.points[startIndex] = JSON.parse(
+        JSON.stringify(rightCurveEdge.end)
+      );
+      mathUtil.clonePoint(rightCurveEdge.end, rightJoin);
       curveEdgeService.setCurves(rightCurveEdge);
     }
+
     this.setCurves(curveRoad);
   }
 
@@ -459,12 +492,13 @@ export default class CurveRoadService extends RoadService {
   }
 
   //删除或者减少车道
-  updateForAddSubtractLanesCount(curveRoad, newCount, dir) {
+  updateForAddSubtractLanesCount(curveRoadId, newCount, dir) {
+    let curveRoad = dataService.getCurveRoad(curveRoadId);
     let curveEdge, oldCount, lanes;
     const leftCurveEdge = dataService.getCurveRoadEdge(curveRoad.leftEdgeId);
     const rightCurveEdge = dataService.getCurveRoadEdge(curveRoad.rightEdgeId);
-    if (newCount < 0) {
-      newCount = 0;
+    if (newCount < 1) {
+      return;
     }
 
     let ratio = null;
@@ -584,10 +618,10 @@ export default class CurveRoadService extends RoadService {
   //多车道转单车道
   mulToSinglelane(curveRoad) {
     if (curveRoad.leftDrivewayCount > 0) {
-      this.updateForAddSubtractLanesCount(curveRoad, 1, "left");
+      this.updateForAddSubtractLanesCount(curveRoad.vectorId, 1, "left");
     }
     if (curveRoad.rightDrivewayCount > 0) {
-      this.updateForAddSubtractLanesCount(curveRoad, 1, "right");
+      this.updateForAddSubtractLanesCount(curveRoad.vectorId, 1, "right");
     }
     curveRoad.leftDrivewayCount = 0;
     curveRoad.rightDrivewayCount = 0;

+ 6 - 6
src/graphic/Service/DataService.js

@@ -30,8 +30,8 @@ export class DataService {
 
   initGrid() {
     this.grid = {
-      defalutstep1: 50 * coordinate.ratio,
-      defalutstep2: 250 * coordinate.ratio,
+      defalutstep1: 25 * coordinate.ratio,
+      defalutstep2: 125 * coordinate.ratio,
       display: true,
     };
     this.grid.start = JSON.parse(JSON.stringify(coordinate.center));
@@ -134,11 +134,11 @@ export class DataService {
 
   deleteLine(lineId) {
     let line = this.getLine(lineId);
-    if(!line){
-      return
+    if (!line) {
+      return;
     }
     let start = this.getPoint(line.startId);
-    if (start  && start.getCategory()!= VectorCategory.Point.BasePoint) {
+    if (start && start.getCategory() != VectorCategory.Point.BasePoint) {
       let startParent = start.getParent();
       delete startParent[lineId];
       if (
@@ -153,7 +153,7 @@ export class DataService {
     if (end) {
       let endParent = end.getParent();
       delete endParent[lineId];
-      
+
       if (
         Object.keys(endParent).length == 0 &&
         end.getCategory() != VectorCategory.Point.BasePoint

+ 7 - 2
src/graphic/Service/RoadService.js

@@ -616,6 +616,11 @@ export default class RoadService {
     this.subtraRoadFromIntersect(road.startId, roadId);
     this.subtraRoadFromIntersect(road.endId, roadId);
     dataService.deleteRoad(roadId);
+
+    dataService.deleteCrossPointForEdge(road.leftEdgeId, "start");
+    dataService.deleteCrossPointForEdge(road.leftEdgeId, "end");
+    dataService.deleteCrossPointForEdge(road.rightEdgeId, "start");
+    dataService.deleteCrossPointForEdge(road.rightEdgeId, "end");
   }
 
   setRoadPointId(roadId, pointId, dir) {
@@ -1264,8 +1269,8 @@ export default class RoadService {
       middy2;
     let road = dataService.getRoad(roadId);
 
-    if (newCount < 0) {
-      newCount = 0;
+    if (newCount < 1) {
+      return;
     }
 
     let startPoint = dataService.getRoadPoint(road.startId);

+ 3 - 0
src/graphic/Util/MathUtil.js

@@ -644,6 +644,9 @@ export default class MathUtil {
   }
 
   equalPoints(points1, points2) {
+    if (points1.length != points2.length) {
+      return false;
+    }
     for (let i = 0; i < points1.length; ++i) {
       let flag = this.equalPoint(points1[i], points2[i]);
       if (!flag) {

+ 1 - 1
src/main.ts

@@ -1,7 +1,7 @@
 import VConsole from 'vconsole';
 if (import.meta.env.MODE !== "production") {
   if (!os.isPc) {
-    // new VConsole();
+    new VConsole();
   }
 }
 

+ 1 - 0
src/sdk/types/sdk.ts

@@ -21,6 +21,7 @@ export type SceneEventMap = {
   loaded: void;
   webglError: void;
   visible: boolean;
+  viewChange: "Top" | "Bottom"
 };
 
 export type PointInfo = {

+ 4 - 4
src/views/graphic/geos/normalLine.vue

@@ -19,7 +19,7 @@ import VectorCategory from "@/graphic/enum/VectorCategory";
 const props = defineProps<{ geo: FocusVector }>()
 const vector = computed(() => dataService.getLine(props.geo.vectorId))
 
-console.log(vector)
+const isCurve = props.geo.type === VectorType.CurveLine
 const clickHandlerFactory = (key) => {
   return () => drawRef.value.uiControl.updateVectorForSelectUI(key)
 }
@@ -70,7 +70,7 @@ const lineWidthMenu = [
     text: "宽度",
     onClick: () => {
       clickHandlerFactory(VectorWeight.Thinning)()
-      menus.value[1] = lineWidthMenu[1]
+      menus.value[isCurve ? 0 : 1] = lineWidthMenu[1]
     }
   },
   {
@@ -79,12 +79,12 @@ const lineWidthMenu = [
     text: "宽度",
     onClick: () => {
       clickHandlerFactory(VectorWeight.Bold)()
-      menus.value[1] = lineWidthMenu[0]
+      menus.value[isCurve ? 0 : 1] = lineWidthMenu[0]
     }
   },
 ]
 
-const appendMenus = (props.geo.category === VectorCategory.Line.NormalLine || props.geo.type === VectorType.CurveLine)
+const appendMenus = (props.geo.category === VectorCategory.Line.NormalLine || isCurve)
   ? [
     {
       key: VectorEvents.AddCrossPoint,

+ 1 - 1
src/views/photos/index.vue

@@ -1,7 +1,7 @@
 <template>
   <MainPanel>
     <template v-slot:header>
-      <Header :count="selects.length" :title="`全部照片(${photos.length})`" type="return">
+      <Header :count="selects.length" :title="`全部照片(${photos.length})`" type="return" :on-back="() => router.back()">
         <ui-button type="primary" @click="selectMode = !selectMode" width="96px" v-if="sortPhotos.length">
           {{ selectMode ? '取消' : '选择' }}
         </ui-button>

+ 9 - 1
src/views/scene/menus/menus.ts

@@ -1,6 +1,6 @@
 import {findMenuByAttr, generateMixMenus as generateMixMenusRaw} from '@/utils/menus'
 import {nextTick, ref} from "vue";
-import {useSDK} from "@/hook";
+import {useAsyncSDK, useSDK} from "@/hook";
 import {laserModeStack, modeDisabled} from '@/hook/custom/index'
 import {Mode} from "@/sdk";
 import {baseLines} from "@/store/baseLine";
@@ -31,6 +31,13 @@ export enum menuEnum {
   BASE_POINT = 'basePoint',
 }
 
+const vView = ref(false)
+useAsyncSDK().then(sdk => {
+  sdk.scene.on('viewChange', (view) => {
+    vView.value = view === "Top" || view === "Bottom"
+  })
+})
+
 export const menus: MenuRaw[] = [
   // {
   //   icon: "save",
@@ -59,6 +66,7 @@ export const menus: MenuRaw[] = [
       {
         icon: "line_v",
         continued: true,
+        disabled: () => vView.value,
         text: "垂直",
         key: menuEnum.MEASURE_COLUMN
       },

+ 7 - 0
src/views/scene/menus/pane.vue

@@ -47,6 +47,13 @@ const store = generateMixMenus(
   menusMix.value
 )
 
+watchEffect(() => {
+  const menu = findMenuByKey(store.itemActiveKey.value as any)
+  if (menu?.disabled && menu?.disabled()) {
+    store.itemActiveKey.value = null
+  }
+})
+
 watchEffect((onCleanup) => {
   const menu = store.activeMenuKey.value && findMenuByKey(store.activeMenuKey.value)
   if (store.child && menu?.onClick) {