Эх сурвалжийг харах

综合分析-所有图层和预设模型中弹出框内容显示异常BUG修复。

DESKTOP-6LTVLN7\Liumouren 2 жил өмнө
parent
commit
f748d93e65

+ 196 - 231
src/components/map/MapHolder.vue

@@ -1,9 +1,9 @@
 <template>
   <div id="map2DViewer">
     <!-- 特殊地图属性弹窗 -- 有审计功能 -->
-    <CaseAuditPopup v-show="auditPopupShow" ref="auditRef" />
+    <CaseAuditPopup v-show="auditPopupShow" :tableObj="auditRefTableObj" ref="auditRef" />
     <!-- 通用地图属性弹窗 -- 无审计功能 -->
-    <NormalAttrPopup v-show="normalAttrPopupShow" ref="normalRef" />
+    <NormalAttrPopup v-show="normalAttrPopupShow" :tableObj="tableObj" ref="normalRef" />
     <LabelCasePopup v-show="labelDetailsPopupShow" ref="labelRef" />
     <BasemapChange />
   </div>
@@ -18,13 +18,14 @@ import NormalAttrPopup from "@/components/popup/NormalAttrPopup.vue";
 import LabelCasePopup from "@/components/popup/LabelCasePopup.vue";
 import BasemapChange from "@/components/map/BasemapChange.vue";
 import coordinate from "@/utils/coordinate.js";
