Ver Fonte

接口接入

zpf há 1 ano atrás
pai
commit
2d7d74d58e
3 ficheiros alterados com 41 adições e 21 exclusões
  1. 0 8
      src/store/store.js
  2. 40 12
      src/views/cockpit/bjxm.vue
  3. 1 1
      src/views/viewer.vue

+ 0 - 8
src/store/store.js

@@ -114,14 +114,6 @@ var store2 = {
                 bcgd: {},
             }
         },
-        cockpit_bjxm: {
-            csbj: {
-                csbj_echart: {}
-            },
-            szbj: {
-                szbj_echart: {}
-            }
-        },
         cockpit_gkzb: {
             // 生态保护红线面积
             mj: 0,

+ 40 - 12
src/views/cockpit/bjxm.vue

@@ -31,11 +31,12 @@
           <span>{{ left_value == 'csbj' ? sdata.sj_mj : sdata_szbj.sj_mj }}</span>平方千米
         </div>
       </div>
-      <div id="" v-show="xzqh_flag">
+      <!-- <div id="" v-show="xzqh_flag">
         三亚
       </div>
-      <div id="bjxm_echart" v-show="!xzqh_flag"></div>
+      <div id="bjxm_echart" v-show="!xzqh_flag"></div> -->
 
+      <div id="bjxm_echart"></div>
 
     </div>
   </div>
@@ -57,6 +58,9 @@ export default {
       icon_switch: false,
       szbj_echart: null,
       csbj_echart: null,
+      csbj_ps_echart: null,
+      szbj_ps_echart: null,
+
       left_value: 'csbj',
       xzqh_flag: true,
       options: [
@@ -109,17 +113,20 @@ export default {
       let res_szbj = await QueryOne(obj_szbj);
       this.sdata_szbj = res_szbj.data;
     },
-    switch_xzqh(value) {
+    async switch_xzqh(value) {
+      await this.init_bjxm_echart_info(value);
       if (value.id == '4602') {
         this.xzqh_flag = true
-
+        this.init_bjxm_cs_echart(this.csbj_ps_echart);
       } else {
         this.xzqh_flag = false
+        this.changeChartsLeft();
       }
 
     },
     async init_bjxm_echart_info(params) {
       const that = this;
+      // 城市报建,某个区
       let obj = {
         jscType: 'jsc_bjxm_csbj_yffl',
         beginTime: params ? params.beginTime : store.state.cockpit_date[0],
@@ -139,12 +146,7 @@ export default {
 
 
       });
-      store.state.cockpit_bjxm.csbj.csbj_echart = {
-        xAxis: xAxis,
-        bat_data: bat_data,
-        line_data: line_data,
-        legend_data: ["用地面积", "项目数量"],
-      }
+
       this.csbj_echart = {
         xAxis: xAxis,
         bat_data: bat_data,
@@ -152,7 +154,7 @@ export default {
 
       }
 
-      // 私宅报建
+      // 私宅报建,某个区
 
       let dateString_beginTime = store.state.cockpit_date[0];
       let formattedDate = dateString_beginTime.slice(0, 4) + '-' + dateString_beginTime.slice(4, 6) + '-' + dateString_beginTime.slice(6);
@@ -189,9 +191,35 @@ export default {
 
       }
 
+      // 城市报建,全市
+      let obj_cs_ps = {
+        jscType: 'jsc_bjxm_csbj_qxfl',
+        beginTime: params ? params.beginTime : store.state.cockpit_date[0],
+        endTime: params ? params.endTime : store.state.cockpit_date[1],
+        id: '460200'
+      };
+      let data_cs_ps = await QueryList(obj_cs_ps);
+      let xAxis_cs_ps = [];
+      let bat_data_cs_ps = [];
+      let line_data_cs_ps = [];
+
+      data_cs_ps.data.forEach(element => {
+        xAxis_cs_ps.push(element.name);
+        bat_data_cs_ps.push(element.sj_mj);
+        line_data_cs_ps.push(element.sj_number);
+
+      });
 
       // this.init_bjxm_cs_echart(this.szbj_echart);
-      this.changeChartsLeft();
+
+
+      this.csbj_ps_echart = {
+        xAxis: xAxis_cs_ps,
+        bat_data: bat_data_cs_ps,
+        line_data: line_data_cs_ps,
+
+      }
+
 
     },
     init_bjxm_cs_echart(data) {

+ 1 - 1
src/views/viewer.vue

@@ -172,7 +172,7 @@ export default {
             // 报建项目
             this.$refs.bjxm_ref.switch_xzqh(this.params);
             this.$refs.bjxm_ref.init_info(this.params);
-            this.$refs.bjxm_ref.init_bjxm_echart_info(this.params);
+            // this.$refs.bjxm_ref.init_bjxm_echart_info(this.params);
             // 生态修复
             this.$refs.stxf_ref.getInfo(this.params);
             this.$refs.stxf_ref.tdzz(this.params);