gemercheung 1 rok temu
rodzic
commit
72a6ef11c2
3 zmienionych plików z 22 dodań i 12 usunięć
  1. 1 1
      src/store/relics.ts
  2. 21 10
      src/view/map/map-board.vue
  3. 0 1
      src/view/map/map-right-poly.vue

+ 1 - 1
src/store/relics.ts

@@ -1,7 +1,7 @@
 import {
   relicsInfoFetch,
   // relicsPolyginsFetch,
-  relicsSelfCheckFetch,
+  // relicsSelfCheckFetch,
   updateRelicsFetch,
 } from "@/request";
 import { ref } from "vue";

+ 21 - 10
src/view/map/map-board.vue

@@ -38,6 +38,7 @@
     </div>
 
     <Teleport to="body" v-if="isMounted">
+      <el-button class="temp_btn" @click="clearPolys">后端全清</el-button>
       <div class="draw-global-icon" v-if="isCurrentTab(1) && !isEditDrawingMode" @click="handleBoardDraw">
         <el-icon size="30">
           <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
@@ -140,6 +141,7 @@ watch(
           flyUserCenter(mapManage);
         }
         const points = scenePosTransform(scenes.value);
+        console.log('scenePosTransform', points, scenes.value)
         board.setData(
           {
             points: points,
@@ -337,16 +339,16 @@ const handlePolysEdit = (item: PolyDataType) => {
   handleSyncDataToServer();
 }
 
-// const clearPolys = async () => {
-//   await addOrUpdateDrawingFetch({
-//     relicsId: String(relicsId.value),
-//     data: {
-//       points: [],
-//       polygons: [],
-//       lines: []
-//     }
-//   });
-// }
+const clearPolys = async () => {
+  await addOrUpdateDrawingFetch({
+    relicsId: String(relicsId.value),
+    data: {
+      points: [],
+      polygons: [],
+      lines: []
+    }
+  });
+}
 
 </script>
 
@@ -527,4 +529,13 @@ const handlePolysEdit = (item: PolyDataType) => {
   cursor: pointer;
   color: #409EFF;
 }
+
+.temp_btn {
+  top: 40px;
+  position: fixed;
+  z-index: 1000;
+  top: 10px;
+  transform: translateX(calc(-1 * calc(50% - 300px)));
+  left: calc(50% - 300px);
+}
 </style>

+ 0 - 1
src/view/map/map-right-poly.vue

@@ -96,7 +96,6 @@ const handleDownload = async () => {
                 const targetPoint = props.data.points.find(p => p.id === point)
                 targetPoint && points.push(targetPoint)
             })
-
         })
     });
     console.log('points', points)