Browse Source

智能选址,前端定位

liutao 2 months ago
parent
commit
63a15b2976
1 changed files with 16 additions and 10 deletions
  1. 16 10
      web_ui/src/views/industrial-land/ZnxzDetail.vue

+ 16 - 10
web_ui/src/views/industrial-land/ZnxzDetail.vue

@@ -216,7 +216,7 @@
                     class="t-item"
                     v-for="(item, index) in ghfxList"
                     :key="index"
-                    @click="ghfxClick(item,index)"
+                    @click="ghfxClick(item, index)"
                     :class="{ activate: index == ghfxIndex }"
                   >
                     <div class="td c6">{{ item.name }}</div>
@@ -1221,9 +1221,9 @@ export default {
       this.jbxxIndex = 0;
       this.ggssIndex = 0;
       this.qytsIndex = 0;
-      this.ghfxIndex=-1;
-      this.xzfxIndex=-1;
-      this.sqsxIndex=-1;
+      this.ghfxIndex = -1;
+      this.xzfxIndex = -1;
+      this.sqsxIndex = -1;
       this.$emit("toggle");
       if (index == 2) {
         this.toggltGgssIndex(0, { name: "医院" });
@@ -1242,6 +1242,9 @@ export default {
     // 基本信息选项卡切换
     toggltJbxxIndex(index) {
       this.jbxxIndex = index;
+      this.xzfxIndex = -1;
+      this.sqsxIndex = -1;
+      this.ghfxIndex = -1;
       this.$emit("toggle", "jbxx", index);
     },
     toggltQytsIndex(index) {
@@ -1860,7 +1863,7 @@ export default {
         if (!ydxz) {
           continue;
         }
-        ydxz = ydxz.replace(/[\n\r]+/g, '');
+        ydxz = ydxz.replace(/[\n\r]+/g, "");
         // Get intersection
         const intersection = turf.intersect(geometry, geom);
         if (!intersection) {
@@ -1905,7 +1908,8 @@ export default {
         geometryList = this.sqsxAnalysisReuslt["yjjbnt"];
       }
       this.sqsxIndex = index;
-      console.log(geometryList);
+      this.ghfxIndex = -1;
+      this.xzfxIndex = -1;
       if (!geometryList) return;
       const geojson = geometryList["geojson_list"];
       this.$emit("analysisLayer", geojson);
@@ -1914,17 +1918,21 @@ export default {
       console.log(item);
       let geometryList = this.xzfxAnalysisReuslt[item.name];
       console.log(geometryList);
+      this.sqsxIndex = -1;
+      this.ghfxIndex = -1;
       this.xzfxIndex = index;
       if (!geometryList) return;
       const geojson = geometryList["geojson_list"];
       this.$emit("analysisLayer", geojson);
     },
     ghfxClick(item, index) {
-      item.name = item.name.replace(/[\n\r]+/g, '');
+      item.name = item.name.replace(/[\n\r]+/g, "");
       console.log(item);
       let geometryList = this.ghfxAnalysisReuslt[item.name];
       console.log(geometryList);
+      this.sqsxIndex = -1;
       this.ghfxIndex = index;
+      this.xzfxIndex = -1;
       if (!geometryList) return;
       const geojson = geometryList["geojson_list"];
       this.$emit("analysisLayer", geojson);
@@ -1940,9 +1948,7 @@ export default {
       // this.sqsxAnalysis(
       //   "POLYGON ((117.11419709081183 36.182983468640515, 117.11420047198547 36.18294635016128, 117.11421755948791 36.182947168376224, 117.11429144933 36.182950712593104, 117.11428765128782 36.18298780623907, 117.11421406714791 36.182984281554766, 117.11419709081183 36.182983468640515))"
       // );
-      this.ghfxAnalysis(
-        this.item.geom
-      );
+      this.ghfxAnalysis(this.item.geom);
       this.xzfxAnalysis(this.item.geom);
 
       let pointWkt = this.item.center_wkt;