Browse Source

历史记录接口调试

lkk 1 year ago
parent
commit
b3a57044c6

+ 8 - 0
src/api/ghss/ghxz.js

@@ -41,3 +41,11 @@ export function GetXzjg(params) {
         params
     })
 }
+// 选址结果信息
+export function GetXzResList(params) {
+    return request({
+        url: '/analyse/fzss/GetXzResList',
+        method: 'get',
+        params
+    })
+}

+ 39 - 9
src/views/complianceAnalysis/components/lsjl.vue

@@ -75,6 +75,7 @@
 import { GetPage, GetFxjg, Delect } from "@/api/ghss/hgxfx.js";
 import { Message, MessageBox } from "element-ui";
 import { rest } from "lodash";
+import { GetXzResList } from "../../../api/ghss/ghxz.js";
 let dataSources;
 export default {
   props: {
@@ -146,6 +147,9 @@ export default {
       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);
+      }
       //   }
       // });
     },
@@ -159,6 +163,8 @@ export default {
       this.$emit("updateParent", "loading", true);
       setTimeout(() => {
         this.getData();
+        console.log(111);
+
       }, 500);
     },
     changeForm() {
@@ -179,15 +185,30 @@ export default {
 
     getData() {
       this.$emit("updateParent", "loading", true);
-      GetPage({ ...this.pageObj }).then((res) => {
-        setTimeout(() => {
-          this.$emit("updateParent", "loading", false);
-        }, 100);
-        // this.pageObj.total = res.recordstotal;
-        // this.pageObj.page = res.page;
-        // this.pageObj.allpage = res.totalpages;
-        this.datalist = [...this.datalist, ...res.data];
-      });
+      if (this.$props.type == "hgxfx") {
+        GetPage({ ...this.pageObj }).then((res) => {
+          setTimeout(() => {
+            this.$emit("updateParent", "loading", false);
+          }, 100);
+          this.datalist = [...this.datalist, ...res.data];
+        });
+      } else {
+        let tempObj = { ...this.pageObj }
+        console.log(tempObj.page,'tempObj.page');
+        let obj = {
+          startTime: tempObj.kssj,
+          endTime: tempObj.jssj,
+          name: tempObj.xmmc,
+          pageNum: 1,
+          pageSize: 10,
+        };
+        GetXzResList(obj).then((res) => {
+          setTimeout(() => {
+            this.$emit("updateParent", "loading", false);
+          }, 100);
+          this.datalist = res.data.items;
+        });
+      }
     },
     zoomItem(item) {
       this.now = item.bsm;
@@ -214,6 +235,15 @@ export default {
     },
   },
   watch: {},
+  beforeDestroy() {
+    this.pageObj = {
+      kssj: "",
+      sj: [],
+      jssj: "",
+      xmmc: "",
+      page: 1,
+    };
+  },
 };
 </script>
 

+ 18 - 11
src/views/siteselection/components/xzjg.vue

@@ -155,18 +155,21 @@ export default {
       copyData: null,
       arrww: [],
       dataSources: {},
-      tempdataSourcesId:null,
+      tempdataSourcesId: null,
+      xzjgBSM: "",
     };
   },
   mounted() {
-    GetXzjg({ bsm: "dbc5fcf178fc4592b4940627e758b90d" }).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.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.drawWktPloygon(res.data.geom, "#ff0000"); //res.data.bsm
     });
   },
   methods: {
@@ -254,7 +257,7 @@ export default {
             offset: new Cesium.HeadingPitchRange(0, -45, 5000),
           });
           if (id) {
-            this.tempdataSourcesId = id
+            this.tempdataSourcesId = id;
             _this.dataSources[id] = dataSource;
           }
         });
@@ -326,6 +329,9 @@ export default {
       });
     },
   },
+  beforeResolve(to, from, next) {
+    console.log(to, from, next, "to, from, next");
+  },
 
   watch: {
     activeTabs(newValue, oldValue) {
@@ -334,16 +340,17 @@ export default {
       }
     },
     //监听区域id的变化,用于删除上一次点击生成的geojson区域面
-    tempdataSourcesId(newVal,oldVal){
+    tempdataSourcesId(newVal, oldVal) {
       if (oldVal) {
         viewer.dataSources.remove(this.dataSources[oldVal]);
       }
-    }
+    },
   },
 
   beforeDestroy() {
     viewer.entities.removeAll();
     viewer.dataSources.removeAll();
+    this.bus.$off("xzjgBSM"); //清除全局事件总线
   },
 };
 </script>

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

@@ -21,6 +21,7 @@
             :activeTabs="activeTabs"
             :historyList="historyList"
             @updateParent="changeData"
+            type="ghxz"
             ref="lsju"
           ></Lsjl>
         </el-tab-pane>