Browse Source

影像对比

maxiaoxiao 5 months ago
parent
commit
70636dcd2f

+ 4 - 3
src/views/LandConsolidation/components/AsideBottom.vue

@@ -8,6 +8,7 @@
     ></div>
     <el-steps :active="activeVal" align-center class="stepClass">
       <!-- <el-step /> -->
+      {{ activeVal }}----
       <el-step
         :title="item.year"
         v-for="(item, i) in dataArray"
@@ -30,7 +31,7 @@ export default {
   components: {},
   data() {
     return {
-      dataArray: ["2020", "2021", "2022", "2023", "2024"],
+      dataArray: [],
       activeVal: 5,
       timer: "",
     };
@@ -58,12 +59,12 @@ export default {
         this.timer = null;
       } else {
         this.addActiveValFun();
-        this.timer = setInterval(this.addActiveValFun, 10000);
+        this.timer = setInterval(this.addActiveValFun, 5000);
       }
     },
     addActiveValFun() {
       this.activeVal++;
-      if (this.activeVal > dataArray.length) this.activeVal = 0;
+      if (this.activeVal > this.dataArray.length) this.activeVal = 0;
       this.$emit("activeValChange", this.activeVal);
     },
   },

+ 23 - 25
src/views/LandConsolidation/components/contrast.vue

@@ -41,7 +41,11 @@
       </div>
       <div class="sm-toolTitle">{{ `整治${!i ? "前" : "后"}地类图斑` }}</div>
     </div>
-    <AsideBottom ref="aside" v-show="active == 2"></AsideBottom>
+    <AsideBottom
+      ref="aside"
+      v-show="active == 2"
+      @activeValChange="playChange"
+    ></AsideBottom>
   </div>
 </template>
 
@@ -73,7 +77,7 @@ export default {
         { label: "住宅", value: "5" },
       ],
       checkdata: [[], []],
-      layers: {},
+      imagelayers: {},
       nolayer: "",
       layersData: [],
     };
@@ -120,16 +124,16 @@ export default {
       console.log(i, this.layersData, "---");
       if (i == 0) {
         await this.Getlayers();
+        this.$refs.aside.setdata(this.layersData);
         this.nolayer = this.layersData[1].year;
         this.setImager(this.layersData[1], true, (layer) => {
           useRoller(true, "lrRoller", "leftRoller", "", false);
-          // setImageryRoller(layer);
-          layer.splitDirection = new Cesium.Cartesian2(
-            Cesium.ImagerySplitDirection.RIGHT,
-            Cesium.ImagerySplitDirection.NONE
-          );
+          setImageryRoller(layer);
         });
-      } else useRoller(false);
+      } else {
+        hideImageryRoller(this.imagelayers[this.nolayer]);
+        useRoller(false);
+      }
       this.multiView();
       if (i == 2) {
         this.$refs.aside.activeVal == 0;
@@ -139,18 +143,6 @@ export default {
         //   this.setImager(img, false);
         // });
       }
-      // switch (this.active) {
-      //   case 0:
-      //     break;
-      //   case 1:
-      //     break;
-      //   case 2:
-      //     break;
-      //   case 3:
-      //     break;
-      //   default:
-      //     break;
-      // }
     },
     async Getlayers() {
       let res = await QueryList({
@@ -159,19 +151,25 @@ export default {
       });
       this.layersData = res.data;
     },
+    playChange(acti) {
+      if (acti) {
+        this.nolayer = this.layersData[acti - 1].year;
+        this.setImager(this.layersData[acti - 1], true);
+      }
+    },
     setImager(obj, isshow = true, fun) {
-      console.log(obj, isshow, "---");
+      console.log(obj, obj.year, isshow, "---");
 
-      if (this.layers[obj.year]) this.layers[obj.year].show = isshow;
+      if (this.imagelayers[obj.year]) this.imagelayers[obj.year].show = isshow;
       else if (isshow)
-        this.layers[obj.year] = viewer.imageryLayers.addImageryProvider(
+        this.imagelayers[obj.year] = viewer.imageryLayers.addImageryProvider(
           new Cesium.SuperMapImageryProvider({
             url: obj.url,
             name: obj.year,
           })
         );
-      fun && fun(this.layers[obj.year]);
-      // viewer.flyTo(this.layers[obj.year]);
+      fun && fun(this.imagelayers[obj.year]);
+      // viewer.flyTo(this.imagelayers[obj.year]);
     },
     roller() {
       rollerShutterConfig.splitDirection = new Cesium.Cartesian2(

+ 6 - 1
src/views/LandConsolidation/components/sdgk.vue

@@ -8,7 +8,7 @@
           <span class="cvalue"
             >{{
               index == 2
-                ? (sdata[sd.prop] || 0)
+                ? sdata[sd.prop] || 0
                 : (sdata[sd.prop] || 0).toFixed(2)
             }}
           </span>
@@ -211,6 +211,11 @@ export default {
           });
       });
     },
+    sourcesshow(isshow) {
+      Object.keys(geoSources).forEach((dageo) => {
+        dageo.show = isshow;
+      });
+    },
     reset() {
       // if (!window.viewer) return;
       // viewer.entities.removeAll();

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

@@ -91,7 +91,7 @@
     <Contrast
       ref="contrastModal"
       v-show="iscontrast"
-      @close="iscontrast = false"
+      @close="contrastClose"
     ></Contrast>
     <RzDtails
       :rzBsm="rzBsm"
@@ -189,9 +189,15 @@ export default {
       this[name] = updata;
     },
     goContrast(dbdata) {
+      this.$refs.sdgk.sourcesshow(false);
       this.iscontrast = true;
       this.$refs.contrastModal.show(dbdata);
     },
+    contrastClose() {
+      this.iscontrast = false;
+      this.$refs.sdgk.sourcesshow(true);
+    },
+
     rzClose() {
       this.$refs.preCheck.rzClose();
     },