Преглед изворни кода

修改综合分析所有图层分级,根据镇域更新树节点

Bella пре 2 година
родитељ
комит
08e4addf2a
4 измењених фајлова са 342 додато и 197 уклоњено
  1. 23 12
      src/assets/global.css
  2. 55 28
      src/components/map/MapHolder.vue
  3. 2 2
      src/utils/request.js
  4. 262 155
      src/views/ComprehensiveAnalysis.vue

+ 23 - 12
src/assets/global.css

@@ -72,7 +72,7 @@
   color: #ffffff;
   border: none;
 }
-.el-collapse-item__header i{
+.el-collapse-item__header i {
   text-indent: 0px;
 }
 
@@ -196,24 +196,25 @@
 /* table */
 .el-dialog__body *,
 #WholeProcessManagement
-  *:not(.el-pager li, .el-pagination .btn-prev, .StepsMyBox, .StepsMyBox *,.el-table__row,.el-table__header-wrapper),
+  *:not(.el-pager li, .el-pagination .btn-prev, .StepsMyBox, .StepsMyBox
+    *, .el-table__row, .el-table__header-wrapper),
 tr,
 td,
 th {
   background-color: transparent !important;
 }
 
-.el-table__row{
+.el-table__row {
   background: #00395c !important;
 }
-.el-table__row:hover{
+.el-table__row:hover {
   cursor: pointer !important;
   color: #fff !important;
-  background-color: #FFFFFF32 !important;
-  background: #FFFFFF32 !important;
+  background-color: #ffffff32 !important;
+  background: #ffffff32 !important;
 }
 
-.el-table__header-wrapper{
+.el-table__header-wrapper {
   background: #00000064 !important;
 }
 /* .el-table__body-wrapper  */
@@ -262,7 +263,7 @@ th {
   border: 1px solid #74ffff;
 }
 
-.docx-wrapper section.docx{
+.docx-wrapper section.docx {
   box-shadow: none !important;
 }
 
@@ -284,7 +285,7 @@ th {
   border-color: #fff !important;
 }
 .docx-wrapper {
-  background: #FFFFFF !important;
+  background: #ffffff !important;
   justify-content: flex-start !important;
   padding: 0 !important;
 }
@@ -298,7 +299,6 @@ body iframe {
   z-index: -1;
 }
 
-
 .leaflet-touch .leaflet-bar a {
   position: fixed;
   left: 21%;
@@ -318,6 +318,17 @@ body iframe {
   margin: 0;
 }
 /* 时间范围组件 */
-.el-range-separator{
+.el-range-separator {
   color: #ffffff !important;
-}
+}
+
+/* el-loading样式 */
+/* 修改动画的大小  给文字加粗效果 */
+.el-loading-spinner {
+  font-size: 40px;
+  font-weight: bold;
+}
+/* 修改文字的大小 */
+.el-loading-mask .el-loading-spinner .el-loading-text {
+  font-size: 18px;
+}

+ 55 - 28
src/components/map/MapHolder.vue

@@ -169,7 +169,7 @@ export default {
      * @sourceType
      */
     createNormalDiv(str, geojsonData, sourceType) {
-      // debugger;
+      debugger;
       let currentInnerHtml = this.$refs.normalRef.$el.innerHTML;
       // 搜索geojson数据中的固定字段 -- 镇域名称,面积,土地类型,图斑编号
       // this.$refs.normalRef.tableObj = geojsonData;
@@ -179,23 +179,35 @@ export default {
         div.className = "case-audit";
         // 动态创建div后赋值模板样式
         div.innerHTML = currentInnerHtml;
-        $(() => {
-          // 法律法规点击事件
-          if ($(`#${str}_id a`)) {
-            $(`#${str}_id a`)
-              .eq(0)
-              .click((e) => {
-                this.$store.state.lawPopupShow = true;
-                this.$store.state.lawSourceType = sourceType;
-              });
-            $(`#${str}_id a`)
-              .eq(1)
-              .click((e) => {
-                // 触发综合分析右侧面板点击事件
-                this.$bus.$emit("viewDetailsPopup", geojsonData);
-              });
-          }
-        });
+        // 需要显示法律法规详细信息的弹窗
+        if (sourceType) {
+          $(() => {
+            // 法律法规点击事件
+            if ($(`#${str}_id a`)) {
+              $(`#${str}_id a`)
+                .eq(0)
+                .click((e) => {
+                  this.$store.state.lawPopupShow = true;
+                  this.$store.state.lawSourceType = sourceType;
+                });
+              $(`#${str}_id a`)
+                .eq(1)
+                .click((e) => {
+                  // 触发综合分析右侧面板点击事件
+                  this.$bus.$emit("viewDetailsPopup", geojsonData);
+                });
+            }
+          });
+        } else {
+          // 不需要显示法律法规详细信息的弹窗
+          $(()=>{
+            if($(`#${str}_id a`)){
+              $(`#${str}_id a`).remove()
+            }
+          })
+          console.log("呈现我的模型的几何数据");
+        }
+
         return div;
       }
     },
@@ -527,7 +539,7 @@ export default {
         attributionControl: false,
         zoomControl: false,
         minZoom: 10,
-        maxZoom: 16,
+        maxZoom: 19,
       }).setView(systemConfig.mapViewer.center, systemConfig.mapViewer.zoom);
 
       //添加默认图层
@@ -686,6 +698,7 @@ export default {
      * @sourceType 土地资源/林地资源/生态资源/水资源/全部
      */
     addSinglePolygon(geometry, cid, color, uniqueId, mainType, sourceType) {
+      // debugger;
       let uniqueIdList = [];
       if (this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId]) {
         uniqueIdList =
@@ -702,19 +715,24 @@ export default {
         uniqueIdList;
       let coordinates = "";
 
-      if (uniqueId === "一般耕地_47") {
+      // 经纬度等上海2000转为经纬度坐标后再重新修改
         let coord = JSON.parse(geometry).geometry.coordinates[0];
         coordinates = coord.map((v) => {
           return [v[1], v[0]];
         });
-      } else {
-        coordinates = JSON.parse(geometry).geometry.coordinates[0];
-        coordinates = coordinates.map((v) => {
-          let data = transformCoord.shcj_to_wgs84(v[1], [v[0]]);
-          data = [data[1], data[0]];
-          return data;
-        });
-      }
+      // if (uniqueId === "一般耕地_47") {
+      //   let coord = JSON.parse(geometry).geometry.coordinates[0];
+      //   coordinates = coord.map((v) => {
+      //     return [v[1], v[0]];
+      //   });
+      // } else {
+      //   coordinates = JSON.parse(geometry).geometry.coordinates[0];
+      //   coordinates = coordinates.map((v) => {
+      //     let data = transformCoord.shcj_to_wgs84(v[1], [v[0]]);
+      //     data = [data[1], data[0]];
+      //     return data;
+      //   });
+      // }
       // 纬经度
       // [22474.568725585938, -16689.47381591797]
       // x,y转换
@@ -749,6 +767,15 @@ export default {
           this.currentProperties = geojsonData;
           this.currentSourceType = sourceType;
         }
+        // 我的模型图层 -- 无疑点审计功能,无法律法规选项
+        if (mainType === "我的模型") {
+          this.normalAttrPopupShow = true;
+          this.normalPopup = L.popup({ maxWidth: 700, maxHeight: 600 })
+            .setLatLng(e.latlng)
+            .setContent(this.createNormalDiv(cid, geojsonData, sourceType));
+          this.normalAttrPopupShow = false;
+          this.normalPopup.openOn(map2DViewer.map);
+        }
       });
     },
     // 综合分析 - 图层绘制面

+ 2 - 2
src/utils/request.js

@@ -6,7 +6,7 @@ import { VueAxios } from "./axios";
 // 创建 axios 实例
 const service = axios.create({
   // baseURL: 'http://121.43.55.7:8888',
-  timeout: 8000, // 请求超时时间,
+  timeout: 80000, // 请求超时时间,
   headers: {
     "Content-Type": "application/form-data",
   },
@@ -14,7 +14,7 @@ const service = axios.create({
 
 const fileService = axios.create({
   baseURL: "",
-  timeout: 80000, // 请求超时时间,
+  timeout: 800000, // 请求超时时间,
   headers: {
     "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
   },

+ 262 - 155
src/views/ComprehensiveAnalysis.vue

@@ -1,5 +1,11 @@
 <template>
-  <div class="comprehensive-analysis">
+  <div
+    class="comprehensive-analysis"
+    v-loading="layerLoading"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+  >
     <LawPopup class="comprehensive-analysis-law-popup" />
     <LabelCasePopup
       class="comprehensive-analysis-label-popup"
@@ -278,9 +284,16 @@ export default {
   },
   data() {
     return {
+      layerLoading: false,
       expandedKeys: [],
+      // 我的模型id集合
       myModelIdMap: new Map(),
+      // 第一层数据集合
+      firstLevelIdMap: new Map(),
+      // 下拉框镇集合
       townSelectTreeMap: new Map(),
+      // 所有图层 -- 根据镇域划分的数据集合
+      allLayersByTownMap: new Map(),
       labelAllVisibleChecked: true,
       townSelectVal: "",
       townOptions: [],
@@ -530,9 +543,11 @@ export default {
   },
   created() {
     this.townOptions = [];
-    this.getColumnList();
     this.classDictQuery("0", "c_task_type", "任务类型");
     this.classDictQuery("0", "浦东新区行政区划", "浦东新区行政区划");
+    setTimeout(() => {
+      this.getColumnList();
+    }, 500);
   },
 
   mounted() {
@@ -564,9 +579,54 @@ export default {
     // 勾选镇时默认展开当前镇
     changeTownEvent(val) {
       if (this.townSelectTreeMap.has(val)) {
-        this.expandedKeys = [];
-        this.expandedKeys.push(this.townSelectTreeMap.get(val).id);
-        console.log(this.expandedKeys);
+        // let children = [{ id: 123, label: val, town: val, source: "生态资源" }];
+        let children = [];
+        let data = this.townSelectTreeMap.get(val).data;
+        if (data.length > 0) {
+          children = data.map((item1) => {
+            return {
+              id: `${item1.title}_${item1.id}`,
+              label: item1.title,
+              children:
+                !item1.columnList || item1.columnList.length === 0
+                  ? []
+                  : item1.columnList.map((item2) => {
+                      this.rightPanelDataMap.set(`${item2.title}_${item2.id}`, {
+                        id: item2.id,
+                        mainType: "所有图层",
+                        sourceType: item1.title,
+                      });
+                      this.randomColor.set(
+                        `${item2.title}_${item2.id}`,
+                        publicFun.getRandomColor()
+                      );
+                      return {
+                        id: `${item2.title}_${item2.id}`,
+                        label: item2.title,
+                        columnId: item2.id,
+                        townId: this.townSelectTreeMap.get(val).id,
+                        townType: val,
+                        sourceId: item1.id,
+                        sourceType: item1.title,
+                        mainType: "所有图层",
+                        color: publicFun.getRandomColor(),
+                        children: [],
+                      };
+                    }),
+            };
+          });
+        }
+
+        if (this.$refs.tree) {
+          this.$refs.tree.updateKeyChildren(
+            this.firstLevelIdMap.get("所有图层").id,
+            children
+          );
+          this.expandedKeys.push(this.firstLevelIdMap.get("所有图层").id);
+        }
+
+        // this.expandedKeys.push(this.townSelectTreeMap.get(val).id);
+        // console.log(this.expandedKeys);
       }
     },
     // 清除页面所有数据
@@ -581,12 +641,12 @@ export default {
           this.$store.state.mapMethodsCollection
             .get("RENDER")
             .deleteGroupFromMap(group);
-          map2DViewer.analysisGroups[group].remove();
+          // map2DViewer.analysisGroups[group].remove();
         }
         this.$refs.tree.setCheckedKeys([]);
       }
 
-      map2DViewer.analysisGroups = {};
+      // map2DViewer.analysisGroups = {};
       map2DViewer.polygons = {};
       this.attrTableShow = false;
       this.updateCasePopupShow = false;
@@ -632,24 +692,33 @@ export default {
      * @sourceType 土地资源/林地资源/生态资源/水资源/全部
      */
     displaySingleLayer(columnId, id, mainType, sourceType) {
-      if (id !== "永久基本农田_50") {
+      // if (id !== "永久基本农田_50") {
+      let uniqueId = id;
+      if (!map2DViewer.analysisGroups[uniqueId]) {
+        if (!this.layerLoading) {
+          this.layerLoading = true;
+        }
         // console.log(columnId, "columnId");
         let layerParams = new FormData();
         layerParams = {
           columnId: columnId,
           states: "0,1,2,3",
-          pageSize: 10,
+          pageSize: 10000,
           page: 0,
         };
         this.$Post(this.urlsCollection.selectContentList, layerParams).then(
           (res) => {
             if (res.code === 202 && res.content === "数据不存在") {
+              this.layerLoading = false;
               this.$message.info("暂无数据!");
             }
+            if (res.code === 200) {
+              this.layerLoading = false;
+            }
             if (res.code === 200 && res.content.data.length > 0) {
+              console.log(res.content.count, "count");
               this.paginationData.currentPage = 1;
               this.paginationData.total = res.content.count;
-              let uniqueId = id;
               map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
               map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
               this.legendTitle.push({
@@ -704,9 +773,16 @@ export default {
                 };
               });
             }
+          },
+          (error) => {
+            this.layerLoading = false;
+            this.$message.error("请求错误");
           }
         );
       }
+      if (map2DViewer.analysisGroups[uniqueId]) {
+        map2DViewer.map.addLayer(map2DViewer.analysisGroups[uniqueId]);
+      }
     },
     /**
      * 切换页时改变图层数据
@@ -790,14 +866,14 @@ export default {
             this.classTextToIndex[keyName].set(v.name, v.index + "");
           });
 
-          if (keyName === "浦东新区行政区划") {
-            this.classTextToIndex[keyName].forEach((v, i) => {
-              this.townOptions.push({
-                value: i,
-                label: i,
-              });
-            });
-          }
+          // if (keyName === "浦东新区行政区划") {
+          //   this.classTextToIndex[keyName].forEach((v, i) => {
+          //     // this.townOptions.push({
+          //     //   value: i,
+          //     //   label: i,
+          //     // });
+          //   });
+          // }
         }
       });
     },
@@ -808,75 +884,39 @@ export default {
         if (res.code === 200 && res.content.length > 0) {
           let data = res.content.map((item1) => {
             if (item1.title === "所有图层" && item1.columnList.length > 0) {
-              return {
+              this.firstLevelIdMap.set(item1.title, {
                 id: `${item1.title}_${item1.id}`,
                 label: item1.title,
-                // 镇
-                children:
-                  !item1.columnList || item1.columnList.length === 0
-                    ? []
-                    : item1.columnList.map((item2) => {
-                        this.townSelectTreeMap.set(item2.title, {
-                          id: `${item2.title}_${item2.id}`,
-                        });
+              });
+              if (item1.columnList && item1.columnList.length > 0) {
+                item1.columnList.map((item2) => {
+                  //存储所有镇相关的数据
+                  this.townSelectTreeMap.set(item2.title, {
+                    id: item2.id,
+                    data:
+                      !item2.columnList || item2.columnList.length === 0
+                        ? []
+                        : item2.columnList,
+                  });
+                });
+              }
 
-                        return {
-                          id: `${item2.title}_${item2.id}`,
-                          label: item2.title,
-                          // 水资源,土地资源,林地资源
-                          children:
-                            !item2.columnList || item2.columnList.length === 0
-                              ? []
-                              : item2.columnList.map((item3) => {
-                                  return {
-                                    id: `${item3.title}_${item3.id}`,
-                                    label: item3.title,
-                                    tag: item3.tag,
-                                    children:
-                                      !item3.columnList ||
-                                      item3.columnList.length === 0
-                                        ? []
-                                        : item3.columnList.map((item4) => {
-                                            this.rightPanelDataMap.set(
-                                              `${item4.title}_${item4.id}`,
-
-                                              {
-                                                id: item4.id,
-                                                mainType: item1.title,
-                                                sourceType: item3.title,
-                                              }
-                                            );
-
-                                            this.randomColor.set(
-                                              `${item4.title}_${item4.id}`,
-                                              publicFun.getRandomColor()
-                                            );
-
-                                            return {
-                                              id: `${item4.title}_${item4.id}`,
-                                              label: item4.title,
-                                              children: [],
-                                              columnId: item4.id,
-                                              townId: item2.id,
-                                              townType: item2.title,
-                                              sourceId: item3.id,
-                                              sourceType: item3.title,
-                                              mainType: item1.title,
-                                              color: publicFun.getRandomColor(),
-                                            };
-                                          }),
-                                  };
-                                }),
-                        };
-                      }),
+              return {
+                id: `${item1.title}_${item1.id}`,
+                label: item1.title,
+                children: [],
               };
             }
             if (item1.title === "预设模型" && item1.columnList.length > 0) {
+              this.firstLevelIdMap.set(item1.title, {
+                id: `${item1.title}_${item1.id}`,
+                label: item1.title,
+              });
               return {
                 id: `${item1.title}_${item1.id}`,
                 label: item1.title,
                 children:
-                  item1.columnList.length === 0
+                  !item1.columnList || item1.columnList.length === 0
                     ? []
                     : item1.columnList.map((item2) => {
                         return {
@@ -917,6 +957,10 @@ export default {
             }
 
             if (item1.title === "我的模型") {
+              this.firstLevelIdMap.set(item1.title, {
+                id: `${item1.title}_${item1.id}`,
+                label: item1.title,
+              });
               this.myModelIdMap.set(
                 `${item1.title}_${item1.id}`,
                 `${item1.title}_${item1.id}`
@@ -934,13 +978,23 @@ export default {
               this.modelData.unshift(v);
             }
           });
+
           this.modelData.push({
             id: "我的图层",
             label: "我的图层",
             children: [],
           });
 
+          // 获取我的模型数据
           this.getMyModelData();
+          this.classTextToIndex["浦东新区行政区划"].forEach((v, i) => {
+            if (this.townSelectTreeMap.has(i)) {
+              this.townOptions.push({
+                value: i,
+                label: i,
+              });
+            }
+          });
         }
       });
     },
@@ -955,7 +1009,6 @@ export default {
 
       this.$Post(this.urlsCollection.selectContentList, params)
         .then((res) => {
-          // console.log(res, "判断是否有");
           if (res.code === 200 && res.content.data.length > 0) {
             let children = res.content.data.map((ele) => {
               customModelIdMap.set(ele.title, {
@@ -977,11 +1030,19 @@ export default {
               };
             });
             if (this.modelData.length > 0) {
-              this.modelData.forEach((ele) => {
-                if (ele.label == "我的模型") {
-                  ele.children = children;
-                }
-              });
+              if (this.$refs.tree) {
+                this.$refs.tree.updateKeyChildren(
+                  this.firstLevelIdMap.get("我的模型").id,
+                  children
+                );
+              }
+
+              // this.expandedKeys.push(this.firstLevelIdMap.get("我的模型").id);
+              // this.modelData.forEach((ele) => {
+              //   if (ele.label == "我的模型") {
+              //     ele.children = children;
+              //   }
+              // });
             }
           }
         })
@@ -1074,7 +1135,9 @@ export default {
       if (!value) return true;
       return data.label.indexOf(value) !== -1;
     },
+    // 定位功能失效
     locateEvent(node) {
+      console.log(this.layerIdMap);
       if (this.layerIdMap.has(node.data.id)) {
         let layer = this.layerIdMap.get(node.data.id);
         // console.log(layer, "layer");
@@ -1183,7 +1246,7 @@ export default {
                     data.columnId,
                     data.id,
                     data.mainType,
-                    data.sourceType
+                    data.sourceType ? data.sourceType : ""
                   );
                 }
               }
@@ -1197,16 +1260,21 @@ export default {
               data.columnId,
               data.id,
               data.mainType,
-              data.sourceType
+              data.sourceType ? data.sourceType : ""
             );
           }
         } else {
-          if (this.$store.state.selectSelectDataMap["singlePolygon"][data.id]) {
+          if (
+            this.$store.state.selectSelectDataMap["singlePolygon"] &&
+            this.$store.state.selectSelectDataMap["singlePolygon"][data.id]
+          ) {
             delete this.$store.state.selectSelectDataMap["singlePolygon"][
               data.id
             ];
           }
-          delete this.originalData[data.id];
+          if (this.originalData && this.originalData[data.id]) {
+            delete this.originalData[data.id];
+          }
           map2DViewer.map.closePopup();
 
           // 移除图例
@@ -1240,82 +1308,121 @@ export default {
         checked ? this.displayMyModelData(data) : this.deleteMyModelData(data);
       }
     },
+    // 显示我的模型数据
     displayMyModelData(data) {
-      // 如果有叠置分析文件 -- 呈现叠置分析内容
-      if (data.c_dzfx_file) {
-        this.$Get(this.uploadBaseUrl + data.c_dzfx_file, "").then(
-          (response) => {
-            if (response.features.length > 0) {
-              response.features.forEach((v) => {
-                let geojson = publicFun.standardGeojson(v.geometry.coordinates);
-                // console.log(geojson, "geojson")
-                this.readGeojson(geojson, data.id);
-              });
-            }
-          }
-        );
-      } else {
-        let params = new FormData();
-        params = {
-          modelId: data.id,
-          userId: localStorage.getItem("USER_ID"),
-        };
-        // 调用我的模型查看接口读取所有图层数据
-        this.$Post(this.urlsCollection.getModelCoverAgeInfo, params).then(
-          (res) => {
-            if (res.code === 201 && res.message === "未申请任务权限") {
-              this.$message.info("暂无数据!");
+      debugger;
+      let uniqueId = data.id;
+      // 我的模型图层组初始化
+      if (!map2DViewer.analysisGroups[uniqueId]) {
+        map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
+        map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
+        this.layerIdMap.set(uniqueId, uniqueId);
+        if (!this.$store.state.selectSelectDataMap["singlePolygon"]) {
+          this.$store.state.selectSelectDataMap["singlePolygon"] = [];
+        }
+
+        // 如果有叠置分析文件 -- 呈现叠置分析内容
+        if (data.c_dzfx_file) {
+          this.$Get(this.uploadBaseUrl + data.c_dzfx_file, "").then(
+            (response) => {
+              if (response.features.length > 0) {
+                if (map2DViewer.analysisGroups[uniqueId]) {
+                  // 清除当前图层组内所有图层,并读取GeoJSON数据
+                  map2DViewer.analysisGroups[uniqueId].clearLayers();
+                  response.features.forEach((v) => {
+                    let geojson = publicFun.standardGeojson(
+                      v.geometry.coordinates
+                    );
+                    // 读取Geojson中的数据
+                    // this.$store.state.mapMethodsCollection
+                    // .get("RENDER")
+                    // .addSinglePolygon(
+                    //   geometry,
+                    //   cid,
+                    //   "#ff0",
+                    //   uniqueId,
+                    //   data.mainType,
+                    //   ""
+                    // );
+                    //等叠置分析有结果后再进行调试
+                    // console.log(geojson, "geojson")
+                    // this.readGeojson(geojson, data.id);
+                  });
+                }
+              }
             }
-            if (res.code === 200 && res.content.length > 0) {
-              console.log(res.content, "查看我的模型图层数据");
-              let uniqueId = `${data.label}_${data.id}`;
-              map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
-              map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
-              this.layerIdMap.set(uniqueId, uniqueId);
-              // 判断能用的数据
-              // 根据column_name或 column_id判断有几个图层
-              res.content.forEach((ele, index) => {
-                let cid = ele.id;
-                let geometry = ele.c_content;
-                // this.$store.state.mapMethodsCollection
-                //   .get("RENDER")
-                //   .addSinglePolygon(
-                //     geometry,
-                //     cid,
-                //     // this.randomColor.get(uniqueId),
-                //     uniqueId,
-                //     mainType,
-                //     sourceType
-                //   );
-                // let legendTitle = this.legendTitle.push({});
-                // map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
-                // map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
-              });
+          );
+        } else {
+          let params = new FormData();
+          params = {
+            modelId: data.id,
+            userId: localStorage.getItem("USER_ID"),
+          };
+          // 调用我的模型查看接口读取所有图层数据
+          this.$Post(this.urlsCollection.getModelCoverAgeInfo, params).then(
+            (res) => {
+              if (res.code === 201 && res.message === "未申请任务权限") {
+                this.$message.info("暂无数据!");
+              }
+              if (res.code === 200 && res.content.length > 0) {
+                console.log(res.content, "查看我的模型图层数据");
+                // 清除当前图层组内所有图层,并读取GeoJSON数据
+                map2DViewer.analysisGroups[uniqueId].clearLayers();
+                // 判断能用的数据
+                // 根据column_name或 column_id判断有几个图层
+                res.content.forEach((ele, index) => {
+                  let cid = ele.id;
+                  let geometry = ele.c_content;
+                  this.$store.state.mapMethodsCollection
+                    .get("RENDER")
+                    .addSinglePolygon(
+                      geometry,
+                      cid,
+                      "#ff0",
+                      uniqueId,
+                      data.mainType,
+                      ""
+                    );
+                  // let legendTitle = this.legendTitle.push({});
+                  // map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
+                  // map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
+                });
+              }
             }
-          }
-        );
+          );
+        }
+      }
+
+      if (map2DViewer.analysisGroups[uniqueId]) {
+        // 直接显示移除掉的图层
+        map2DViewer.map.addLayer(map2DViewer.analysisGroups[uniqueId]);
       }
     },
-    readGeojson(geojson, id) {
-      map2DViewer.overlay[id] = [];
-      let states = [];
-      states.push(geojson);
-      let geojsonData = L.geoJSON(states, {
-        style: function (feature) {
-          // console.log(feature);
-        },
-      }).addTo(map2DViewer.map);
-      map2DViewer.overlay[id] = geojsonData;
+    readGeojson(geojson, uniqueId) {
+      debugger;
+      // 尽量与所有图层,预设模型读取几何数据的方式一样,
+      // let states = [];
+      // states.push(geojson);
+      // let geojsonData = L.geoJSON(states, {
+      //   style: function (feature) {
+      //     // console.log(feature);
+      //   },
+      // }).addTo(map2DViewer.map);
+      // map2DViewer.analysisGroups[uniqueId] = geojsonData;
     },
     deleteMyModelData(data) {
-      // 如果有叠置分析文件,删除叠置分析图层
-      if (data.c_dzfx_file) {
-        if (map2DViewer.overlay[data.id]) {
-          map2DViewer.map.removeLayer(map2DViewer.overlay[data.id]);
-        }
-      } else {
-        // 删除绘制的图层数据
+      // 直接删除图层组中的数据
+      if (map2DViewer.analysisGroups[data.id]) {
+        map2DViewer.map.removeLayer(map2DViewer.analysisGroups[data.id]);
       }
+      // 如果有叠置分析文件,删除叠置分析图层
+      // if (data.c_dzfx_file) {
+      //   if (map2DViewer.analysisGroups[data.id]) {
+      //     map2DViewer.map.removeLayer(map2DViewer.analysisGroups[data.id]);
+      //   }
+      // } else {
+      //   // 删除绘制的图层数据
+      // }
     },
     //显示详细信息
     viewDetailsPopup(data) {