Browse Source

菜单ETA社区跳转

jwyu 11 months ago
parent
commit
1b39c06ec6
5 changed files with 33 additions and 3 deletions
  1. 1 0
      config/dev.env.js
  2. 1 0
      config/prod.env.js
  3. 1 0
      config/prod.test.env.js
  4. 29 2
      src/views/Home.vue
  5. 1 1
      src/views/Login.vue

+ 1 - 0
config/dev.env.js

@@ -15,4 +15,5 @@ module.exports = merge(prodEnv, {
   VUE_APP_ETA_DOCS:'"http://8.136.199.33:8622/update/index"',
 	VUE_APP_ETA_HELP_DOCS:'"http://8.136.199.33:8622/help/index"',
     VUE_APP_ETA_VIDEO:'"http://8.136.199.33:8622/video/list"',
+    VUE_APP_ETA_FORUM:'"http://8.136.199.33:8901/"',
 });

+ 1 - 0
config/prod.env.js

@@ -12,5 +12,6 @@ module.exports = {
 	VUE_APP_ETA_DOCS:'"https://etadocs.hzinsights.com/update/index"',
 	VUE_APP_ETA_HELP_DOCS:'"https://etadocs.hzinsights.com/help/index"',
 	VUE_APP_ETA_VIDEO:'"https://etadocs.hzinsights.com/video/list"',
+	VUE_APP_ETA_FORUM:'"http://8.136.199.33:8901/"',
 		
 }

+ 1 - 0
config/prod.test.env.js

@@ -12,4 +12,5 @@ module.exports = {
 	VUE_APP_ETA_DOCS:'"http://8.136.199.33:8622/update/index"',
 	VUE_APP_ETA_HELP_DOCS:'"http://8.136.199.33:8622/help/index"',
 	VUE_APP_ETA_VIDEO:'"http://8.136.199.33:8622/video/list"',
+	VUE_APP_ETA_FORUM:'"http://8.136.199.33:8901/"',
 }

+ 29 - 2
src/views/Home.vue

@@ -38,12 +38,33 @@
               <template v-for="(item, index) in navlists">
                 <el-menu-item
                   :path="item.level_path"
-                  :index="item.level_path"
+                  :index="item.level_path==='etaForum'?null:item.level_path"
                   :key="item.level_path"
                   :style="!isCollapse ? 'text-align:left' : ''"
                   v-if="item.IsLevel === 1&&!item.hidden"
                 >
+                  <span class="el-level-path" v-if="item.path==='etaForum'" @click.prevent="handleGoETAForum">
+                    <img
+                      :src="getMenuIcon(item)"
+                      alt=""
+                      style="width: 24px; height: 24px"
+                    />
+                    <span class="titleLetter" v-show="isCollapse">{{
+                      isCollapse ? MenuLetterMap[item.name] || "" : ""
+                    }}</span>
+                    <span
+                      style="
+                        display: inline-block;
+                        width: 96px;
+                        text-align: left;
+                        font-size: 15px;
+                        margin-left: 20px;
+                      "
+                      >{{ $i18nt.locale==='zh'?item.name:item.name_en }}</span
+                    >
+                  </span>
                   <a
+                    v-else
                     :href="`/${item.level_path}`"
                     class="el-level-path"
                     :style="`display: block;color:${
@@ -477,6 +498,7 @@ export default {
   methods: {
     getMenuIcon(item){
       const iconMap=new Map([
+        ['ETA社区',require('@/assets/icons/menu/out_link.png')],
         ['外部链接',require('@/assets/icons/menu/out_link.png')],
         ['研报管理',require('@/assets/icons/menu/yb_manager.png')],
         ['智能ppt',require('@/assets/icons/menu/ppt.png')],
@@ -781,7 +803,7 @@ export default {
           let shouldVerificationRoute=["Sysdatauth"]
           shouldVerificationRoute.map(sMenu =>{
             this.navlists.forEach(item =>{
-              if(item.children.some(menu => menu.path === sMenu || '/'+menu.path === sMenu)){
+              if(item.children&&item.children.some(menu => menu.path === sMenu || '/'+menu.path === sMenu)){
                 // 添加有权限的路由
                 this.$store.commit("ADD_PERMISSION_ROUTE", sMenu);
                 return
@@ -908,6 +930,11 @@ export default {
        this.$i18n.locale =  this.$i18n.locale == 'zh' ? 'en' : 'zh'
        localStorage.setItem('i18n',this.$i18n.locale)
     },
+
+    handleGoETAForum(item,e){
+      const href = `${process.env.VUE_APP_ETA_FORUM}`
+      window.open(href, '_blank')
+    }
   },
 };
 </script>

+ 1 - 1
src/views/Login.vue

@@ -412,7 +412,7 @@ export default {
                             break;
                         }
                     }
-                    return resolvePath || "/" + menuList[0].children[0].path;
+                    return resolvePath || "/" + (menuList[0].children?menuList[0].children[0].path:menuList[1].children[0].path);
                 }
                 return "/" + pathVal;
             });