From 1b6d76526936f8a0762552585f274a850c4be1c2 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Fri, 25 Feb 2022 15:46:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E5=8F=B0=E6=9D=83=E9=99=90?= =?UTF-8?q?=E3=80=81=E5=91=98=E5=B7=A5=E7=BB=84=E7=BB=87=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/system/list/staff.vue | 6 +++--- src/router/index.js | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/pages/system/list/staff.vue b/src/pages/system/list/staff.vue index 73c9ac2..f9b204a 100644 --- a/src/pages/system/list/staff.vue +++ b/src/pages/system/list/staff.vue @@ -601,12 +601,12 @@ export default { .wrap { display: flex; padding: 24px; - .side { - width: 350px; + width: 300px; + padding-right: 10px; margin-right: 24px; + border-right: 1px solid rgba(0, 0, 0, 0.06); } - .right { width: calc(100% - 374px); padding: 24px; diff --git a/src/router/index.js b/src/router/index.js index f3de9cf..af8fcd5 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -54,7 +54,7 @@ function getPermission() { // 取得路由的值,使用addRouter添加进路由里 // 该项目的路由实际上做了两层处理,一层指向了默认的路由,对应模块,用于基础布局的nav,下面一层才是实际上的路由跳转, // 所以需要默认进行赋值,实际操作时根据path去禁用掉对应的nav即可。 - const arr = ['station', 'achievement','assessment','course',"evaluation",'information','match','project','setting','student','system']; + const arr = ['achievement','assessment','course',"evaluation",'information','match','project','setting','student', 'station','system']; let permissionRouters = []; // 最后处理好的路由数组 let data = res.permissionMenu[0].children; @@ -76,7 +76,6 @@ function getPermission() { let children = []; // 第二级是按钮级数据,一级归属当前页的同级页面,实际上一共就一级路由 if (e.children && e.children.length > 0) { - console.log(e.children) e.children.forEach(i => { // 避免重复生成路由 if (i.path && permissionRouters[index] && !permissionRouters[index].children.some(e => i.path === e.path)) { @@ -228,13 +227,23 @@ function getPermission() { } }); console.log(permissionRouters, "处理好的"); + const station = permissionRouters.findIndex(e => e.name === 'station') + console.log(333, station) + if (station) { + permissionRouters[station].children.push({ + name: `stationPreview`, + path: `/station/preview`, + component: () => import("@/pages/station/preview"), + meta: { title: "实验台" } + }) + } // 把处理完成的路由,add到router里 // 记录一下路由的名称,用于nav let nav = data.map(e => e.path); router.app.$options.store.commit("routers", nav); let redirect = [{ path: "/index", - redirect: permissionRouters.find(e => e.name === 'station') ? '/station' : permissionRouters[0].path + redirect: station ? '/station' : permissionRouters[0].path }]; router.addRoutes(redirect); router.addRoutes(permissionRouters);