소스 검색

项目编码传值,规划选址流程加载

lkk 11 달 전
부모
커밋
374c7d20b7
3개의 변경된 파일22개의 추가작업 그리고 20개의 파일을 삭제
  1. 1 8
      src/views/complianceAnalysis/components/lsjl.vue
  2. 19 12
      src/views/siteselection/components/xzjg.vue
  3. 2 0
      src/views/siteselection/index.vue

+ 1 - 8
src/views/complianceAnalysis/components/lsjl.vue

@@ -142,19 +142,12 @@ export default {
         .catch(() => {});
     },
     checkDetails(item) {
-      // this.$emit("updateParent", "rwBsm", item.bsm);
-      // GetFxjg({ bsm: item.bsm }).then((res) => {
-      //   if (res.success) {
-      // this.$emit("updateParent", "scjgObj=JSON.parse(JSON.stringify(res.data))
-      // this.$emit("updateParent", "scjgObj=JSON.parse(JSON.stringify(res.data))
       this.$emit("updateParent", "nowObj", item);
       let next = this.$props.type == "hgxfx" ? "scjg" : "xzjg";
       this.$emit("updateParent", "activeTabs", next);
       if (this.$props.type != "hgxfx") {
-        this.bus.$emit("xzjgBSM", item.bsm);
+        this.$emit("updateParent", "rwBsm", item.bsm);
       }
-      //   }
-      // });
     },
     checkRz(item) {
       this.$emit("updateParent", "nowObj", item);

+ 19 - 12
src/views/siteselection/components/xzjg.vue

@@ -125,6 +125,9 @@ export default {
     scjgObj: {
       type: Object,
     },
+    rwBsm: {
+      type: String,
+    },
   },
 
   data() {
@@ -160,19 +163,24 @@ export default {
     };
   },
   mounted() {
-    this.bus.$on("xzjgBSM", (val) => {
-      GetXzjg({ bsm: val }).then((res) => {
-        this.xzjgObj = JSON.parse(JSON.stringify(res.data));
-        this.copyData = JSON.parse(JSON.stringify(res.data));
-        this.tempObj = JSON.parse(JSON.stringify(res.data));
-        this.xzjgObj.dks.forEach((item) => {
-          this.drawWktPloygon(item.geom, "#0000ff"); //item.dkbm
-        });
-        this.drawWktPloygon(res.data.geom, "#ff0000"); //res.data.bsm
-      });
-    });
+    this.GetXzjg()
   },
   methods: {
+    GetXzjg() {
+      GetXzjg({ bsm: this.$props.rwBsm }).then((res) => {
+        if (res.success) {
+          this.xzjgObj = JSON.parse(JSON.stringify(res.data));
+          this.copyData = JSON.parse(JSON.stringify(res.data));
+          this.tempObj = JSON.parse(JSON.stringify(res.data));
+          this.xzjgObj.dks.forEach((item) => {
+            this.drawWktPloygon(item.geom, "#0000ff"); //item.dkbm
+          });
+          this.drawWktPloygon(res.data.geom, "#ff0000"); //res.data.bsm
+        } else {
+          this.$message.error(res.message);
+        }
+      });
+    },
     download() {
       window.open(this.$props.scjgObj.task.fxbg);
     },
@@ -350,7 +358,6 @@ export default {
   beforeDestroy() {
     viewer.entities.removeAll();
     viewer.dataSources.removeAll();
-    this.bus.$off("xzjgBSM"); //清除全局事件总线
   },
 };
 </script>

+ 2 - 0
src/views/siteselection/index.vue

@@ -30,11 +30,13 @@
           label="选址结果"
           :disabled="activeTabs != 'scjg'"
           name="xzjg"
+
         >
           <XZJG
             :activeTabs="activeTabs"
             :loading="loading"
             :scjgObj="scjgObj"
+            :rwBsm="rwBsm"
             v-if="activeTabs == 'xzjg'"
           ></XZJG>
         </el-tab-pane>