bill 1 jaar geleden
bovenliggende
commit
b4b3971b1b
6 gewijzigde bestanden met toevoegingen van 27 en 13 verwijderingen
  1. 1 1
      src/view/map/coord.vue
  2. 2 2
      src/view/map/install.ts
  3. 3 2
      src/view/map/layout.vue
  4. 14 3
      src/view/map/polygons.vue
  5. 2 0
      src/view/step-tree/step-tree.vue
  6. 5 5
      vite.config.ts

+ 1 - 1
src/view/map/coord.vue

@@ -87,7 +87,7 @@
                       v-if="!data.run"
                       @click.stop="
                         data.type === 'scene'
-                          ? gotoScene(data.raw, true)
+                          ? gotoScene(data.raw, false)
                           : gotoPointPage(data.raw)
                       "
                     />

+ 2 - 2
src/view/map/install.ts

@@ -24,13 +24,13 @@ export const flyScene = (scene: Scene) => {
   let numCalc = 0;
   for (let i = 0; i < scene.scenePos.length; i++) {
     const coord = scene.scenePos[i].pos as number[];
-    if (coord && coord.length > 0) {
+    if (!noValidPoint(scene.scenePos[i])) {
       totalPos[0] += coord[0];
       totalPos[1] += coord[1];
       numCalc++;
     }
   }
-
+  console.log(scene);
   totalPos[0] /= numCalc;
   totalPos[1] /= numCalc;
   mapManage.map.getView().setCenter(totalPos);

+ 3 - 2
src/view/map/layout.vue

@@ -94,7 +94,7 @@ import { computed, ref, watch } from "vue";
 import { initRelics, relics } from "@/store/relics";
 import { queryMode } from "./install";
 import { PoPoint } from "drawing-board";
-import { boardData } from "@/store/scene";
+import { boardData, scenePoints } from "@/store/scene";
 import saveAs from "@/util/file-serve";
 
 const menus = [
@@ -142,10 +142,11 @@ watch(
   () => [isCoordPage.value, boardData.value, showPoints.value] as const,
   ([isCoordPage, _, showPoints]) => {
     if (!board.polygon) return;
+    const ids = scenePoints.value.map(({ id }) => id.toString());
     board.polygon.children.forEach((entity) => {
       if (entity instanceof PoPoint) {
         if (isCoordPage) {
-          entity.visible(entity.attrib.rtk);
+          entity.visible(entity.attrib.rtk && ids.includes(entity.attrib.id));
         } else {
           entity.visible(showPoints);
         }

+ 14 - 3
src/view/map/polygons.vue

@@ -97,9 +97,11 @@ const selectChange = (id: string) => {
       const points = getWholeLinePolygonPoints(boardData.value, selectItem.value.id);
       if (points.length) {
         const total = points.reduce((t, p) => [t[0] + p.x, t[1] + p.y], [0, 0]);
-        mapManage.map
-          .getView()
-          .setCenter([total[0] / points.length, total[1] / points.length]);
+        const view = mapManage.map.getView();
+        view.setZoom(20);
+        setTimeout(() => {
+          view.setCenter([total[0] / points.length, total[1] / points.length]);
+        }, 100);
       }
     }
   }
@@ -264,6 +266,15 @@ const handleDownload = async (item: any) => {
       color: #409eff;
       cursor: pointer;
     }
+
+    span {
+      word-break: break-all;
+    }
+
+    .right {
+      flex: none;
+      width: 80px;
+    }
   }
 
   .empty {

+ 2 - 0
src/view/step-tree/step-tree.vue

@@ -27,6 +27,7 @@ const props = withDefaults(
     padding?: number[];
     fontSize?: number;
     data: any;
+    treeBoxMargin?: number[];
     fontFamily?: string;
     hostFontSize?: number;
     hostMargin?: number[];
@@ -172,6 +173,7 @@ const getStepAttrib = (step: NStep) => {
     style,
     step,
     margin: props.margin,
+    treeBoxMargin: props.treeBoxMargin,
     padding: props.padding,
     fontSize: props.fontSize,
     hostMargin: props.hostMargin,

+ 5 - 5
vite.config.ts

@@ -16,11 +16,11 @@ export default ({ mode }: any) =>
         },
         {
           find: "drawing-board",
-          replacement: resolve(__dirname, "./src/lib/board/4dmap.js"),
-          // replacement: resolve(
-          //   __dirname,
-          //   "../drawing-board/src/app/4dmap/index.ts"
-          // ),
+          // replacement: resolve(__dirname, "./src/lib/board/4dmap.js"),
+          replacement: resolve(
+            __dirname,
+            "../drawing-board/src/app/4dmap/index.ts"
+          ),
         },
       ],
     },