Răsfoiți Sursa

图斑上图

maxiaoxiao 6 luni în urmă
părinte
comite
fa365eb5e3

+ 5 - 0
src/views/LandConsolidation/components/config.js

@@ -22,6 +22,11 @@ export const xzForm = [
     }
   ]
 ]
+export const legends = [
+    { label: "试点区域", color: '#caf982' },
+    { label: "整治区域", color: '#80ffff' },
+    { label: "整治项目", color: '#facd91' }
+]
 export const reasonList = [
   { name: "政府原因", code: 0 },
   { name: "企业原因", code: 1 },

+ 30 - 14
src/views/LandConsolidation/components/contrast.vue

@@ -10,6 +10,7 @@
         >
           {{ item }}
         </li>
+        <i class="el-icon-close" @click="closeInster"></i>
       </ul>
     </div>
     <div v-for="(k, i) in 2" :key="i" class="splitScreen w50">
@@ -47,7 +48,7 @@ export default {
     return {
       layers: [false, false],
       list: ["卷帘对比", "分屏对比", "影像对比", "重置"],
-      active: 1,
+      active: 0,
       checked: true,
       mllist: [
         { label: "耕地", value: "0" },
@@ -62,9 +63,15 @@ export default {
   },
   components: {},
   mounted() {
+    this.active = 0;
     this.getData();
   },
   methods: {
+    closeInster() {
+      this.active = -1;
+      this.onClick();
+      this.$emit("close");
+    },
     checkedChange(value) {
       console.log(value);
     },
@@ -75,19 +82,19 @@ export default {
 
     clickml() {},
     onClick() {
-      switch (this.active) {
-        case 0:
-          break;
-        case 1:
-          this.multiView();
-          break;
-        case 2:
-          break;
-        case 3:
-          break;
-        default:
-          break;
-      }
+      this.multiView();
+      // switch (this.active) {
+      //   case 0:
+      //     break;
+      //   case 1:
+      //     break;
+      //   case 2:
+      //     break;
+      //   case 3:
+      //     break;
+      //   default:
+      //     break;
+      // }
     },
     multiView() {
       let mul = this.active == 1 ? "HORIZONTAL" : "NONE";
@@ -110,6 +117,15 @@ export default {
           });
       });
     },
+    removeGeoJSON() {
+      if (!window.viewer) return;
+      viewer.entities.removeAll();
+      viewer.dataSources.removeAll();
+      // viewer.dataSources._dataSources.forEach((das) => {
+      //   if (das.name == "Idleland") {viewer.dataSources.remove(das);}
+      // });
+    },
+
     setImageryRollers(imageryLayer) {
       if (this.active == 1) setImageryRoller(imageryLayer);
       else hideImageryRoller(imageryLayer);

+ 34 - 0
src/views/LandConsolidation/components/sdgk.vue

@@ -88,6 +88,8 @@
 import pie from "@/components/echartsTemplate/pie.vue";
 import { overview, district, reason } from "@/api/Idleland.js";
 import { QueryList } from "@/api/cockpitNew";
+import { legends } from "./config.js";
+import { loadGeoJSON } from "@/utils/MapHelper/help.js";
 export default {
   props: {},
   data() {
@@ -132,6 +134,10 @@ export default {
       this.$emit("updateParent", "loading", true);
       this.params = { districtCode: this.region };
       this.Getzzxm();
+      this.Getkjxx();
+      this.Getkjxx();
+      this.Getkjxx();
+      this.Getkjxx();
 
       this.GetSumList();
     },
@@ -161,6 +167,34 @@ export default {
       //   tzje: res_hz.data[0].tzje,
       // };
     },
+    async Getkjxx(params) {
+      let res = await QueryList({
+        jscType: "qytuzz_sdzl_kjxx",
+        id: params ? params.id : "4602",
+      });
+      this.active_tableData(res.data);
+    },
+    active_tableData(newVal) {
+      newVal.forEach((res, index) => {
+        let color = legends[res.type].color;
+        if (res.geom)
+          loadGeoJSON(res.geom, color, { isfly: false }, (data) => {
+            geoSources[res.id] = data;
+            data.name = "LandConsolidation";
+            // data.entities.values.forEach((entity) => {
+            //   entity.properties = { type: "图斑上图", id: res.id };
+            // });
+          });
+      });
+    },
+    reset() {
+      if (!window.viewer) return;
+      viewer.entities.removeAll();
+      viewer.dataSources.removeAll();
+      // viewer.dataSources._dataSources.forEach((das) => {
+      //   if (das.name == "LandConsolidation") {viewer.dataSources.remove(das);}
+      // });
+    },
     GetOverview() {
       overview(this.params).then((res) => {
         this.sdata = res.data || {};

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

@@ -77,7 +77,7 @@
           图例
           <div v-for="(litem, li) in legends" :key="litem.label">
             <span :class="`legend${li}`" class="lcolor"></span>
-            <span class="legLabel">{{ litem }}</span>
+            <span class="legLabel">{{ litem.label }}</span>
           </div>
         </div>
       </div>
@@ -102,7 +102,7 @@ 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 { legends } from "./components/config.js";
 import * as pick_cockpit_vector from "@/components/Query/clickQuery/pick_cockpit_vector.js";
 export default {
   name: "LandConsolidation",
@@ -135,8 +135,8 @@ export default {
           title: "整治预检",
         },
       ],
-      activeIndex: 1,
-      legends: ["试点区域", "整治区域", "整治项目"],
+      activeIndex: 0,
+      legends: legends,
       iscontrast: false,
     };
   },
@@ -174,8 +174,8 @@ export default {
   },
   watch: {
     activeIndex(newValue) {
-      // if (newValue != "qhdb") this.$refs.qhdb.reset();
-      // if (newValue == "sdgk") this.$refs.sdgk.getData();
+      if (newValue != 0) this.$refs.sdgk.reset();
+      if (newValue == 0) this.$refs.sdgk.getData();
       // if (newValue == "qhdb") this.$refs.qhdb.changeForm();
       // if (newValue == 1) this.$refs.list.searchFun();
       if (newValue == 2) this.$refs.xzgd.getData();