Ver Fonte

添加数据

zpf há 11 meses atrás
pai
commit
7c47b5ba12

+ 0 - 1
src/common/js/cockpit.js

@@ -96,7 +96,6 @@ const add_wall = (obj, positions, res) => {
 }
 const add_hy = (obj, res, oneDArray, xzqh_color) => {
 
-
     manager_entity.entities.add({
         position: Cesium.Cartesian3.fromDegrees(res.properties.centroid[0], res.properties.centroid[1], 500),
         properties: obj,

+ 2 - 2
src/views/cockpit/common/DialWatch.vue

@@ -44,7 +44,7 @@ export default {
     components: {},
     data() {
         return {
-            icon_switch: true,
+            icon_switch: false,
         };
     },
     //监听属性 类似于data概念
@@ -84,7 +84,7 @@ export default {
     methods: {
         draw_vector() {
             this.icon_switch = !this.icon_switch
-            this.$emit('draw_vector')
+            this.$emit('draw_vector',this.icon_switch)
         },
         init_dial_watch(echart_data) {
             var myChart = echarts.init(this.$refs.dial_watch_scjg);

+ 61 - 2
src/views/cockpit/tdsy.vue

@@ -67,7 +67,7 @@
       <div v-show="left_value == left_options[0].value && right_value == right_options[0].value">
 
         <DialWatch class="tdgy_gyjd" :dial_watch_info="dial_watch_info" ref="tdgy_gyjd"
-          @draw_vector="draw_vector_tdgy_gy_jd" />
+          @draw_vector="switch_vector_tdgy_gy_jd" />
 
         <pie3d id="tdgy_echart_gyjd" unit="公顷" :legendFlag=true ref="tdgy_echart_gyjd"></pie3d>
 
@@ -133,11 +133,13 @@ import { QueryOne, QueryList } from "../../api/cockpitNew";
 import pie3d from "../../components/echartsTemplate/3dPie.vue";
 import DialWatch from './common/DialWatch.vue';
 import Graph3D from './common/Graph3D.vue';
+import parse from "wellknown";
 
 export default {
   components: { pie3d, DialWatch, Graph3D },
   data() {
     return {
+      vector_data: null,
       wccchy: "",
       wcccxm: "",
       legendData: ['计划收储', '完成收储'],
@@ -191,6 +193,8 @@ export default {
         },
       ],
       left_value: 'gyjsyd',
+      gy_jd_entity: null,
+
     };
   },
   //监听属性 类似于data概念
@@ -834,7 +838,54 @@ export default {
 
     },
     draw_vector_tdgy_gy_jd() {
-      console.log(11);
+
+      this.vector_data.forEach((res) => {
+        res.geom.coordinates[0].forEach((res_coordinates) => {
+
+          const twoDArray = res_coordinates;
+          const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
+
+
+          this.gy_jd_entity.entities.add({
+            // position: Cesium.Cartesian3.fromDegrees(res_coordinates[0], res_coordinates[1], 0),
+            // properties: obj,
+            name: "国有建设用地完成项目",
+            polygon: {
+              zIndex: 1,
+              hierarchy: {
+                positions: Cesium.Cartesian3.fromDegreesArrayHeights(oneDArray),
+              },
+              // outline: false,
+              // material: Cesium.Color.fromCssColorString(xzqh_color),
+
+              height: 0,
+              extrudedHeight: 0,
+              outline: true,
+              // outlineColor : Cesium.Color.BLACK
+              outlineColor: Cesium.Color.fromCssColorString('#55A1E3'),
+            }
+          })
+        })
+      })
+
+    },
+    switch_vector_tdgy_gy_jd(flag) {
+      console.log('flag: ', flag);
+      this.gy_jd_entity.show = flag
+    },
+    async init_vector(params) {
+      const that = this;
+      let obj = {
+        jscType: 'jsc_tdgy_gy_zbmx',
+        id: params ? params.id : '4602'
+      };
+      let data = await QueryList(obj);
+      data.data.map((res) => {
+        res.geom = parse(res.geom);
+      })
+      this.vector_data = data.data;
+
+      this.draw_vector_tdgy_gy_jd();
     }
   },
   mounted() {
@@ -849,6 +900,14 @@ export default {
       that.init_tdgy_jt_jd();
       that.init_info();
       that.init_echart_data();
+      that.init_vector();
+
+
+
+      this.gy_jd_entity = new Cesium.CustomDataSource("gy_jd_entity");
+      viewer.dataSources.add(this.gy_jd_entity);
+      this.gy_jd_entity.show = false
+
     });
   },
   beforeUpdate() { }, //生命周期 - 更新之前