浏览代码

fix: 切换

gemercheung 1 年之前
父节点
当前提交
a8e3f3bb48
共有 3 个文件被更改,包括 7 次插入31 次删除
  1. 1 1
      src/submodule
  2. 4 29
      src/view/map/map-board.vue
  3. 2 1
      src/view/map/map-right-poly.vue

+ 1 - 1
src/submodule

@@ -1 +1 @@
-Subproject commit acaac285816ce22c012752616a81cf7c3bdcc4ce
+Subproject commit 30a7b241e2e64e3edb10cb20a057fdbbac88245a

+ 4 - 29
src/view/map/map-board.vue

@@ -37,7 +37,7 @@
     </div>
 
     <Teleport to="body" v-if="isMounted">
-      <el-button class="temp_btn" @click="clearPolys">后端全清</el-button>
+      <!-- <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">
@@ -267,7 +267,7 @@ const patchPolyName = (data: DrawingDataType) => {
   const poly = data.polygons;
   poly?.forEach((item) => {
     if (!item.name) {
-      item.name = "";
+      item.name = "本体边界" + item.id;
     }
   });
 };
@@ -317,34 +317,9 @@ const initPolyTabData = async () => {
 
 const handlePolysDel = (id: string) => {
   try {
-    // const data = board.getData() as any as DrawingDataType;
-    // const obj: DrawingDataType = JSON.parse(JSON.stringify(data))
-    // const index = obj.polygons.findIndex(i => id === i.id)
-    // console.log('handlePolysDel', id, index)
-    // const points = [];
-    // if (index > -1) {
-    //   data.polygons[index].lineIds.forEach(id => {
-    //     // 当前poly下线段与点都删除
-    //     const line = data.lines.find(l => l.id === id);
-    //     line && line.pointIds.forEach(p => points.push(p));
-
-    //     const lIndex = obj.lines.findIndex(l => l.id === id);
-    //     lIndex > -1 && obj.lines.splice(lIndex, 1)
-    //   });
-    //   new Set(points).forEach((_, i) => {
-    //     const pIndex = obj.points.findIndex(p => p.id === i);
-    //     // console.log('pIndex', pIndex, obj.points)
-    //     obj.points.splice(pIndex, 1)
-    //   })
-    //   console.log('points', new Set(points))
-    //   obj.polygons.splice(index, 1);
-    // }
     board.polygon().removePolygon(id);
-    // board.setData({
-    //   points: obj.points,
-    //   lines: obj.lines,
-    //   polygons: obj.polygons,
-    // }, obj.id)
+    handleSyncDataToServer();
+
   } catch (error) {
     console.error("handlePolysDel", error);
   }

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

@@ -100,7 +100,8 @@ const handleDownload = async () => {
     });
     console.log('points', points)
     console.log('handleDownload');
-    await downloadPointsPolys(points, [{ title: "xx", desc: "xxxx" }], 'xx');
+    
+    // await downloadPointsPolys(points, [{ title: "xx", desc: "xxxx" }], 'xx');
 } 
 </script>