Prechádzať zdrojové kódy

Merge branch 'master' of http://114.244.114.158:8802/siwei/real3d-portalsite

lkk 7 mesiacov pred
rodič
commit
3ced364a48

+ 1 - 1
src/utils/MapHelper/clickQuery.js

@@ -131,7 +131,7 @@ export async function getfieldList(zymlBsm, resetType) {
      * @param number y
      * @returns {object} x: x, y: y, z: z
      */
-function cartesianToCartographic84(x, y) {
+export function cartesianToCartographic84(x, y) {
   let cartesian3InMercator = new Cesium.Cartesian3(x, y, 0);
   let mercator = new Cesium.WebMercatorProjection();
   let p = mercator.unproject(cartesian3InMercator);

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

@@ -37,7 +37,7 @@ export const reasonList = [
 export const TableHeader = [
   { label: "项目名称", prop: "xmmc", align: 'center' },
   // { label: "主管部门", prop: "zgbm", width: '80px' },// slot: "mj"
-  { label: "建设规模", prop: "gm", width: '80px', align: 'center' },
+  { label: "建设规模(公顷)", prop: "gm", width: '120px',slot: "mj", align: 'center' },
   { label: "操作", slot: "action", width: '80px', align: 'center' },
 ]
 
@@ -49,7 +49,7 @@ export const xzForm = [
       span: 20,
       component: 'ElInput',
       componentProps: {
-        placeholder: '请输入地块编号'
+        placeholder: '请输入图斑编号'
       }
     },
     {
@@ -59,9 +59,10 @@ export const xzForm = [
   ]
 ]
 export const xzTableHeader = [
-  { label: "地块编号", prop: "xzgdlydlbm", align: 'center', align: 'center' },
-  { label: "面积(亩)", prop: "xzgdmj", slot: "mj", align: 'center' },
-  { label: "等别", prop: "xzgddb", align: 'center' },
+  { label: "图斑编号", prop: "tbbh", align: 'center' },
+  { label: "地类名称", prop: "zzhdlmc", align: 'center' },
+  { label: "面积(亩)", prop: "tbmj_m", slot: "mj", align: 'center' },
+  { label: "等别", prop: "xzgddb", width: '50px',align: 'center' },
   { label: "操作", slot: "action", width: '80px', align: 'center' },
 ]
 export const detailInfosold = [

+ 152 - 87
src/views/LandConsolidation/components/contrast.vue

@@ -13,7 +13,24 @@
         <li class="el-icon-close" @click="closeInster"></li>
       </ul>
     </div>
-    <div
+    <contSplit
+      v-for="(k, i) in 2"
+      :key="i"
+      v-show="active == 0 || active == 1"
+      :toolshow="ptaye == 'gdbh' || active == 1"
+      :panelshow="layers[i]"
+      :list="dbdata.fp"
+      :tname="ptaye == 'gdbh' ? 'year' : 'dlbmmc'"
+      @toolChick="$set(layers, i, !layers[i])"
+      @checkChange="(name, c, data) => clickcheck(i, name, c)"
+      :checkdata="ptaye == 'gdbh' ? gdjlcheck[i] : checkdata[0]"
+      :toolTitle="
+        ptaye == 'gdbh'
+          ? gdjlcheck[i].join(',')
+          : `整治${!i ? '前' : '后'}地类图斑`
+      "
+    ></contSplit>
+    <!-- <div
       v-for="(k, i) in 2"
       :key="i"
       class="splitScreen w50"
@@ -23,20 +40,19 @@
         class="sm-tool-btn sm-btn"
         title="目录"
         @click="$set(layers, i, !layers[i])"
-        v-show="active == 1"
+        v-show="ptaye == 'gdbh' || active == 1"
       >
         <span class="iconfont icontuceng"></span>
       </li>
       <div class="ml sm-panel" v-show="layers[i]">
-        <!-- @change="checkedChange" -->
         <el-checkbox-group v-model="checkdata[0]" v-if="dbdata.fp.length > 1">
           <el-checkbox
             v-for="mli in dbdata.fp"
-            :key="mli.dlbmmc"
-            :label="mli.dlbmmc"
-            @change="(c) => clickcheck(i, mli.dlbmmc, c)"
+            :key="mli[fpname]"
+            :label="mli[fpname]"
+            @change="(c) => clickcheck(i, mli[fpname], c)"
           >
-            {{ mli.dlbmmc }}
+            {{ mli[fpname] }}
             <span
               :style="`background: ${mli.dict_color}`"
               class="lcolor"
@@ -44,8 +60,10 @@
           </el-checkbox>
         </el-checkbox-group>
       </div>
-      <div class="sm-toolTitle">{{ `整治${!i ? "前" : "后"}地类图斑` }}</div>
-    </div>
+      <div v-if="ptaye != 'gdbh'" lass="sm-toolTitle">
+        {{ `整治${!i ? "前" : "后"}地类图斑` }}
+      </div>
+    </div> -->
     <AsideBottom
       ref="aside"
       v-show="active == 2"
@@ -61,15 +79,20 @@ import {
   initroller,
   useRoller,
 } from "@/utils/MapHelper/map.js";
-import { loadGeoJSON, removeGeoJSON } from "@/utils/MapHelper/help.js";
+import {
+  loadGeoJSON,
+  removeGeoJSON,
+  addImagery,
+} from "@/utils/MapHelper/help.js";
+import contSplit from "./contrastSplit.vue";
 import AsideBottom from "./AsideBottom.vue";
 import { QueryOne, QueryList } from "@/api/cockpitNew";
 let geoSources = {};
 export default {
   props: {
-    ptaye:{
+    ptaye: {
       type: String,
-    }
+    },
   },
   data() {
     return {
@@ -77,15 +100,27 @@ export default {
       list: ["卷帘对比", "分屏对比", "影像对比", "重置"],
       active: 0,
       dbdata: { id: "", fp: {} },
+      gdjlcheck: [[], []],
+      gdfpcheck: [[], []],
       checkdata: [[], []],
       imagelayers: {},
       nolayer: "",
       layersData: [],
     };
   },
-  components: { AsideBottom },
+  components: { contSplit, AsideBottom },
+  computed: {
+    toolcheck(i) {
+      if (this.$props.ptaye == "gdbh") {
+        return this.gdjlcheck[i]; //this.active?this.gdjlcheck:this.gdfpcheck
+      } else {
+        return this.checkdata[0];
+      }
+    },
+  },
+
   created() {
-    this.GetServer();
+    this.$props.ptaye != "gdbh" && this.GetServer();
   },
   mounted() {
     this.$nextTick(() => {
@@ -94,13 +129,24 @@ export default {
   },
   methods: {
     closeInster() {
+      this.layers = [false, false];
       this.onClick(-1);
       removeGeoJSON("fpdb");
       this.$emit("close");
+      Object.keys(this.imagelayers).forEach((key) => {
+        viewer.imageryLayers.remove(this.imagelayers[key]);
+      });
+      this.imagelayers = {};
     },
     show(data) {
       console.log(data);
+
       this.dbdata = { ...this.dbdata, ...data };
+      if (this.$props.ptaye == "gdbh") {
+        this.layersData = data.fp;
+        this.$refs.aside.setdata(this.layersData);
+      }
+      this.active = 0;
       this.onClick(0);
     },
     async GetServer() {
@@ -121,21 +167,90 @@ export default {
       console.log(value);
     },
     clickcheck(i, name, checked) {
-      let geodata = geoSources[`${name}${i ? "h" : "q"}`];
-      if (geodata) {
-        if (checked)
-          viewer.flyTo(geodata, {
-            offset: new Cesium.HeadingPitchRange(0, -45),
-          });
-        // geodata.setVisibleInViewport(i, checked);
-        geoSources[`${name}q`].setVisibleInViewport(0, checked);
-        geoSources[`${name}h`].setVisibleInViewport(1, checked);
-        // geodata.show = checked;
+      if (this.$props.ptaye == "gdbh") {
+        if (this.active == 0) {
+          if (i == 0) {
+            let dobj = this.dbdata.fp.fined((d) => d.year == name);
+            this.setImager(dobj, checked, (layer) => {
+              setImageryRoller(layer);
+            });
+          }
+        } else if (this.active == 1) {
+          let lay = this.imagelayers[name];
+          viewer.flyTo(lay);
+          lay.setVisibleInViewport(i, checked);
+        }
+      } else {
+        let geodata = geoSources[`${name}${i ? "h" : "q"}`];
+        if (geodata) {
+          if (checked)
+            viewer.flyTo(geodata, {
+              offset: new Cesium.HeadingPitchRange(0, -45),
+            });
+          // geodata.setVisibleInViewport(i, checked);
+          geoSources[`${name}q`].setVisibleInViewport(0, checked);
+          geoSources[`${name}h`].setVisibleInViewport(1, checked);
+          // geodata.show = checked;
+        }
       }
     },
 
     clickml() {},
-    async onClick(i) {
+    onClick(i) {
+      if (this.$props.ptaye == "gdbh") {
+        this.onGdbhClick(i);
+      } else {
+        this.onTdzzClick(i);
+      }
+    },
+
+    async onGdbhClick(i) {
+      if (i == 3) {
+        this.reset();
+        return;
+      }
+      this.active = i;
+      if (this.active != 0 || this.active != 1) {
+        Object.keys(this.imagelayers).forEach((key) => {
+          this.imagelayers[key].show = false;
+        });
+      }
+      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) => {
+          useRoller(true, "lrRoller", "leftRoller", "", false);
+          setImageryRoller(layer);
+        });
+      } else {
+        Object.keys(this.imagelayers).forEach((key) => {
+          hideImageryRoller(this.imagelayers[key]);
+        });
+        useRoller(false);
+      }
+      let mul = this.active == 1 ? "HORIZONTAL" : "NONE";
+      scene.multiViewportMode = Cesium.MultiViewportMode[mul];
+
+      if (i == 1) {
+        this.layers = [false, false];
+        this.setImager({ ...this.dbdata.fp[0] }, true, (layer) => {
+          layer.setVisibleInViewport(1, false);
+        });
+        this.setImager({ ...this.dbdata.fp[1] }, true, (layer) => {
+          layer.setVisibleInViewport(0, false);
+        });
+      }
+      if (i == 2) {
+        this.$refs.aside.activeVal == 0;
+        this.$refs.aside.clickHandler();
+      } else {
+        this.reset();
+      }
+    },
+    async onTdzzClick(i) {
       if (i == 3) {
         this.reset();
         return;
@@ -151,6 +266,7 @@ export default {
         //   useRoller(true, "lrRoller", "leftRoller", "", false);
         //   setImageryRoller(layer);
         // });
+        this.layers = [false, false];
         store.setaddNode([
           { id: "ttzz", url: this.dbdata.zzq, label: "土地整治对比" },
         ]);
@@ -183,6 +299,10 @@ export default {
     },
     reset() {
       this.$emit("fly");
+      if (this.$props.ptaye == "gdbh") {
+        let dalist = this.gdjlcheck[0];
+        viewer.flyTo(this.imagelayers[dalist[dalist.length - 1]]);
+      }
       if (this.active == 1)
         this.checkdata[1].forEach((mc, i) => {
           if (this.checkdata[0].indexOf(mc) == -1) {
@@ -215,13 +335,10 @@ export default {
       console.log(obj.year, isshow, this.imagelayers[obj.year], "---");
 
       if (this.imagelayers[obj.year]) this.imagelayers[obj.year].show = isshow;
-      else if (isshow)
-        this.imagelayers[obj.year] = viewer.imageryLayers.addImageryProvider(
-          new Cesium.SuperMapImageryProvider({
-            url: obj.url,
-            name: obj.year,
-          })
-        );
+      else if (isshow) {
+        let { layer } = addImagery(obj);
+        this.imagelayers[obj.year] = layer;
+      }
       if (obj.top) viewer.imageryLayers.raiseToTop(this.imagelayers[obj.year]);
       fun && fun(this.imagelayers[obj.year]);
       // viewer.flyTo(this.imagelayers[obj.year]);
@@ -262,9 +379,6 @@ export default {
       if (this.active == 1) setImageryRoller(imageryLayer);
       else hideImageryRoller(imageryLayer);
     },
-    setVisible(id, show) {
-      imagelayer.setVisibleInViewport(id, show);
-    },
   },
   watch: {
     nolayer(newVal, oldVal) {
@@ -272,6 +386,9 @@ export default {
       if (oldVal) this.setImager({ year: oldVal }, false);
     },
   },
+  beforeDestroy() {
+    this.closeInster();
+  },
 };
 </script>
 <style lang="scss" scoped>
@@ -296,57 +413,5 @@ export default {
     line-height: 36px;
     cursor: pointer;
   }
-  .splitScreen {
-    float: left;
-    height: calc(100% - 80px);
-    width: 100%;
-    position: relative;
-    margin-top: 80px;
-
-    .sm-btn {
-      position: absolute;
-      top: 10px !important;
-      left: 20px;
-      background-color: transparent;
-      z-index: 100;
-    }
-    .sm-btn1 {
-      position: absolute;
-      top: 40px;
-      right: 20px;
-      background-color: transparent;
-      font-size: 30px;
-      z-index: 100;
-    }
-
-    .sm-panel {
-      max-width: 300px;
-      height: 400px; //75%;
-      max-height: 80%;
-      top: 0;
-      left: 0;
-    }
-  }
-  .w50 {
-    width: 50%;
-  }
-  .ml {
-    margin: 60px 0 0 30px;
-    .el-checkbox {
-      display: block;
-      color: #fff;
-    }
-    .lcolor {
-      display: inline-block;
-      width: 14px;
-      height: 14px;
-      margin-left: 5px;
-    }
-  }
-  .sm-toolTitle {
-    top: 10px;
-    left: 25%;
-    font-size: 20px;
-  }
 }
 </style>

+ 117 - 0
src/views/LandConsolidation/components/contrastSplit.vue

@@ -0,0 +1,117 @@
+<template>
+  <div class="splitScreen w50">
+    <li
+      class="sm-tool-btn sm-btn"
+      title="目录"
+      @click="$emit('toolChick')"
+      v-show="toolshow"
+    >
+      <span class="iconfont icontuceng"></span>
+    </li>
+    <div class="ml sm-panel" v-show="panelshow">
+      <!-- @change="checkedChange" -->
+      <el-checkbox-group v-model="checkdata" v-if="list.length > 1">
+        <el-checkbox
+          v-for="mli in list"
+          :key="mli[tname]"
+          :label="mli[tname]"
+          @change="(c) => $emit('checkChange', mli[tname], c, checkdata)"
+        >
+          {{ mli[tname] }}
+          <span :style="`background: ${mli.dict_color}`" class="lcolor"></span>
+        </el-checkbox>
+      </el-checkbox-group>
+    </div>
+    <div class="sm-toolTitle">{{ toolTitle }}</div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    ptaye: {
+      type: String,
+    },
+    toolshow: {
+      type: Boolean,
+    },
+    panelshow: {
+      type: Boolean,
+    },
+    tname: {
+      type: String,
+    },
+    checkdata: {
+      type: Array,
+    },
+    list: {
+      type: Array,
+    },
+    toolTitle: {
+      type: String,
+    },
+  },
+  data() {
+    return {
+      //   checkdata: [],
+    };
+  },
+  methods: {},
+};
+</script>
+
+
+<style lang="scss" scoped>
+.splitScreen {
+  float: left;
+  height: calc(100% - 80px);
+  width: 100%;
+  position: relative;
+  margin-top: 80px;
+
+  .sm-btn {
+    position: absolute;
+    top: 10px !important;
+    left: 20px;
+    background-color: transparent;
+    z-index: 100;
+  }
+  .sm-btn1 {
+    position: absolute;
+    top: 40px;
+    right: 20px;
+    background-color: transparent;
+    font-size: 30px;
+    z-index: 100;
+  }
+
+  .sm-panel {
+    max-width: 300px;
+    height: 400px; //75%;
+    max-height: 80%;
+    top: 0;
+    left: 0;
+  }
+}
+.w50 {
+  width: 50%;
+}
+.ml {
+  margin: 60px 0 0 30px;
+  .el-checkbox {
+    display: block;
+    color: #fff;
+  }
+  .lcolor {
+    display: inline-block;
+    width: 14px;
+    height: 14px;
+    margin-left: 5px;
+  }
+}
+.sm-toolTitle {
+  top: 10px;
+  left: 25%;
+  font-size: 20px;
+}
+</style>

+ 1 - 1
src/views/LandConsolidation/components/list.vue

@@ -37,7 +37,7 @@
       @currentChange="searchFun"
     >
       <template #mj="{ row }">
-        {{ Number(row.crmj).toFixed(2) }}
+        {{ Number(row.gm).toFixed(2) }}
       </template>
       <template #action="{ row }">
         <span class="usable" @click="detail(row)">详情</span>

+ 5 - 5
src/views/LandConsolidation/components/xzgd.vue

@@ -17,11 +17,11 @@
     >
       <el-tab-pane label="新增耕地总览情况" name="gdzl">
         <div class="content sdata">
-          <div class="item" v-for="(sd, index) in sdlist" :key="index">
+          <div class="item" v-for="(sd, si) in sdlist" :key="si">
             <div class="text">
               <p>{{ sd.name }}</p>
               <span class="cvalue"
-                >{{ (sdata[sd.prop] || 0).toFixed(2) }}
+                >{{ (sdata[sd.prop] || 0).toFixed(si == 2 ? 0 : 2) }}
               </span>
               <span class="unit">{{ sd.unit }}</span>
             </div>
@@ -74,7 +74,7 @@ export default {
       sdlist: [
         { name: "新增耕地面积", prop: "area_number_gq", unit: "公顷" },
         { name: "新增耕地面积", prop: "area_number_m", unit: "亩" },
-        { name: "新增耕地地块数", prop: "count_number", unit: "个" },
+        { name: "新增耕地地块数", prop: "count_number", unit: "个", fiex: 0 },
       ],
       // tab: 0,
       xmdata: {},
@@ -123,7 +123,7 @@ export default {
       getsjzlXzgd(this.params).then((res) => {
         res.data.map((a) => {
           a.name = a.zzhdlmc;
-          a.value = a.area_number.toFixed(2);
+          a.value = a.area_number_m.toFixed(2);
         });
         this.setEchart({ data: res.data, type: '"horizontal"' }, 0);
         this.$emit("updateParent", "loading", false);
@@ -133,7 +133,7 @@ export default {
       getXzgdly(this.params).then((res) => {
         res.data.map((a) => {
           a.name = a.dlmc;
-          a.value = a.area_number.toFixed(2);
+          a.value = a.area_number_m.toFixed(2);
         });
         this.setEchart({ data: res.data, type: '"horizontal"' }, 1);
         this.$emit("updateParent", "loading", false);

+ 1 - 1
src/views/LandConsolidation/components/xzlist.vue

@@ -21,7 +21,7 @@
       @currentChange="searchFun"
     >
       <template #mj="{ row }">
-        {{ Number(row.xzgdmj).toFixed(2) }}
+        {{ Number(row.tbmj_m).toFixed(2) }}
       </template>
       <template #action="{ row }">
         <span class="usable" @click="detail(row)">详情</span>

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

@@ -162,7 +162,7 @@ export default {
       xzqh: "",
       checkList: [
         {
-          title: "试点总",
+          title: "试点总",
         },
         {
           title: "整治项目",

+ 1 - 0
src/views/farmlandProtection/config.js

@@ -23,6 +23,7 @@ export const zzForm = [
   ]
 ]
 export const legends = [
+  { id: "01", label: "耕地", index: 0 },
   { id: '0101', label: "水田", color: '#caf982', index: 1 },
   { id: '0102', label: "水浇地", color: '#80ffff', index: 2 },
   { id: '0103', label: "旱地", color: '#facd91', index: 3 }

+ 14 - 13
src/views/farmlandProtection/gdzl/index.vue

@@ -28,7 +28,7 @@
             v-model="nowyear"
             placeholder="请选择"
             size="mini"
-            @change="regionChange()"
+            @change="yearChange()"
           >
             <el-option
               v-for="item in yearList"
@@ -262,7 +262,7 @@ export default {
   created() {
     // this.getYear();
     // this.GetDate();
-    this.typeList = [{ id: "01", label: "耕地", index: 0 }, ...legends];
+    this.typeList = [...JSON.parse(JSON.stringify(legends))];
   },
   mounted() {},
   methods: {
@@ -280,6 +280,11 @@ export default {
     unitChange() {
       this.setLnbh(this.lnbndata);
     },
+    yearChange() {
+      let yobj = this.yearList.find((y) => y.year == this.nowyear);
+      this.setImager(yobj);
+      this.regionChange();
+    },
     dlbmChange() {
       let nowtype = this.typeList.find((x) => x.id == this.dlbm);
       this.gtype = nowtype.label;
@@ -289,7 +294,6 @@ export default {
       } else {
         if (nowtype.layerID) {
           this.nowlayer = this.nowyear + nowtype.layerID;
-          console.log(nowtype, "----nowtype");
         } else if (this.layers.length) {
           let yobj = this.yearList.find((y) => y.year == this.nowyear);
           if (yobj) this.goLayer(yobj, nowtype);
@@ -328,12 +332,9 @@ export default {
       this.nowlayer = this.nowyear;
       init_handler(this.yearList[0], this.showInfo);
       store.setaddNode([
-        {
-          id: "gdbh" + this.$props.pageType,
-          url: this.yearList[0].url,
-          label: "耕地保护",
-        },
+        { id: "gdbh", url: this.yearList[0].url, label: "耕地保护" },
       ]);
+      // + this.$props.pageType
       this.setImager(this.yearList[0], true, (layer) => {
         Getlayers(this.yearList[0].url, (layers) => {
           this.layers = layers;
@@ -349,8 +350,8 @@ export default {
       });
     },
     showInfo(data, obj) {
-      let legends = store.state.addlegend;
-      if (legends && legends.length && legends[0].id == "gdbh") {
+      let alegends = store.state.addlegend;
+      if (alegends && alegends.length && alegends[0].id == "gdbh") {
         this.$emit("handleView", data, obj);
       }
     },
@@ -477,10 +478,9 @@ export default {
       this.$emit("contrast", dbdata);
     },
     fly() {
-      viewer.flyTo(this.imagelayers[obj.year]);
+      // viewer.flyTo(this.imagelayers[this.nowlayer]);
     },
     sourcesshow(show) {
-      console.log(this.nowyear, show, "000");
       this.setImager({ year: this.nowlayer }, show);
     },
     reset() {
@@ -489,6 +489,8 @@ export default {
         Object.keys(this.imagelayers).forEach((key) => {
           viewer.imageryLayers.remove(this.imagelayers[key]);
         });
+        this.imagelayers = {};
+        this.typeList = [...JSON.parse(JSON.stringify(legends))];
       });
     },
     setEchart(data, id) {
@@ -502,7 +504,6 @@ export default {
       console.log(newValue, "---");
     },
     nowlayer(newValue, oldVal) {
-      console.log(newValue, oldVal, "-ssssss--");
       this.setImager({ year: oldVal }, false);
       this.setImager({ year: newValue }, true);
     },

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

@@ -43,6 +43,7 @@
     <Details ref="detailModal"></Details>
     <Contrast
       ref="contrastModal"
+      ptaye="gdbh"
       v-show="iscontrast"
       @fly="fly"
       @close="contrastClose"