Browse Source

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

lkk 6 months ago
parent
commit
907387b261

+ 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);

+ 100 - 79
src/views/LandConsolidation/components/sdgk.vue

@@ -5,7 +5,7 @@
       <div class="item" v-for="(sd, index) in sdlist" :key="index">
         <div class="text">
           <p>{{ sd.name }}</p>
-          <span class="cvalue">{{ (sdata.area || 0).toFixed(2) }} </span>
+          <span class="cvalue">{{ (sdata[sd.prop] || 0).toFixed(2) }} </span>
           <span class="unit">{{ sd.unit }}</span>
         </div>
       </div>
@@ -19,6 +19,22 @@
     <div class="echars">
       <div class="echartTitle">
         <div class="block-title">现状信息</div>
+        <div class="selectTab">
+          <el-select
+            v-model="tab"
+            placeholder="请选择"
+            :popper-append-to-body="false"
+            @change="Getxzxx()"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.name"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </div>
       </div>
       <div class="content">
         <div class="item" v-for="(sd, index) in xzlist" :key="index">
@@ -27,7 +43,7 @@
           </div>
           <div class="text">
             <p>{{ sd.name }}</p>
-            <span class="cvalue">{{ (sdata.area || 0).toFixed(2) }} </span>
+            <span class="cvalue">{{ (xzdata[sd.prop] || 0).toFixed(2) }} </span>
             <span class="unit">{{ sd.unit }}</span>
           </div>
         </div>
@@ -36,27 +52,11 @@
     <div class="echars">
       <div class="echartTitle">
         <div class="block-title">试点投资</div>
-        <div class="selectTab">
-          <el-select
-            v-model="tab"
-            placeholder="请选择"
-            :popper-append-to-body="false"
-            @change="changeCharts"
-          >
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.name"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select>
-        </div>
       </div>
       <div class="content ztzc">
         <div class="text">
           <span>总投资</span>
-          <span class="cvalue">{{ (tzdata.area || 0).toFixed(2) }} </span>
+          <span class="cvalue">{{ (tzdata.jhtz || 0).toFixed(2) }} </span>
           <span class="unit">万元</span>
         </div>
       </div>
@@ -65,18 +65,18 @@
         <div class="item">
           <div class="text">
             <p>财政投资</p>
-            <span class="cvalue">{{ (tzdata.area || 0).toFixed(2) }} </span>
+            <span class="cvalue">{{ (tzdata.czjhtz || 0).toFixed(2) }} </span>
             <span class="unit">万元</span>
-            <p>{{ (tzdata.area || 0).toFixed(2) }}%</p>
+            <p>{{ (tzdata.czratio || 0).toFixed(2) }}%</p>
           </div>
         </div>
         <div class="item"></div>
         <div class="item">
           <div class="text">
             <p>社会投资</p>
-            <span class="cvalue">{{ (tzdata.area || 0).toFixed(2) }} </span>
+            <span class="cvalue">{{ (tzdata.shjhtz || 0).toFixed(2) }} </span>
             <span class="unit">万元</span>
-            <p>{{ (tzdata.area || 0).toFixed(2) }}%</p>
+            <p>{{ (tzdata.sjratio || 0).toFixed(2) }}%</p>
           </div>
         </div>
       </div>
@@ -87,40 +87,41 @@
 <script>
 import pie from "@/components/echartsTemplate/pie.vue";
 import { overview, district, reason } from "@/api/Idleland.js";
