From f754a1f2f47ea24c9c74e54c011fb2e33aaa72c8 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Fri, 07 Nov 2025 10:10:39 +0800
Subject: [PATCH] feat:编辑文件夹清除区域

---
 src/views/layerManagement/components/leftList.vue |    8 ++++----
 src/views/layerManagement/index.vue               |   14 +++-----------
 2 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/src/views/layerManagement/components/leftList.vue b/src/views/layerManagement/components/leftList.vue
index 76ceb7b..ced13a9 100644
--- a/src/views/layerManagement/components/leftList.vue
+++ b/src/views/layerManagement/components/leftList.vue
@@ -170,9 +170,9 @@
     } else {
       // 全选:仅设置 level 3 节点的 id
       treeRef.value.setCheckedKeys(allFenceKeys);
-      checkedKeys.value = allFenceKeys; // 同步更新 checkedKeys
-      checkedNodes.value = allFenceNodes; // 存储 level 3 数据
-      coverData.value = allFenceNodes; // 同步 coverData
+      checkedKeys.value = allFenceKeys;
+      checkedNodes.value = allFenceNodes;
+      coverData.value = allFenceNodes;
     }
     emit('update:coverData', coverData.value);
   }
@@ -358,7 +358,7 @@
   left: 0;
   height: 95%;
   z-index: 99;
-  width: 392px;
+  width: 382px;
   overflow: hidden;
   background: rgba(0, 0, 0, 0.8);
   border-radius: 8px 8px 8px 8px;
diff --git a/src/views/layerManagement/index.vue b/src/views/layerManagement/index.vue
index acb2227..88e7f86 100644
--- a/src/views/layerManagement/index.vue
+++ b/src/views/layerManagement/index.vue
@@ -53,12 +53,11 @@
 import { flyVisual } from '@/utils/cesium/mapUtil';
 import rightEdit from '@/views/layerManagement/components/rightEdit.vue';
 import leftList from '@/views/layerManagement/components/leftList.vue';
-import nationalSpatialPlanning from '@/views/layerManagement/components/nationalSpatialPlanning.vue';
 import { DrawPolygon } from '@/views/layerManagement/components/utils';
 import * as Cesium from 'cesium';
 import { PublicCesium } from '@/utils/cesium/publicCesium';
 import _, { cloneDeep, throttle } from 'lodash';
-import { ElButton } from 'element-plus';
+
 import { provide } from 'vue';
 import { useStore } from 'vuex';
 const store = useStore();
@@ -157,6 +156,7 @@
 };
 // 编辑文件夹
 const handleFolder = val => {
+parentMethod()
   layerParams.value.editFolderData = val;
 };
 // 新增开启绘制
@@ -273,7 +273,6 @@
 let publicCesiumInstance = null;
 let viewer = null;
 const viewInstance = shallowRef(null);
-const homeViewer = shallowRef(null);
 const drawPolygonExample = new DrawPolygon();
 // 地图初始化
 const initMap = () => {
@@ -284,10 +283,8 @@
     layerMode: 4,
     contour: false,
   });
-
   viewer = publicCesiumInstance.getViewer();
   viewInstance.value = publicCesiumInstance;
-
   const nanChangPosition = Cesium.Cartesian3.fromDegrees(
     115.892151, // 经度
     28.676493, // 纬度
@@ -328,22 +325,17 @@
   let polygonString = JSON.stringify(polygon);
   layerParams.value.polygonPosition = polygon.length > 0 ? polygonString : null;
   if (polygon.length >= 3) {
-    //  确保多边形闭合:最后一个点与第一个点一致(避免计算偏差)
+    //  确保多边形闭合:最后一个点与第一个点一致
     const firstPoint = polygon[0];
     const lastPoint = polygon[polygon.length - 1];
     const isClosed =
       _.round(firstPoint[0], 6) === _.round(lastPoint[0], 6) &&
       _.round(firstPoint[1], 6) === _.round(lastPoint[1], 6);
-    // 若未闭合,手动添加闭合点
     const closedPolygon = isClosed ? polygon : [...polygon, firstPoint];
-    //  转换为 turf 支持的 GeoJSON 格式(Polygon 类型需外层嵌套数组)
     const turfPolygon = turf.polygon([closedPolygon]);
-    //  计算面积(turf.area() 返回平方米,保留2位小数)
     const area = _.round(turf.area(turfPolygon), 2);
-    //  赋值给 layerParams,
     layerParams.value.fenceArea = area;
   } else {
-    // 坐标点不足3个时,清空面积
     layerParams.value.fenceArea = 0;
   }
 };

--
Gitblit v1.9.3