Browse Source

no message

linwenxin 1 year ago
parent
commit
f47aaf734c
2 changed files with 22 additions and 5 deletions
  1. 13 5
      src/layout/components/Navbar.vue
  2. 9 0
      src/permission.js

+ 13 - 5
src/layout/components/Navbar.vue

@@ -18,18 +18,18 @@
       </div>
       <!-- 右侧 -->
       <div class="right-menu">
+        <div class="right-menu-item" v-if="bigViewsBool" @click="goBigViews">
+          <el-button size="mini">数据大屏</el-button>
+        </div>
         <div class="right-menu-item">
           <el-autocomplete
             v-model="pathurl"
-            :fetch-suggestions="querySearchAsync"
+            :fetch-suggestions="querySearchAsync"s
             placeholder="搜索菜单"
             @select="handleSelect"
           ></el-autocomplete>
         </div>
-        <div style="margin-right: 20px; cursor: pointer" @click="
-          getList()
-        isShow = true
-          ">
+        <div  style="margin-right: 20px; cursor: pointer" @click="getList();isShow = true">
           <i class="el-icon-message-solid"></i>
           <el-badge :is-dot="isDot1 || isDot2"></el-badge>
         </div>
@@ -235,6 +235,9 @@ export default {
     routes() {
       return global.antRouter.filter(item => item.meta)
     },
+    bigViewsBool(){
+      return !!global.antRouter.find(item => item.code=="bigViews")
+    },
     noticeVisible() {
       return this.noticeCount > 0
     },
@@ -324,6 +327,11 @@ export default {
     this.$store.commit('app/SET_L1_PATH', this.path)
   },
   methods: {
+    goBigViews(){
+      this.$router.push({
+	  		name: 'bigViews',
+	  	})
+    },
     handlePage() {
       let link = null
       if (process.env.VUE_APP_ENV === 'production') {

+ 9 - 0
src/permission.js

@@ -64,6 +64,8 @@ router.beforeEach(async (to, from, next) => {
             if (route.code == "bigViews") {
               router.addRoutes([{
                 path: '/bigViews',
+                code: "bigViews",
+                name: "bigViews",
                 component: _import(`${route.fullUrl}/index`),
                 hidden: true
               }])
@@ -76,6 +78,13 @@ router.beforeEach(async (to, from, next) => {
           global.antRouter = []
           for (var route of store.getters.menus) {
             if (route.code == "bigViews") {
+              global.antRouter.push({
+                path: '/bigViews',
+                code: "bigViews",
+                name: "bigViews",
+                component: _import(`${route.fullUrl}/index`),
+                hidden: true
+              })
             } else if (moduleObj[route.code] !== false) {
               global.antRouter.push(...buildRoute(route, '', false))
             }