Ver Fonte

首页请求地址及固定菜单栏联动逻辑实现

ming há 3 anos atrás
pai
commit
684ea89371

+ 1 - 1
src/layout/vab-avatar/index.vue

@@ -116,7 +116,7 @@ export default {
       }
     },
     goAlarmingPage() {
-      this.$router.push('/alarmManage/index')
+      this.$router.push('/alarmManage')
     },
 
      async closeAllTabs() {

+ 52 - 10
src/store/modules/routes.js

@@ -53,13 +53,32 @@ const actions = {
             store.state.auth = 1
         }
         data[0].meta.affix = false
-        data[0].children[0].meta.affix = true
+
+
+        //根据首页请求地址动态配置affix的标签项
+        if (store.state.homePageUrl) {
+            data.forEach(function(item) {
+                item.children.forEach(function(aa) {
+                    if (aa.component == store.state.homePageUrl) {
+                        aa.meta.affix = true
+                    }
+                })
+            })
+
+        } else {
+            data[0].children[0].meta.affix = true
+
+        }
+
+
+
+
 
 
         // data.unshift({
-        //     path: "/home",
+        //     path: "/",
         //     hidden: false,
-        //     redirect: "/index/index",
+        //     redirect: "/index",
         //     component: "Layout",
         //     meta: {
         //         title: "数据看板",
@@ -67,11 +86,11 @@ const actions = {
 
         //     },
         //     children: [{
-        //         path: "/index/index",
+        //         path: "index",
         //         hidden: false,
-        //         component: "@/views/index/index",
+        //         component: "@/views/index",
         //         meta: {
-        //             title: "数据看板",
+        //             title: "数据看板1",
         //             icon: "home",
         //             affix: true
 
@@ -79,6 +98,29 @@ const actions = {
         //     }]
         // })
 
+        // data.push({
+        //     path: "/alarmManage",
+        //     hidden: false,
+        //     redirect: "/alarmManage/index",
+        //     component: "Layout",
+        //     meta: {
+        //         title: "告警管理",
+        //         icon: "alarmManage",
+
+        //     },
+        //     children: [{
+        //         meta: {
+        //             title: "告警管理",
+        //             icon: "alarmManage",
+
+        //         },
+        //         path: "/alarmManage",
+        //         hidden: false,
+        //         component: "@/views/alarmManage/index",
+
+        //     }, ]
+        // }, )
+
 
 
 
@@ -119,9 +161,9 @@ const actions = {
                     icon: "statisManage",
 
                 },
-                path: "/loginLog",
+                path: "loginLog",
                 hidden: false,
-                component: "@/views/statisManage/loginLog",
+                component: "@/views/statisManage/loginLog/index",
 
             }, {
                 meta: {
@@ -129,9 +171,9 @@ const actions = {
                     icon: "statisManage",
 
                 },
-                path: "/operLog",
+                path: "operLog",
                 hidden: false,
-                component: "@/views/statisManage/operLog",
+                component: "@/views/statisManage/operLog/index",
 
             }]
         })

+ 9 - 8
src/vab/plugins/permissions.js

@@ -77,16 +77,17 @@ router.beforeEach(async(to, from, next) => {
                     if (store.state.middleStatus == 1 && store.state.firstMiddleState == true) {
                         next('/middle')
                     } else {
-                        // alert(store.state.homePageUrl)
-                        next(accessRoutes[0].children[0].path)
-                            // if (store.state.homePageUrl) {
-                            //     var pathUrl = (store.state.homePageUrl).slice(8);
-                            //     next(pathUrl)
+                        var aa = (store.state.homePageUrl).slice(7)
+                        var bb = aa.slice(0, -6)
 
-                        // } else {
-                        //     next(accessRoutes[0].children[0].path)
+                        // 首页请求地址动态配置
+                        if (store.state.homePageUrl) {
+                            var pathUrl = bb
+                            next(pathUrl)
+                        } else {
+                            next(accessRoutes[0].children[0].path)
 
-                        // }
+                        }
 
                     }
 

+ 3 - 3
src/views/tenantManage/tenantUnit/index.vue

@@ -55,7 +55,7 @@
           ></el-input>
         </div>
         <div class="filter-item">
-          试用租户/正式租户:
+          客户类型:
           <el-select
             v-model="tenantType"
             placeholder="请选择"
@@ -63,8 +63,8 @@
             clearable
             :disabled="store.state.authorities.indexOf('查询') == -1"
           >
-            <el-option label="试用户" :value="0"></el-option>
-            <el-option label="正式户" :value="1"></el-option>
+            <el-option label="试用户" :value="0"></el-option>
+            <el-option label="正式户" :value="1"></el-option>
           </el-select>
         </div>
         <div class="filter-item">