maxiaoxiao преди 7 месеца
родител
ревизия
53d6e2b5ff

+ 8 - 7
src/utils/MapHelper/map.js

@@ -42,28 +42,29 @@ export function setImageryRollerMode() {
     // else hideImageryRoller(imageryLayer);
 }
 
-export function setImageryRoller(imageryLayer) {
-    console.log("---", Cesium.SplitDirection.RIGHT)
-    switch (rollerShutterConfig.splitDirection) {
-        case Cesium.SplitDirection.LEFT:
+export function setImageryRoller(imageryLayer, layersplit) {
+    // console.log("-splitDirection--", rollerShutterConfig.splitDirection)
+    let direction = layersplit ? layersplit : rollerShutterConfig.splitDirection
+    switch (direction) {
+        case Cesium.SplitDirection.LEFT://1
             imageryLayer.splitDirection = new Cesium.Cartesian2(
                 Cesium.ImagerySplitDirection.RIGHT,
                 Cesium.ImagerySplitDirection.NONE
             );
             break;
-        case Cesium.SplitDirection.RIGHT:
+        case Cesium.SplitDirection.RIGHT://2
             imageryLayer.splitDirection = new Cesium.Cartesian2(
                 Cesium.ImagerySplitDirection.LEFT,
                 Cesium.ImagerySplitDirection.NONE
             );
             break;
-        case Cesium.SplitDirection.TOP:
+        case Cesium.SplitDirection.TOP://-1
             imageryLayer.splitDirection = new Cesium.Cartesian2(
                 Cesium.ImagerySplitDirection.NONE,
                 Cesium.ImagerySplitDirection.BOTTOM
             );
             break;
-        case Cesium.SplitDirection.BOTTOM:
+        case Cesium.SplitDirection.BOTTOM://-2
             imageryLayer.splitDirection = new Cesium.Cartesian2(
                 Cesium.ImagerySplitDirection.NONE,
                 Cesium.ImagerySplitDirection.TOP

+ 43 - 27
src/views/LandConsolidation/components/contrast.vue

@@ -22,7 +22,7 @@
       :list="dbdata.fp"
       :tname="ptaye == 'gdbh' ? 'year' : 'dlbmmc'"
       @toolChick="$set(layers, i, !layers[i])"
-      @checkChange="(name, c, data) => clickcheck(i, name, c)"
+      @checkChange="(name, c, data) => clickcheck(i, name, c, data)"
       :checkdata="ptaye == 'gdbh' ? gdjlcheck[i] : checkdata[0]"
       :toolTitle="
         ptaye == 'gdbh'
@@ -166,21 +166,27 @@ export default {
     checkedChange(value) {
       console.log(value);
     },
-    clickcheck(i, name, checked) {
+    clickcheck(i, name, checked, data) {
       if (this.$props.ptaye == "gdbh") {
+        this.$set(this.gdjlcheck, i, data);
+        let dobj = this.dbdata.fp.find((d) => d.year == name);
         if (this.active == 0) {
-          if (i == 0) {
-            let dobj = this.dbdata.fp.fined((d) => d.year == name);
-            this.setImager(dobj, checked, (layer) => {
-              setImageryRoller(layer);
-            });
-          }
+          let a = {
+            ...dobj,
+            year: dobj.year + (i ? "right" : ""),
+            isfly: checked,
+          };
+          this.setImager(a, checked, (layer) => {
+            if (checked) setImageryRoller(layer, i ? 1 : 2);
+            else hideImageryRoller(layer);
+          });
         } else if (this.active == 1) {
-          let lay = this.imagelayers[name];
-          viewer.flyTo(lay);
-          lay.setVisibleInViewport(i, checked);
+          this.setImager({ ...dobj, isfly: checked }, true, (layer) => {
+            layer.setVisibleInViewport(i, checked);
+          });
         }
       } else {
+        this.checkdata[0] = data;
         let geodata = geoSources[`${name}${i ? "h" : "q"}`];
         if (geodata) {
           if (checked)
@@ -205,6 +211,7 @@ export default {
     },
 
     async onGdbhClick(i) {
+      this.gdjlcheck = [[], []];
       if (i == 3) {
         this.reset();
         return;
@@ -216,14 +223,20 @@ export default {
         });
       }
       if (i == 0) {
-        
         this.layers = [false, false];
         this.gdjlcheck[0].push(this.dbdata.fp[0].year);
         this.gdjlcheck[1].push(this.dbdata.fp[1].year);
-        this.setImager({ ...this.dbdata.fp[0], top: true }, true);
-        this.setImager({ ...this.dbdata.fp[1], top: false }, true, (layer) => {
+        this.setImager({ ...this.dbdata.fp[0], top: true }, true, (layer) => {
           useRoller(true, "lrRoller", "leftRoller", "", false);
-          setImageryRoller(layer);
+          setImageryRoller(layer, 2);
+        });
+        let data = {
+          ...this.dbdata.fp[1],
+          year: this.dbdata.fp[1].year + "right",
+          top: false,
+        };
+        this.setImager(data, true, (layer) => {
+          setImageryRoller(layer, 1);
         });
       } else {
         Object.keys(this.imagelayers).forEach((key) => {
@@ -236,6 +249,8 @@ export default {
 
       if (i == 1) {
         this.layers = [false, false];
+        this.gdjlcheck[0].push(this.dbdata.fp[0].year);
+        this.gdjlcheck[1].push(this.dbdata.fp[1].year);
         this.setImager({ ...this.dbdata.fp[0] }, true, (layer) => {
           layer.setVisibleInViewport(1, false);
         });
@@ -270,13 +285,19 @@ export default {
         store.setaddNode([
           { id: "ttzz", url: this.dbdata.zzq, label: "土地整治对比" },
         ]);
-        this.setImager({ url: this.dbdata.zzq, year: "qian", top: true }, true);
         this.setImager(
-          { url: this.dbdata.zzh, year: "hou", top: true },
+          { url: this.dbdata.zzq, year: "qian", top: true },
           true,
           (layer) => {
             useRoller(true, "lrRoller", "leftRoller", "", false);
-            setImageryRoller(layer);
+            setImageryRoller(layer, 2);
+          }
+        );
+        this.setImager(
+          { url: this.dbdata.zzh, year: "hou", top: true },
+          true,
+          (layer) => {
+            setImageryRoller(layer, 1);
           }
         );
       } else {
@@ -311,12 +332,12 @@ export default {
           }
         });
       else if (this.active == 2) {
-        this.$refs.aside.activeVal == 1;
-        this.$refs.aside.clearTimer();
         this.layersData.forEach((img) => {
           this.setImager(img, false);
         });
       }
+      this.$refs.aside.activeVal == 1;
+      this.$refs.aside.clearTimer();
     },
     async Getlayers() {
       let res = await QueryList({
@@ -328,7 +349,7 @@ export default {
     playChange(acti) {
       if (acti) {
         this.nolayer = this.layersData[acti - 1].year;
-        this.setImager(this.layersData[acti - 1], true);
+        this.setImager({ ...this.layersData[acti - 1], isfly: true }, true);
       }
     },
     setImager(obj, isshow = true, fun) {
@@ -341,7 +362,7 @@ export default {
       }
       if (obj.top) viewer.imageryLayers.raiseToTop(this.imagelayers[obj.year]);
       fun && fun(this.imagelayers[obj.year]);
-      // viewer.flyTo(this.imagelayers[obj.year]);
+      if (obj.isfly) viewer.flyTo(this.imagelayers[obj.year]);
     },
     roller() {
       rollerShutterConfig.splitDirection = new Cesium.Cartesian2(
@@ -374,11 +395,6 @@ export default {
           });
       });
     },
-
-    setImageryRollers(imageryLayer) {
-      if (this.active == 1) setImageryRoller(imageryLayer);
-      else hideImageryRoller(imageryLayer);
-    },
   },
   watch: {
     nolayer(newVal, oldVal) {

+ 3 - 0
src/views/farmlandProtection/gdzl/details.vue

@@ -44,6 +44,9 @@ export default {
     //关闭详情
     closeInster() {
       this.isShallow = false;
+      this.$nextTick(() => {
+        viewer.entities.removeAll();
+      });
     },
     handleView({ parts, queryData, geoms, e }, type) {
       this.type = type;

+ 27 - 15
src/views/farmlandProtection/gdzl/index.vue

@@ -43,7 +43,7 @@
             v-model="region"
             :show-all-levels="false"
             :options="store.state.region_tree"
-            @change="regionChange()"
+            @change="xzqhChange()"
             placeholder="行政区"
             size="mini"
             :props="{
@@ -286,24 +286,36 @@ export default {
       this.regionChange();
     },
     dlbmChange() {
-      let nowtype = this.typeList.find((x) => x.id == this.dlbm);
-      this.gtype = nowtype.label;
+      // let nowtype = this.typeList.find((x) => x.id == this.dlbm);
+      this.gtype = this.typeList.find((x) => x.id == this.dlbm).label;
+      this.xzqhChange();
+      // this.regionChange();
+      // if (this.dlbm == "01") {
+      //   this.nowlayer = this.nowyear;
+      // } else {
+      //   if (nowtype.layerID) {
+      //     this.nowlayer = this.nowyear + nowtype.layerID;
+      //   } else if (this.layers.length) {
+      //     let yobj = this.yearList.find((y) => y.year == this.nowyear);
+      //     if (yobj) this.goLayer(yobj, nowtype);
+      //   }
+      // }
+    },
+    xzqhChange() {
       this.regionChange();
-      if (this.dlbm == "01") {
-        this.nowlayer = this.nowyear;
-      } else {
-        if (nowtype.layerID) {
-          this.nowlayer = this.nowyear + nowtype.layerID;
-        } else if (this.layers.length) {
-          let yobj = this.yearList.find((y) => y.year == this.nowyear);
-          if (yobj) this.goLayer(yobj, nowtype);
-        }
+      if (this.layers.length) {
+        let yobj = this.yearList.find((y) => y.year == this.nowyear);
+        if (yobj) this.goLayer(yobj);
       }
     },
     goLayer(lobj, nowtype) {
       let lname = this.layers[0].name; // `dlbm like '${this.dlbm}%'`,
-      SetParameters(lname, `dlbm = '${this.dlbm}'`, this.provider, (lid) => {
-        this.typeList[nowtype.index].layerID = lid;
+      let sql = `dlbm LIKE '${this.dlbm}%' and ${
+        this.pageType ? "xzqdm" : "qsdwdm"
+      } LIKE '%${this.region}%'`;
+      SetParameters(lname, sql, this.provider, (lid) => {
+        // this.typeList[nowtype.index].layerID = lid;
+        console.log(lid);
         this.nowlayer = this.nowyear + lid;
         this.setImager({ ...lobj, lid });
       });
@@ -490,7 +502,7 @@ export default {
           viewer.imageryLayers.remove(this.imagelayers[key]);
         });
         this.imagelayers = {};
-        this.typeList = [...JSON.parse(JSON.stringify(legends))];
+        this.typeList = [...JSON.parse(JSON.stringify(legends))];    
       });
     },
     setEchart(data, id) {

+ 4 - 1
src/views/farmlandProtection/indexNew.vue

@@ -136,7 +136,10 @@ export default {
     },
     onClick(val) {
       this.activeIndex = val;
-      if (val != 0 || val != 1) this.$refs.gdzl.reset();
+      if (val != 0 || val != 1) {
+        this.$refs.gdzl.reset();
+        this.$refs.detailModal.closeInster();
+      }
       if (val == 0 || val == 1) {
         this.$nextTick(() => {
           this.$refs.gdzl.regionChange(true);