Quellcode durchsuchen

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

xzw vor 2 Jahren
Ursprung
Commit
afce45ca29

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
server/test/SS-t-P1d6CwREny2/attach/sceneStore


BIN
server/test/SS-t-P1d6CwREny2/attach/upload/1684815565512952.jpg


BIN
server/test/SS-t-P1d6CwREny2/attach/upload/168481615598888.jpg


+ 8 - 0
src/assets/pc.scss

@@ -15,3 +15,11 @@
 
   --boundMargin: 24px
 }
+
+.head-icon {
+  display: inline-block;
+  width: var(--editor-menu-width);
+  font-size: 20px !important;
+  margin-left: -20px;
+  text-align: center;
+}

+ 1 - 1
src/components/group-button/index.vue

@@ -81,7 +81,7 @@ const menuStyle = computed(() => {
 
   p {
     line-height: 17px;
-    font-size: 12px;
+    font-size: 14px;
     white-space:nowrap;
   }
 }

+ 1 - 0
src/components/main-panel/index.vue

@@ -53,6 +53,7 @@ const layoutClass = computed(() => ({
   top: var(--header-top);
   display: flex;
   align-items: center;
+  font-size: 16px;
 }
 
 .header .menu {

+ 1 - 0
src/graphic/CanvasStyle/default.js

@@ -204,6 +204,7 @@ export default {
   Magnifier,
   Font: CanvasFont,
   MeasureLine,
+  PositionLine: MeasureLine,
   Measure,
   Element,
   TestPoint,

+ 18 - 16
src/graphic/Controls/AddLine.js

@@ -5,6 +5,7 @@ import VectorCategory from "../enum/VectorCategory";
 import Point from "../Geometry/Point.js";
 import { mathUtil } from "../Util/MathUtil";
 import Settings from "../Settings";
+import { pointService } from "../Service/PointService";
 
 export default class AddLine {
   constructor() {
@@ -52,24 +53,25 @@ export default class AddLine {
   }
 
   finish(position) {
-    if (
-      this.newLine != null &&
-      mathUtil.equalPoint(this.startInfo.position, position)
-    ) {
-      dataService.deleteLine(this.newLine.vectorId);
-    } else if (
-      listenLayer.modifyPoint &&
-      listenLayer.modifyPoint.linkedPointId &&
-      this.newLine.getCategory() != VectorCategory.Line.ArrowLine &&
-      this.newLine.getCategory() != VectorCategory.Line.GuideLine
-    ) {
-      lineService.mergePoint(
-        this.newLine.endId,
-        listenLayer.modifyPoint.linkedPointId
-      );
+    if (this.newLine != null) {
+      if (mathUtil.equalPoint(this.startInfo.position, position)) {
+        dataService.deleteLine(this.newLine.vectorId);
+      } else if (
+        listenLayer.modifyPoint &&
+        listenLayer.modifyPoint.linkedPointId &&
+        this.newLine.getCategory() != VectorCategory.Line.ArrowLine &&
+        this.newLine.getCategory() != VectorCategory.Line.GuideLine
+      ) {
+        pointService.mergePoint(
+          this.newLine.endId,
+          listenLayer.modifyPoint.linkedPointId
+        );
+      }
+      if (this.newLine.getCategory() == VectorCategory.Line.BaseLine) {
+        Settings.baseLineId = this.newLine.vectorId;
+      }
     }
   }
-
   clearVectorData() {
     this.newLine = null;
     this.startInfo = {};

+ 6 - 5
src/graphic/Controls/AddPoint.js

@@ -9,17 +9,17 @@ import Settings from "../Settings";
 import { stateService } from "../Service/StateService";
 import VectorType from "../enum/VectorType";
 import Constant from "../Constant";
+import { listenLayer } from "../ListenLayer";
 
 export default class AddPoint {
   constructor() {
-    this.basePointIds = []; //所有基准点
     this.testPointIds = []; //所有待测点
   }
 
   buildPoint(position) {
     const newPoint = pointService.create(position);
     if (newPoint.getCategory() == VectorCategory.Point.BasePoint) {
-      this.basePointIds.push(newPoint.vectorId);
+      Settings.selectBasePointId = newPoint.vectorId;
     } else {
       if (Settings.locationMode == Constant.angleLocationMode) {
         this.setLocationByAngle(newPoint.vectorId);
@@ -37,9 +37,8 @@ export default class AddPoint {
   }
 
   isFocusBasePoint() {
-    let focusItem = stateService.getFocusItem();
-    if (focusItem && focusItem.type == VectorType.Point) {
-      let point = dataService.getPoint(focusItem.vectorId);
+    if (Settings.selectBasePointId) {
+      let point = dataService.getPoint(Settings.selectBasePointId);
       if (point.getCategory() == VectorCategory.Point.BasePoint) {
         return point;
       }
@@ -51,8 +50,10 @@ export default class AddPoint {
   setLocationByAngle(testPointId) {
     let basePoint = this.isFocusBasePoint();
     if (!basePoint) {
+      console.error("没有基准点");
       return;
     }
+    console.error("选中基准点:" + basePoint.vectorId);
     let testPoint = dataService.getPoint(testPointId);
     if (testPoint.getCategory() != VectorCategory.Point.TestPoint) {
       return;

+ 26 - 0
src/graphic/Controls/MovePoint.js

@@ -1,5 +1,9 @@
 import { dataService } from "../Service/DataService";
+import { pointService } from "../Service/PointService";
 import Settings from "../Settings";
+import VectorCategory from "../enum/VectorCategory";
+import { listenLayer } from "../ListenLayer";
+
 export default class MovePoint {
   constructor() {}
 
@@ -9,6 +13,28 @@ export default class MovePoint {
     point.y = position.y;
   }
 
+  finish(pointId) {
+    if (
+      pointId &&
+      listenLayer.modifyPoint &&
+      listenLayer.modifyPoint.linkedPointId
+    ) {
+      let linkedPoint = dataService.getPoint(
+        listenLayer.modifyPoint.linkedPointId
+      );
+      const category = linkedPoint.getCategory();
+      if (
+        category != VectorCategory.Point.BasePoint &&
+        category != VectorCategory.Point.TestBasePoint &&
+        category != VectorCategory.Point.TestPoint
+      ) {
+        pointService.mergePoint(pointId, listenLayer.modifyPoint.linkedPointId);
+      } else if (category == VectorCategory.Point.BasePoint) {
+        Settings.selectBasePointId = pointId;
+      }
+    }
+  }
+
   //直角定位法
   //movePointForLocationByAngle(testPointId, basePointId) {
   movePointByAngleLocation(pointId) {

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

@@ -71,8 +71,7 @@ export default class UIControl {
       } else if (this.selectUI != selectUI) {
         if (this.selectUI != null) {
           //先取消当前事件和进程
-          stateService.clear();
-          //。。。。
+          this.layer.exit();
         }
 
         //执行新的事件
@@ -281,6 +280,19 @@ export default class UIControl {
     this._prompts.push(Message.success({ msg }));
   }
 
+  // 进入持续添加出确认与取消框
+  showConfirm() {
+    this.graphicStateUI.continuedMode = true
+  }
+  confirmEntry() {
+    console.log("确认")
+    this.graphicStateUI.continuedMode = false
+  }
+  confirmCancel() {
+    console.log("取消")
+    this.graphicStateUI.continuedMode = false
+  }
+
   hidePrompt() {
     for (let prompt of this._prompts) {
       prompt();

+ 10 - 6
src/graphic/Layer.js

@@ -819,6 +819,7 @@ export default class Layer {
         break;
       case LayerEvents.MovePoint:
         needAutoRedraw = true;
+        movePoint.finish(draggingItem.vectorId);
         this.history.save();
         break;
       case LayerEvents.MoveCircle:
@@ -856,7 +857,7 @@ export default class Layer {
     dataService.setGridForZoom(
       coordinate.width,
       coordinate.height,
-      (coordinate.res * coordinate.zoom) / coordinate.defaultZoom
+      coordinate.zoom / coordinate.defaultZoom
     );
     this.renderer.autoRedraw();
   }
@@ -1113,13 +1114,16 @@ export default class Layer {
     this.renderer.autoRedraw();
   }
 
+  initLocation() {
+    Settings.baseLineId = null;
+    this.uiControl.graphicStateUI.canAngleLocationMode = false;
+    this.uiControl.graphicStateUI.canAllLocationMode = false;
+    this.uiControl.graphicStateUI.existsBaseLine = false;
+  }
+
   //更新定位信息
   updateForLocation() {
-    if (
-      addLine.newLine &&
-      addLine.newLine.getCategory() == VectorCategory.Line.BaseLine
-    ) {
-      Settings.baseLineId = addLine.newLine.vectorId;
+    if (Settings.baseLineId) {
       this.uiControl.graphicStateUI.canAngleLocationMode = true;
       this.uiControl.graphicStateUI.canAllLocationMode = true;
       this.uiControl.graphicStateUI.existsBaseLine = true;

+ 146 - 128
src/graphic/Load.js

@@ -4,6 +4,7 @@ import { pointService } from "./Service/PointService.js";
 import { imageService } from "./Service/ImageService.js";
 import VectorCategory from "./enum/VectorCategory.js";
 import { coordinate } from "./Coordinate.js";
+import Settings from "./Settings";
 import { circleService } from "./Service/CircleService.js";
 import { magnifierService } from "./Service/MagnifierService.js";
 import { textService } from "./Service/TextService.js";
@@ -17,139 +18,156 @@ export default class Load {
   }
 
   async load(dataLocal, data3d) {
-    if (dataLocal) {
-      if (dataLocal.backgroundImg) {
-        let bgImg = imageService.create(
-          dataLocal.backgroundImg.src,
-          dataLocal.backgroundImg.vectorId
-        );
-        bgImg.setCenter(dataLocal.backgroundImg.center);
-        bgImg.setDisplay(dataLocal.backgroundImg.display);
-        bgImg.setAngle(dataLocal.backgroundImg.angle);
-        try {
-          if (dataLocal.backgroundImg.src) {
-            await bgImg.setImageData();
-          }
-        } catch (e) {}
-      }
-      if (dataLocal.circles) {
-        for (let key in dataLocal.circles) {
-          let circle = circleService.create(
-            dataLocal.circles[key].center,
-            dataLocal.circles[key].radius,
-            key
-          );
-          circle.setPoints(dataLocal.circles[key].points);
-          circle.setColor(dataLocal.circles[key].color);
-          circle.setDisplay(dataLocal.circles[key].display);
-        }
-      }
-      if (dataLocal.magnifiers) {
-        for (let key in dataLocal.magnifiers) {
-          let magnifier = magnifierService.create(
-            dataLocal.magnifiers[key].position,
-            key
-          );
-          magnifier.setSrc(dataLocal.magnifiers[key].photoUrl);
-          magnifier.setDisplay(dataLocal.magnifiers[key].display);
-          try {
-            if (dataLocal.magnifiers[key].photoUrl) {
-              await magnifier.setImageData();
-            }
-          } catch (e) {}
-        }
-      }
-      if (dataLocal.texts) {
-        for (let key in dataLocal.texts) {
-          let text = textService.create(dataLocal.texts[key].center, key);
-          text.setValue(dataLocal.texts[key].value);
-          text.setFontSize(dataLocal.texts[key].fontSize);
-          text.setColor(dataLocal.texts[key].color);
-          text.setDisplay(dataLocal.texts[key].display);
-        }
-      }
-      if (dataLocal.points) {
-        for (let key in dataLocal.points) {
-          let point = pointService.create(
-            { x: dataLocal.points[key].x, y: dataLocal.points[key].y },
-            dataLocal.points[key].category,
-            key
-          );
-          point.setParent(
-            JSON.parse(JSON.stringify(dataLocal.points[key].parent))
-          );
-          point.setDisplay(dataLocal.points[key].display);
-        }
-      }
-      if (dataLocal.lines) {
-        for (let key in dataLocal.lines) {
-          let line = lineService.createByPointId(
-            dataLocal.lines[key].startId,
-            dataLocal.lines[key].endId,
-            dataLocal.lines[key].category,
-            key
-          );
-          if (dataLocal.lines[key].arrowColor) {
-            line.setArrowColor(dataLocal.lines[key].arrowColor);
-          }
-          line.setDisplay(dataLocal.lines[key].display);
-        }
-      }
-      if (dataLocal.hasOwnProperty("currentId")) {
-        dataService.setCurrentId(dataLocal.currentId);
-      }
-    }
-    if (data3d) {
-      if (data3d.backImage) {
-        let bgImg = imageService.create(data3d.backImage, data3d.vectorId);
-        bgImg.setCenter(coordinate.center);
-        try {
-          if (bgImg.src) {
-            await bgImg.setImageData();
-          }
-        } catch (e) {}
-      }
-      if (data3d.baseLines) {
-        for (let i = 0; i < data3d.baseLines.length; ++i) {
-          //理论上基准线只能有一条
-          lineService.create(
-            data3d.baseLines[i][0],
-            data3d.baseLines[i][1],
-            VectorCategory.Line.BaseLine
-          );
-        }
-      }
-      if (data3d.measures) {
-        for (let i = 0; i < data3d.measures.length; ++i) {
-          //理论上基准线只能有一条
-          lineService.create(
-            data3d.measures[i][0],
-            data3d.measures[i][1],
-            VectorCategory.Line.MeasureLine
-          );
-        }
-      }
-      if (data3d.basePoints) {
-        for (let i = 0; i < data3d.basePoints.length; ++i) {
-          pointService.create(
-            data3d.basePoints[i],
-            VectorCategory.Point.BasePoint
-          );
-        }
-      }
-      if (data3d.fixPoints) {
-        for (let i = 0; i < data3d.fixPoints.length; ++i) {
-          pointService.create(
-            data3d.fixPoints[i],
-            VectorCategory.Point.FixPoint
-          );
-        }
-      }
+    this.layer.initLocation();
+    // if (dataLocal) {
+    //   if (dataLocal.backgroundImg) {
+    //     let bgImg = imageService.create(
+    //       dataLocal.backgroundImg.src,
+    //       dataLocal.backgroundImg.vectorId
+    //     );
+    //     bgImg.setCenter(dataLocal.backgroundImg.center);
+    //     bgImg.setDisplay(dataLocal.backgroundImg.display);
+    //     bgImg.setAngle(dataLocal.backgroundImg.angle);
+    //     try {
+    //       if (dataLocal.backgroundImg.src) {
+    //         await bgImg.setImageData();
+    //       }
+    //     } catch (e) {}
+    //   }
+    //   if (dataLocal.circles) {
+    //     for (let key in dataLocal.circles) {
+    //       let circle = circleService.create(
+    //         dataLocal.circles[key].center,
+    //         dataLocal.circles[key].radius,
+    //         key
+    //       );
+    //       circle.setPoints(dataLocal.circles[key].points);
+    //       circle.setColor(dataLocal.circles[key].color);
+    //       circle.setDisplay(dataLocal.circles[key].display);
+    //     }
+    //   }
+    //   if (dataLocal.magnifiers) {
+    //     for (let key in dataLocal.magnifiers) {
+    //       let magnifier = magnifierService.create(
+    //         dataLocal.magnifiers[key].position,
+    //         key
+    //       );
+    //       magnifier.setSrc(dataLocal.magnifiers[key].photoUrl);
+    //       magnifier.setDisplay(dataLocal.magnifiers[key].display);
+    //       try {
+    //         if (dataLocal.magnifiers[key].photoUrl) {
+    //           await magnifier.setImageData();
+    //         }
+    //       } catch (e) {}
+    //     }
+    //   }
+    //   if (dataLocal.texts) {
+    //     for (let key in dataLocal.texts) {
+    //       let text = textService.create(dataLocal.texts[key].center, key);
+    //       text.setValue(dataLocal.texts[key].value);
+    //       text.setFontSize(dataLocal.texts[key].fontSize);
+    //       text.setColor(dataLocal.texts[key].color);
+    //       text.setDisplay(dataLocal.texts[key].display);
+    //     }
+    //   }
+    //   if (dataLocal.points) {
+    //     for (let key in dataLocal.points) {
+    //       let point = pointService.create(dataLocal.points[key], key);
+    //       point.setCategory(dataLocal.points[key].category);
+    //       point.setParent(
+    //         JSON.parse(JSON.stringify(dataLocal.points[key].parent))
+    //       );
+    //       point.setDisplay(dataLocal.points[key].display);
+    //     }
+    //   }
+    //   if (dataLocal.lines) {
+    //     for (let key in dataLocal.lines) {
+    //       let line = lineService.createByPointId(
+    //         dataLocal.lines[key].startId,
+    //         dataLocal.lines[key].endId,
+    //         dataLocal.lines[key].category,
+    //         key
+    //       );
+    //       if (dataLocal.lines[key].arrowColor) {
+    //         line.setArrowColor(dataLocal.lines[key].arrowColor);
+    //       }
+    //       line.setDisplay(dataLocal.lines[key].display);
+    //       if (line.getCategory() == VectorCategory.Line.BaseLine) {
+    //         Settings.baseLineId = key;
+    //       }
+    //     }
+    //   }
+    //   if (dataLocal.hasOwnProperty("currentId")) {
+    //     dataService.setCurrentId(dataLocal.currentId);
+    //   }
+    // }
+    // if (data3d) {
+    //   if (data3d.backImage) {
+    //     let bgImg = imageService.create(data3d.backImage, data3d.vectorId);
+    //     bgImg.setCenter(coordinate.center);
+    //     try {
+    //       if (bgImg.src) {
+    //         await bgImg.setImageData();
+    //       }
+    //     } catch (e) {}
+    //     if (data3d.meterPerPixel) {
+    //       const width = bgImg.imageData.width;
+    //       const height = bgImg.imageData.height;
+    //       coordinate.setRes(data3d.meterPerPixel);
+    //       if (data3d.baseLines) {
+    //         for (let i = 0; i < data3d.baseLines.length; ++i) {
+    //           //理论上基准线只能有一条
+    //           let baseLine = lineService.create(
+    //             this.getXY(width, height, data3d.baseLines[i][0]),
+    //             this.getXY(width, height, data3d.baseLines[i][1]),
+    //             VectorCategory.Line.BaseLine
+    //           );
+    //           Settings.baseLineId = baseLine.vectorId;
+    //         }
+    //       }
+    //       if (data3d.measures) {
+    //         for (let i = 0; i < data3d.measures.length; ++i) {
+    //           //理论上基准线只能有一条
+    //           lineService.create(
+    //             this.getXY(width, height, data3d.measures[i][0]),
+    //             this.getXY(width, height, data3d.measures[i][1]),
+    //             VectorCategory.Line.MeasureLine
+    //           );
+    //         }
+    //       }
+    //       if (data3d.basePoints) {
+    //         for (let i = 0; i < data3d.basePoints.length; ++i) {
+    //           let point = pointService.create(
+    //             this.getXY(width, height, data3d.basePoints[i])
+    //           );
+    //           point.setCategory(VectorCategory.Point.BasePoint);
+    //         }
+    //       }
+    //       if (data3d.fixPoints) {
+    //         for (let i = 0; i < data3d.fixPoints.length; ++i) {
+    //           let point = pointService.create(
+    //             this.getXY(width, height, data3d.fixPoints[i])
+    //           );
+    //           point.setCategory(VectorCategory.Point.FixPoint);
+    //         }
+    //       }
+    //     }
+    //   }
+    // }
+    if (Settings.baseLineId) {
+      this.layer.updateForLocation();
     }
     this.layer.history.init();
     this.layer.renderer.autoRedraw();
   }
 
+  getXY(width, height, position) {
+    const point = {};
+    point.x = position.x - width / 2;
+    point.y = height / 2 - position.y;
+    return point;
+  }
+
   save() {
     return dataService.vectorData;
   }

+ 3 - 4
src/graphic/Renderer/Draw.js

@@ -687,7 +687,7 @@ export default class Draw {
       this.context,
       coordinate.getScreenXY(startReal),
       coordinate.getScreenXY(endReal),
-      help.getRealDistance(startReal, endReal) + "m",
+      help.getRealDistance(startReal, endReal) * coordinate.res + "m",
       style
     )
   }
@@ -736,7 +736,7 @@ export default class Draw {
     const [style, attr] = help.setVectorStyle(
       this.context,
       vector,
-      vector.category || vector.geoType
+      [vector.category, vector.geoType, 'BaseLine']
     );
     if (style.dash) {
       this.context.setLineDash(style.dash);
@@ -764,9 +764,8 @@ export default class Draw {
         this.drawBaseLineLabel(vector)
         drawPoints()
         break;
-      case VectorCategory.Line.MeasureLine:
+      case VectorCategory.Line.PositionLine:
         this.drawLineText(vector, style.text)
-        drawPoints()
         break;
     }
 

+ 11 - 3
src/graphic/Renderer/Render.js

@@ -35,6 +35,9 @@ export default class Render {
       case VectorType.CrossPoint:
         draw.drawCrossPoint(vector);
         return;
+      case VectorType.Point:
+        draw.drawPoint(vector);
+        break;
       case VectorType.Line:
         draw.drawLine(vector); //需要修改,有几种情况:测量,校准,基准
         break;
@@ -119,9 +122,9 @@ export default class Render {
       this.drawGeometry(roads[key]);
     }
 
-    let points = dataService.getRoadPoints();
-    for (let key in points) {
-      this.drawGeometry(points[key]);
+    let roadPoints = dataService.getRoadPoints();
+    for (let key in roadPoints) {
+      this.drawGeometry(roadPoints[key]);
     }
 
     let curveRoads = dataService.getCurveRoads();
@@ -134,6 +137,11 @@ export default class Render {
       this.drawGeometry(crossPoints[key]);
     }
 
+    let points = dataService.getPoints();
+    for (let key in points) {
+      this.drawGeometry(points[key]);
+    }
+
     let lines = dataService.getLines();
     for (let key in lines) {
       this.drawGeometry(lines[key]);

+ 2 - 4
src/graphic/Service/DataService.js

@@ -70,11 +70,9 @@ export class DataService {
     this.grid.startX += dx;
     this.grid.startY += dy;
     this.grid.step1 =
-      (this.grid.defalutstep1 * coordinate.res * coordinate.zoom) /
-      coordinate.defaultZoom;
+      (this.grid.defalutstep1 * coordinate.zoom) / coordinate.defaultZoom;
     this.grid.step2 =
-      (this.grid.defalutstep2 * coordinate.res * coordinate.zoom) /
-      coordinate.defaultZoom;
+      (this.grid.defalutstep2 * coordinate.zoom) / coordinate.defaultZoom;
     while (this.grid.startX > 0) {
       this.grid.startX -= this.grid.step2;
     }

+ 10 - 18
src/graphic/Service/LineService.js

@@ -72,26 +72,18 @@ export default class LineService {
     return newLine;
   }
 
-  //将pointId1合并到pointId2
-  mergePoint(pointId1, pointId2) {
-    if (pointId1 == pointId2) {
-      return;
-    } else if (pointId1 != null && pointId2 != null) {
-      let point1 = dataService.getPoint(pointId1);
-      let parent1 = point1.getParent();
-      let point2 = dataService.getPoint(pointId2);
-      for (let key in parent1) {
-        let line = dataService.getLine(key);
-        let dir = line.getDir(pointId1);
-        if (dir == "start") {
-          line.startId = pointId2;
-        } else if (dir == "end") {
-          line.endId = pointId2;
-        }
-        point2.setPointParent(key, dir);
+  getLine(pointId1, pointId2) {
+    let lines = dataService.getLines();
+    for (let key in lines) {
+      const line = dataService.getLine(key);
+      if (
+        (line.startId == pointId1 && line.endId == pointId2) ||
+        (line.endId == pointId1 && line.startId == pointId2)
+      ) {
+        return key;
       }
-      dataService.deletePoint(pointId1);
     }
+    return null;
   }
 }
 

+ 30 - 0
src/graphic/Service/PointService.js

@@ -3,6 +3,7 @@ import Line from "../Geometry/Line.js";
 import { dataService } from "./DataService.js";
 import VectorCategory from "../enum/VectorCategory.js";
 import { mathUtil } from "../Util/MathUtil.js";
+import { lineService } from "./LineService.js";
 export default class PointService {
   constructor() {}
 
@@ -11,6 +12,35 @@ export default class PointService {
     dataService.addPoint(point);
     return point;
   }
+
+  //将pointId1合并到pointId2
+  mergePoint(pointId1, pointId2) {
+    if (pointId1 == pointId2) {
+      return;
+    } else if (pointId1 != null && pointId2 != null) {
+      let point1 = dataService.getPoint(pointId1);
+      let parent1 = point1.getParent();
+      let point2 = dataService.getPoint(pointId2);
+      if (mathUtil.equalPoint(point1, point2)) {
+        let lineId = lineService.getLine(pointId1, pointId2);
+        if (lineId) {
+          dataService.deleteLine(lineId);
+          return;
+        }
+      }
+      for (let key in parent1) {
+        let line = dataService.getLine(key);
+        let dir = line.getDir(pointId1);
+        if (dir == "start") {
+          line.startId = pointId2;
+        } else if (dir == "end") {
+          line.endId = pointId2;
+        }
+        point2.setPointParent(key, dir);
+      }
+      dataService.deletePoint(pointId1);
+    }
+  }
 }
 
 const pointService = new PointService();

+ 18 - 11
src/graphic/Service/UIService.js

@@ -81,17 +81,24 @@ export default class UIService {
   }
 
   isBelongPoint(ui) {
-    // if (ui == UIEvents.Arrow) {
-    //   this.setLineCategory(VectorCategory.Line.ArrowLine);
-    //   return true;
-    // } else if (ui == UIEvents.MeasureLine) {
-    //   this.setLineCategory(VectorCategory.Line.MeasureLine);
-    //   return true;
-    // } else if (ui == UIEvents.Line) {
-    //   this.setLineCategory(VectorCategory.Line.NormalLine);
-    //   return true;
-    // }
-    // return false;
+    if (ui == UIEvents.NormalLocationMode) {
+      this.setPointCategory(VectorCategory.Point.TestPoint);
+      this.setLocationMode(Constant.normalLocationMode);
+      return true;
+    } else if (ui == UIEvents.AngleLocationMode) {
+      this.setPointCategory(VectorCategory.Point.TestPoint);
+      this.setLocationMode(Constant.angleLocationMode);
+      return true;
+    } else if (ui == UIEvents.AllLocationMode) {
+      this.setPointCategory(VectorCategory.Point.TestPoint);
+      this.setLocationMode(Constant.allLocationMode);
+      return true;
+    } else if (ui == UIEvents.BasePoint) {
+      this.setPointCategory(VectorCategory.Point.BasePoint);
+      this.setLocationMode(null);
+      return true;
+    }
+    return false;
   }
 
   setWayType(value) {

+ 1 - 0
src/graphic/Settings.js

@@ -21,5 +21,6 @@ const Settings = {
   pointCategory: VectorCategory.Point.NormalPoint,
   locationMode: Constant.angleLocationMode,
   baseLineId: null, //基准线id,有且只有一条
+  selectBasePointId: null, //选中的基准点
 };
 export default Settings;

+ 1 - 0
src/hook/useGraphic.ts

@@ -35,6 +35,7 @@ export const graphicState = ref({
   canAngleLocationMode: false,
   canAllLocationMode: false,
   existsBaseLine: false,
+  continuedMode: false
 })
 
 export const setCanvas = async (canvas: HTMLCanvasElement, data: Ref<AccidentPhoto | RoadPhoto>) => {

+ 44 - 0
src/views/graphic/confirm.vue

@@ -0,0 +1,44 @@
+<template>
+  <div class="confirm">
+    <GraphicAction class="confirm-action">
+      <ui-icon
+          type="checkbox1"
+          ctrl
+          @click="() => drawRef.uiControl.confirmEntry()"
+      />
+    </GraphicAction>
+    <GraphicAction class="confirm-action">
+      <ui-icon
+          type="close"
+          ctrl
+          @click="() => drawRef.uiControl.confirmCancel()"
+      />
+    </GraphicAction>
+  </div>
+</template>
+
+<script setup lang="ts">
+import {customMap} from "@/hook";
+import GraphicAction from "@/components/button-pane/index.vue";
+import UiIcon from "@/components/base/components/icon/index.vue";
+import {uiType, drawRef} from '@/hook/useGraphic'
+
+</script>
+
+<style scoped lang="scss">
+.confirm {
+  position: absolute;
+  left: 50%;
+  bottom: var(--boundMargin);
+  width: 145px;
+  display: flex;
+  justify-content: space-between;
+}
+
+.confirm-action {
+  position: static;
+  width: 64px;
+  font-size: 22px;
+  justify-content: center;
+}
+</style>

+ 54 - 0
src/views/graphic/geos/del.vue

@@ -0,0 +1,54 @@
+<template>
+  <GeoTeleport :menus="menus" class="geo-teleport-use">
+    <template v-slot="{ data }">
+      <ui-icon type="del" class="icon" v-if="data.key === 'del'" />
+    </template>
+  </GeoTeleport>
+</template>
+
+<script setup lang="ts">
+import GeoTeleport from "@/views/graphic/geos/geo-teleport.vue";
+import UiIcon from "@/components/base/components/icon/index.vue";
+import {drawRef, uiType, UIType} from '@/hook/useGraphic'
+import GeoActions from "@/graphic/enum/GeoActions"
+
+const menus = [
+  {
+    key: 'del',
+    text: "删除",
+    onClick: () => {
+      drawRef.value.uiControl.handleGeo(GeoActions.DeleteAction)
+      uiType.change(UIType.Delete)
+    }
+  }
+]
+</script>
+
+<style scoped lang="scss">
+.color {
+  width: 18px;
+  height: 18px;
+  border: 2px solid #fff;
+  border-radius: 50%;
+}
+
+.icon {
+  font-size: 16px;
+}
+
+.geo-input {
+  position: absolute;
+  left: 0;
+  right: 0;
+  top: 0;
+  bottom: 0;
+  z-index: 1;
+  opacity: 0;
+}
+</style>
+
+<style lang="scss">
+.select-floating.select-float.dire-top {
+  margin-top: -10px;
+}
+</style>

+ 3 - 0
src/views/graphic/geos/index.ts

@@ -3,9 +3,12 @@ import Arrow from './arrow.vue'
 import Text from './text.vue'
 import Circle from './circle.vue'
 import magnifier from './magnifier.vue'
+import Del from './del.vue'
 import VectorCategory from "@/graphic/enum/VectorCategory";
 
 
+export const GlobalComp = Del
+
 export default {
   [VectorType.ArrowLine]: Arrow,
   // [VectorCategory.Line.MeasureLine]: Arrow,

+ 2 - 2
src/views/graphic/header.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="graphic-header" v-if="data">
     <div class="title">
-      <ui-icon type="close" @click="router.back" />
+      <ui-icon type="close" @click="router.back" class="head-icon" />
       <p>{{ isRoad ? '现场绘图' : '事故照片' }}</p>
     </div>
     <div class="actions">
@@ -148,7 +148,7 @@ const createTable = async () => {
   align-items: center;
   justify-content: center;
   p {
-    font-size: 12px;
+    font-size: 14px;
     text-align: center;
   }
 }

+ 9 - 5
src/views/graphic/index.vue

@@ -18,7 +18,8 @@
       />
     </GraphicAction>
     <VectorMenus :menus="focusMenus" v-if="focusMenus" />
-    <Component :is="geoComponent as any" v-if="geoComponent" :geo="currentVector"/>
+    <Confirm v-if="graphicState.continuedMode" />
+    <Component :is="geoComponent as any" v-else-if="geoComponent" :geo="currentVector"/>
   </MainPanel>
 </template>
 
@@ -30,13 +31,13 @@ import Container from './container.vue'
 import GraphicAction from '@/components/button-pane/index.vue'
 import UiIcon from "@/components/base/components/icon/index.vue";
 import VectorMenus from './vectorMenus.vue'
+import Confirm from './confirm.vue'
 import {router} from '@/router'
-
 import {computed} from "vue";
 import {customMap} from '@/hook'
 import {focusMenuRaw, generateMixMenus, mainMenusRaw, photoMenusRaw, Mode, UITypeExtend} from './menus'
-import {currentVector} from "@/hook/useGraphic";
-import geos from "./geos/index";
+import {currentVector, graphicState} from "@/hook/useGraphic";
+import geos, {GlobalComp} from "./geos/index";
 
 const menusRaws = computed(() => {
   const mode = Number(router.currentRoute.value.params.mode) as Mode
@@ -45,6 +46,7 @@ const menusRaws = computed(() => {
 const store = computed(() => generateMixMenus(
   "extend",
   (mainMenuRaw) => ({
+    ...mainMenuRaw,
     title: mainMenuRaw.text,
     name: mainMenuRaw.key,
     isRoute: false,
@@ -57,7 +59,9 @@ const store = computed(() => generateMixMenus(
 
 const focusMenus = computed(() => focusMenuRaw[currentVector.value?.type])
 const geoComponent = computed(() => {
-  return geos[currentVector.value?.type] || geos[currentVector.value?.category]
+  if (currentVector.value) {
+    return geos[currentVector.value?.type] || geos[currentVector.value?.category] || GlobalComp
+  }
 })
 const isFull = computed(() => customMap.sysView === 'full' )
 </script>

+ 6 - 1
src/views/graphic/menus.ts

@@ -5,6 +5,7 @@ import {
   generateMixMenus as generateMixMenusRaw
 } from '@/utils/menus'
 import Message from "@/components/base/components/message/message.vue";
+import {computed} from "vue";
 
 export enum Mode {
   Road,
@@ -75,7 +76,11 @@ export const templateMenusRaw = [
 ]
 
 export const measureMenusRaw = [
-  { key: UIType.BaseLine, text: "基准线" },
+  {
+    key: UIType.BaseLine,
+    text: "基准线",
+    disabled: computed(() => graphicState.value.existsBaseLine)
+  },
   { key: UIType.BasePoint, text: "基准点" },
   { key: UIType.NormalLocationMode, text: "自由测量" },
   {

+ 1 - 1
src/views/sys/head/index.vue

@@ -9,7 +9,7 @@
       }"
       @click="customMap.sysView = customMap.sysView === 'full' ? 'auto' : 'full'"
     >
-      <ui-icon :type="customMap.sysView === 'full' || !os.isPc ? 'menu' : 'close'" ctrl />
+      <ui-icon  :type="customMap.sysView === 'full' || !os.isPc ? 'menu' : 'close'" ctrl />
     </div>
     <div class="main">
       <span class="title">{{ title }}</span>

+ 9 - 3
src/views/sys/menu/index.vue

@@ -67,9 +67,6 @@ const active = computed(() =>
   display: flex;
   flex-direction: column;
 
-  .ui-menu-item span {
-    font-size: 12px;
-  }
 
   .ui-editor-menu-item {
     position: relative;
@@ -90,6 +87,15 @@ const active = computed(() =>
     }
   }
 }
+.global-menu ,.menu-children {
+
+  .ui-menu-item span {
+    font-size: 14px;
+  }
+  .ui-menu-item .icon {
+    font-size: 20px !important;
+  }
+}
 
 .readonly .menu-item {
   cursor: inherit;

+ 2 - 0
src/views/sys/menu/item/index.vue

@@ -7,6 +7,7 @@
     :ref="attrs.children[0].menuRef"
     :data-route-name="attrs.atom.name"
     class="menu-item"
+    :class="{disabled: attrs.atom.disabled?.value}"
     @enter="enterHandler"
     @leave="leaveHandler"
     @click="emit('select', attrs.atom)"
@@ -36,6 +37,7 @@
     :ref="attrs.children[index].menuRef"
     :data-route-name="raw.name"
     class="menu-item child-menu-item"
+    :class="{disabled: raw.disabled?.value}"
     @enter="enterHandler(index)"
     @leave="leaveHandler(index)"
     @click="selectHandler(index, raw)"