瀏覽代碼

页面标识使用英文

gcz 3 年之前
父節點
當前提交
03f107e9fe
共有 1 個文件被更改,包括 21 次插入13 次删除
  1. 21 13
      src/views/index.vue

+ 21 - 13
src/views/index.vue

@@ -14,19 +14,19 @@
 
     <Alarm v-if="page==6&&alarmData.length>=1" :data="alarmData" />
 
-    <section class="left-wrap " v-if="page==1">
+    <section class="left-wrap " v-if="$store.state.addr.page=='forest'">
       <Numerical class="" :data="page1numerical" />
       <MyEcharts class="blur-wrap u-p-t" mid="page1Char1" ref="page1Char1" :option="page1Char1" height="30vh" style="padding-left:20px" />
       <MyEcharts class="blur-wrap u-m-t u-p-t" mid="page1Char2" ref="page1Char2" :option="page1Char2" height="30vh" style="padding-left:20px" />
     </section>
 
-    <section class="left-wrap " v-if="page==2">
+    <section class="left-wrap " v-if="$store.state.addr.page=='treeSpecies'">
       <MyEcharts class="blur-wrap u-p-t" mid="page2Char1" :option="page2Char1" ref="page2Char1" height="30vh" />
       <MyEcharts class="blur-wrap u-m-t u-p-t" mid="page2Char2" :option="page2Char2" ref="page2Char2" height="40vh" />
     </section>
 
     <!-- 林业经济 -->
-    <section class="left-wrap " v-if="page==5">
+    <section class="left-wrap " v-if="$store.state.addr.page=='economics'">
       <Typeslide :data="typeSlideData" />
       <Numerical class="" :data="page5numerical" />
       <MyEcharts class="blur-wrap u-p-t" mid="page5Char1" ref="page5Char1" :option="page5Char1" height="30vh" />
@@ -34,7 +34,7 @@
     </section>
 
     <!-- 事件信息 -->
-    <section class="left-wrap " v-if="page==6">
+    <section class="left-wrap " v-if="$store.state.addr.page=='event'">
       <Numerical class="" :data="page6numerical" />
       <MyEcharts class="blur-wrap u-p-t" mid="page6Char1" ref="page6Char1" :option="page6Char1" height="30vh" />
     </section>
@@ -187,8 +187,11 @@
         console.log('addrChange',value);
       },
       navClick(index){
-        // console.log('index',index);
-        if(index==3||index==4){
+        this.$store.commit('changePage',this.navList[index-1].en);
+        console.log('this.navList[index-1].en',this.navList[index-1].en);
+        this.page = index;
+        console.log('index',index);
+        if(this.$store.state.addr.page=='sink'||this.$store.state.addr.page=='circulation'){
            Message('暂未开放!')
           return
         }
@@ -199,32 +202,37 @@
         //   name: '贵州省',
         //   mapLevel: 'province'
         // });
-        this.$store.commit('changePage',this.navList[index-1].en);
-        console.log('this.navList[index-1].en',this.navList[index-1].en);
-        this.page = index;
+        
         this.getPageData();
       },
       getPageData(){
         debounce(this.debounceGetData, 1000, true)
       },
       debounceGetData(){
-        if(this.page==1){
+        console.log('page',this.$store.state.addr.page);
+        // {text:'森林资源',en:'forest'},
+        //   {text:'林木结构',en:'treeSpecies'},
+        //   {text:'碳汇管理',en:'sink'},
+        //   {text:'林下经济',en:'economics'},
+        //   {text:'土地流转',en:'circulation'},
+        //   {text:'事件信息',en:'event'},
+        if(this.$store.state.addr.page=='forest'){
           this.getPage1numerical();
           this.getPage1echarts01();
           this.getPage1echarts02();
           this.getRightScrollData();
-        }else if(this.page==2){
+        }else if(this.$store.state.addr.page=='treeSpecies'){
           this.getPage2echarts01();
           this.getPage2echarts02();
           this.getRightScrollData();
-        }else if(this.page==5){
+        }else if(this.$store.state.addr.page=='economics'){
           this.getPage5numerical();
           this.getTypeSlideData();
           this.getPage5echarts01();
           this.getPage5echarts02();
           this.getRightScrollData();
         }
-        else if(this.page==6){
+        else if(this.$store.state.addr.page=='event'){
           this.getPage6numerical();
           this.getPage6echarts01();
           this.getAlarmData();