import layoutHeaderAside from '@/layout/header-aside' // 由于懒加载页面太多的话会造成webpack热更新太慢,所以开发环境不使用懒加载,只有生产环境使用懒加载 const _import = require('@/libs/util.import.' + process.env.NODE_ENV) /** * 在主框架内显示 */ const frameIn = [ { path: '/', redirect: { name: 'index' }, component: layoutHeaderAside, children: [ // 首页 { path: 'index_1', name: 'index_1', meta: { auth: true }, component: _import('system/index') }, { path: 'index', name: 'index', meta: { auth: true }, component: _import('system/index') }, { path: 'page2', name: 'page2', meta: { title: '页面 2', auth: true }, component: _import('demo/page2') }, { path: 'page3', name: 'page3', meta: { title: '页面 3', auth: true }, component: _import('demo/page3') }, // 设备管理 { path: 'instrument', name: 'instrument', meta: { title: '设备管理', auth: true }, component: _import('instrument') }, // 人员管理 { path: 'personnel', name: 'personnel', meta: { title: '人员管理', auth: true }, component: _import('personnel') }, // 班级管理 { path: 'class', name: 'class', meta: { title: '班级管理', auth: true }, component: _import('class') }, // 值班管理 { path: 'duty', name: 'duty', meta: { title: '值班管理', auth: true }, component: _import('duty') }, { path: '/duty/detail', name: 'dutyDetailEdit', meta: { title: '值班详情', auth: true, cache: true }, component: _import('duty/detail/index') }, // 信息发布 { path: 'information', name: 'information', meta: { title: '信息发布', auth: true }, component: _import('information') }, // 课程管理 { path: 'course', name: 'course', meta: { title: '课程管理', auth: true }, component: _import('course') }, // 课程详情 { path: '/course/detail', name: 'courseDetailEdit', meta: { title: '课程详情', auth: true, cache: true }, component: _import('course/detail/index') }, // 系统 前端日志 { path: 'log', name: 'log', meta: { title: '前端日志', auth: true }, component: _import('system/log') }, // 刷新页面 必须保留 { path: 'refresh', name: 'refresh', hidden: true, component: _import('system/function/refresh') }, // 页面重定向 必须保留 { path: 'redirect/:route*', name: 'redirect', hidden: true, component: _import('system/function/redirect') }, // mypage { path: '/mypage', name: 'mypage', meta: { title: 'mypage-示例页面', auth: true }, component: _import('mypage') }, { path: 'sysadmin/organize', name: 'organizes', meta: { title: '部门管理', auth: true, cache: true }, component: _import('sysadmin/organize/index') }, { path: 'sysadmin/user', name: 'user', meta: { title: '用户管理', auth: true, cache: true }, component: _import('sysadmin/user/index') }, { path: 'sysadmin/role', name: 'role', meta: { title: '角色管理', auth: true, cache: true }, component: _import('sysadmin/role/index') }, { path: 'sysadmin/menu', name: 'menu', meta: { title: '菜单管理', auth: true, cache: true }, component: _import('sysadmin/menu/index') }, { path: 'module01', name: 'module01', meta: { title: 'frame测试', auth: true, cache: true }, component: _import('system/module/module01') }, { path: '/setuser/userset', name: 'setuser', meta: { title: '设置用户信息', auth: true }, component: _import('setuser/userset') }, { path: '/setuser/passwordset', name: 'setuserpassword', meta: { title: '密码修改', auth: true }, component: _import('setuser/passwordset') }, // 工作流 { path: '/workflow/edit', name: 'editWorkflow', meta: { title: '部门管理', auth: true, cache: true }, component: _import('workflow/edit/index') }, // 测试相关--学生 { path: '/demo/student', name: 'student', meta: { title: '学生管理', auth: true, cache: true }, component: _import('demo/student/index') }, // 测试相关调用微服务接口--学生 { path: '/micro/student', name: 'student2', meta: { title: '学生管理2', auth: true, cache: true }, component: _import('micro/student/index') }, // ================== add 字典分类 08-12 s ==================== { path: '/sysadmin/item', name: 'itemEdit', meta: { title: '字典分类', auth: true, cache: true }, component: _import('sysadmin/item/index') }, // 字典项 { path: '/sysadmin/itemdetail', name: 'itemDetailEdit', meta: { title: '字典项', auth: true, cache: true }, component: _import('sysadmin/item_detail/index') }, // 房间管理 { path: 'managingrooms', name: 'managingrooms', meta: { title: '实验室管理', auth: true }, component: _import('managingrooms') }, // 运行记录 { path: 'instrument/instrumenrunrecord', name: 'instrument/instrumenrunrecord', meta: { title: '运行记录', auth: true }, component: _import('instrument/instrumenrunrecord') }, // 维护保养 { path: 'instrument/maintainlog', name: 'instrument/maintainlog', meta: { title: '维护保养', auth: true }, component: _import('instrument/maintainlog') }, // 确认及报废 { path: 'instrument/confirmandscrap', name: 'instrument/confirmandscrap', meta: { title: '确认及报废', auth: true }, component: _import('instrument/confirmandscrap') } ] } ] /** * 在主框架之外显示 */ const frameOut = [ // 登录 { path: '/login', name: 'login', component: _import('system/login') }, { path: '/page1', name: 'page1', component: _import('demo/page1') } ] /** * 错误页面 */ const errorPage = [ { path: '*', name: '404', component: _import('system/error/404') } ] // 导出需要显示菜单的 export const frameInRoutes = frameIn // 重新组织后导出 export default [...frameIn, ...frameOut, ...errorPage]