import Vue from 'vue' import Router from 'vue-router' Vue.use(Router) /* Layout */ import Layout from '@/layout' /* Router Modules */ // import componentsRouter from './modules/components' // import chartsRouter from './modules/charts' // import tableRouter from './modules/table' // import nestedRouter from './modules/nested' /** * Note: sub-menu only appear when route children.length >= 1 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html * * hidden: true if set true, item will not show in the sidebar(default is false) * alwaysShow: true if set true, will always show the root menu * if not set alwaysShow, when item has more than one children route, * it will becomes nested mode, otherwise not show the root menu * redirect: noRedirect if set noRedirect will no redirect in the breadcrumb * name:'router-name' the name is used by (must set!!!) * meta : { roles: ['admin','editor'] control the page roles (you can set multiple roles) title: 'title' the name show in sidebar and breadcrumb (recommend set) icon: 'svg-name'/'el-icon-x' the icon show in the sidebar noCache: true if set true, the page will no be cached(default is false) affix: true if set true, the tag will affix in the tags-view breadcrumb: false if set false, the item will hidden in breadcrumb(default is true) activeMenu: '/example/list' if set path, the sidebar will highlight the path you set } */ /** * constantRoutes * a base page that does not have permission requirements * all roles can be accessed */ export const constantRoutes = [ { path: '/redirect', component: Layout, hidden: true, children: [ { path: '/redirect/:path(.*)', component: () => import('@/views/redirect/index') } ] }, { path: '/login', component: () => import('@/views/login/index'), hidden: true }, { path: '/auth-redirect', component: () => import('@/views/login/auth-redirect'), hidden: true }, { path: '/404', component: () => import('@/views/error-page/404'), hidden: true }, { path: '/401', component: () => import('@/views/error-page/401'), hidden: true }, { path: '/', component: Layout, redirect: '/dashboard', children: [ { path: 'dashboard', component: () => import('@/views/dashboard/index'), name: 'Dashboard', meta: { title: '首页', icon: 'dashboard', affix: true } } ] } ] export const partRoutes = [ { path: '/ncs-device', component: Layout, redirect: '/ncs-device/index', children: [ { path: 'index', // component: () => import('@/views/ncs-device/index'), component: () => import('@/views/ncs-device/deviceManagement'), name: 'CallingDevice', meta: { title: '设备管理', icon: 'component', noCache: true } } ] }, { path: '/hospitalFrame', component: Layout, redirect: '/hospitalFrame/hospitalFrame', children: [ { path: 'hospitalFrame', component: () => import('@/views/hospitalFrame/hospitalFrame'), name: 'hospitalFrame', meta: { title: '医院结构', icon: 'el-icon-s-shop', noCache: true } } ] }, { path: '/frameTreeView', component: Layout, redirect: '/hospitalFrame/frameTreeView', children: [ { path: 'frameTreeView', component: () => import('@/views/hospitalFrame/frameTreeView'), name: 'hospitalFrame', meta: { title: '空间位置', icon: 'el-icon-s-shop', noCache: true } } ] }, { path: '/ncs-clerk', component: Layout, redirect: '/ncs-clerk/clerkList', children: [ { path: 'clerkList', component: () => import('@/views/ncs-clerk/clerkList'), name: 'clerkList', meta: { title: '科室员工设置', icon: 'user', noCache: true } } ] }, { path: '/customer', component: Layout, redirect: '/customer/list', children: [ { path: 'customer', component: () => import('@/views/customer/list'), name: 'customerList', meta: { title: '病人管理', icon: 'el-icon-s-custom', noCache: true } } ] }, { path: '/customerlist', component: Layout, redirect: '/customerlist/index', children: [ { path: 'index', component: () => import('@/views/customer/customerManagement'), name: 'customerManager', meta: { title: '用户管理', icon: 'el-icon-s-custom', noCache: true } } ] }, { path: '/ncs-nurse-watch', component: Layout, redirect: '/ncs-device/nurse_watch', children: [ { path: 'index', component: () => import('@/views/ncs-device/nurse_watch'), name: 'nurse_watch', meta: { title: '腕表管理', icon: 'el-icon-watch', noCache: true } } ] }, { path: '/remark', component: Layout, redirect: '/remark/index', children: [ { path: 'remark', component: () => import('@/views/ncs-remark/index'), name: 'remarkList', meta: { title: '便签管理', icon: 'el-icon-s-order', noCache: true } } ] }, { path: '/task', component: Layout, redirect: '/task/index', children: [ { path: 'task', component: () => import('@/views/ncs-task/index'), name: 'taskList', meta: { title: '任务管理', icon: 'table', noCache: true } } ] }, { path: '/ncs-interaction', component: Layout, redirect: '/ncs-interaction/index', children: [ { path: 'index', component: () => import('@/views/ncs-interaction/index'), name: 'CallingList', meta: { title: '交互历史管理', icon: 'list', noCache: true } } ] }, { path: '/calling-message', component: Layout, redirect: '/calling-message/index', children: [ { path: 'index', component: () => import('@/views/calling-message/index'), name: 'CallingMessage', meta: { title: '留言设置', icon: 'email', noCache: true } } ] }, { path: '', component: Layout, redirect: '/frameGroup/index', name: 'frameGroup', children: [ { path: '/frameGroup/index', component: () => import('@/views/hospitalFrame/frameGroup'), name: 'frameGroup', meta: { title: '区域管理', icon: 'area', noCache: true } }, { path: '/frameGroup/edit/:id?', component: () => import('@/views/hospitalFrame/frameGroupEdit'), name: 'frameGroupEdit', meta: { title: '编辑区域信息', icon: 'area', noCache: true }, hidden: true }, { path: 'nurse_watch_frame/:id?', component: () => import('@/views/hospitalFrame/nurse_watch_frame'), name: 'nurseWatchFrame', meta: { title: '腕表管理空间', icon: 'area', noCache: true }, hidden: true } ] }, { path: '', component: Layout, redirect: '/broadcast/index', children: [ { path: '/broadcast/index', component: () => import('@/views/ncs-broadcast/index'), name: 'Broadcast', meta: { title: '广播设置', icon: 'el-icon-headset', noCache: true } }, { path: '/broadcast/edit/:id?', component: () => import('@/views/ncs-broadcast/broadcastEdit'), name: 'broadcastEdit', meta: { title: '编辑广播信息', icon: 'area', noCache: true }, hidden: true } ] }, { path: '/ncs-nurse-config', component: Layout, redirect: '/ncs-nurse-config/index', children: [ { path: 'index', component: () => import('@/views/ncs-nurse-config/index'), name: 'NcsNurseConfig', meta: { title: '护理设置', icon: 'el-icon-s-goods', noCache: true } } ] }, { path: '/calling-board', component: Layout, redirect: '/calling-board/index', children: [ { path: 'index', component: () => import('@/views/calling-board/index'), name: 'CallingBoard', meta: { title: '看板设置', icon: 'el-icon-s-tools', noCache: true } } ] }, { path: '/ncs-event', component: Layout, redirect: '/ncs-event/index', children: [ { path: 'index', component: () => import('@/views/ncs-event/index'), name: 'eventList', meta: { title: '按钮事件管理', icon: 'el-icon-notebook-2', noCache: true } } ] }, { path: '/calling-deviceregisterparams', component: Layout, redirect: '/deviceregisterparams/index', children: [ { path: 'index', component: () => import('@/views/calling-deviceRegisterParam/index'), name: 'deviceRegisterParam', meta: { title: '设备自动注册参数', icon: 'params', noCache: true } } ] }, { path: '/calling-setting', component: Layout, redirect: '/calling-setting/index', children: [ { path: 'index', component: () => import('@/views/calling-setting/index'), name: 'CallingSetting', meta: { title: '系统设置', icon: 'el-icon-s-tools', noCache: true } } ] }, { path: '*', redirect: '/404', hidden: true } ] export const hospitalRoutes = [ { path: '/hospital/ncs_frame', component: Layout, redirect: '/ncs_frame/index', children: [ { path: 'index', component: () => import('@/views/hospital/ncs_frame/frameTreeView'), name: 'hospital_frameTreeView', meta: { title: '空间管理', icon: 'component', noCache: true } } ] }, { path: '*', redirect: '/404', hidden: true } ] export const adminRoutes = [ { path: '/ncs-device', component: Layout, redirect: '/ncs-device/device-admin', children: [ { path: 'index', component: () => import('@/views/ncs-device/device-admin'), name: 'CallingDeviceAdmin', meta: { title: '所有设备', icon: 'component', noCache: true } } ] }, { path: '/calling-ncError', component: Layout, redirect: '/calling-ncError/index', children: [ { path: 'index', component: () => import('@/views/calling-ncError/index'), name: 'CallingNcError', meta: { title: '错误日志', icon: 'bug', noCache: true } } ] }, { path: '/ncs-nurse-config', component: Layout, redirect: '/ncs-nurse-config/index', children: [ { path: 'index', component: () => import('@/views/ncs-nurse-config/index'), name: 'CallingNcConfig', meta: { title: '系统参数', icon: 'nested', noCache: true } } ] }, { path: '/calling-partInfoSetting', component: Layout, children: [ { path: 'index/:id?', component: () => import('@/views/ncs-orginazition/partInfoSetting'), name: 'partInfoSetting', meta: { title: '科室设置', icon: 'nested', noCache: true }, hidden: true } ] }, { path: '/calling-menu', component: Layout, children: [ { path: 'index', component: () => import('@/views/ncs-menu/menuManager'), name: 'menuSetting', meta: { title: '菜单管理', icon: 'function', noCache: true } } ] }, { path: '/ncs-orginazition', component: Layout, children: [ { path: 'index', component: () => import('@/views/ncs-orginazition/index'), name: 'orginazition', meta: { title: '组织机构', icon: 'tree', noCache: true } } ] }, { path: '/ncs-rolemanager', component: Layout, children: [ { path: 'index', component: () => import('@/views/ncs-auth/superadmin/defaultRoleManager'), name: 'rolemanager', meta: { title: '角色功能', icon: 'authen', noCache: true } } ] }, { path: '*', redirect: '/404', hidden: true } ] const createRouter = () => new Router({ mode: 'history', // require service support scrollBehavior: () => ({ y: 0 }), routes: constantRoutes }) const router = createRouter() // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 export function resetRouter() { const newRouter = createRouter() router.matcher = newRouter.matcher // reset router } export default router