浏览代码

修复bug

xushiting 2 年之前
父节点
当前提交
bb34c2c992
共有 2 个文件被更改,包括 53 次插入0 次删除
  1. 51 0
      src/graphic/Controls/UIControl.js
  2. 2 0
      src/graphic/Layer.js

+ 51 - 0
src/graphic/Controls/UIControl.js

@@ -380,7 +380,58 @@ export default class UIControl {
           if (endPoint.getCategory() != VectorCategory.Point.BasePoint) {
           if (endPoint.getCategory() != VectorCategory.Point.BasePoint) {
             pointService.deletePoint(line.endId);
             pointService.deletePoint(line.endId);
           }
           }
+        } else if (
+          line.getCategory() == VectorCategory.Line.LocationLineByFixPoint
+        ) {
+          let lines = dataService.getLines();
+          for (let key in lines) {
+            let _line = dataService.getLine(key);
+            if (
+              _line.getCategory() == VectorCategory.Line.ExtendedPositionLine
+            ) {
+              if (
+                line.startId == _line.startId ||
+                line.startId == _line.endId ||
+                line.endId == _line.startId ||
+                line.endId == _line.endId
+              ) {
+                dataService.deleteLine(key);
+                break;
+              }
+            }
+          }
+        } else if (
+          line.getCategory() == VectorCategory.Line.LocationLineByBasePoint
+        ) {
+          let lines = dataService.getLines();
+          for (let key in lines) {
+            let _line = dataService.getLine(key);
+            if (
+              _line.getCategory() == VectorCategory.Line.ExtendedPositionLine
+            ) {
+              if (
+                line.startId == _line.startId ||
+                line.startId == _line.endId ||
+                line.endId == _line.startId ||
+                line.endId == _line.endId
+              ) {
+                dataService.deleteLine(key);
+              }
+            } else if (
+              _line.getCategory() == VectorCategory.Line.GuideLocationLine
+            ) {
+              if (
+                line.startId == _line.startId ||
+                line.startId == _line.endId ||
+                line.endId == _line.startId ||
+                line.endId == _line.endId
+              ) {
+                dataService.deleteLine(key);
+              }
+            }
+          }
         }
         }
+
         break;
         break;
       case VectorType.CurveLine:
       case VectorType.CurveLine:
         lineService.deleteCurveLine(vectorId);
         lineService.deleteCurveLine(vectorId);

+ 2 - 0
src/graphic/Layer.js

@@ -1277,6 +1277,7 @@ export default class Layer {
             );
             );
           }
           }
         }
         }
+        elementService.hideAll();
         this.history.save();
         this.history.save();
         break;
         break;
       case LayerEvents.MoveCurveLine:
       case LayerEvents.MoveCurveLine:
@@ -1290,6 +1291,7 @@ export default class Layer {
       case LayerEvents.AddPoint:
       case LayerEvents.AddPoint:
         // 绘制的是基准点
         // 绘制的是基准点
         if (Settings.selectPointCategory == VectorCategory.Point.BasePoint) {
         if (Settings.selectPointCategory == VectorCategory.Point.BasePoint) {
+          uiService.setSelectPointCategory(null);
           stateService.clearEventName();
           stateService.clearEventName();
           this.history.save();
           this.history.save();
         } else {
         } else {