+import { nextTick } from "vue";
 export default {
   name: "MapHolder",
   components: {
     CaseAuditPopup,
     NormalAttrPopup,
     LabelCasePopup,
-    BasemapChange,
+    BasemapChange
   },
   data() {
     return {
@@ -44,9 +45,20 @@ export default {
       // 标记疑点
       currentLabelCid: null,
       currentLabelHtml: null,
-      tableObj: {},
       // 疑点审计的保存后的疑点状态集合
       caseStatusMap: new Map(),
+      tableObj: {
+        镇域名称: "--",
+        面积: "--",
+        土地类型: "--",
+        图斑编号: "--"
+      },
+      auditRefTableObj: {
+        镇域名称: "--",
+        面积: "--",
+        图层构成: "--",
+        性质: "--"
+      }
     };
   },
   created() {},
@@ -77,7 +89,7 @@ export default {
       deleteSinglePolygon: this.deleteSinglePolygon,
       deleteGroupFromMap: this.deleteGroupFromMap,
       drawGeometry: this.drawGeometry,
-      deleteGeometry: this.deleteGeometry,
+      deleteGeometry: this.deleteGeometry
     });
   },
   beforeDestroyed() {
@@ -98,7 +110,7 @@ export default {
     // 监听当前菜单
     getCurrentMenu() {
       return this.$store.state.navSelect;
-    },
+    }
   },
   watch: {
     getLabelCaseBtnStatus(val) {
@@ -141,9 +153,9 @@ export default {
         this.$nextTick(() => {
           this.getJSonData();
         });
-      },
+      }
       // immediate: true
-    },
+    }
   },
   methods: {
     // 开始标记疑点事件
@@ -154,7 +166,7 @@ export default {
     stopLabelCase() {
       if (map2DViewer.measureTool) {
         map2DViewer.setDrawTool({
-          action: "remove",
+          action: "remove"
         });
       }
     },
@@ -170,24 +182,7 @@ export default {
      * @sourceType
      */
     createNormalDiv(str, geojsonData, sourceType) {
-      let geoProperties = JSON.parse(geojsonData).properties;
-      // 搜索geojson数据中的固定字段 -- 镇域名称,面积,土地类型,图斑编号
-      this.$refs.normalRef.tableObj["面积"] = geoProperties["面积"] || "--";
-      this.$refs.normalRef.tableObj["镇域名称"] =
-        geoProperties["镇域名称"] || "--";
-      this.$refs.normalRef.tableObj["土地类型"] =
-        geoProperties["土地类型"] || "--";
-      this.$refs.normalRef.tableObj["图斑编号"] =
-        geoProperties["图斑编号"] || "--";
       let currentInnerHtml = this.$refs.normalRef.$el.innerHTML;
-      // 需要重新绘制的属性obj
-      let targetObj = {
-        镇域名称: geoProperties["镇域名称"] || "--",
-        面积: geoProperties["面积"] || "--",
-        土地类型: geoProperties["土地类型"] || "--",
-        图斑编号: geoProperties["图斑编号"] || "--",
-      };
-
       if (currentInnerHtml) {
         let div = document.createElement("div");
         div.id = str + "_id";
@@ -196,37 +191,24 @@ export default {
         div.innerHTML = currentInnerHtml;
         // 需要显示法律法规详细信息的弹窗
         if (sourceType) {
-          $(() => {
+          setTimeout(() => {
+            let _this = this;
             // 法律法规点击事件
             if ($(`#${str}_id a`)) {
-              // 属性框内容
-              if ($(".center-table-item-normal")) {
-                $(".center-table-item-normal .leftcell").each(
-                  (index, domEle) => {
-                    $(".center-table-item-normal .leftcell")
-                      .eq(index)
-                      .text(Object.keys(targetObj)[index]);
-                    $(".center-table-item-normal .rightcell")
-                      .eq(index)
-                      .text(Object.values(targetObj)[index]);
-                  }
-                );
-              }
-
               $(`#${str}_id a`)
                 .eq(0)
-                .click((e) => {
+                .click(e => {
                   this.$store.state.lawPopupShow = true;
                   this.$store.state.lawSourceType = sourceType;
                 });
               $(`#${str}_id a`)
                 .eq(1)
-                .click((e) => {
+                .click(e => {
                   // 触发综合分析右侧面板点击事件
                   this.$bus.$emit("viewDetailsPopup", geojsonData);
                 });
             }
-          });
+          }, 0);
         } else {
           // 不需要显示法律法规详细信息的弹窗
           $(() => {
@@ -236,7 +218,6 @@ export default {
           });
           // console.log("呈现我的模型的几何数据");
         }
-
         return div;
       }
     },
@@ -249,58 +230,33 @@ export default {
     createAuditDiv(str, geojsonData, sourceType) {
       // 根据ref获取组件的dom元素
       this.currentHtml = this.$refs.auditRef.$el.innerHTML;
-      let geoProperties = JSON.parse(geojsonData).properties;
-      // 搜索geojson数据中的固定字段 -- 镇域名称,面积,土地类型,图斑编号
-      this.$refs.auditRef.tableObj["面积"] = geoProperties["面积"] || "--";
-      this.$refs.auditRef.tableObj["镇域名称"] =
-        geoProperties["镇域名称"] || "--";
-      this.$refs.auditRef.tableObj["图层构成"] =
-        geoProperties["图层构成"] || "--";
-      this.$refs.auditRef.tableObj["性质"] = geoProperties["性质"] || "--";
-
-      // 需要重新绘制的属性obj
-      let targetObj = {
-        镇域名称: geoProperties["镇域名称"] || "--",
-        面积: geoProperties["面积"] || "--",
-        图层构成: geoProperties["图层构成"] || "--",
-        性质: geoProperties["性质"] || "--",
-      };
       if (this.currentHtml) {
         let div = document.createElement("div");
         div.id = str + "_id";
         div.className = "case-audit";
         // 动态创建div后赋值模板样式
         div.innerHTML = this.currentHtml;
-        $(() => {
+        setTimeout(() => {
+          // let _this = this;
           // 属性框内容
-          if ($(".center-table-item-normal")) {
-            $(".center-table-item-normal .leftcell").each((index, domEle) => {
-              $(".center-table-item-normal .leftcell")
-                .eq(index)
-                .text(Object.keys(targetObj)[index]);
-              $(".center-table-item-normal .rightcell")
-                .eq(index)
-                .text(Object.values(targetObj)[index]);
-            });
-          }
+          // if ($(".center-table-item-normal")) {
+          //   $(".center-table-item-normal .leftcell").each((index, domEle) => {
+          //     $(".center-table-item-normal .leftcell").eq(index).text(Object.keys(_this.auditRefTableObj)[index]);
+          //     $(".center-table-item-normal .rightcell").eq(index).text(Object.values(_this.auditRefTableObj)[index]);
+          //   });
+          // }
 
-          if ($(".center-table-item-special")) {
-            $(".center-table-item-special .leftcell").each((index, domEle) => {
-              $(".center-table-item-speciall .leftcell")
-                .eq(index)
-                .text(Object.keys(targetObj)[index]);
-              $(".center-table-item-special .rightcell")
-                .eq(index)
-                .text(Object.values(targetObj)[index]);
-            });
-          }
+          // if ($(".center-table-item-special")) {
+          //   $(".center-table-item-special .leftcell").each((index, domEle) => {
+          //     $(".center-table-item-speciall .leftcell").eq(index).text(Object.keys(_this.auditRefTableObj)[index]);
+          //     $(".center-table-item-special .rightcell").eq(index).text(Object.values(_this.auditRefTableObj)[index]);
+          //   });
+          // }
 
           // 下拉框内容
           if ($(`#${str}_id .center-table-item-special select`)) {
             if (this.caseStatusMap.has(str)) {
-              $(`#${str}_id .center-table-item-special select`).val(
-                this.caseStatusMap.get(str)
-              );
+              $(`#${str}_id .center-table-item-special select`).val(this.caseStatusMap.get(str));
             }
           }
 
@@ -308,13 +264,13 @@ export default {
           if ($(`#${str}_id a`)) {
             $(`#${str}_id a`)
               .eq(0)
-              .click((e) => {
+              .click(e => {
                 this.$store.state.lawPopupShow = true;
                 this.$store.state.lawSourceType = sourceType;
               });
             $(`#${str}_id a`)
               .eq(1)
-              .click((e) => {
+              .click(e => {
                 // 触发综合分析右侧面板点击事件
 
                 this.$bus.$emit("viewDetailsPopup", geojsonData);
@@ -322,7 +278,7 @@ export default {
           }
           // input添加点击事件
           if ($(`#${str}_id input`)[1]) {
-            $(`#${str}_id input`).click((e) => {
+            $(`#${str}_id input`).click(e => {
               switch (e.target.defaultValue) {
                 case "取消":
                   this.cancelBtnEvent();
@@ -333,7 +289,7 @@ export default {
               }
             });
           }
-        });
+        }, 0);
         return div;
       }
     },
@@ -358,7 +314,7 @@ export default {
           console.log($(`#${str}_id textarea`).val(), "textarea");
           $(`#${str}_id`).css("height", "100%");
 
-          $(`#${str}_id input`).click((e) => {
+          $(`#${str}_id input`).click(e => {
             console.log(e.target.defaultValue);
             switch (e.target.defaultValue) {
               case "取消":
@@ -387,22 +343,20 @@ export default {
         // 修改人员名称
         c_editor_name: localStorage.getItem("USER_NAME"),
         // 修改人员ID
-        c_editorid: localStorage.getItem("USER_ID"),
+        c_editorid: localStorage.getItem("USER_ID")
       };
       let modifyParams = new FormData();
       modifyParams = {
         columnId: 510,
         modelId: 118,
-        content: JSON.stringify(obj),
+        content: JSON.stringify(obj)
       };
-      this.$Post(this.urlsCollection.updateContent, modifyParams).then(
-        (res) => {
-          if (res.code === 200) {
-            this.$message.success("数据修改成功");
-            map2DViewer.map.closePopup();
-          }
+      this.$Post(this.urlsCollection.updateContent, modifyParams).then(res => {
+        if (res.code === 200) {
+          this.$message.success("数据修改成功");
+          map2DViewer.map.closePopup();
         }
-      );
+      });
     },
     cancelBtnEvent() {
       map2DViewer.map.closePopup();
@@ -427,13 +381,7 @@ export default {
         } else {
           geoName = $(`#${str}_id input`).eq(0).val();
           let coordinates = [data.points];
-          let geometry = publicFun.generateGeoJSON(
-            title,
-            des,
-            geoType,
-            coordinates,
-            geoName
-          );
+          let geometry = publicFun.generateGeoJSON(title, des, geoType, coordinates, geoName);
           let params = new FormData();
           let newGeojson = JSON.stringify(geometry);
           myLabelNameMap.set(geoName, newGeojson);
@@ -441,11 +389,11 @@ export default {
             geojson: newGeojson,
             type: geoType,
             userId: Number(localStorage.getItem("USER_ID")),
-            sourceId: 0,
+            sourceId: 0
           };
 
           this.$Post(this.urlsCollection.addConllection, params).then(
-            (res) => {
+            res => {
               if (res.code == 200) {
                 // 标记成功后删除保存的原有名称
                 myLabelNameMap.delete(geoName);
@@ -455,36 +403,33 @@ export default {
                 paramData = {
                   userId: Number(localStorage.getItem("USER_ID")),
                   sourceId: 0,
-                  pageSize: 10,
+                  pageSize: 10
                 };
                 // 暂存map中刚刚保存的数据
-                this.$Post(this.urlsCollection.selectByUser, paramData).then(
-                  (userRes) => {
-                    if (userRes.code === 200) {
-                      if (userRes.content.length > 0) {
-                        this.$store.state.myLabelPointsArr = [];
-                        this.$store.state.myLabelPointsArr =
-                          userRes.content.map((v) => {
-                            if (JSON.stringify(geometry) === v.geojson) {
-                              sessionStorage.setItem("myLabelPointsId", v.id);
-                            }
-                            return {
-                              id: v.id,
-                              geojson: v.geojson,
-                              type: v.type,
-                            };
-                          });
-                        // 判断刚刚暂存的数据,并调用小眼睛的方法
-                      }
+                this.$Post(this.urlsCollection.selectByUser, paramData).then(userRes => {
+                  if (userRes.code === 200) {
+                    if (userRes.content.length > 0) {
+                      this.$store.state.myLabelPointsArr = [];
+                      this.$store.state.myLabelPointsArr = userRes.content.map(v => {
+                        if (JSON.stringify(geometry) === v.geojson) {
+                          sessionStorage.setItem("myLabelPointsId", v.id);
+                        }
+                        return {
+                          id: v.id,
+                          geojson: v.geojson,
+                          type: v.type
+                        };
+                      });
+                      // 判断刚刚暂存的数据,并调用小眼睛的方法
                     }
-                    // 更新时调用一次搜索接口
                   }
-                );
+                  // 更新时调用一次搜索接口
+                });
               }
               // 保存后需要删除地图上的标记
               this.reStartLabelCase();
             },
-            (error) => {
+            error => {
               console.log("标记疑点保存失败!", error);
               this.reStartLabelCase();
             }
@@ -498,9 +443,7 @@ export default {
         map2DViewer.jlMap = L.tileLayer(
           "http://t0.tianditu.gov.cn/DataServer?T=img_w&X={x}&Y={y}&L={z}&tk=f331ba0b9ab96fb21c56d91de868935d"
         ).addTo(map2DViewer.map);
-        map2DViewer.jlControl = L.control
-          .sideBySide(map2DViewer.map, map2DViewer.jlMap)
-          .addTo(map2DViewer.map);
+        map2DViewer.jlControl = L.control.sideBySide(map2DViewer.map, map2DViewer.jlMap).addTo(map2DViewer.map);
       } else if (map2DViewer.map.hasLayer(map2DViewer.jlMap)) {
         map2DViewer.map.removeControl(map2DViewer.jlControl);
         map2DViewer.map.removeLayer(map2DViewer.jlMap);
@@ -523,14 +466,7 @@ export default {
       // 每次点击按钮后重绘弹窗
       if (this.currentHtml && this.currentCid) {
         setTimeout(() => {
-          this.popup.setContent(
-            this.createAuditDiv(
-              this.currentCid,
-              this.currentProperties,
-              this.currentSourceType
-            )
-          );
-          // .openOn(map2DViewer.map);
+          this.popup.setContent(this.createAuditDiv(this.currentCid, this.currentProperties, this.currentSourceType));
         }, 300);
       }
     },
@@ -538,7 +474,7 @@ export default {
     initDraw() {
       if (!map2DViewer.measureTool) {
         // 引入疑点标记绘制方法
-        map2DViewer.drawToolFire = (data) => {
+        map2DViewer.drawToolFire = data => {
           // 纬经度
           if (data && data.points.length >= 1) {
             let geoType = null;
@@ -577,7 +513,7 @@ export default {
           color: "red",
           font_size: "14px",
           closeButton: true,
-          iconUrl: "../../static/plugins/draw-plugin/images/marker-icon.png",
+          iconUrl: "../../static/plugins/draw-plugin/images/marker-icon.png"
         });
       }
     },
@@ -588,13 +524,11 @@ export default {
         "+proj=tmerc +lat_0=0 +lon_0=121.2751921 +k=1 +x_0=0 +y_0=-3457147.81 +ellps=krass +units=m +no_defs",
         {
           resolutions: [
-            132.2919312505292, 52.91677250021167, 26.458386250105836,
-            13.229193125052918, 5.291677250021167, 2.6458386250105836,
-            1.3229193125052918, 0.5291677250021167, 0.26458386250105836,
-            0.13229193125052918,
+            132.2919312505292, 52.91677250021167, 26.458386250105836, 13.229193125052918, 5.291677250021167, 2.6458386250105836,
+            1.3229193125052918, 0.5291677250021167, 0.26458386250105836, 0.13229193125052918
           ],
           origin: [-66000, 75000],
-          bounds: L.bounds([-65000, -76000], [75000, 72000]),
+          bounds: L.bounds([-65000, -76000], [75000, 72000])
         }
       );
 
@@ -604,7 +538,7 @@ export default {
         minZoom: 0,
         maxZoom: 8,
         attributionControl: false,
-        zoomControl: false,
+        zoomControl: false
         // preferCanvas: true,
       }).setView(systemConfig.mapViewer.center, systemConfig.mapViewer.zoom);
 
@@ -621,7 +555,7 @@ export default {
           // http://aimap.pudong.sh:5236/zjmap/reproduction-service/maps/rest/services/sat-2019s4/proxy?AccessKey=lUaEMxqqhZKLSImGuP/Ergx47orYVyIqHVgxfyGpIurKAy9kdq5uU1cWuTuIXeOM
           // url: "http://aimap.pudong.sh:5236/maps/rest/services/basemap-shanghai-gem-blue-sh2000/mapserver",
           tileSize: 512,
-          url:systemConfig.blueBlackMap,
+          url:systemConfig.blueBlackMap
         })
         .addTo(map2DViewer.map);
       // layer.setStyle({opacity:0,fillOpacity:0})
@@ -639,16 +573,14 @@ export default {
         map2DViewer.groups["浦东新区_polygon"].remove();
       }
       // 请求并渲染新的区域图层
-      get("./static/json/simplified_pdgeojson.json", "").then((geoJson) => {
+      get("./static/json/simplified_pdgeojson.json", "").then(geoJson => {
         // 存放所有的面数据
         map2DViewer.groups["浦东新区_polygon"] = L.featureGroup();
         map2DViewer.groups["浦东新区_label"] = L.featureGroup();
         map2DViewer.groups["浦东新区_polygon"].addTo(map2DViewer.map);
         map2DViewer.groups["浦东新区_label"].addTo(map2DViewer.map);
-        geoJson.features.map((feature) => {
-          let correctCordArr = JSON.parse(
-            JSON.stringify(feature.geometry.coordinates)
-          );
+        geoJson.features.map(feature => {
+          let correctCordArr = JSON.parse(JSON.stringify(feature.geometry.coordinates));
           let newCorrectCoordArr = publicFun.latLngsCorrection(correctCordArr);
           feature.geometry.coordinates = newCorrectCoordArr;
 
@@ -690,7 +622,6 @@ export default {
         this.getJSonDataToStreet("", "");
         // 切换到首页时需定位到当前图层
         if (this.$store.state.homeSpecialTown === "全部") {
-          // map2DViewer.map.fitBounds(map2DViewer.groups["浦东新区_polygon"].getBounds())
           this.setView(
             townLocationMap.get(this.$store.state.homeSpecialTown),
             10
@@ -726,7 +657,7 @@ export default {
         weight: 3,
         fillColor: this.getColor(name),
         opacity: 1,
-        fillOpacity: 0.4,
+        fillOpacity: 0.4
       }).addTo(map2DViewer.groups["浦东新区_polygon"]);
 
       center = JSON.parse(JSON.stringify(center)).geometry.coordinates;
@@ -738,25 +669,25 @@ export default {
         radius: 10,
         weight: 1,
         fillOpacity: 0,
-        color: "#e6d273",
+        color: "#e6d273"
       });
       wmarker.bindLabel(feature.properties.NAME, {
         noHide: true,
         clickable: true,
-        offset: [-25, 10],
+        offset: [-25, 10]
       });
       wmarker.addTo(map2DViewer.groups["浦东新区_label"]);
       let circle1 = L.circleMarker(center, {
         radius: 8,
         weight: 1,
         fillOpacity: 0,
-        color: "#e6d273",
+        color: "#e6d273"
       }).addTo(map2DViewer.groups["浦东新区_polygon"]);
       let circle2 = L.circleMarker(center, {
         radius: 5,
         weight: 1,
         fillOpacity: 1,
-        color: "#e6d273",
+        color: "#e6d273"
       }).addTo(map2DViewer.groups["浦东新区_polygon"]);
     },
     latLngsToReverse: function (latlngsAry) {
@@ -794,18 +725,16 @@ export default {
     addSinglePolygon(geometry, cid, color, uniqueId, mainType, sourceType) {
       let uniqueIdList = [];
       if (this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId]) {
-        uniqueIdList =
-          this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId];
+        uniqueIdList = this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId];
       }
 
       let singlePolygonItem = {
         uniqueId: uniqueId,
         geometry: geometry,
-        cid: cid,
+        cid: cid
       };
       uniqueIdList.push(singlePolygonItem);
-      this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId] =
-        uniqueIdList;
+      this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId] = uniqueIdList;
       // 当前数据坐标系为WGS84
       let targetGeometry = JSON.parse(geometry).geometry;
       // 预设模型与所有图层层级不同
@@ -817,73 +746,109 @@ export default {
         weight: 3,
         fillColor: color,
         opacity: 1,
-        fillOpacity: 0.4,
+        fillOpacity: 0.4
       }).addTo(map2DViewer.analysisGroups[uniqueId]);
 
-      polygon.on("click", (e) => {
+      polygon.on("click", e => {
         let geojsonData = geometry;
         // 所有图层下的疑点图层 -- 常规展示
-        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);
-        }
-        // 预设模型下图层 -- 需要考虑审计功能
-        if (mainType === "预设模型") {
-          this.auditPopupShow = true;
-          this.popup = L.popup({ maxWidth: 700, maxHeight: 600 })
-            .setLatLng(e.latlng)
-            .setContent(this.createAuditDiv(cid, geojsonData, sourceType));
-          this.auditPopupShow = false;
-          this.popup.openOn(map2DViewer.map);
-          this.currentCid = cid;
-          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);
+        if (geojsonData) {
+          if (mainType === "预设模型") {
+            let geoProperties = JSON.parse(geojsonData).properties;
+            this.auditRefTableObj = {
+              镇域名称: geoProperties["镇域名称"] || "--",
+              面积: geoProperties["面积"] || "--",
+              图层构成: geoProperties["图层构成"] || "--",
+              性质: geoProperties["性质"] || "--"
+            };
+            this.$refs.auditRef.$nextTick(() => {
+              this.currentCid = cid;
+              this.currentProperties = geojsonData;
+              this.currentSourceType = sourceType;
+              let domItem = this.createAuditDiv(cid, geojsonData, sourceType);
+              this.auditPopupShow = true;
+              this.popup = L.popup({ maxWidth: 700, maxHeight: 600 }).setLatLng(e.latlng).setContent(domItem);
+              this.auditPopupShow = false;
+              this.popup.openOn(map2DViewer.map);
+            });
+          } else {
+            let geoProperties = JSON.parse(geojsonData).properties;
+            this.tableObj = {
+              镇域名称: geoProperties["镇域名称"] || "--",
+              面积: geoProperties["面积"] || "--",
+              图层构成: geoProperties["图层构成"] || "--",
+              性质: geoProperties["性质"] || "--"
+            };
+
+            this.$refs.normalRef.$nextTick(() => {
+              let domItem = this.createNormalDiv(cid, geojsonData, sourceType);
+              this.normalAttrPopupShow = true;
+              this.normalPopup = L.popup({ maxWidth: 700, maxHeight: 600 }).setLatLng(e.latlng).setContent(domItem);
+              this.normalAttrPopupShow = false;
+              this.normalPopup.openOn(map2DViewer.map);
+            });
+            // this.$refs.normalRef.$nextTick(() => {
+            //     if (mainType === "所有图层") {
+            //       let domItem = this.createNormalDiv(cid, geojsonData, sourceType);
+            //       this.normalAttrPopupShow = true;
+            //       this.normalPopup = L.popup({ maxWidth: 700, maxHeight: 600 }).setLatLng(e.latlng).setContent(domItem);
+            //       this.normalAttrPopupShow = false;
+            //       this.normalPopup.openOn(map2DViewer.map);
+            //     }
+            //     // 预设模型下图层 -- 需要考虑审计功能
+            //     if (mainType === "预设模型") {
+            //       let domItem = this.createAuditDiv(cid, geojsonData, sourceType);
+            //       this.auditPopupShow = true;
+            //       this.popup = L.popup({ maxWidth: 700, maxHeight: 600 })
+            //         .setLatLng(e.latlng)
+            //         .setContent(domItem);
+            //       this.auditPopupShow = false;
+            //       this.popup.openOn(map2DViewer.map);
+            //       this.currentCid = cid;
+            //       this.currentProperties = geojsonData;
+            //       this.currentSourceType = sourceType;
+            //     }
+            //     // 我的模型图层 -- 无疑点审计功能,无法律法规选项
+            //     if (mainType === "我的模型") {
+            //       let domItem = this.createNormalDiv(cid, geojsonData, sourceType);
+            //       this.normalAttrPopupShow = true;
+            //       this.normalPopup = L.popup({ maxWidth: 700, maxHeight: 600 }).setLatLng(e.latlng).setContent(domItem);
+            //       this.normalAttrPopupShow = false;
+            //       this.normalPopup.openOn(map2DViewer.map);
+            //     }
+            // });
+          }
         }
       });
     },
     // 综合分析 - 图层绘制面
-    addPolygonLayer(data, cid, color) {
-      data.map((feature) => {
-        let polygonData = JSON.parse(JSON.stringify(feature));
-        let coordinates = polygonData.geometry.coordinates[0];
-        let infos = polygonData.properties;
-        let polygon = L.polygon(coordinates, {
-          color: color,
-          weight: 3,
-          fillColor: color,
-          opacity: 1,
-          fillOpacity: 0.4,
-        }).addTo(map2DViewer.map);
-        map2DViewer.polygons[`${cid}_layer`].push(polygon);
-        polygon.infos = infos;
-        polygon.on("click", (e) => {
-          // console.log(e, "polygon");
-          this.auditPopupShow = true;
-          // console.log(e.latlng, "获取当前弹窗坐标111");
+    // addPolygonLayer(data, cid, color) {
+    //   data.map(feature => {
+    //     let polygonData = JSON.parse(JSON.stringify(feature));
+    //     let coordinates = polygonData.geometry.coordinates[0];
+    //     let infos = polygonData.properties;
+    //     let polygon = L.polygon(coordinates, {
+    //       color: color,
+    //       weight: 3,
+    //       fillColor: color,
+    //       opacity: 1,
+    //       fillOpacity: 0.4
+    //     }).addTo(map2DViewer.map);
+    //     map2DViewer.polygons[`${cid}_layer`].push(polygon);
+    //     polygon.infos = infos;
+    //     polygon.on("click", e => {
+    //       // console.log(e, "polygon");
+    //       this.auditPopupShow = true;
+    //       // console.log(e.latlng, "获取当前弹窗坐标111");
 
-          this.popup = L.popup({ maxWidth: 700, maxHeight: 600 })
-            .setLatLng(e.latlng)
-            .setContent(this.createAuditDiv(cid));
-          // .openOn(map2DViewer.map);
-          this.auditPopupShow = false;
-          this.popup.openOn(map2DViewer.map);
-          this.currentCid = cid;
-        });
-      });
-    },
+    //       this.popup = L.popup({ maxWidth: 700, maxHeight: 600 }).setLatLng(e.latlng).setContent(this.createAuditDiv(cid));
+    //       // .openOn(map2DViewer.map);
+    //       this.auditPopupShow = false;
+    //       this.popup.openOn(map2DViewer.map);
+    //       this.currentCid = cid;
+    //     });
+    //   });
+    // },
     deleteSinglePolygon(polygon) {
       map2DViewer.map.removeLayer(polygon);
     },
@@ -896,7 +861,7 @@ export default {
     //综合分析 - 标记疑点 - 删除面
     deletePolygonLayer(layer) {
       console.log(layer, "layer");
-      map2DViewer.polygons[layer].forEach((polygon) => {
+      map2DViewer.polygons[layer].forEach(polygon => {
         map2DViewer.map.removeLayer(polygon);
       });
     },
@@ -904,7 +869,7 @@ export default {
     drawPoints(data) {
       if (!map2DViewer.myLabels[`label_${data.id}`]) {
         let point = L.marker(data.coord, {
-          opacity: 1,
+          opacity: 1
         }).addTo(map2DViewer.groups["我的标记图层组"]);
         map2DViewer.myLabels[`label_${data.id}`] = point;
       }
@@ -917,7 +882,7 @@ export default {
           weight: 3,
           fillOpacity: color,
           opacity: 1,
-          fillOpacity: 0.4,
+          fillOpacity: 0.4
         }).addTo(map2DViewer.groups["我的标记图层组"]);
         // zoom the map to the polyline
         map2DViewer.myLabels[`label_${data.id}`] = polyline;
@@ -931,7 +896,7 @@ export default {
           weight: 3,
           fillOpacity: color,
           opacity: 1,
-          fillOpacity: 0.4,
+          fillOpacity: 0.4
         }).addTo(map2DViewer.groups["我的标记图层组"]);
 
         map2DViewer.myLabels[`label_${data.id}`] = polygon;
@@ -953,7 +918,7 @@ export default {
             fillOpacity: color,
             opacity: 1,
             fillOpacity: 0.4,
-            radius: Number(distance),
+            radius: Number(distance)
           }).addTo(map2DViewer.groups["我的标记图层组"]);
           map2DViewer.myLabels[`label_${data.id}`] = circle;
         }
@@ -984,8 +949,8 @@ export default {
       if (geometry) {
         geometry.removeFrom(map2DViewer.map);
       }
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="less" scoped>

+ 7 - 6
src/components/popup/CaseAuditPopup.vue

@@ -66,6 +66,7 @@ import NewSelect from "@/components/common/NewSelect.vue";
 export default {
   name: "CaseAuditPopup",
   components: { MenuCard, NewSelect },
+  props: ["tableObj"],
   data() {
     return {
       menuData: {
@@ -75,12 +76,12 @@ export default {
         boxHeight: "320",
       },
       status: "normal",
-      tableObj: {
-        镇域名称: "--",
-        面积: "--",
-        图层构成: "--",
-        性质: "--",
-      },
+      // tableObj: {
+      //   镇域名称: "--",
+      //   面积: "--",
+      //   图层构成: "--",
+      //   性质: "--",
+      // },
       selectVal: "疑点",
       selectOptions: [
         { value: "疑点", label: "疑点" },

+ 8 - 7
src/components/popup/NormalAttrPopup.vue

@@ -7,7 +7,7 @@
       <div class="top-law">
         <a style="cursor: pointer"> 》更多详细内容</a>
       </div>
-      <div class="center-table" style="height: 75%">
+      <div class="center-table" style="height: 75%" v-if="tableObj">
         <div
           class="center-table-item-normal"
           v-for="(value, key) in tableObj"
@@ -31,6 +31,7 @@ import NewSelect from "@/components/common/NewSelect.vue";
 export default {
   name: "NormalAttrPopup",
   components: { MenuCard, NewSelect },
+  props: ["tableObj"],
   data() {
     return {
       menuData: {
@@ -39,12 +40,12 @@ export default {
         boxWidth: "300",
         boxHeight: "320",
       },
-      tableObj: {
-        镇域名称: "--",
-        面积: "--",
-        土地类型: "--",
-        图斑编号: "--",
-      },
+      // tableObj: {
+      //   镇域名称: "--",
+      //   面积: "--",
+      //   土地类型: "--",
+      //   图斑编号: "--",
+      // },
     };
   },
 };