-import { QueryList } from "@/api/cockpitNew";
-import {QueryOne} from '../../../api/stxf/tdzz.js'
+import { QueryOne, QueryList } from "@/api/cockpitNew";
+import { legends } from "./config.js";
+import { loadGeoJSON } from "@/utils/MapHelper/help.js";
 export default {
   props: {},
   data() {
     return {
-      sdata: { suspected: {}, confirm: {}, disposal: {} },
+      region: "",
+      sdata: {},
       sdlist: [
-        { name: "试点区域", prop: "suspected", unit: "公顷" },
-        { name: "整治区域", prop: "confirm", unit: "公顷" },
-        { name: "涉及村庄", prop: "disposal", unit: "个" },
+        { name: "试点区域", prop: "试点面积", unit: "公顷" },
+        { name: "整治区域", prop: "整治面积", unit: "公顷" },
+        { name: "涉及村庄", prop: "村庄个数", unit: "个" },
       ],
-      tab: 0,
+      tab: "sd",
       options: [
-        { name: "试点区域", value: 0 },
-        { name: "整治区域", value: 1 },
+        { name: "试点区域", value: "sd" },
+        { name: "整治区域", value: "zzqy" },
       ],
       xzlist: [
-        { name: "农用地面积", prop: "suspected", unit: "公顷" },
-        { name: "建设用地面积", prop: "confirm", unit: "公顷" },
-        { name: "未利用地面积", prop: "disposal", unit: "公顷" },
-        { name: "耕地面积", prop: "disposal", unit: "公顷" },
-        { name: "永久基本农田", prop: "disposal", unit: "公顷" },
-        { name: "生态红线划定", prop: "disposal", unit: "公顷" },
+        { name: "农用地面积", prop: "nydmk", unit: "公顷" },
+        { name: "建设用地面积", prop: "jsydmj", unit: "公顷" },
+        { name: "未利用地面积", prop: "wlytmj", unit: "公顷" },
+        { name: "耕地面积", prop: "gd", unit: "公顷" },
+        { name: "永久基本农田", prop: "yjjbnt", unit: "公顷" },
+        { name: "生态红线划定", prop: "sthxhdmj", unit: "公顷" },
       ],
+      xzdata: {},
       tzdata: {},
     };
   },
   components: {
     pie,
   },
-  mounted() {
-    this.getData();
-  },
+  mounted() {},
   methods: {
     changeData(name, updata) {
       this[name] = updata;
@@ -131,20 +132,23 @@ export default {
     },
     getData() {
       this.$emit("updateParent", "loading", true);
-      this.params = { districtCode: this.region };
       this.Getzzxm();
-
-      this.GetSumList();
+      this.Getxzxx();
+      this.Getsdtz();
+      this.Getkjxx();
+      this.Getkjxx();
+      this.Getkjxx();
+      this.Getkjxx();
     },
-    async Getzzxm(params) {
-      let getGk = await QueryOne({
-        jscType: "qytuzz_sdzl_xzxx_sd",
-        id: params ? params.id : "4602",
-      })
-      console.log(getGk,'getGkgetGkgetGkgetGk');
+    async Getzzxm() {
+      let sdres = await QueryOne({
+        jscType: "qytuzz_sdzl_sdqk",
+        id: this.region,
+      });
+      this.sdata = sdres.data;
       let res = await QueryList({
         jscType: "jsc_stxf_ywfl_tdzz",
-        id: params ? params.id : "4602",
+        id: this.region,
       });
       let arr = [];
       res.data.forEach((res) => {
@@ -154,38 +158,54 @@ export default {
         });
       });
       this.setEchart({ data: arr, type: '"horizontal"' }, 0);
-      // this.$refs.stxf_echart_tdzz.setOptions(arr);
-
-      // let res_hz = await QueryList({
-      //   jscType: "jsc_stxf_ztgh_tdzz",
-      //   id: params ? params.id : "4602",
-      // });
-
-      // this.sdata.tdzz = {
-      //   xzqhdm_number: res_hz.data[0].xmsl,
-      //   zlmj: res_hz.data[0].mj,
-      //   tzje: res_hz.data[0].tzje,
-      // };
     },
-    GetOverview() {
-      overview(this.params).then((res) => {
-        this.sdata = res.data || {};
-        this.$emit("updateParent", "loading", false);
+    async Getxzxx() {
+      let res = await QueryOne({
+        jscType: `qytuzz_sdzl_xzxx_${this.tab}`,
+        id: this.region,
       });
+      this.xzdata = res.data;
+      this.$emit("updateParent", "loading", false);
     },
-    GetSumList() {
-      reason(this.params).then((res) => {
-        res.data.map((a) => {
-          a.name = a.reason;
-          a.value = a.area.toFixed(2);
-        });
-        let redPercent = 60;
-        let bluePercent = 40;
-        const background = `linear-gradient(to right,#DFE15A ${redPercent}%,#62ADED   ${bluePercent}%)`;
-        this.$refs.tzRef.style.background = background;
-        this.setEchart({ data: res.data, type: '"horizontal"' }, 0);
-        this.$emit("updateParent", "loading", false);
+    async Getsdtz() {
+      let { data } = await QueryOne({
+        jscType: "qytuzz_sdzl_sdtz",
+        id: this.region,
       });
+      let czratio = data.jhtz ? (data.czjhtz / data.jhtz) * 100 : 0;
+      let sjratio = data.jhtz ? (data.shjhtz / data.jhtz) * 100 : 0;
+      this.tzdata = { ...data, czratio, sjratio };
+      const background = `linear-gradient(to right,#DFE15A ${czratio}%,#62ADED 0%)`;
+      this.$refs.tzRef.style.background = background;
+      this.$emit("updateParent", "loading", false);
+    },
+    async Getkjxx() {
+      let res = await QueryList({
+        jscType: "qytuzz_sdzl_kjxx",
+        id: this.region,
+      });
+      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);}
+      // });
     },
     changeCharts(e) {},
     setEchart(data, id) {
@@ -277,6 +297,7 @@ export default {
   .tzdiv {
     height: 20px;
     margin: 5px 20px;
+    // background: #62aded;
   }
 }
 </style>

+ 5 - 5
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",
@@ -136,7 +136,7 @@ export default {
         },
       ],
       activeIndex: 0,
-      legends: ["试点区域", "整治区域", "整治项目"],
+      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();