Ver Fonte

土地整治优化调整

maxiaoxiao há 5 meses atrás
pai
commit
10d5b46a93

+ 0 - 1
src/utils/MapHelper/help.js

@@ -59,7 +59,6 @@ export function loadGeoJSON(geom, yanse, adata, fun) {
         offset: new Cesium.HeadingPitchRange(0, -45),
       });
     fun(data)
-    console.log(adata.name, '---')
     data.entities.values.forEach((entity, ei) => {
       if (!geojson.type.includes("Polygon")) {
         if (entity.billboard) {

+ 8 - 5
src/views/LandConsolidation/components/AsideBottom.vue

@@ -47,10 +47,7 @@ export default {
     stepPropsClick(active) {
       if (this.activeVal == active) return;
       this.activeVal = active;
-      if (this.timer) {
-        clearInterval(this.timer);
-        this.timer = null;
-      }
+      this.clearTimer();
       this.$emit("activeValChange", this.activeVal);
     },
     clickHandler() {
@@ -67,9 +64,15 @@ export default {
       if (this.activeVal > this.dataArray.length) this.activeVal = 0;
       this.$emit("activeValChange", this.activeVal);
     },
+    clearTimer() {
+      if (this.timer) {
+        clearInterval(this.timer);
+        this.timer = null;
+      }
+    },
   },
   beforeDestroy() {
-    clearInterval(this.timer);
+    this.clearTimer();
   },
   watch: {},
 };

+ 9 - 6
src/views/LandConsolidation/components/contrast.vue

@@ -92,7 +92,7 @@ export default {
     closeInster() {
       this.onClick(-1);
       removeGeoJSON("fpdb");
-      this.nolayer = this.layersData[0].year;
+
       this.$emit("close");
     },
     show(data) {
@@ -128,14 +128,16 @@ export default {
           setImageryRoller(layer);
         });
       } else {
-        hideImageryRoller(this.imagelayers[this.nolayer]);
-        useRoller(false);
+        // hideImageryRoller(this.imagelayers[this.nolayer]);
+        // useRoller(false);
       }
       this.multiView();
       if (i == 2) {
         this.$refs.aside.activeVal == 0;
         this.$refs.aside.clickHandler();
       } else {
+        this.$refs.aside.clearTimer();
+        // this.nolayer = this.layersData[0].year;
         // this.layersData.forEach((img) => {
         //   this.setImager(img, false);
         // });
@@ -184,14 +186,15 @@ export default {
       newVal.forEach((res, index) => {
         this.checkdata[0].push(res.dlbmmc);
         // this.checkdata[1].push(res.dlbmmc);
+        let adata = { isfly: true, fill_a: 0.8 };
         if (res.qgeom)
-          loadGeoJSON(res.qgeom, res.dict_color, { isfly: true }, (data) => {
+          loadGeoJSON(res.qgeom, res.dict_color, adata, (data) => {
             geoSources[res.dlbmmc + "q"] = data;
             data.name = "fpdb";
             data.setVisibleInViewport(1, false);
           });
         if (res.hgeom)
-          loadGeoJSON(res.hgeom, res.dict_color, { isfly: true }, (data) => {
+          loadGeoJSON(res.hgeom, res.dict_color, adata, (data) => {
             geoSources[res.dlbmmc + "h"] = data;
             data.name = "fpdb";
             data.setVisibleInViewport(0, false);
@@ -209,7 +212,7 @@ export default {
   },
   watch: {
     nolayer(newVal, oldVal) {
-      console.log(newVal, oldVal,'---nolayer');
+      console.log(newVal, oldVal, "---nolayer");
       if (oldVal) this.setImager({ year: oldVal }, false);
     },
   },

+ 3 - 3
src/views/LandConsolidation/components/list.vue

@@ -137,14 +137,14 @@ export default {
         });
       });
     },
-    flyTo(item) {
+    flyTo(item, fill_a = 0.4) {
       // let xzqdm = "h_" + item.xzqdm;
       // this.tempdataLayerId = xzqdm;
       // if (geoSources[xzqdm]) return;
       removeGeoJSON("zzxmhig");
       item.tQytdzzZzxm.forEach((res) => {
         if (res.geom)
-          loadGeoJSON(res.geom, "#ff0000", { isfly: true }, (data) => {
+          loadGeoJSON(res.geom, "#ff0000", { isfly: true, fill_a }, (data) => {
             data.name = "zzxmhig";
             geoSources[res.pid + res.id + "h"] = data;
             res.entity = "整治图斑";
@@ -172,7 +172,7 @@ export default {
     },
     async handle(row) {
       removeGeoJSON("zzxm");
-      this.flyTo(row);
+      this.flyTo(row, 0.01);
       let res = await QueryList({
         jscType: "qytuzz_zzxm_qhdb",
         id: row.id,

+ 6 - 2
src/views/LandConsolidation/components/qhdb.vue

@@ -51,7 +51,7 @@ export default {
       jdData: {
         legend_data: ["整治前", "整治后", "变化面积"],
         x_data: [],
-        yAxis: [{ name: "面积(km²)" }, { name: "变化面积(km²)" }],
+        yAxis: [{ name: "面积(公顷)" }, { name: "变化面积(公顷)" }],
         legendmap: [{ type: "bar" }, { type: "bar" }, { type: "line" }],
         params: {},
         region: "",
@@ -100,7 +100,11 @@ export default {
         jscType: `qytuzz_sdzl_tdlyqhdb_dlbh_${this.tab}`,
         id: this.region,
       }).then((res) => {
-        this.dbdata = { id: this.region, fp: res.data };
+        this.dbdata = {
+          id: this.region,
+          fp: res.data,
+          type: this.tab,
+        };
         res.data.forEach((jdData) => {
           this.jdData.x_data.push(jdData.dlbmmc);
           this.jdData.result[0].push(jdData.qtbdlmj.toFixed(2));

+ 15 - 2
src/views/LandConsolidation/components/sdgk.vue

@@ -96,7 +96,7 @@ import pie from "@/components/echartsTemplate/pie.vue";
 import { overview, district, reason } from "@/api/Idleland.js";
 import { QueryOne, QueryList } from "@/api/cockpitNew";
 import { legends } from "./config.js";
-import { loadGeoJSON } from "@/utils/MapHelper/help.js";
+import { loadGeoJSON, removeGeoJSON } from "@/utils/MapHelper/help.js";
 let geoSources = {};
 export default {
   props: {},
@@ -207,6 +207,8 @@ export default {
         jscType: "qytuzz_sdzl_kjxx",
         id: this.region,
       });
+      this.zlgeom = res.data;
+
       this.active_tableData(res.data);
     },
     active_tableData(newVal) {
@@ -233,7 +235,18 @@ export default {
           );
       });
     },
-    sourcesshow(isshow) {
+    flyTo(type) {
+      removeGeoJSON("zlhig");
+      this.zlgeom.forEach((res) => {
+        if (res.geom && res.type == type)
+          loadGeoJSON(res.geom, "#ff0000", { fill_a: 0.01 }, (data) => {
+            data.name = "zlhig";
+          });
+      });
+    },
+    sourcesshow(isshow, type) {
+      if (!isshow) type && this.flyTo(type == "sd" ? 0 : 1);
+      else removeGeoJSON("zlhig");
       Object.keys(geoSources).forEach((name) => {
         console.log(name, geoSources[name]);
         geoSources[name].show = isshow;

+ 1 - 1
src/views/LandConsolidation/index.vue

@@ -222,7 +222,7 @@ export default {
       );
     },
     goContrast(dbdata) {
-      this.$refs.sdgk.sourcesshow(false);
+      this.$refs.sdgk.sourcesshow(false, dbdata.type);
       this.iscontrast = true;
       this.$refs.contrastModal.show(dbdata);
     },