Sfoglia il codice sorgente

影像对比加图例

maxiaoxiao 7 mesi fa
parent
commit
64daf62d3d

+ 6 - 3
src/components/Combinations/LayerManage/LayerLegend.vue

@@ -53,7 +53,10 @@ export default {
   },
   computed: {
     checkedVector() {
-      return store.state.checkedNode.filter((ci) => ci.type == "Vector");
+      return [
+        ...store.state.checkedNode.filter((ci) => ci.type == "Vector"),
+        ...store.state.addlegend,
+      ];
     },
   },
   mounted() {
@@ -70,11 +73,11 @@ export default {
       if (this.showlist) {
         this.top = 90;
         this.height = 40;
-        this.showlist = false
+        this.showlist = false;
       } else {
         this.top = 70;
         this.height = 250;
-        this.showlist = true
+        this.showlist = true;
       }
     },
     async Getbbox(vdata) {

+ 9 - 0
src/store/store.js

@@ -31,6 +31,7 @@ var store2 = {
         modellayerlist: [],
         layerparamslist: [],//影像
         checkedNode: [],//资源目录勾选数据
+        addlegend: [],//资源目录没勾选的补充数据数据
         chooseLayer: [],
         flattenNames: [],//存储压平的名称数组
         S3MList: [],
@@ -133,6 +134,7 @@ var store2 = {
             isNightSwitch: false, //夜景状态(中图)
         },
         vectordataid: 0,
+        jlserver: { zz: null },//卷帘对比影像
     },
     setisInitViewer(newValue) {
         this.state.isInitViewer = newValue;
@@ -171,6 +173,9 @@ var store2 = {
     setcheckedTreeNode(newValue) {
         this.state.checkedNode = newValue;
     },
+    setaddNode(newValue) {
+        this.state.addlegend = newValue;
+    },
     setToolBarShow(newValue) {
         this.state.ToolBarShow = newValue;
     },
@@ -288,6 +293,10 @@ var store2 = {
     }, setCockpit_vector(newValue) {
         this.state.cockpit_vector = newValue;
     },
+
+    setJlServer(name, newValue) {
+        this.state.jlserver[name] = newValue;
+    },
 }
 
 

+ 47 - 20
src/views/LandConsolidation/components/contrast.vue

@@ -17,12 +17,13 @@
       v-for="(k, i) in 2"
       :key="i"
       class="splitScreen w50"
-      v-show="active == 1"
+      v-show="active == 0 || active == 1"
     >
       <li
         class="sm-tool-btn sm-btn"
         title="目录"
         @click="$set(layers, i, !layers[i])"
+        v-show="active == 1"
       >
         <span class="iconfont icontuceng"></span>
       </li>
@@ -62,7 +63,7 @@ import {
 } from "@/utils/MapHelper/map.js";
 import { loadGeoJSON, removeGeoJSON } from "@/utils/MapHelper/help.js";
 import AsideBottom from "./AsideBottom.vue";
-import { QueryList } from "@/api/cockpitNew";
+import { QueryOne, QueryList } from "@/api/cockpitNew";
 let geoSources = {};
 export default {
   props: {},
@@ -72,14 +73,7 @@ export default {
       list: ["卷帘对比", "分屏对比", "影像对比", "重置"],
       active: 0,
       dbdata: { id: "", fp: {} },
-      mllist: [
-        { label: "耕地", value: "0" },
-        { label: "种植园", value: "1" },
-        { label: "林地", value: "2" },
-        { label: "草地", value: "3" },
-        { label: "商服", value: "4" },
-        { label: "住宅", value: "5" },
-      ],
+
       checkdata: [[], []],
       imagelayers: {},
       nolayer: "",
@@ -87,6 +81,9 @@ export default {
     };
   },
   components: { AsideBottom },
+  created() {
+    this.GetServer();
+  },
   mounted() {
     this.$nextTick(() => {
       initroller();
@@ -96,13 +93,26 @@ export default {
     closeInster() {
       this.onClick(-1);
       removeGeoJSON("fpdb");
-
       this.$emit("close");
     },
     show(data) {
-      this.dbdata = data;
+      this.dbdata = { ...this.dbdata, ...data };
       this.onClick(0);
     },
+    async GetServer() {
+      if (this.dbdata.zzq_server) return;
+      if (!store.state.jlserver.zz) {
+        let res = await QueryOne({
+          jscType: "qytuzz_sdxz_server",
+          id: "1",
+        });
+
+        store.setJlServer("zz", res.data);
+      }
+
+      this.dbdata.zzq_server = store.state.jlserver.zz.zzq_server;
+      this.dbdata.zzh_server = store.state.jlserver.zz.zzh_server;
+    },
     checkedChange(value) {
       console.log(value);
     },
@@ -123,16 +133,33 @@ export default {
     clickml() {},
     async onClick(i) {
       this.active = i;
-      if (i == 0) {
+      if (!this.layersData.length) {
         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);
-        });
+      }
+      if (i == 0) {
+        // this.nolayer = this.layersData[1].year;
+        // this.setImager(this.layersData[1], true, (layer) => {
+        //   useRoller(true, "lrRoller", "leftRoller", "", false);
+        //   setImageryRoller(layer);
+        // });
+        // this.nolayer = this.layersData[1].year;
+        store.setaddNode([
+          { id: "ttzz", url: this.dbdata.zzq_server, label: "土地整治对比" },
+        ]);
+        this.setImager({ url: this.dbdata.zzq_server, year: "qian" }, true);
+        this.setImager(
+          { url: this.dbdata.zzh_server, year: "hou" },
+          true,
+          (layer) => {
+            useRoller(true, "lrRoller", "leftRoller", "", false);
+            setImageryRoller(layer);
+          }
+        );
       } else {
-        hideImageryRoller(this.imagelayers[this.nolayer]);
+        store.setaddNode([]);
+        // hideImageryRoller(this.imagelayers[this.nolayer]);
+        hideImageryRoller(this.imagelayers["hou"]);
         useRoller(false);
       }
       this.multiView();
@@ -297,7 +324,7 @@ export default {
   }
   .sm-toolTitle {
     top: 10px;
-    left: -70px;
+    left: 25%;
     font-size: 20px;
   }
 }

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

@@ -102,12 +102,6 @@ export default {
       }).then((res) => {
         this.dbdata = {
           id: this.region,
-          jl: {
-            qlayer:
-              "http://192.168.60.2:8090/iserver/services/map-YinZiGongZuoKongJian/rest/maps/tb_qytdzz_sd_zzq",
-            hlayer:
-              "http://192.168.60.2:8090/iserver/services/map-YinZiGongZuoKongJian/rest/maps/tb_qytdzz_sd_zzh",
-          },
           fp: res.data,
           type: this.tab,
         };