index.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. Vue.use(Router)
  4. /* Layout */
  5. import Layout from '@/layout'
  6. /* Router Modules */
  7. // import componentsRouter from './modules/components'
  8. // import chartsRouter from './modules/charts'
  9. // import tableRouter from './modules/table'
  10. // import nestedRouter from './modules/nested'
  11. /**
  12. * Note: sub-menu only appear when route children.length >= 1
  13. * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
  14. *
  15. * hidden: true if set true, item will not show in the sidebar(default is false)
  16. * alwaysShow: true if set true, will always show the root menu
  17. * if not set alwaysShow, when item has more than one children route,
  18. * it will becomes nested mode, otherwise not show the root menu
  19. * redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
  20. * name:'router-name' the name is used by <keep-alive> (must set!!!)
  21. * meta : {
  22. roles: ['admin','editor'] control the page roles (you can set multiple roles)
  23. title: 'title' the name show in sidebar and breadcrumb (recommend set)
  24. icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
  25. noCache: true if set true, the page will no be cached(default is false)
  26. affix: true if set true, the tag will affix in the tags-view
  27. breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
  28. activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
  29. }
  30. */
  31. /**
  32. * constantRoutes
  33. * a base page that does not have permission requirements
  34. * all roles can be accessed
  35. */
  36. export const constantRoutes = [
  37. {
  38. path: '/redirect',
  39. component: Layout,
  40. hidden: true,
  41. children: [
  42. {
  43. path: '/redirect/:path(.*)',
  44. component: () => import('@/views/redirect/index')
  45. }
  46. ]
  47. },
  48. {
  49. path: '/login',
  50. component: () => import('@/views/login/index'),
  51. hidden: true
  52. },
  53. {
  54. path: '/auth-redirect',
  55. component: () => import('@/views/login/auth-redirect'),
  56. hidden: true
  57. },
  58. {
  59. path: '/404',
  60. component: () => import('@/views/error-page/404'),
  61. hidden: true
  62. },
  63. {
  64. path: '/401',
  65. component: () => import('@/views/error-page/401'),
  66. hidden: true
  67. },
  68. {
  69. path: '/',
  70. component: Layout,
  71. redirect: '/dashboard',
  72. children: [
  73. {
  74. path: 'dashboard',
  75. component: () => import('@/views/dashboard/index'),
  76. name: 'Dashboard',
  77. meta: { title: '首页', icon: 'dashboard', affix: true }
  78. }
  79. ]
  80. }
  81. ]
  82. export const partRoutes = [
  83. {
  84. path: '/ncs-device',
  85. component: Layout,
  86. redirect: '/ncs-device/index',
  87. children: [
  88. {
  89. path: 'index',
  90. // component: () => import('@/views/ncs-device/index'),
  91. component: () => import('@/views/ncs-device/deviceManagement'),
  92. name: 'CallingDevice',
  93. meta: { title: '设备管理', icon: 'component', noCache: true }
  94. }
  95. ]
  96. },
  97. {
  98. path: '/hospitalFrame',
  99. component: Layout,
  100. redirect: '/hospitalFrame/hospitalFrame',
  101. children: [
  102. {
  103. path: 'hospitalFrame',
  104. component: () => import('@/views/hospitalFrame/hospitalFrame'),
  105. name: 'hospitalFrame',
  106. meta: { title: '医院结构', icon: 'el-icon-s-shop', noCache: true }
  107. }
  108. ]
  109. },
  110. {
  111. path: '/frameTreeView',
  112. component: Layout,
  113. redirect: '/hospitalFrame/frameTreeView',
  114. children: [
  115. {
  116. path: 'frameTreeView',
  117. component: () => import('@/views/hospitalFrame/frameTreeView'),
  118. name: 'hospitalFrame',
  119. meta: { title: '空间位置', icon: 'el-icon-s-shop', noCache: true }
  120. }
  121. ]
  122. },
  123. {
  124. path: '/ncs-clerk',
  125. component: Layout,
  126. redirect: '/ncs-clerk/clerkList',
  127. children: [
  128. {
  129. path: 'clerkList',
  130. component: () => import('@/views/ncs-clerk/clerkList'),
  131. name: 'clerkList',
  132. meta: { title: '科室员工设置', icon: 'user', noCache: true }
  133. }
  134. ]
  135. },
  136. {
  137. path: '/customer',
  138. component: Layout,
  139. redirect: '/customer/list',
  140. children: [
  141. {
  142. path: 'customer',
  143. component: () => import('@/views/customer/list'),
  144. name: 'customerList',
  145. meta: { title: '病人管理', icon: 'el-icon-s-custom', noCache: true }
  146. }
  147. ]
  148. },
  149. {
  150. path: '/customerlist',
  151. component: Layout,
  152. redirect: '/customerlist/index',
  153. children: [
  154. {
  155. path: 'index',
  156. component: () => import('@/views/customer/customerManagement'),
  157. name: 'customerManager',
  158. meta: { title: '用户管理', icon: 'el-icon-s-custom', noCache: true }
  159. }
  160. ]
  161. },
  162. {
  163. path: '/ncs-nurse-watch',
  164. component: Layout,
  165. redirect: '/ncs-device/nurse_watch',
  166. children: [
  167. {
  168. path: 'index',
  169. component: () => import('@/views/ncs-device/nurse_watch'),
  170. name: 'nurse_watch',
  171. meta: { title: '腕表管理', icon: 'el-icon-watch', noCache: true }
  172. }
  173. ]
  174. },
  175. {
  176. path: '/remark',
  177. component: Layout,
  178. redirect: '/remark/index',
  179. children: [
  180. {
  181. path: 'remark',
  182. component: () => import('@/views/ncs-remark/index'),
  183. name: 'remarkList',
  184. meta: { title: '便签管理', icon: 'el-icon-s-order', noCache: true }
  185. }
  186. ]
  187. },
  188. {
  189. path: '/task',
  190. component: Layout,
  191. redirect: '/task/index',
  192. children: [
  193. {
  194. path: 'task',
  195. component: () => import('@/views/ncs-task/index'),
  196. name: 'taskList',
  197. meta: { title: '任务管理', icon: 'table', noCache: true }
  198. }
  199. ]
  200. },
  201. {
  202. path: '/ncs-interaction',
  203. component: Layout,
  204. redirect: '/ncs-interaction/index',
  205. children: [
  206. {
  207. path: 'index',
  208. component: () => import('@/views/ncs-interaction/index'),
  209. name: 'CallingList',
  210. meta: { title: '交互历史管理', icon: 'list', noCache: true }
  211. }
  212. ]
  213. },
  214. {
  215. path: '/calling-message',
  216. component: Layout,
  217. redirect: '/calling-message/index',
  218. children: [
  219. {
  220. path: 'index',
  221. component: () => import('@/views/calling-message/index'),
  222. name: 'CallingMessage',
  223. meta: { title: '留言设置', icon: 'email', noCache: true }
  224. }
  225. ]
  226. },
  227. {
  228. path: '',
  229. component: Layout,
  230. redirect: '/frameGroup/index',
  231. name: 'frameGroup',
  232. children: [
  233. {
  234. path: '/frameGroup/index',
  235. component: () => import('@/views/hospitalFrame/frameGroup'),
  236. name: 'frameGroup',
  237. meta: { title: '区域管理', icon: 'area', noCache: true }
  238. },
  239. {
  240. path: '/frameGroup/edit/:id?',
  241. component: () => import('@/views/hospitalFrame/frameGroupEdit'),
  242. name: 'frameGroupEdit',
  243. meta: { title: '编辑区域信息', icon: 'area', noCache: true },
  244. hidden: true
  245. },
  246. {
  247. path: 'nurse_watch_frame/:id?',
  248. component: () => import('@/views/hospitalFrame/nurse_watch_frame'),
  249. name: 'nurseWatchFrame',
  250. meta: { title: '腕表管理空间', icon: 'area', noCache: true },
  251. hidden: true
  252. }
  253. ]
  254. },
  255. {
  256. path: '',
  257. component: Layout,
  258. redirect: '/broadcast/index',
  259. children: [
  260. {
  261. path: '/broadcast/index',
  262. component: () => import('@/views/ncs-broadcast/index'),
  263. name: 'Broadcast',
  264. meta: { title: '广播设置', icon: 'el-icon-headset', noCache: true }
  265. },
  266. {
  267. path: '/broadcast/edit/:id?',
  268. component: () => import('@/views/ncs-broadcast/broadcastEdit'),
  269. name: 'broadcastEdit',
  270. meta: { title: '编辑广播信息', icon: 'area', noCache: true },
  271. hidden: true
  272. }
  273. ]
  274. },
  275. {
  276. path: '/ncs-nurse-config',
  277. component: Layout,
  278. redirect: '/ncs-nurse-config/index',
  279. children: [
  280. {
  281. path: 'index',
  282. component: () => import('@/views/ncs-nurse-config/index'),
  283. name: 'NcsNurseConfig',
  284. meta: { title: '护理设置', icon: 'el-icon-s-goods', noCache: true }
  285. }
  286. ]
  287. }, {
  288. path: '/calling-board',
  289. component: Layout,
  290. redirect: '/calling-board/index',
  291. children: [
  292. {
  293. path: 'index',
  294. component: () => import('@/views/calling-board/index'),
  295. name: 'CallingBoard',
  296. meta: { title: '看板设置', icon: 'el-icon-s-tools', noCache: true }
  297. }
  298. ]
  299. },
  300. {
  301. path: '/ncs-event',
  302. component: Layout,
  303. redirect: '/ncs-event/index',
  304. children: [
  305. {
  306. path: 'index',
  307. component: () => import('@/views/ncs-event/index'),
  308. name: 'eventList',
  309. meta: { title: '按钮事件管理', icon: 'el-icon-notebook-2', noCache: true }
  310. }
  311. ]
  312. },
  313. {
  314. path: '/calling-deviceregisterparams',
  315. component: Layout,
  316. redirect: '/deviceregisterparams/index',
  317. children: [
  318. {
  319. path: 'index',
  320. component: () => import('@/views/calling-deviceRegisterParam/index'),
  321. name: 'deviceRegisterParam',
  322. meta: { title: '设备自动注册参数', icon: 'params', noCache: true }
  323. }
  324. ]
  325. },
  326. {
  327. path: '/calling-setting',
  328. component: Layout,
  329. redirect: '/calling-setting/index',
  330. children: [
  331. {
  332. path: 'index',
  333. component: () => import('@/views/calling-setting/index'),
  334. name: 'CallingSetting',
  335. meta: { title: '系统设置', icon: 'el-icon-s-tools', noCache: true }
  336. }
  337. ]
  338. },
  339. { path: '*', redirect: '/404', hidden: true }
  340. ]
  341. export const hospitalRoutes = [
  342. {
  343. path: '/hospital/ncs_frame',
  344. component: Layout,
  345. redirect: '/ncs_frame/index',
  346. children: [
  347. {
  348. path: 'index',
  349. component: () => import('@/views/hospital/ncs_frame/frameTreeView'),
  350. name: 'hospital_frameTreeView',
  351. meta: { title: '空间管理', icon: 'component', noCache: true }
  352. }
  353. ]
  354. },
  355. { path: '*', redirect: '/404', hidden: true }
  356. ]
  357. export const adminRoutes = [
  358. {
  359. path: '/ncs-device',
  360. component: Layout,
  361. redirect: '/ncs-device/device-admin',
  362. children: [
  363. {
  364. path: 'index',
  365. component: () => import('@/views/ncs-device/device-admin'),
  366. name: 'CallingDeviceAdmin',
  367. meta: { title: '所有设备', icon: 'component', noCache: true }
  368. }
  369. ]
  370. },
  371. {
  372. path: '/calling-ncError',
  373. component: Layout,
  374. redirect: '/calling-ncError/index',
  375. children: [
  376. {
  377. path: 'index',
  378. component: () => import('@/views/calling-ncError/index'),
  379. name: 'CallingNcError',
  380. meta: { title: '错误日志', icon: 'bug', noCache: true }
  381. }
  382. ]
  383. },
  384. {
  385. path: '/ncs-nurse-config',
  386. component: Layout,
  387. redirect: '/ncs-nurse-config/index',
  388. children: [
  389. {
  390. path: 'index',
  391. component: () => import('@/views/ncs-nurse-config/index'),
  392. name: 'CallingNcConfig',
  393. meta: { title: '系统参数', icon: 'nested', noCache: true }
  394. }
  395. ]
  396. },
  397. {
  398. path: '/calling-partInfoSetting',
  399. component: Layout,
  400. children: [
  401. {
  402. path: 'index/:id?',
  403. component: () => import('@/views/ncs-orginazition/partInfoSetting'),
  404. name: 'partInfoSetting',
  405. meta: { title: '科室设置', icon: 'nested', noCache: true },
  406. hidden: true
  407. }
  408. ]
  409. },
  410. {
  411. path: '/calling-menu',
  412. component: Layout,
  413. children: [
  414. {
  415. path: 'index',
  416. component: () => import('@/views/ncs-menu/menuManager'),
  417. name: 'menuSetting',
  418. meta: { title: '菜单管理', icon: 'function', noCache: true }
  419. }
  420. ]
  421. },
  422. {
  423. path: '/ncs-orginazition',
  424. component: Layout,
  425. children: [
  426. {
  427. path: 'index',
  428. component: () => import('@/views/ncs-orginazition/index'),
  429. name: 'orginazition',
  430. meta: { title: '组织机构', icon: 'tree', noCache: true }
  431. }
  432. ]
  433. },
  434. {
  435. path: '/ncs-rolemanager',
  436. component: Layout,
  437. children: [
  438. {
  439. path: 'index',
  440. component: () => import('@/views/ncs-auth/superadmin/defaultRoleManager'),
  441. name: 'rolemanager',
  442. meta: { title: '角色功能', icon: 'authen', noCache: true }
  443. }
  444. ]
  445. },
  446. { path: '*', redirect: '/404', hidden: true }
  447. ]
  448. const createRouter = () => new Router({
  449. mode: 'history', // require service support
  450. scrollBehavior: () => ({ y: 0 }),
  451. routes: constantRoutes
  452. })
  453. const router = createRouter()
  454. // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
  455. export function resetRouter() {
  456. const newRouter = createRouter()
  457. router.matcher = newRouter.matcher // reset router
  458. }
  459. export default router