瀏覽代碼

预检分析结果上图

maxiaoxiao 6 月之前
父節點
當前提交
c14ff42af8
共有 1 個文件被更改,包括 67 次插入49 次删除
  1. 67 49
      src/views/LandConsolidation/components/fxjg.vue

+ 67 - 49
src/views/LandConsolidation/components/fxjg.vue

@@ -14,7 +14,7 @@
       </div>
       <div>
         预检分析面积:
-        <span class="text">{{ compute(scjgObj.fxmj) }}亩</span>
+        <span class="text">{{ compute(scjgObj.xzmj) }}亩</span>
         <span class="export" @click="download">导出报告</span>
       </div>
     </div>
@@ -55,6 +55,7 @@ import scjgContent from "../../complianceAnalysis/components/scjgContent.vue";
 import { getyjjg } from "@/api/stxf/tdzz.js";
 import { jslist } from "./config.js";
 import parse from "wellknown";
+import { loadGeoJSON } from "@/utils/MapHelper/help.js";
 let dataSourceList = {};
 let colors = [
   "#62ADED",
@@ -103,7 +104,7 @@ export default {
       console.log("----", this.$props.scjgObj);
       this.echarts = [];
       this.$emit("updateParent", "loading", true);
-      this.addPolygon(this.$props.scjgObj.geom, "all", "#ff0000", true);
+      this.addPolygon(this.$props.scjgObj.geom, "all", "#ff0000","#ffffff");
       getyjjg(this.$props.scjgObj.bsm).then((res) => {
         if (res.code == 200) {
           let jdData = {
@@ -123,7 +124,7 @@ export default {
             jdData.result[2].push(ci.ce_area);
             // zzh_geom
           });
-          res.data.XZGD.map((ci) => {
+          res.data.XZGD.map((ci, i) => {
             ci.id = "XZGD" + i;
           });
           res.data.SQSX.map((ci, i) => {
@@ -131,7 +132,7 @@ export default {
             ci.value = ci.sumvalue;
             ci.id = "SQSX" + i;
           });
-          res.data.GHDK.map((ci) => {
+          res.data.GHDK.map((ci, i) => {
             ci.name = ci.groupvalue;
             ci.value = ci.sumvalue;
             ci.id = "GHDK" + i;
@@ -156,7 +157,7 @@ export default {
       if (dataSourceList[id]) {
         dataSourceList[id].show = this.isshowAll;
       } else {
-        this.addPolygon(this.$props.scjgObj.geom, "all", "#ff0000", true);
+        this.addPolygon(this.$props.scjgObj.geom, "all", "#ff0000","#ffffff");
       }
     },
     eyesChaneg(i) {
@@ -167,8 +168,18 @@ export default {
       let iseyes = this.echarts[i].iseyes;
       if (this.echarts[i].dataList)
         this.echarts[i].dataList.forEach((child, ci) => {
-          console.log(child, "child");
-          this.changeDataSources({ ...child, iseyes }, colors[ci]);
+          if (this.echarts[i].scxstyle == 2) {
+            this.changeDataSources(
+              { id: `zzq_${ci}`, iseyes, geomvalue: child.zzq_geom },
+              colors[ci],
+              "#186bb8"
+            );
+            this.changeDataSources(
+              { id: `zzh_${ci}`, iseyes, geomvalue: child.zzh_geom },
+              colors[ci],
+              "#4ee1ac"
+            );
+          } else this.changeDataSources({ ...child, iseyes }, colors[ci]);
         });
       // this.lForEach(this.echarts[i].lchildren, "sources", iseyes);
       // }
@@ -202,7 +213,7 @@ export default {
         }
       });
     },
-    changeDataSources({ geomvalue, id, iseyes, iszoom }, color) {
+    changeDataSources({ geomvalue, id, iseyes, iszoom }, color, fcolor) {
       console.log(geomvalue, id, iseyes, iszoom, color);
       if (iszoom) {
         this.zoomTo(id, geomvalue);
@@ -210,7 +221,7 @@ export default {
         dataSourceList[id].show = iseyes;
         this.tempdataSourcesId = null;
       } else if (geomvalue) {
-        this.addPolygon(geomvalue, id, color);
+        this.addPolygon(geomvalue, id, color, fcolor);
       }
     },
     zoomTo(id, geom) {
@@ -233,50 +244,57 @@ export default {
       });
     },
     // 加载GeoJSON数据
-    addPolygon(geom, id, colors, fillreset) {
-      let geojson = parse(geom);
-      console.log("---", geojson.type);
+    addPolygon(geom, id, colors, fillcolor) {
       let _this = this;
-      // viewer.entities.removeAll();
-      let scolor = colors
-        ? Cesium.Color.fromCssColorString(colors)
-        : Cesium.Color.RED;
-      let fcolor =
-        colors && !fillreset
-          ? Cesium.Color.fromCssColorString(colors)
-          : Cesium.Color.WHITE;
+      let fill = fillcolor || colors || "#ffffff";
 
-      let polygon = Cesium.GeoJsonDataSource.load(geojson, {
-        clampToGround: true,
-        stroke: scolor,
-        fill: fcolor.withAlpha(0.3), //注意:颜色必须大写,即不能为blue
-        strokeWidth: 5,
-      });
-      polygon.then(function (dataSource) {
-        // dataSource.id = id;
-        // 将数据源添加到Cesium Viewer
-        viewer.dataSources.add(dataSource);
-        viewer.zoomTo(dataSource);
-        dataSourceList[id] = dataSource;
+      loadGeoJSON(geom, colors || "#ff0000", { isfly: true, fill }, (data) => {
+        data.name = "MultiLevelQuery_echart";
+        dataSourceList[id] = data;
         if (id == "all") _this.isshowAll = true;
-        if (!geojson.type.includes("Polygon")) {
-          dataSource.entities.values.forEach((entity, ei) => {
-            if (entity.billboard) {
-              entity.billboard = new Cesium.BillboardGraphics({
-                image: "@/.././static/images/flypng/hos_point.png",
-                height: 40,
-                width: 40,
-                scale: 1.0,
-                pixelOffset: new Cesium.Cartesian2(0, -16),
-              });
-              // entity.point = {
-              //   pixelsize: 20,
-              //   color: Cesium.Color.fromCssColorString(colors),
-              // };
-            }
-          });
-        }
       });
+      // let geojson = parse(geom);
+      // console.log("---", geojson.type);
+      // // viewer.entities.removeAll();
+      // let scolor = colors
+      //   ? Cesium.Color.fromCssColorString(colors)
+      //   : Cesium.Color.RED;
+      // let fcolor =
+      //   colors && !fillreset
+      //     ? Cesium.Color.fromCssColorString(colors)
+      //     : Cesium.Color.WHITE;
+
+      // let polygon = Cesium.GeoJsonDataSource.load(geojson, {
+      //   clampToGround: true,
+      //   stroke: scolor,
+      //   fill: fcolor.withAlpha(0.3), //注意:颜色必须大写,即不能为blue
+      //   strokeWidth: 5,
+      // });
+      // polygon.then(function (dataSource) {
+      //   // dataSource.id = id;
+      //   // 将数据源添加到Cesium Viewer
+      //   viewer.dataSources.add(dataSource);
+      //   viewer.zoomTo(dataSource);
+      //   dataSourceList[id] = dataSource;
+      //   if (id == "all") _this.isshowAll = true;
+      //   if (!geojson.type.includes("Polygon")) {
+      //     dataSource.entities.values.forEach((entity, ei) => {
+      //       if (entity.billboard) {
+      //         entity.billboard = new Cesium.BillboardGraphics({
+      //           image: "@/.././static/images/flypng/hos_point.png",
+      //           height: 40,
+      //           width: 40,
+      //           scale: 1.0,
+      //           pixelOffset: new Cesium.Cartesian2(0, -16),
+      //         });
+      //         // entity.point = {
+      //         //   pixelsize: 20,
+      //         //   color: Cesium.Color.fromCssColorString(colors),
+      //         // };
+      //       }
+      //     });
+      //   }
+      // });
     },
 
     download() {