瀏覽代碼

添加需求

bill 2 年之前
父節點
當前提交
238887e31e
共有 4 個文件被更改,包括 23 次插入5 次删除
  1. 1 1
      src/graphic/Renderer/Draw.js
  2. 4 0
      src/graphic/Service/DataService.js
  3. 8 0
      src/graphic/enum/ErrMsg.js
  4. 10 4
      src/views/graphic/index.vue

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

@@ -1015,7 +1015,7 @@ export default class Draw {
   }
 
   drawPoint(vector, screenSave) {
-    console.log(vector);
+    // console.log(vector);
     const screenNotDrawTypes = [VectorCategory.Point.NormalPoint];
     if (!screenSave) {
       if (

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

@@ -132,6 +132,10 @@ export class DataService {
     return this.vectorData.lines[lineId];
   }
 
+  getGeo(type, id) {
+    return this[`get${type}`](id);
+  }
+
   deleteLine(lineId) {
     let line = this.getLine(lineId);
     if (!line) {

+ 8 - 0
src/graphic/enum/ErrMsg.js

@@ -0,0 +1,8 @@
+const ErrMsg = {
+  UnBaseLine: "请先创建基准线",
+  UnBasePoint: "请先创建基准点",
+  UnSelectBasePoint: "请先选择基准点",
+  UnFixPoint: "请先创建固定点",
+};
+
+export default ErrMsg;

+ 10 - 4
src/views/graphic/index.vue

@@ -54,6 +54,7 @@ import {
 } from "./menus";
 import { currentVector, drawRef, graphicState, uiType } from "@/hook/useGraphic";
 import geos, { GlobalComp } from "./geos/index";
+import { dataService } from "@/graphic/Service/DataService";
 
 const menusRaws = computed(() => {
   const mode = Number(router.currentRoute.value.params.mode) as Mode;
@@ -85,10 +86,15 @@ watchEffect(() => {
 const focusMenus = computed(() => focusMenuRaw[currentVector.value?.type]);
 const geoComponent = computed(() => {
   if (currentVector.value) {
-    console.log(currentVector.value);
-    return (
-      geos[currentVector.value?.category] || geos[currentVector.value?.type] || GlobalComp
-    );
+    let category = currentVector.value?.category;
+    if (!category) {
+      const geo = dataService.getGeo(
+        currentVector.value.type,
+        currentVector.value.vectorId
+      );
+      category = currentVector.value.category = geo?.category;
+    }
+    return geos[category] || geos[currentVector.value?.type] || GlobalComp;
   }
 });
 const isFull = computed(() => customMap.sysView === "full");