import Vue from 'vue' import Router from 'vue-router' import i18n from '@/utils/i18n' // eslint-disable-next-line no-unused-vars // import { uiVersion } from 'domain' Vue.use(Router) /* Layout */ import Layout from '@/layout' const uiVersion = domain.uiVersion /* 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: i18n.t('tab.home'), icon: 'dashboard', affix: true } } ] }, { path: '/vital_sign_log', component: () => import('@/views/vital-sign/index'), hidden: true } ] // 科室级页面 export const partRoutes = [ { path: '/frameTreeView', component: Layout, redirect: '/hospitalFrame/frameTreeView', children: [ { path: 'frameTreeView', component: () => import('@/views/hospitalFrame/frameTreeView'), name: 'hospitalFrame', meta: { title: i18n.t('tab.frameManage'), icon: 'tree', noCache: true } // 空间位置 } ] }, { path: '/', component: Layout, name: 'part-device', meta: { title: i18n.t('tab.deviceManage'), icon: 'component' }, children: [ { path: 'ncs-device', component: () => import('@/views/ncs-device/deviceManagement'), name: 'CallingDevice', meta: { title: i18n.t('tab.deviceManage'), icon: 'component', noCache: true } // 所有设备 }, { path: 'ncs-nurse-watch', component: () => import('@/views/ncs-device/nurse_watch'), name: 'nurse_watch', meta: { title: i18n.t('tab.mobileDeviceManage'), icon: 'el-icon-watch', noCache: true } // 移动设备 }, { path: 'ncs-user-watch', component: () => import('@/views/ncs-device/user_watch'), name: 'user_watch', meta: { title: i18n.t('tab.userLocationManage'), icon: 'el-icon-watch-1', noCache: true } // 用户设备 }, { path: 'ncs-sos-device', component: () => import('@/views/ncs-sos-device-setting/sos_device_setting'), name: 'sos-device-setting', meta: { title: i18n.t('tab.sosDeviceSettingManage'), icon: 'el-icon-s-help', noCache: true } // 报警设备 }, { path: 'myMapHtml', component: () => import('@/views/customer/myMapHtml'), name: 'myMapHtml', meta: { title: i18n.t('customerManage.footprint'), icon: 'area', noCache: true }, // 足迹 hidden: true } ] }, // { // 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: i18n.t('tab.deviceManage'), icon: 'component', noCache: true } // 所有设备 // } // ] // }, { path: '/ncs-clerk', component: Layout, redirect: '/ncs-clerk/clerkList', children: [ { path: 'clerkList', component: () => import('@/views/ncs-clerk/clerkManagement'), name: 'clerkList', meta: { title: i18n.t('tab.clerkManage'), icon: 'peoples', noCache: true } } ] }, { path: '/entrace-guard', component: Layout, redirect: '/entrace-guard/users', children: [ { path: 'users', component: () => import('@/views/entrace-guard/users'), name: 'users', meta: { title: i18n.t('tab.entraceguardUser'), icon: 'pass_through', noCache: true } }] }, { path: '/ncs-clerk-frame-manage', component: Layout, redirect: '/ncs-clerk-frame-manage/index', children: [ { path: 'clerkList', component: () => import('@/views/ncs-clerk-frame-manage/index'), name: 'clerkList', meta: { title: i18n.t('tab.staffManageFrames'), icon: 'frame_manage', 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: () => uiVersion === 1 ? import('@/views/customer/patientManagement') : uiVersion === 2 ? import('@/views/customer/customerManagement') : import('@/views/customer/elderlyCareManagement'), name: uiVersion === 1 ? 'patientManagement' : uiVersion === 2 ? 'customerManager' : 'elderlyCareManager', meta: { title: uiVersion === 1 ? i18n.t('tab.patientManage') : i18n.t('tab.customerManage'), icon: 'el-icon-s-custom', noCache: true } }, { path: '/allMap', component: () => import('@/views/customer/allMap'), name: 'allMap', meta: { title: '用户分布', icon: 'area', noCache: true }, hidden: true }, { path: '/advice/:id?', component: () => import('@/views/ncs-advice/index'), name: 'advice', meta: { title: i18n.t('tab.customerAdvice'), icon: 'area', noCache: true }, hidden: 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: i18n.t('tab.mobileDeviceManage'), icon: 'el-icon-watch', noCache: true } // 移动设备 // }, // { // path: '/myMapHtml', // component: () => import('@/views/customer/myMapHtml'), // name: 'myMapHtml', // meta: { title: i18n.t('customerManage.footprint'), icon: 'area', noCache: true }, // hidden: true // } // ] // }, // { // path: '/ncs-user-watch', // component: Layout, // redirect: '/ncs-device/user_watch', // children: [ // { // path: 'index', // component: () => import('@/views/ncs-device/user_watch'), // name: 'user_watch', // meta: { title: i18n.t('tab.userLocationManage'), icon: 'el-icon-watch', noCache: true } // } // ] // }, // { // path: '/ncs-sos-device', // component: Layout, // redirect: '/ncs-device/sos_device', // children: [ // { // path: 'index', // component: () => import('@/views/ncs-sos-device-setting/sos_device_setting'), // name: 'sos-device-setting', // meta: { title: i18n.t('tab.sosDeviceSettingManage'), icon: 'el-icon-s-help', noCache: true } // } // ] // }, { path: '/ncs-channel', component: Layout, redirect: '/ncs-channel/index', children: [ { path: 'index', component: () => import('@/views/ncs-channel/index'), name: 'ncsChannel', meta: { title: i18n.t('tab.channelManage'), icon: 'el-icon-mobile-phone', noCache: true } }, { path: '/ncs-channel/history/:id?', component: () => import('@/views/ncs-channel/channelImHistory'), name: 'channelImHistory', meta: { title: i18n.t('tab.channelImHistory'), icon: 'area', noCache: true }, hidden: true } ] }, { path: '/remark', component: Layout, redirect: '/remark/index', children: [ { path: 'remark', component: () => import('@/views/ncs-remark/index'), name: 'remarkList', meta: { title: i18n.t('tab.remarkManage'), 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: i18n.t('tab.taskManage'), 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: i18n.t('tab.interactionHistory'), 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: i18n.t('tab.frameGroupManage'), icon: 'area', noCache: true } }, { path: '/frameGroup/edit/:id?', component: () => import('@/views/hospitalFrame/frameGroupEdit'), name: 'frameGroupEdit', meta: { title: i18n.t('tab.frameGroupEdit'), icon: 'area', noCache: true }, hidden: true }, { path: 'nurse_watch_frame/:id?', component: () => import('@/views/hospitalFrame/nurse_watch_frame'), name: 'nurseWatchFrame', meta: { title: i18n.t('tab.watchFrameManage'), 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: i18n.t('tab.broadcastManage'), icon: 'el-icon-headset', noCache: true } // 广播设置 }, { path: '/broadcast/edit/:id?', component: () => import('@/views/ncs-broadcast/broadcastEdit'), name: 'broadcastEdit', meta: { title: i18n.t('tab.broadcastEdit'), icon: 'area', noCache: true }, hidden: true } ], hidden: uiVersion !== 1 }, { 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: i18n.t('tab.nurseConfig'), icon: 'care1', noCache: true } // 护理参数 } ], hidden: uiVersion !== 1 }, { path: '/calling-board', component: Layout, redirect: '/calling-board/index', children: [ { path: 'index', component: () => import('@/views/calling-board/index'), name: 'CallingBoard', meta: { title: i18n.t('tab.boardManage'), icon: 'el-icon-data-board', noCache: true } } ], hidden: uiVersion === 2 }, { path: '/board-title', component: Layout, redirect: '/custom-infoboard/board-title', children: [ { path: 'index', component: () => import('@/views/custom-infoboard/board-title'), name: 'BoardTitle', meta: { title: i18n.t('tab.customBoardManage'), icon: 'designer', noCache: true } } ], hidden: uiVersion === 2 }, { path: '/calling-board-designer', component: Layout, redirect: '/custom-infoboard/screen-designer', children: [ { path: 'index/:id?', component: () => import('@/views/custom-infoboard/screen-designer'), name: 'BoardDesigner', meta: { title: i18n.t('tab.customBoardDesigner'), icon: 'el-icon-data-board', noCache: true } } ], hidden: true }, { path: '/ncs-event', component: Layout, redirect: '/ncs-event/index', children: [ { path: 'index', component: () => import('@/views/ncs-event/index'), name: 'eventList', meta: { title: i18n.t('tab.eventManage'), icon: 'el-icon-notebook-2', noCache: true } } ], hidden: uiVersion === 1 }, // { // 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: '/ncs-interaction-chars', component: Layout, redirect: '/ncs-interaction-chars/index', children: [ { path: 'index', component: () => import('@/views/ncs-chars/index'), name: 'interactionChars', meta: { title: i18n.t('tab.interactionChars'), icon: 'el-icon-pie-chart', noCache: true } } ] }, { path: '/function-mapping', component: Layout, redirect: '/function-mapping/index', children: [ { path: 'index', component: () => import('@/views/function-mapping/index'), name: 'functionMapping', meta: { title: i18n.t('tab.functionRoleMapping'), icon: 'function', noCache: true } } ] }, { path: '/countdown-config', component: Layout, redirect: '/ncs-countdown-config/index', children: [ { path: 'index', component: () => import('@/views/ncs-countdown-config/index'), name: 'countdownConfig', meta: { title: i18n.t('tab.functionRoleMapping'), icon: 'function', noCache: true } } ] }, { path: '/interaction-chain', component: Layout, redirect: '/interaction-chain/index', children: [ { path: 'index', component: () => import('@/views/interaction-chain/index'), name: 'interactionChain', meta: { title: i18n.t('tab.interactionChain'), icon: 'squence', noCache: true } } ] }, { path: '/calling-setting', component: Layout, redirect: '/calling-setting/index', children: [ { path: 'index', component: () => import('@/views/calling-setting/index'), name: 'CallingSetting', meta: { title: i18n.t('tab.partSetting'), icon: 'el-icon-s-tools', noCache: true } } ] }, { path: '/ncs_led', component: Layout, redirect: '/ncs_led/index', children: [ { path: 'index', component: () => import('@/views/ncs-led/ledManager'), name: 'part_led', meta: { title: i18n.t('tab.ledDevice'), icon: 'el-icon-message-solid', noCache: true } } ], hidden: uiVersion !== 1 }, { 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: i18n.t('tab.frameManage'), icon: 'tree', noCache: true } } ] }, { path: '/hospital/ncs_device', component: Layout, redirect: '/ncs_device/index', children: [ { path: 'index', // component: () => import('@/views/hospital/ncs_device/deviceManager'), component: () => import('@/views/hospital/deviceManagement'), name: 'hospital_deviceList', meta: { title: i18n.t('tab.deviceManage'), icon: 'component', noCache: true } } ] }, { path: '/hospital/ncs_clerk', component: Layout, redirect: '/ncs_clerk/index', children: [ { path: 'index', component: () => import('@/views/hospital/clerkManager'), name: 'hospital_clerkList', meta: { title: i18n.t('tab.clerkManage'), icon: 'peoples', noCache: true } } ] }, { path: '/hospital/ncs_customer', component: Layout, redirect: '/ncs_customer/index', children: [ { path: 'index', component: () => import('@/views/hospital/customerManagement'), name: 'hospital_customerList', meta: { title: i18n.t('tab.customerManage'), icon: 'el-icon-s-custom', noCache: true } // component: () => uiVersion === 1 ? import('@/views/customer/patientManagement') : import('@/views/customer/customerManagement'), // name: uiVersion === 1 ? 'hospital_patientList' : 'hospital_customerList', // meta: { title: uiVersion === 1 ? '入住人管理' : '用户管理', icon: 'el-icon-s-custom', noCache: true } } ] }, { path: '/hospital/ncs_led', component: Layout, redirect: '/ncs_led/index', children: [ { path: 'index', component: () => import('@/views/hospital/ledManager'), name: 'hospital_led', meta: { title: i18n.t('tab.ledDevice'), icon: 'el-icon-message-solid', noCache: true } } ] }, { path: '*', redirect: '/404', hidden: true } ] export const adminRoutes = [ { path: '/admin/ncs_frame', component: Layout, redirect: '/ncs_frame/frame-admin', children: [ { path: 'index', component: () => import('@/views/hospitalFrame/frameTreeView-admin'), name: 'CallingFrameTreeViewAdmin', meta: { title: i18n.t('tab.frameManage'), icon: 'tree', noCache: true } } ] }, { path: '/admin/ncs_clerk', component: Layout, redirect: '/ncs_clerk/clerk-admin', children: [ { path: 'index', component: () => import('@/views/ncs-clerk/clerk-admin'), name: 'CallingClerkAdmin', meta: { title: i18n.t('tab.allClerk'), icon: 'peoples', noCache: true } } ] }, { path: '/admin/ncs_customer', component: Layout, redirect: '/ncs_customer/customer-admin', children: [ { path: 'index', component: () => import('@/views/customer/customer-admin'), name: 'CallingCustomerAdmin', meta: { title: i18n.t('tab.allCustomer'), icon: 'el-icon-s-custom', noCache: true } // component: () => uiVersion === 1 ? import('@/views/customer/patientManagement') : import('@/views/customer/customerManagement'), // name: uiVersion === 1 ? 'hospital_patientList' : 'hospital_customerList', // meta: { title: uiVersion === 1 ? '入住人管理' : '用户管理', icon: 'el-icon-s-custom', noCache: true } } ] }, { path: '/admin/ncs-device', component: Layout, redirect: '/ncs-device/device-admin', children: [ { path: 'index', component: () => import('@/views/ncs-device/device-admin'), name: 'CallingDeviceAdmin', meta: { title: i18n.t('tab.allDevice'), icon: 'component', noCache: true } } ] }, { path: '/admin/ncs_event', component: Layout, redirect: '/ncs-event/event', children: [ { path: 'index', component: () => import('@/views/ncs-event/eventManagement'), name: 'EventManagement', meta: { title: i18n.t('tab.eventManage'), icon: 'el-icon-notebook-2', noCache: true } } ] }, { path: '/admin/ncs-his', component: Layout, redirect: '/ncs-his/hisManager', children: [ { path: 'index', component: () => import('@/views/ncs-his/hisManagement'), name: 'hisManagement', meta: { title: i18n.t('tab.hisManage'), icon: 'el-icon-search', noCache: true } }, { path: 'patientManage/:keyval?', component: () => import('@/views/ncs-his/his-patient/hisPatientManage'), name: 'hisPatientManage', meta: { title: i18n.t('his.hisPatient'), icon: 'el-icon-search', noCache: true }, hidden: true }, { path: 'clerkManage/:keyval?', component: () => import('@/views/ncs-his/his-clerk/hisClerkManager'), name: 'hisClerkManage', meta: { title: i18n.t('his.hisClerk'), icon: 'el-icon-search', noCache: true }, hidden: true }, { path: 'nurseConfigManage/:keyval?', component: () => import('@/views/ncs-his/his-nurse-config/hisNurseConfigManager'), name: 'hisNurseConfigManage', meta: { title: i18n.t('his.hisNurseConfig'), icon: 'el-icon-search', noCache: true }, hidden: true } ] }, { path: '/calling-ncError', component: Layout, redirect: '/calling-ncError/index', children: [ { path: 'index', component: () => import('@/views/calling-ncError/index'), name: 'CallingNcError', meta: { title: i18n.t('tab.errorLog'), icon: 'bug', noCache: true } } ] }, { path: '/ncs-system-config', component: Layout, redirect: 'index', children: [ { path: 'index', component: () => import('@/views/ncs-system-config/index'), name: 'NcsSystemConfig', meta: { title: i18n.t('tab.systemConfig'), icon: 'nested', noCache: true } } ] }, { path: '/calling-partInfoSetting', component: Layout, children: [ { path: 'index/:id?', component: () => import('@/views/ncs-orginazition/partInfoSetting'), name: 'partInfoSetting', meta: { title: i18n.t('tab.shopSetting'), icon: 'nested', noCache: true }, hidden: true } ] }, { path: '/calling-menu', component: Layout, children: [ { path: 'index', component: () => import('@/views/ncs-menu/menuManager'), name: 'menuSetting', meta: { title: i18n.t('tab.menuManage'), icon: 'function', noCache: true } } ] }, { path: '/ncs-orginazition', component: Layout, children: [ { path: 'index', component: () => import('@/views/ncs-orginazition/index'), name: 'organization', meta: { title: i18n.t('tab.organization'), icon: 'tree', noCache: true } } ] }, { path: '/ncs-rolemanager', component: Layout, children: [ { path: 'index', component: () => import('@/views/ncs-auth/superadmin/defaultRoleManager'), name: 'rolemanager', meta: { title: i18n.t('tab.roleManage'), icon: 'authen', noCache: true } } ] }, { path: '/ncs-485', component: Layout, children: [ { path: 'index', component: () => import('@/views/ncs-485/index'), name: '485Commissioning', meta: { title: i18n.t('tab.debugging485'), icon: 'authen', noCache: true } } ] }, { path: '/ncs-linux-version', component: Layout, children: [ { path: 'index', component: () => import('@/views/ncs-linux-version/linuxVersionSetting'), name: 'linuxVersion', meta: { title: i18n.t('tab.linuxVersion'), icon: 'nested', noCache: true } } ] }, { path: '/device-frame', component: Layout, children: [ { path: 'device-frame', component: () => import('@/views/ncs-orginazition/device-frame'), name: 'device-frame', meta: { title: i18n.t('tab.deviceFrame'), icon: 'nested', noCache: true }, hidden: 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