Bläddra i källkod

综合分析属性弹窗补充镇域名称信息

Bella 2 år sedan
förälder
incheckning
ce714a493e
1 ändrade filer med 41 tillägg och 7 borttagningar
  1. 41 7
      src/views/ComprehensiveAnalysis.vue

+ 41 - 7
src/views/ComprehensiveAnalysis.vue

@@ -1121,16 +1121,24 @@ export default {
      * @mainType 判断是主目录类型
      * @uniqueId id
      */
-    addLayerDataSource(data, mainType, layerName) {
+    addLayerDataSource(data, mainType, layerName, townType) {
+      debugger;
       let targetGeometry = JSON.parse(data);
       if (targetGeometry) {
         let properties = targetGeometry.properties;
         let id = targetGeometry.id;
         targetGeometry.properties["id"] = id;
+        // 添加数据来源
         if (!targetGeometry.properties["数据来源"]) {
           targetGeometry.properties["数据来源"] = "规资";
         }
 
+        // 缺少的镇域名称补充
+        if (townType && townType != "") {
+          targetGeometry.properties["镇域名称"] = townType;
+        }
+
+        // 添加图层构成
         if (
           mainType === "预设模型" &&
           layerName &&
@@ -1141,6 +1149,7 @@ export default {
               this.preLayerCompMap.get(layerName).c_layer_component;
           }
         }
+
         return JSON.stringify(targetGeometry);
       }
     },
@@ -1571,7 +1580,8 @@ export default {
         this.changeSingleLayer(1, this.currentPageSize, uniqueId);
       }
     },
-    getMapData(uniqueId, columnId, mainType, sourceType, layerName) {
+    getMapData(uniqueId, columnId, mainType, sourceType, layerName, townType) {
+      debugger;
       let layerParams = new FormData();
       layerParams = {
         columnId: columnId,
@@ -1674,7 +1684,8 @@ export default {
                 let geometry = this.addLayerDataSource(
                   ele.c_content,
                   mainType,
-                  layerName
+                  layerName,
+                  townType
                 );
                 let defaultStatus = ele.c_boolean;
                 let modelId = ele.model_id;
@@ -1717,7 +1728,13 @@ export default {
                 this.targetLayerTotal[uniqueId]
               ) {
                 this.targetLayerPage[uniqueId]++;
-                this.getMapData(uniqueId, columnId, mainType, sourceType);
+                this.getMapData(
+                  uniqueId,
+                  columnId,
+                  mainType,
+                  sourceType,
+                  townType
+                );
               }
             }
           }
@@ -1737,8 +1754,17 @@ export default {
      * @mainType  所有图层/预设模型
      * @sourceType 土地资源/林地资源/生态资源/水资源/全部
      * @layerName 图层名称
+     * @townType
      */
-    displaySingleLayer(columnId, id, mainType, sourceType, layerName) {
+    displaySingleLayer(
+      columnId,
+      id,
+      mainType,
+      sourceType,
+      layerName,
+      townType
+    ) {
+      debugger;
       let uniqueId = id;
       this.layerIdMap.set(uniqueId, uniqueId);
 
@@ -1752,7 +1778,14 @@ export default {
         if (!this.layerLoading && this.targetLayerPage[uniqueId] === 0) {
           this.layerLoading = true;
         }
-        this.getMapData(uniqueId, columnId, mainType, sourceType, layerName);
+        this.getMapData(
+          uniqueId,
+          columnId,
+          mainType,
+          sourceType,
+          layerName,
+          townType
+        );
       }
     },
     /**
@@ -2299,7 +2332,8 @@ export default {
                   data.id,
                   data.mainType,
                   data.sourceType ? data.sourceType : "",
-                  data.label
+                  data.label,
+                  data.townType ? data.townType : ""
                 );
                 // if (res.code === 202 && res.content === "数据不存在") {
                 //   this.$message.info("当前用户无权限!");