gcz hace 2 años
padre
commit
1456dc64f9
Se han modificado 3 ficheros con 111 adiciones y 5 borrados
  1. 1 1
      src/components/echarts.vue
  2. 30 0
      src/service/mock.js
  3. 80 4
      src/views/index.vue

+ 1 - 1
src/components/echarts.vue

@@ -76,7 +76,7 @@ export default {
   },
   },
   methods: {
   methods: {
     intChar(charUuid){
     intChar(charUuid){
-      console.log('intChar charUuid',charUuid);
+      // console.log('intChar charUuid',charUuid);
       // console.log('this.uuid 前',this.uuid);
       // console.log('this.uuid 前',this.uuid);
       // // this.uuid = idGen();
       // // this.uuid = idGen();
       // console.log('this.uuid 后',this.uuid);
       // console.log('this.uuid 后',this.uuid);

+ 30 - 0
src/service/mock.js

@@ -45,6 +45,36 @@ export const page2echarts02 = () =>
         prefixUrl: 'api1',
         prefixUrl: 'api1',
     })
     })
 
 
+export const page5numerical = () =>
+    callApi({
+        url: 'page5numerical',
+        prefixUrl: 'api1',
+    })
+
+export const page5echarts01 = () =>
+    callApi({
+        url: 'page5echarts01',
+        prefixUrl: 'api1',
+    })
+
+export const page5echarts02 = () =>
+    callApi({
+        url: 'page5echarts02',
+        prefixUrl: 'api1',
+    })
+
+export const page6numerical = () =>
+    callApi({
+        url: 'page6numerical',
+        prefixUrl: 'api1',
+    })
+
+export const page6echarts01 = () =>
+    callApi({
+        url: 'page6echarts01',
+        prefixUrl: 'api1',
+    })
+
 // export const mockPostDel = (data) =>
 // export const mockPostDel = (data) =>
 //     callApi({
 //     callApi({
 //         url: 'mock/postDel',
 //         url: 'mock/postDel',

+ 80 - 4
src/views/index.vue

@@ -25,10 +25,17 @@
       <MyEcharts class="blur-wrap u-m-t u-p-t" mid="page2Char2" :option="page2Char2" ref="page2Char2" height="40vh" />
       <MyEcharts class="blur-wrap u-m-t u-p-t" mid="page2Char2" :option="page2Char2" ref="page2Char2" height="40vh" />
     </section>
     </section>
 
 
+    <!-- 林业经济 -->
     <section class="left-wrap " v-if="page==5">
     <section class="left-wrap " v-if="page==5">
-      <Numerical class="blur-wrap" :data="page1numerical" />
-      <MyEcharts class="blur-wrap u-p-t" :option="page1Char1" height="30vh" />
-      <MyEcharts class="blur-wrap u-m-t u-p-t" :option="page1Char2" height="30vh" />
+      <Numerical class="blur-wrap" :data="page5numerical" />
+      <MyEcharts class="blur-wrap u-p-t" mid="page5Char1" ref="page5Char1" :option="page5Char1" height="30vh" />
+      <MyEcharts class="blur-wrap u-m-t u-p-t" mid="page5Char2" ref="page5Char2" :option="page5Char2" height="30vh" />
+    </section>
+
+    <!-- 林业经济 -->
+    <section class="left-wrap " v-if="page==6">
+      <Numerical class="blur-wrap" :data="page6numerical" />
+      <MyEcharts class="blur-wrap u-p-t" mid="page6Char1" ref="page6Char1" :option="page6Char1" height="30vh" />
     </section>
     </section>
     
     
     <section class="right-wrap">
     <section class="right-wrap">
@@ -67,6 +74,11 @@
     alarmDataApi,
     alarmDataApi,
     page2echarts01,
     page2echarts01,
     page2echarts02,
     page2echarts02,
+    page5numerical,
+    page5echarts01,
+    page5echarts02,
+    page6numerical,
+    page6echarts01,
   } from "../service/index"
   } from "../service/index"
 
 
   // import { provinceAndCityData, regionData, provinceAndCityDataPlus, regionDataPlus, CodeToText, TextToCode } from 'element-china-area-data';
   // import { provinceAndCityData, regionData, provinceAndCityDataPlus, regionDataPlus, CodeToText, TextToCode } from 'element-china-area-data';
@@ -155,6 +167,11 @@
         },
         },
         page2Char1:{},
         page2Char1:{},
         page2Char2:{},
         page2Char2:{},
+        page5numerical:[],
+        page5Char1:{},
+        page5Char2:{},
+        page6numerical:[],
+        page6Char1:{},
       };
       };
     },
     },
     created(){
     created(){
@@ -193,6 +210,15 @@
         }else if(index==2){
         }else if(index==2){
           this.getPage2echarts01();
           this.getPage2echarts01();
           this.getPage2echarts02();
           this.getPage2echarts02();
+        }else if(index==5){
+          this.getPage5numerical();
+          this.getPage5echarts01();
+          this.getPage5echarts02();
+        }
+        else if(index==6){
+          this.getPage6numerical();
+          this.getPage6echarts01();
+          this.getAlarmData();
         }
         }
       },
       },
       getPage1echarts01(){
       getPage1echarts01(){
@@ -247,11 +273,61 @@
           // console.log('res',res);
           // console.log('res',res);
           this.page2Char2 = res.data;
           this.page2Char2 = res.data;
           let charUuid = this.$refs.page2Char2.mid;
           let charUuid = this.$refs.page2Char2.mid;
-          this.$refs.page2Char1.intChar(charUuid)
+          this.$refs.page2Char2.intChar(charUuid)
         }).catch(err=>{
         }).catch(err=>{
           console.log('getPage2echarts02 err',err);
           console.log('getPage2echarts02 err',err);
         })
         })
       },
       },
+      
+      getPage5numerical(){
+        //第一屏统计
+        page5numerical().then(res=>{
+          // console.log('res',res);
+          this.page5numerical = res.data;
+        }).catch(err=>{
+          console.log('echarts01 err',err);
+        })
+      },
+       getPage5echarts01(){
+        page5echarts01().then(res=>{
+          // console.log('res',res);
+          this.page5Char1 = res.data;
+          let charUuid = this.$refs.page5Char1.mid;
+          this.$refs.page5Char1.intChar(charUuid)
+        }).catch(err=>{
+          console.log('getPage5echarts01 err',err);
+        })
+      },
+      getPage5echarts02(){
+        page5echarts02().then(res=>{
+          // console.log('res',res);
+          this.page5Char2 = res.data;
+          let charUuid = this.$refs.page5Char2.mid;
+          this.$refs.page5Char1.intChar(charUuid)
+        }).catch(err=>{
+          console.log('getPage5echarts02 err',err);
+        })
+      },
+
+      getPage6numerical(){
+        //第一屏统计
+        page6numerical().then(res=>{
+          // console.log('res',res);
+          this.page6numerical = res.data;
+        }).catch(err=>{
+          console.log('getPage6numerical err',err);
+        })
+      },
+       getPage6echarts01(){
+        page6echarts01().then(res=>{
+          // console.log('res',res);
+          this.page6Char1 = res.data;
+          let charUuid = this.$refs.page6Char1.mid;
+          this.$refs.page6Char1.intChar(charUuid)
+        }).catch(err=>{
+          console.log('getPage6echarts01 err',err);
+        })
+      },
 
 
     },
     },
   }
   }