xushiting %!s(int64=2) %!d(string=hai) anos
pai
achega
a0ae24a622

+ 15 - 7
src/graphic/Controls/MoveLine.js

@@ -7,6 +7,7 @@ import { pointService } from "../Service/PointService";
 import { movePoint } from "./MovePoint";
 import { mathUtil } from "../Util/MathUtil";
 import VectorCategory from "../enum/VectorCategory";
+import Msg from "../enum/Msg";
 import { locationModeControl } from "./LocationModeControl";
 import { uiService } from "../Service/UIService";
 
@@ -163,16 +164,23 @@ export default class MoveLine {
         }
       }
     } else {
-      //综合定位和垂线定位,拖动基准线更新位置
-      //缺
-      startPoint.x += dx;
-      startPoint.y += dy;
-      endPoint.x += dx;
-      endPoint.y += dy;
       if (line.getCategory() == VectorCategory.Line.BaseLine) {
         if (uiService.getSelectLocationMode() == Constant.angleLocationMode) {
-          locationModeControl.setAngle();
+          let msg = locationModeControl.setAngle();
+          if (msg != Msg.OK) {
+            uiService.prompt({ msg: msg, time: 1000 });
+          } else {
+            startPoint.x += dx;
+            startPoint.y += dy;
+            endPoint.x += dx;
+            endPoint.y += dy;
+          }
         }
+      } else {
+        startPoint.x += dx;
+        startPoint.y += dy;
+        endPoint.x += dx;
+        endPoint.y += dy;
       }
     }
     return true;

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

@@ -26,7 +26,7 @@ import { addRoad } from "../Controls/AddRoad";
 import { addLine } from "./AddLine.js";
 import VectorCategory from "../enum/VectorCategory.js";
 // import { floorplanData } from "../VectorData.js";
-import Message from "@/components/base/components/message/message.vue";
+
 import { pointService } from "../Service/PointService.js";
 import Settings from "../Settings.js";
 import { addPoint } from "./AddPoint.js";
@@ -133,7 +133,7 @@ export default class UIControl {
           uiService.setSelectLocationMode(Constant.angleLocationMode);
           let msg = locationModeControl.setAngle();
           if (msg != Msg.OK) {
-            this.prompt({ msg: msg, time: 1000 });
+            uiService.prompt({ msg: msg, time: 1000 });
           } else {
             this.layer.history.save();
             this.layer.renderer.autoRedraw();
@@ -647,13 +647,6 @@ export default class UIControl {
   }
 
   /******************************************************************************************************************************************************************/
-
-  prompt(msg) {
-    this._prompts.push(
-      Message.success(typeof msg === "string" ? { msg } : msg)
-    );
-  }
-
   // 进入持续添加出确认与取消框
   showConfirm() {
     this.graphicStateUI.continuedMode = true;
@@ -711,10 +704,4 @@ export default class UIControl {
       lineWidth: lineWidth,
     };
   }
-
-  hidePrompt() {
-    for (let prompt of this._prompts) {
-      prompt();
-    }
-  }
 }

+ 5 - 0
src/graphic/Service/UIService.js

@@ -10,6 +10,7 @@ import VectorStyle from "../enum/VectorStyle.js";
 import VectorWeight from "../enum/VectorWeight.js";
 import RoadTemplate from "../enum/RoadTemplate.js";
 import RoadStructure from "../enum/RoadStructure.js";
+import Message from "@/components/base/components/message/message.vue";
 
 export default class UIService {
   constructor() {}
@@ -285,6 +286,10 @@ export default class UIService {
     }
     return newPosition;
   }
+
+  prompt(msg) {
+    Message.success(typeof msg === "string" ? { msg } : msg);
+  }
 }
 
 const uiService = new UIService();