Browse Source

添加对比

maxiaoxiao 7 months ago
parent
commit
1d96473d68

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

@@ -66,7 +66,11 @@ import AsideBottom from "./AsideBottom.vue";
 import { QueryOne, QueryList } from "@/api/cockpitNew";
 let geoSources = {};
 export default {
-  props: {},
+  props: {
+    ptaye:{
+      type: String,
+    }
+  },
   data() {
     return {
       layers: [false, false],
@@ -95,6 +99,7 @@ export default {
       this.$emit("close");
     },
     show(data) {
+      console.log(data);
       this.dbdata = { ...this.dbdata, ...data };
       this.onClick(0);
     },

+ 21 - 9
src/views/farmlandProtection/gdzl/index.vue

@@ -127,7 +127,7 @@
                   </el-option>
                 </el-select>
               </div>
-              <div class="usable">更多</div>
+              <div class="usable" @click="contrast">更多</div>
             </div>
           </div>
           <div class="content scontent" v-show="gtype == '耕地'">
@@ -135,9 +135,9 @@
               <div class="text">
                 <p>{{ bh.name }}</p>
                 <span class="cvalue">
-                  {{ (bhdata[bh.prop || uprops[nowunit]] || 0).toFixed(2) }}
+                  {{ (bhdata[bh.prop || bhprops[nowunit]] || 0).toFixed(2) }}
                 </span>
-                <span class="unit">{{ bh.unit }}</span>
+                <span class="unit">{{ unitList[nowunit].unit }}</span>
               </div>
             </div>
           </div>
@@ -195,6 +195,7 @@ export default {
       ],
       nowyear: "",
       uprops: ["mj_qm", "mj", "mj_m"],
+      bhprops: ["d1_mj_qm", "d1_mj", "mj_m"],
       yearList: [],
       typeList: [],
       tab: "2023",
@@ -278,10 +279,10 @@ export default {
       }
       this.yearList = res.data || 0;
       this.nowyear = this.yearList.length ? this.yearList[0].year : "";
-      // this.setImager(this.yearList[0]);
+      this.setImager(this.yearList[0]);
     },
     setImager(obj, isshow = true, fun) {
-      console.log(obj.year, isshow, this.imagelayers[obj.year], viewer, "---");
+      console.log(obj, isshow, this.imagelayers[obj.year], viewer, "---");
 
       if (this.imagelayers[obj.year]) this.imagelayers[obj.year].show = isshow;
       else if (isshow)
@@ -292,9 +293,8 @@ export default {
           })
         );
       if (obj.top) viewer.imageryLayers.raiseToTop(this.imagelayers[obj.year]);
-      viewer.flyTo(this.imagelayers[obj.year]);
       fun && fun(this.imagelayers[obj.year]);
-      // viewer.flyTo(this.imagelayers[obj.year]);
+      viewer.flyTo(this.imagelayers[obj.year]);
     },
     async regionChange(region) {
       // this.region = region;
@@ -338,14 +338,14 @@ export default {
       }
     },
     setLnbh(data) {
-      let lnprops = ["d1_mj_qm", "d1_mj", "mj_m"];
       this.eData.yName = `变化面积${this.unitList[this.nowunit].unit}`;
       this.eData.xData = [];
       this.eData.yData = [[]];
       data.forEach((res) => {
         this.eData.xData.push(res.year);
-        this.eData.yData[0].push(res[lnprops[this.nowunit]]);
+        this.eData.yData[0].push(res[this.bhprops[this.nowunit]]);
       });
+
       this.setEchart(this.eData, 0);
     },
     GetBhqk() {
@@ -383,6 +383,18 @@ export default {
           });
       });
     },
+    contrast() {
+      let dbdata = { id: this.region, fp: this.yearList, type: "gdbb" }; //+ this.$props.pageType,
+      console.log("contrast", dbdata);
+      this.$emit("contrast", dbdata);
+    },
+    fly() {
+      viewer.flyTo(this.imagelayers[obj.year]);
+    },
+    sourcesshow(show) {
+      console.log(this.nowyear, show, "000");
+      this.setImager({ year: this.nowyear }, show);
+    },
     reset() {
       this.$nextTick(() => {
         this.setImager({ year: this.nowyear }, false);

+ 46 - 23
src/views/farmlandProtection/indexNew.vue

@@ -1,28 +1,33 @@
 <!--全域土地综合整治专题-->
 <template>
   <div class="ghzc LandConsolidation">
-    <div>
-      <div class="headerCheck">
-        <ul>
-          <li
-            :class="{ liActive: i == activeIndex }"
-            v-for="(item, i) in checkList"
-            :key="i"
-            @click="onClick(i)"
-          >
-            {{ item.title }}
-          </li>
-        </ul>
+    <div v-show="!iscontrast">
+      <div>
+        <div class="headerCheck">
+          <ul>
+            <li
+              :class="{ liActive: i == activeIndex }"
+              v-for="(item, i) in checkList"
+              :key="i"
+              @click="onClick(i)"
+            >
+              {{ item.title }}
+            </li>
+          </ul>
+        </div>
       </div>
+      <Gdzl
+        v-show="activeIndex == 0 || activeIndex == 1"
+        :pageType="activeIndex"
+        ref="gdzl"
+        ptaye="gdbh"
+        @contrast="goContrast"
+      ></Gdzl>
+      <Jctb v-show="activeIndex == 2" ref="jctb"></Jctb>
+      <Fzyp v-show="activeIndex == 3"></Fzyp>
     </div>
-    <Gdzl
-      v-show="activeIndex == 0 || activeIndex == 1"
-      :pageType="activeIndex"
-      ref="gdzl"
-    ></Gdzl>
-    <Jctb v-show="activeIndex == 2" ref="jctb"></Jctb>
-    <Fzyp v-show="activeIndex == 3"></Fzyp>
-    <div
+
+    <!-- <div
       class="innerContainer legendPane"
       v-drag
       v-show="activeIndex == 0 || activeIndex == 1"
@@ -34,7 +39,13 @@
           <span class="legLabel">{{ litem.label }}</span>
         </div>
       </div>
-    </div>
+    </div> -->
+    <Contrast
+      ref="contrastModal"
+      v-show="iscontrast"
+      @fly="fly"
+      @close="contrastClose"
+    ></Contrast>
   </div>
 </template>
 
@@ -47,7 +58,7 @@ import Jctb from "./jctb/index.vue";
 // import preCheck from "./components/preCheck.vue";
 // import Xzgd from "./components/xzgd.vue";
 // import Details from "./components/details.vue";
-// import Contrast from "./components/contrast.vue";
+import Contrast from "../LandConsolidation/components/contrast.vue";
 import Fzyp from "./index.vue";
 import { legends } from "./config.js";
 import * as pick_cockpit_vector from "@/components/Query/clickQuery/pick_cockpit_vector.js";
@@ -63,7 +74,7 @@ export default {
     // Details,
     // Organize,
     // Xzgd,
-    // Contrast,
+    Contrast,
     Fzyp,
   },
   data() {
@@ -100,6 +111,18 @@ export default {
     changeData(name, updata) {
       this[name] = updata;
     },
+    goContrast(dbdata) {
+      this.$refs.gdzl.sourcesshow(false);
+      this.iscontrast = true;
+      this.$refs.contrastModal.show(dbdata);
+    },
+    fly() {
+      this.$refs.gdzl.fly();
+    },
+    contrastClose() {
+      this.iscontrast = false;
+      this.$refs.gdzl.sourcesshow(true);
+    },
     handleView(row, type) {
       this.$refs.detailModal.handleView(row, type);
     },