Prechádzať zdrojové kódy

切换专题时,当前选中地图区域不变化,树种改为林木结构,林业经济改为林下经济,土地流转与林下经济换位置

gcz 2 rokov pred
rodič
commit
8b8e820154
1 zmenil súbory, kde vykonal 15 pridanie a 13 odobranie
  1. 15 13
      src/views/index.vue

+ 15 - 13
src/views/index.vue

@@ -115,12 +115,12 @@
         // addrOptions: regionDataPlus,
         addrSelectedOptions: ['520000',''],
         navList:[
-          {text:'森林资源'},
-          {text:'树种'},
-          {text:'碳汇管理'},
-          {text:'土地流转'},
-          {text:'林业经济'},
-          {text:'事件信息'},
+          {text:'森林资源',en:'forest'},
+          {text:'林木结构',en:'treeSpecies'},
+          {text:'碳汇管理',en:'sink'},
+          {text:'林下经济',en:'economics'},
+          {text:'土地流转',en:'circulation'},
+          {text:'事件信息',en:'event'},
         ],
         scrollBoardKey:Date.now(),
         scrollBoardStyle:{
@@ -192,13 +192,15 @@
            Message('暂未开放!')
           return
         }
-        this.$store.dispatch('searchArea', {
-          parentId: '520000',
-          name: '贵州省',
-          mapLevel: 'province'
-        });
-        let pageLabel = ['forest','treeSpecies','sink','circulation','economics','event']
-        this.$store.commit('changePage',pageLabel[index-1]);
+
+        // 切换专题时,重置区域
+        // this.$store.dispatch('searchArea', {
+        //   parentId: '520000',
+        //   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();
       },