Browse Source

修正问题

bill 2 years ago
parent
commit
7cbd45cf22

+ 1 - 0
src/graphic/Layer.js

@@ -1468,6 +1468,7 @@ export default class Layer {
     Settings.baseLineId = null;
     this.uiControl.graphicStateUI.canAngleLocationMode = false;
     this.uiControl.graphicStateUI.canAllLocationMode = false;
+    this.uiControl.graphicStateUI.canNotBaseLine = false;
     this.uiControl.graphicStateUI.existsBaseLine = false;
   }
 

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

@@ -1180,6 +1180,7 @@ export default class Draw {
       case VectorCategory.Line.BaseLine:
         this.drawBaseLineLabel(vector);
         break;
+      case VectorCategory.Line.FreeMeasureLine:
       case VectorCategory.Line.MeasureLine:
       case VectorCategory.Line.PositionLine:
         this.drawLineText(vector, style.text);

+ 3 - 1
src/graphic/enum/UIEvents.js

@@ -19,8 +19,10 @@ const UIEvents = {
   //基准点
   BasePoint: "BasePoint",
 
-  // 测量
   // 自由测量
+  FreeMeasureLine: "FreeMeasureLine",
+  // 测量
+  // 垂线定位
   NormalLocationMode: "NormalLocationMode",
   // 直角定位法
   AngleLocationMode: "AngleLocationMode",

+ 1 - 0
src/hook/useGraphic.ts

@@ -38,6 +38,7 @@ export const graphicState = ref({
   canRecovery: false,
   showBackImage: true,
   canAngleLocationMode: false,
+  canNotBaseLine: false,
   canAllLocationMode: false,
   existsBaseLine: false,
   continuedMode: false

+ 8 - 3
src/views/graphic/menus.ts

@@ -86,13 +86,13 @@ export const measureMenusRaw = [
   { key: UIType.BasePoint, text: '基准点', icon: 'point' },
   {
     key: UIType.NormalLocationMode,
-    text: '自由测量',
+    text: '垂线定位',
     icon: 'measure_f',
     onClick(data) {
-      if (graphicState.value.canAllLocationMode) {
+      if (graphicState.value.canNotBaseLine) {
         uiType.change(data.key);
       } else {
-        Message.success({ msg: '请添加基准线及基准点后再执行此操作', time: 3000 });
+        Message.success({ msg: '请添加基准线后再执行此操作', time: 3000 });
       }
     },
   },
@@ -121,6 +121,11 @@ export const measureMenusRaw = [
       }
     },
   },
+  {
+    key: UIType.FreeMeasureLine,
+    text: '自由测量',
+    icon: 'measure'
+  },
 ];
 
 export const mainMenusRaw: MenusRaw = [