zpf 1 gadu atpakaļ
vecāks
revīzija
28cef63eb7
2 mainītis faili ar 48 papildinājumiem un 4 dzēšanām
  1. 0 1
      src/views/cockpitNew1/hysy.vue
  2. 48 3
      src/views/viewer1.vue

+ 0 - 1
src/views/cockpitNew1/hysy.vue

@@ -353,7 +353,6 @@ export default {
             that.label_text.xzqhdm_number = data.data[0].xzqhdm_number
             that.label_text.xzqhdm_number = data.data[0].xzqhdm_number
             that.label_text.zhmj = data.data[0].zhmj
             that.label_text.zhmj = data.data[0].zhmj
             store.setCockpitHysyText(that.label_text);
             store.setCockpitHysyText(that.label_text);
-console.log(store.state.cockpit_hysy.text);
 
 
         },
         },
         async echart_data() {
         async echart_data() {

+ 48 - 3
src/views/viewer1.vue

@@ -23,9 +23,11 @@ import GDBH from './cockpitNew1/gdbh';
 import STXF from './cockpitNew1/stxf';
 import STXF from './cockpitNew1/stxf';
 import WPJG from './cockpitNew1/wpjg';
 import WPJG from './cockpitNew1/wpjg';
 import datePicker from './cockpitNew1/datePicker.vue';
 import datePicker from './cockpitNew1/datePicker.vue';
-import { cockpitInfo } from '@/api/cockpit'
 import xzqh from "../../static/data/460200_full.json";
 import xzqh from "../../static/data/460200_full.json";
 import SerCenter from './cockpitNew1/serCenter.vue';
 import SerCenter from './cockpitNew1/serCenter.vue';
+
+import { cockpitInfo } from '@/api/cockpit'
+
 export default {
 export default {
     components: { serCenter, JSYD, TDSC, HYSY, TDSY, GDBH, STXF, WPJG, datePicker, SerCenter },
     components: { serCenter, JSYD, TDSC, HYSY, TDSY, GDBH, STXF, WPJG, datePicker, SerCenter },
     data() {
     data() {
@@ -48,10 +50,10 @@ export default {
         deteChange(date) {
         deteChange(date) {
 
 
         },
         },
-        pick_xzqh() {
+        async pick_xzqh() {
             const that = this;
             const that = this;
             const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
             const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
-            handler.setInputAction(event => {
+            handler.setInputAction(async event => {
                 let pickObj = viewer.scene.pick(event.position);
                 let pickObj = viewer.scene.pick(event.position);
                 var position = viewer.scene.pickPosition(event.position);
                 var position = viewer.scene.pickPosition(event.position);
 
 
@@ -88,9 +90,11 @@ export default {
                             const address = pickObj.id.properties.adcode.getValue();
                             const address = pickObj.id.properties.adcode.getValue();
                             const center = pickObj.id.properties.centroid.getValue();
                             const center = pickObj.id.properties.centroid.getValue();
 
 
+                            // 选中状态
                             pickObj.id.polygon._material.color = Cesium.Color.fromCssColorString(that.xzqh_color_click);
                             pickObj.id.polygon._material.color = Cesium.Color.fromCssColorString(that.xzqh_color_click);
                             pickObj.id.polygon.extrudedHeight = 850;
                             pickObj.id.polygon.extrudedHeight = 850;
 
 
+                            // 恢复其他状态
                             viewer.entities.values.forEach((res) => {
                             viewer.entities.values.forEach((res) => {
 
 
                                 if (res.properties.name._value != name) {
                                 if (res.properties.name._value != name) {
@@ -101,6 +105,47 @@ export default {
 
 
                                 }
                                 }
                             })
                             })
+                            // 选中xzqh查询
+                            let obj = {
+                                beginTime: '20240101',
+                                endTime: '20240501',
+                                jscType: 'jsc_hysyq_ztsh',
+                                id: address
+                            };
+                            let data = await cockpitInfo(obj);
+
+                            let obg_text = {
+                                xzqhdm_number: data.data[0].xzqhdm_number,
+                                zhmj: data.data[0].zhmj,
+
+                            }
+                            console.log(obg_text, "obg_echart");
+
+                            store.setCockpitHysyText(obg_text);
+
+                            // 图表数据
+                            let obj_echart = {
+                                beginTime: '20240101',
+                                endTime: '20240501',
+                                jscType: 'jsc_hysyq_yelx',
+                                id: address
+                            };
+                            let data_echart = await cockpitInfo(obj_echart);
+
+                            let obg_echart = {
+                                x: data_echart.data.map(item => item.yhlx_name),
+                                bar: data_echart.data.map(item => item.zhmj)
+
+                            }
+
+                            store.setCockpitHysyEchart(obg_echart);
+
+
+
+
+
+                            console.log(address, "address");
+
                         } else {
                         } else {
 
 
                         }
                         }