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);