123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470 |
- 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 <keep-alive> (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
|