فهرست منبع

耕地接口联调

maxiaoxiao 5 ماه پیش
والد
کامیت
dcb5957a89
4فایلهای تغییر یافته به همراه97 افزوده شده و 25 حذف شده
  1. 40 0
      src/api/ghss/gdbhadd.js
  2. 49 17
      src/views/farmlandProtection/gdzl/index.vue
  3. 7 7
      src/views/farmlandProtection/indexNew.vue
  4. 1 1
      vue.config.js

+ 40 - 0
src/api/ghss/gdbhadd.js

@@ -8,6 +8,46 @@ export function GetGdDate(params) {
         params
     })
 }
+// 耕地总量
+export function GetGdZl(params) {
+    return request({
+        url: '/apply/gdbh/gd/ntzl',
+        method: 'get',
+        params
+    })
+}
+// 类型分类
+export function GetGdFl(params) {
+    return request({
+        url: '/apply/gdbh/gd/ntzlfl',
+        method: 'get',
+        params
+    })
+}
+// 变化情况
+export function GetGdBhqk(params) {
+    return request({
+        url: '/apply/gdbh/gd/ntzlbhqk',
+        method: 'get',
+        params
+    })
+}
+// 历年变化情况
+export function GetGdLnbhqk(params) {
+    return request({
+        url: '/apply/gdbh/gd/ntzllnbhqk',
+        method: 'get',
+        params
+    })
+}
+// 区县分类
+export function GetGdQxfl(params) {
+    return request({
+        url: '/apply/gdbh/gd/ntzlqxfl',
+        method: 'get',
+        params
+    })
+}
 //永久基本农田
 export function GetYjjbntDate(params) {
     return request({

+ 49 - 17
src/views/farmlandProtection/gdzl/index.vue

@@ -28,7 +28,7 @@
             v-model="nowyear"
             placeholder="请选择"
             size="mini"
-            @change="regionChange"
+            @change="regionChange()"
           >
             <el-option
               v-for="item in yearList"
@@ -43,7 +43,7 @@
             v-model="region"
             :show-all-levels="false"
             :options="store.state.region_tree"
-            @change="regionChange"
+            @change="regionChange()"
             placeholder="行政区"
             size="mini"
             :props="{
@@ -167,6 +167,11 @@ import Statistics from "../components/statistics.vue";
 import { QueryOne, QueryList } from "@/api/cockpitNew";
 import {
   GetGdDate,
+  GetGdZl,
+  GetGdFl,
+  GetGdBhqk,
+  GetGdLnbhqk,
+  GetGdQxfl,
   GetYjjbntDate,
   GetYjjbntZl,
   GetYjjbntFl,
@@ -323,7 +328,11 @@ export default {
       this.nowlayer = this.nowyear;
       init_handler(this.yearList[0], this.showInfo);
       store.setaddNode([
-        { id: "gdbb", url: this.yearList[0].url, label: "耕地保护" },
+        {
+          id: "gdbh" + this.$props.pageType,
+          url: this.yearList[0].url,
+          label: "耕地保护",
+        },
       ]);
       this.setImager(this.yearList[0], true, (layer) => {
         Getlayers(this.yearList[0].url, (layers) => {
@@ -341,7 +350,7 @@ export default {
     },
     showInfo(data, obj) {
       let legends = store.state.addlegend;
-      if (legends && legends.length && legends[0].id == "gdbb") {
+      if (legends && legends.length && legends[0].id == "gdbh") {
         this.$emit("handleView", data, obj);
       }
     },
@@ -360,6 +369,7 @@ export default {
     },
     async regionChange(region) {
       // this.region = region;
+      if (region) this.nowyear = "";
       if (!this.nowyear) await this.GetDate();
       this.getData();
     },
@@ -371,14 +381,24 @@ export default {
     async Getzzxm() {
       let parms = { year: this.nowyear, xzqhdm: this.region, dlbm: this.dlbm };
       if (this.$props.pageType == 0) {
-        GetGdDate().then((res) => {});
+        GetGdZl(parms).then((res) => {
+          this.zldata = res.data;
+        });
+        if (this.dlbm == "01")
+          GetGdFl(parms).then((res) => {
+            this.fldata = res.data;
+          });
+        GetGdQxfl(parms).then((res) => {
+          this.cityList = res.data;
+        });
       } else {
         GetYjjbntZl(parms).then((res) => {
           this.zldata = res.data;
         });
-        GetYjjbntFl(parms).then((res) => {
-          this.fldata = res.data;
-        });
+        if (this.dlbm == "01")
+          GetYjjbntFl(parms).then((res) => {
+            this.fldata = res.data;
+          });
         GetYjjbntQxfl(parms).then((res) => {
           this.cityList = res.data;
         });
@@ -391,12 +411,19 @@ export default {
       this.eData.xData = [];
       this.eData.yData = [[]];
       if (!this.$props.pageType) {
-        // GetGdDate(params).then((res) => {});
+        GetGdLnbhqk({ xzqhdm: this.region, year: this.nowyear }).then(
+          ({ data }) => {
+            this.lnbndata = data;
+            this.setLnbh(data);
+          }
+        );
       } else {
-        GetYjjbntLnbhqk({ xzqhdm: this.region }).then(({ data }) => {
-          this.lnbndata = data;
-          this.setLnbh(data);
-        });
+        GetYjjbntLnbhqk({ xzqhdm: this.region, year: this.nowyear }).then(
+          ({ data }) => {
+            this.lnbndata = data;
+            this.setLnbh(data);
+          }
+        );
       }
     },
     setLnbh(data) {
@@ -417,7 +444,9 @@ export default {
         xzqhdm: this.region,
       };
       if (!this.$props.pageType) {
-        GetGdDate(params).then((res) => {});
+        GetGdBhqk(params).then((res) => {
+          this.bhdata = res.data;
+        });
       } else {
         GetYjjbntBhqk(params).then((res) => {
           this.bhdata = res.data;
@@ -446,7 +475,7 @@ export default {
       });
     },
     contrast() {
-      let dbdata = { id: this.region, fp: this.yearList, type: "gdbb" }; //+ this.$props.pageType,
+      let dbdata = { id: this.region, fp: this.yearList, type: "gdbh" }; //+ this.$props.pageType,
       console.log("contrast", dbdata);
       this.$emit("contrast", dbdata);
     },
@@ -455,11 +484,14 @@ export default {
     },
     sourcesshow(show) {
       console.log(this.nowyear, show, "000");
-      this.setImager({ year: this.nowyear }, show);
+      this.setImager({ year: this.nowlayer }, show);
     },
     reset() {
       this.$nextTick(() => {
-        this.sourcesshow(false);
+        // this.sourcesshow(false);
+        Object.keys(this.imagelayers).forEach((key) => {
+          viewer.imageryLayers.remove(this.imagelayers[key]);
+        });
       });
     },
     setEchart(data, id) {

+ 7 - 7
src/views/farmlandProtection/indexNew.vue

@@ -20,7 +20,6 @@
         v-show="activeIndex == 0 || activeIndex == 1"
         :pageType="activeIndex"
         ref="gdzl"
-        ptaye="gdbh"
         @contrast="goContrast"
         @handleView="handleView"
       ></Gdzl>
@@ -89,7 +88,7 @@ export default {
         { title: "监测图斑" },
         { title: "辅助研判" },
       ],
-      activeIndex: 1,
+      activeIndex: 0,
       iscontrast: false,
       legends: legends,
     };
@@ -104,7 +103,7 @@ export default {
       store.setCockpitDate(sessionStorage.getItem("cockpitDate").split(","));
   },
   mounted() {
-    this.xzqh = store.state.cockpit_region.id;
+    // this.xzqh = store.state.cockpit_region.id;
     this.regionChange();
     // this.bus.$on("handleView", this.handleView);
   },
@@ -136,11 +135,12 @@ export default {
     },
     onClick(val) {
       this.activeIndex = val;
-      if (val != 0) this.$refs.gdzl.reset();
-      if (val == 0) {
-        this.$refs.gdzl.regionChange(this.xzqh);
+      if (val != 0 || val != 1) this.$refs.gdzl.reset();
+      if (val == 0 || val == 1) {
+        this.$nextTick(() => {
+          this.$refs.gdzl.regionChange(true);
+        });
       }
-      if (val == 1) this.$refs.gdzl.regionChange(this.xzqh);
       if (val !== 2 && this.$refs.jctb) this.$refs.jctb.isShowTb = false;
     },
   },

+ 1 - 1
vue.config.js

@@ -144,6 +144,6 @@ module.exports = {
             },
         },
     },
-    productionSourceMap: false,
+    // productionSourceMap: false,
 };