index.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. import i18n from '@/utils/i18n'
  4. // eslint-disable-next-line no-unused-vars
  5. // import { uiVersion } from 'domain'
  6. Vue.use(Router)
  7. /* Layout */
  8. import Layout from '@/layout'
  9. const uiVersion = domain.uiVersion
  10. const enableBroadcast = domain.enableBroadcast
  11. const enableMobile = domain.enableMobile
  12. const enableEntraceguard = domain.enableEntraceguard
  13. const enableNBiot = domain.enableNBiot
  14. const enableCustomerDevice = domain.enableCustomerDevice
  15. const enableSosDevice = domain.enableSosDevice
  16. const enable485 = domain.enable485
  17. const enableLinux = domain.enableLinux
  18. /**
  19. * constantRoutes
  20. * a base page that does not have permission requirements
  21. * all roles can be accessed
  22. */
  23. export const constantRoutes = [
  24. {
  25. path: '/redirect',
  26. component: Layout,
  27. hidden: true,
  28. children: [
  29. {
  30. path: '/redirect/:path(.*)',
  31. component: () => import('@/views/redirect/index')
  32. }
  33. ]
  34. },
  35. {
  36. path: '/login',
  37. component: () => import('@/views/login/index'),
  38. hidden: true
  39. },
  40. {
  41. path: '/auth-redirect',
  42. component: () => import('@/views/login/auth-redirect'),
  43. hidden: true
  44. },
  45. {
  46. path: '/404',
  47. component: () => import('@/views/error-page/404'),
  48. hidden: true
  49. },
  50. {
  51. path: '/401',
  52. component: () => import('@/views/error-page/401'),
  53. hidden: true
  54. },
  55. {
  56. path: '/',
  57. component: Layout,
  58. redirect: '/dashboard',
  59. children: [
  60. {
  61. path: 'dashboard',
  62. component: () => import('@/views/dashboard/index'),
  63. name: 'Dashboard',
  64. meta: { title: i18n.t('tab.home'), icon: 'dashboard', affix: true }
  65. }
  66. ]
  67. },
  68. {
  69. path: '/vital_sign_log',
  70. component: () => import('@/views/vital-sign/index'),
  71. hidden: true
  72. }
  73. ]
  74. // 科室级页面
  75. export const partRoutes = [
  76. // 空间设备相关
  77. {
  78. path: '/frame',
  79. component: Layout,
  80. redirect: '/frame/tree',
  81. name: 'frame-tree',
  82. meta: { title: i18n.t('tab.frameManage'), icon: 'tree', noCache: true },
  83. children: [{
  84. path: 'tree',
  85. component: () => import('@/views/hospitalFrame/frameTreeView'),
  86. name: 'part-frame-tree',
  87. meta: { title: i18n.t('tab.frameManage'), icon: 'tree', noCache: true } // 空间位置
  88. }, {
  89. path: 'clerk_frame_manage',
  90. component: () => import('@/views/ncs-clerk-frame-manage/index'),
  91. name: 'clerk-frame-manage',
  92. meta: { title: i18n.t('tab.staffManageFrames'), icon: 'frame_manage', noCache: true }
  93. }
  94. ]
  95. },
  96. {
  97. path: '/device',
  98. name: 'part-device',
  99. component: Layout,
  100. redirect: '/device/list',
  101. meta: { title: i18n.t('deviceManage.deviceManage'), icon: 'devices' },
  102. children: [
  103. {
  104. path: 'list',
  105. component: () => import('@/views/ncs-device/deviceManagement'),
  106. name: 'device-list',
  107. meta: { title: i18n.t('tab.deviceManage'), icon: 'component', noCache: true } // 所有设备
  108. },
  109. {
  110. path: 'mobile',
  111. component: () => import('@/views/ncs-device/nurse_watch'),
  112. name: 'device-mobile',
  113. hidden: !enableMobile,
  114. meta: { title: i18n.t('tab.mobileDeviceManage'), icon: 'el-icon-watch', noCache: true } // 移动设备
  115. },
  116. {
  117. path: 'user_watch',
  118. component: () => import('@/views/ncs-device/user_watch'),
  119. name: 'user-watch',
  120. hidden: !enableCustomerDevice,
  121. meta: { title: i18n.t('tab.userLocationManage'), icon: 'el-icon-watch-1', noCache: true } // 用户设备
  122. },
  123. {
  124. path: 'sos',
  125. component: () => import('@/views/ncs-sos-device-setting/sos_device_setting'),
  126. name: 'sos-device',
  127. hidden: !enableSosDevice,
  128. meta: { title: i18n.t('tab.sosDeviceSettingManage'), icon: 'el-icon-s-help', noCache: true } // 报警设备
  129. },
  130. {
  131. path: 'map',
  132. component: () => import('@/views/customer/myMapHtml'),
  133. name: 'device-map',
  134. meta: { title: i18n.t('customerManage.footprint'), icon: 'area', noCache: true }, // 足迹
  135. hidden: true
  136. },
  137. {
  138. path: 'nbdevice_condition',
  139. component: () => import('@/views/ncs-device/nbDeviceCondition'),
  140. name: 'nbdevice-condition',
  141. meta: { title: i18n.t('tab.nbiotDeviceStatus'), icon: 'iot', noCache: true },
  142. hidden: !enableNBiot
  143. },
  144. {
  145. path: 'information_board',
  146. component: () => import('@/views/calling-board/index'),
  147. name: 'information-board',
  148. meta: { title: i18n.t('tab.boardManage'), icon: 'infomation_board', noCache: true },
  149. hidden: uiVersion === 2
  150. },
  151. {
  152. path: 'custom_infoboard',
  153. component: () => import('@/views/custom-infoboard/board-title'),
  154. name: 'board-title',
  155. meta: { title: i18n.t('tab.customBoardManage'), icon: 'designer', noCache: true },
  156. hidden: uiVersion === 2
  157. },
  158. {
  159. path: 'index/:id?',
  160. component: () => import('@/views/custom-infoboard/infoboard-designer'), // 自定义看板 component: () => import('@/views/custom-infoboard/infoboard-designer'),资阳 component: () => import('@/views/custom-infoboard/screen-designer')
  161. name: 'infoboard-designer-manager',
  162. meta: { title: i18n.t('tab.customBoardDesigner'), icon: 'el-icon-data-board', noCache: true },
  163. hidden: true
  164. },
  165. {
  166. path: 'device_menu',
  167. component: () => import('@/views/ncs-device-menu/index'),
  168. name: 'device-menu',
  169. meta: { title: i18n.t('tab.deviceMenuManager'), icon: 'el-icon-menu', noCache: true }
  170. },
  171. {
  172. path: 'device_menu_detail/:id',
  173. component: () => import('@/views/ncs-device-menu-detail/index'),
  174. name: 'device-menu-detail',
  175. meta: { title: i18n.t('tab.deviceMenuDetail'), icon: 'el-icon-tickets', noCache: true },
  176. hidden: true
  177. },
  178. // {
  179. // path: 'led',
  180. // component: () => import('@/views/ncs-led/ledDeviceManagement'),
  181. // name: 'led-manager',
  182. // meta: { title: i18n.t('tab.ledDeviceManager'), icon: 'led', noCache: true },
  183. // hidden: uiVersion === 2
  184. // },
  185. {
  186. path: 'led-control',
  187. component: () => import('@/views/ncs-led/ledControl'),
  188. name: 'led-control',
  189. meta: { title: i18n.t('tab.ledDevice'), icon: 'el-icon-message-solid', noCache: true }, // LED点阵屏
  190. hidden: true
  191. }
  192. ]
  193. },
  194. // 职员相关
  195. {
  196. path: '/clerk',
  197. component: Layout,
  198. redirect: '/clerk/list',
  199. name: 'part-clerk',
  200. meta: { title: i18n.t('tab.clerkManage'), icon: 'peoples', noCache: true },
  201. children: [
  202. {
  203. path: 'list',
  204. component: () => import('@/views/ncs-clerk/clerkManagement'),
  205. name: 'clerk-list',
  206. meta: { title: i18n.t('tab.clerkManage'), icon: 'el-icon-user-solid', noCache: true }
  207. },
  208. {
  209. path: 'nfc_interaction_list',
  210. component: () => import('@/views/nfc-interaction/index'),
  211. name: 'nfc-interaction-list',
  212. meta: { title: i18n.t('tab.clerkCalendar'), icon: 'el-icon-date', noCache: true }
  213. }
  214. ]
  215. },
  216. // 门禁
  217. {
  218. path: '/entrace_guard',
  219. component: Layout,
  220. name: 'entrace-guard',
  221. redirect: '/entrace_guard/users',
  222. hidden: !enableEntraceguard,
  223. children: [
  224. {
  225. path: 'users',
  226. component: () => import('@/views/entrace-guard/users'),
  227. name: 'entrace-guard-list',
  228. meta: { title: i18n.t('tab.entraceguardUser'), icon: 'pass_through', noCache: true },
  229. hidden: !enableEntraceguard
  230. }]
  231. },
  232. // 客户信息
  233. {
  234. path: '/customer',
  235. component: Layout,
  236. redirect: '/customer/list',
  237. name: 'customer-manager',
  238. children: [
  239. {
  240. path: 'list',
  241. component: () => uiVersion === 1 ? import('@/views/customer/patientManagement') : uiVersion === 2 ? import('@/views/customer/customerManagement') : import('@/views/customer/elderlyCareManagement'),
  242. name: 'customer-list',
  243. meta: {
  244. title: uiVersion === 1 ? i18n.t('tab.patientManage') : i18n.t('tab.customerManage'),
  245. icon: 'el-icon-s-custom',
  246. noCache: true
  247. }
  248. },
  249. {
  250. path: 'map',
  251. component: () => import('@/views/customer/allMap'),
  252. name: 'map',
  253. meta: { title: i18n.t('tab.CustomerDistribution'), icon: 'area', noCache: true },
  254. hidden: true
  255. },
  256. {
  257. path: '/advice/:id?',
  258. component: () => import('@/views/ncs-advice/index'),
  259. name: 'advice',
  260. meta: { title: i18n.t('tab.customerAdvice'), icon: 'area', noCache: true },
  261. hidden: true
  262. }
  263. ]
  264. },
  265. // 便签
  266. {
  267. path: '/remark',
  268. component: Layout,
  269. name: 'remark',
  270. redirect: '/remark/list',
  271. meta: { title: i18n.t('tab.remarkManage'), icon: 'el-icon-s-order', noCache: true },
  272. children: [
  273. {
  274. path: 'list',
  275. component: () => import('@/views/ncs-remark/index'),
  276. name: 'remark-list',
  277. meta: { title: i18n.t('tab.remarkManage'), icon: 'el-icon-s-order', noCache: true }
  278. }
  279. ]
  280. },
  281. // 文档管理
  282. {
  283. path: '/file-manager',
  284. component: Layout,
  285. redirect: '/file-manager/index',
  286. children: [
  287. {
  288. path: 'index',
  289. component: () => import('@/views/ncs-file-manager/index'),
  290. name: 'file-manager',
  291. meta: { title: i18n.t('wu20240322.fileManager'), icon: 'el-icon-folder-opened', noCache: true }
  292. }
  293. ]
  294. },
  295. {
  296. path: '/article-manager',
  297. component: Layout,
  298. redirect: '/article-manager/index',
  299. children: [
  300. {
  301. path: 'index',
  302. component: () => import('@/views/article-manager/index'),
  303. name: 'article-manager',
  304. meta: { title: i18n.t('wu20240322.fileManager'), icon: 'el-icon-folder-opened', noCache: true }
  305. }
  306. ]
  307. },
  308. // 任务
  309. {
  310. path: '/task',
  311. component: Layout,
  312. name: 'task',
  313. redirect: '/task/list',
  314. meta: { title: i18n.t('tab.taskManage'), icon: 'table', noCache: true },
  315. children: [
  316. {
  317. path: 'list',
  318. component: () => import('@/views/ncs-task/index'),
  319. name: 'task-list',
  320. meta: { title: i18n.t('tab.taskManage'), icon: 'table', noCache: true }
  321. }
  322. ]
  323. },
  324. // 交互信息
  325. {
  326. path: '/interaction',
  327. component: Layout,
  328. redirect: '/interaction/history',
  329. name: 'interaction',
  330. meta: { title: i18n.t('tab.interaction'), icon: 'list', noCache: true },
  331. children: [
  332. {
  333. path: 'history',
  334. component: () => import('@/views/ncs-interaction/index'),
  335. name: 'interaction-history',
  336. meta: { title: i18n.t('tab.interactionHistory'), icon: 'list', noCache: true }
  337. }, {
  338. path: 'chars',
  339. component: () => import('@/views/ncs-chars/index'),
  340. name: 'interaction-chars',
  341. meta: { title: i18n.t('tab.interactionChars'), icon: 'el-icon-pie-chart', noCache: true }
  342. }
  343. ]
  344. },
  345. // 广播
  346. {
  347. path: '/broadcast',
  348. component: Layout,
  349. name: 'broadcast',
  350. redirect: '/broadcast/index',
  351. hidden: !enableBroadcast || uiVersion !== 1,
  352. children: [
  353. {
  354. path: 'index',
  355. component: () => import('@/views/ncs-broadcast/index'),
  356. name: 'broadcast-list',
  357. meta: { title: i18n.t('tab.broadcastManage'), icon: 'el-icon-headset', noCache: true }, // 广播设置
  358. hidden: !enableBroadcast || uiVersion !== 1
  359. },
  360. {
  361. path: 'edit/:id?',
  362. component: () => import('@/views/ncs-broadcast/broadcastEdit'),
  363. name: 'broadcast-edit',
  364. meta: { title: i18n.t('tab.broadcastEdit'), icon: 'area', noCache: true },
  365. hidden: true
  366. }
  367. ]
  368. },
  369. // {
  370. // path: '/infoboard_designer',
  371. // component: Layout,
  372. // name: 'infoboard-designer',
  373. // children: [
  374. // {
  375. // path: 'index/:id?',
  376. // component: () => import('@/views/custom-infoboard/infoboard-designer'), // 自定义看板 component: () => import('@/views/custom-infoboard/infoboard-designer'),资阳 component: () => import('@/views/custom-infoboard/screen-designer')
  377. // name: 'infoboard-designer-manager',
  378. // meta: { title: i18n.t('tab.customBoardDesigner'), icon: 'el-icon-data-board', noCache: true }
  379. // }
  380. // ],
  381. // hidden: true
  382. // },
  383. {
  384. path: '/settings',
  385. component: Layout,
  386. redirect: '/settings/index',
  387. name: 'settings',
  388. meta: {
  389. title: i18n.t('tab.settings'),
  390. icon: 'el-icon-s-tools'
  391. },
  392. children: [
  393. {
  394. path: 'index',
  395. component: () => import('@/views/calling-setting/index'),
  396. name: 'part-settings',
  397. meta: { title: i18n.t('tab.partSettings'), icon: 'el-icon-s-tools', noCache: true } // 机构设置
  398. }, {
  399. path: 'nurse_config',
  400. component: () => import('@/views/ncs-nurse-config/index'),
  401. name: 'nurse-config',
  402. meta: { title: i18n.t('tab.nurseConfig'), icon: 'care1', noCache: true }, // 护理参数
  403. hidden: uiVersion !== 1
  404. },
  405. {
  406. path: 'channel',
  407. component: () => import('@/views/hospitalFrame/index'),
  408. name: 'channel',
  409. redirect: '/settings/channel/index',
  410. meta: { title: i18n.t('tab.channelManage'), icon: 'el-icon-mobile-phone', noCache: true },
  411. children: [
  412. {
  413. path: 'index',
  414. component: () => import('@/views/ncs-channel/index'),
  415. name: 'channel-im',
  416. meta: { title: i18n.t('tab.channelManage'), icon: 'el-icon-mobile-phone', noCache: true }
  417. },
  418. {
  419. path: 'history/:id?',
  420. component: () => import('@/views/ncs-channel/channelImHistory'),
  421. name: 'channel-im-history',
  422. meta: { title: i18n.t('tab.channelImHistory'), icon: 'area', noCache: true },
  423. hidden: true
  424. }
  425. ]
  426. }, {
  427. path: 'event_list',
  428. component: () => import('@/views/ncs-event/index'),
  429. name: 'event-list',
  430. meta: { title: i18n.t('tab.eventManage'), icon: 'el-icon-notebook-2', noCache: true }
  431. }, {
  432. path: 'components',
  433. component: () => import('@/views/hospitalFrame/index'),
  434. redirect: '/settings/components/function_mapping',
  435. name: 'beds-side',
  436. meta: {
  437. title: i18n.t('tab.bedsideInteraction'),
  438. icon: 'component'
  439. },
  440. children: [
  441. {
  442. path: 'function_mapping',
  443. component: () => import('@/views/function-mapping/index'),
  444. name: 'function-mapping',
  445. meta: { title: i18n.t('tab.functionRoleMapping'), icon: 'function', noCache: true }
  446. },
  447. {
  448. path: 'interaction_chain',
  449. component: () => import('@/views/interaction-chain/index'),
  450. name: 'interaction-chain',
  451. meta: { title: i18n.t('tab.interactionChain'), icon: 'squence', noCache: true } // 交互接收顺序
  452. },
  453. {
  454. path: 'countdonw',
  455. component: () => import('@/views/ncs-countdown-config/index'),
  456. name: 'countdown-config',
  457. meta: { title: i18n.t('tab.countdownConfig'), icon: 'countdown', noCache: true }
  458. },
  459. {
  460. path: 'screentip',
  461. component: () => import('@/views/ncs-screentip/index'),
  462. name: 'screen-tip',
  463. meta: { title: i18n.t('tab.screentip'), icon: 'screen_tip', noCache: true }
  464. }
  465. ]
  466. }, {
  467. path: '/frame_group',
  468. component: () => import('@/views/hospitalFrame/index'),
  469. name: 'frame-group-manager',
  470. redirect: '/frame_group/index',
  471. children: [
  472. {
  473. path: 'index',
  474. component: () => import('@/views/hospitalFrame/frameGroup'),
  475. name: 'frame-group',
  476. meta: { title: i18n.t('tab.frameGroupManage'), icon: 'area', noCache: true }
  477. },
  478. {
  479. path: 'edit/:id?',
  480. component: () => import('@/views/hospitalFrame/frameGroupEdit'),
  481. name: 'frame-group-edit',
  482. meta: { title: i18n.t('tab.frameGroupEdit'), icon: 'area', noCache: true },
  483. hidden: true
  484. },
  485. {
  486. path: 'watch_frame/:id?',
  487. component: () => import('@/views/hospitalFrame/nurse_watch_frame'),
  488. name: 'nurse-watch-frame',
  489. meta: { title: i18n.t('tab.watchFrameManage'), icon: 'area', noCache: true },
  490. hidden: true
  491. }
  492. ]
  493. }
  494. ]
  495. },
  496. { path: '*', redirect: '/404', hidden: true }
  497. ]
  498. export const hospitalRoutes = [
  499. {
  500. path: '/hospital/frame',
  501. component: Layout,
  502. redirect: '/hospital/frame/index',
  503. name: 'hospital-frame',
  504. children: [
  505. {
  506. path: 'index',
  507. component: () => import('@/views/hospital/frame/frameTreeView'),
  508. name: 'hospital-frame-tree',
  509. meta: { title: i18n.t('tab.frameManage'), icon: 'tree', noCache: true }
  510. }
  511. ]
  512. },
  513. {
  514. path: '/hospital/device',
  515. component: Layout,
  516. redirect: '/hospital/device/index',
  517. name: 'hospital-device-manager',
  518. meta: { title: i18n.t('deviceManage.deviceManage'), icon: 'devices' },
  519. children: [
  520. {
  521. path: 'index',
  522. component: () => import('@/views/hospital/deviceManagement'),
  523. name: 'hospital-device-list',
  524. meta: { title: i18n.t('tab.deviceManage'), icon: 'component', noCache: true }
  525. },
  526. {
  527. path: 'led_control',
  528. component: () => import('@/views/hospital/ledControl'),
  529. name: 'hospital-led-control',
  530. meta: { title: i18n.t('tab.ledDevice'), icon: 'el-icon-message-solid', noCache: true }
  531. }
  532. ]
  533. },
  534. {
  535. path: '/hospital/clerk',
  536. component: Layout,
  537. redirect: '/hospital/clerk/index',
  538. name: 'hospital-clerk-manager',
  539. children: [
  540. {
  541. path: 'index',
  542. component: () => import('@/views/hospital/clerkManager'),
  543. name: 'hospital-clerk-list',
  544. meta: { title: i18n.t('tab.clerkManage'), icon: 'peoples', noCache: true }
  545. }
  546. ]
  547. },
  548. {
  549. path: '/hospital/customer',
  550. component: Layout,
  551. redirect: '/hospital/customer/index',
  552. name: 'hospital-customer-manager',
  553. children: [
  554. {
  555. path: 'index',
  556. component: () => import('@/views/hospital/customerManagement'),
  557. name: 'hospital-customer-list',
  558. meta: { title: i18n.t('tab.customerManage'), icon: 'el-icon-s-custom', noCache: true }
  559. }
  560. ]
  561. },
  562. // {
  563. // path: '/hospital/led',
  564. // component: Layout,
  565. // redirect: '/hospital/led/index',
  566. // children: [
  567. // {
  568. // path: 'index',
  569. // component: () => import('@/views/hospital/ledControl'),
  570. // name: 'hospital_led',
  571. // meta: { title: i18n.t('tab.ledDevice'), icon: 'el-icon-message-solid', noCache: true }
  572. // }
  573. // ]
  574. // },
  575. { path: '*', redirect: '/404', hidden: true }
  576. ]
  577. export const adminRoutes = [
  578. {
  579. path: '/frame',
  580. component: Layout,
  581. redirect: '/frame/index',
  582. children: [
  583. {
  584. path: 'index',
  585. component: () => import('@/views/hospitalFrame/frameTreeView-admin'),
  586. name: 'admin-frame',
  587. meta: { title: i18n.t('tab.frameManage'), icon: 'tree', noCache: true }
  588. }
  589. ]
  590. },
  591. {
  592. path: '/clerk',
  593. component: Layout,
  594. redirect: '/clerk/index',
  595. children: [
  596. {
  597. path: 'index',
  598. component: () => import('@/views/ncs-clerk/clerk-admin'),
  599. name: 'admin-clerk',
  600. meta: { title: i18n.t('tab.allClerk'), icon: 'peoples', noCache: true }
  601. }
  602. ]
  603. },
  604. {
  605. path: '/customer',
  606. component: Layout,
  607. redirect: '/customer/index',
  608. children: [
  609. {
  610. path: 'index',
  611. component: () => import('@/views/customer/customer-admin'),
  612. name: 'admin-customer',
  613. meta: { title: i18n.t('tab.allCustomer'), icon: 'el-icon-s-custom', noCache: true }
  614. }
  615. ]
  616. },
  617. {
  618. path: '/device',
  619. component: Layout,
  620. redirect: '/device/index',
  621. meta: {
  622. title: i18n.t('deviceManage.deviceManage'),
  623. icon: 'devices'
  624. },
  625. children: [
  626. {
  627. path: 'index',
  628. component: () => import('@/views/ncs-device/device-admin'),
  629. name: 'admin-device',
  630. meta: { title: i18n.t('tab.allDevice'), icon: 'component', noCache: true }
  631. },
  632. {
  633. path: 'device_menu',
  634. component: () => import('@/views/ncs-device-menu/deviceMenuManagement'),
  635. name: 'admin-device_menu',
  636. meta: { title: i18n.t('tab.deviceMenuManager'), icon: 'el-icon-menu', noCache: true }
  637. },
  638. {
  639. path: 'linux_version',
  640. component: () => import('@/views/ncs-linux-version/linuxVersionSetting'),
  641. name: 'admin-linux-version',
  642. meta: { title: i18n.t('tab.linuxVersion'), icon: 'nested', noCache: true },
  643. hidden: !enableLinux
  644. },
  645. {
  646. path: 'led_device',
  647. component: () => import('@/views/ncs-led/led-admin'),
  648. name: 'admin-led-device',
  649. meta: { title: i18n.t('tab.ledDeviceManager'), icon: 'led', noCache: true }
  650. }
  651. ]
  652. },
  653. {
  654. path: '/event',
  655. component: Layout,
  656. redirect: '/event/index',
  657. children: [
  658. {
  659. path: 'index',
  660. component: () => import('@/views/ncs-event/eventManagement'),
  661. name: 'admin-event',
  662. meta: { title: i18n.t('tab.eventManage'), icon: 'el-icon-notebook-2', noCache: true }
  663. }
  664. ]
  665. },
  666. {
  667. path: '/his',
  668. component: Layout,
  669. redirect: '/his/index',
  670. children: [
  671. {
  672. path: 'index',
  673. component: () => import('@/views/ncs-his/hisManagement'),
  674. name: 'admin-hist',
  675. meta: { title: i18n.t('tab.hisManage'), icon: 'el-icon-search', noCache: true }
  676. },
  677. {
  678. path: 'patient/:keyval?',
  679. component: () => import('@/views/ncs-his/his-patient/hisPatientManage'),
  680. name: 'admin-his-patient',
  681. meta: { title: i18n.t('his.hisPatient'), icon: 'el-icon-search', noCache: true },
  682. hidden: true
  683. },
  684. {
  685. path: 'clerk/:keyval?',
  686. component: () => import('@/views/ncs-his/his-clerk/hisClerkManager'),
  687. name: 'admin-his-clerk',
  688. meta: { title: i18n.t('his.hisClerk'), icon: 'el-icon-search', noCache: true },
  689. hidden: true
  690. },
  691. {
  692. path: 'nurse_config/:keyval?',
  693. component: () => import('@/views/ncs-his/his-nurse-config/hisNurseConfigManager'),
  694. name: 'admin-his-nurse-config',
  695. meta: { title: i18n.t('his.hisNurseConfig'), icon: 'el-icon-search', noCache: true },
  696. hidden: true
  697. }
  698. ]
  699. },
  700. {
  701. path: '/error_log',
  702. component: Layout,
  703. redirect: '/error_log/index',
  704. children: [
  705. {
  706. path: 'index',
  707. component: () => import('@/views/calling-ncError/index'),
  708. name: 'admin-error-log',
  709. meta: { title: i18n.t('tab.errorLog'), icon: 'bug', noCache: true }
  710. }
  711. ]
  712. },
  713. {
  714. path: '/system_config',
  715. component: Layout,
  716. redirect: '/system_config/index',
  717. children: [
  718. {
  719. path: 'index',
  720. component: () => import('@/views/ncs-system-config/index'),
  721. name: 'admin-system-config',
  722. meta: { title: i18n.t('tab.systemConfig'), icon: 'nested', noCache: true }
  723. }
  724. ]
  725. }, {
  726. path: '/menu',
  727. component: Layout,
  728. redirect: '/menu/index',
  729. children: [
  730. {
  731. path: 'index',
  732. component: () => import('@/views/ncs-menu/menuManager'),
  733. name: 'admin-menu',
  734. meta: { title: i18n.t('tab.menuManage'), icon: 'function', noCache: true }
  735. }
  736. ]
  737. },
  738. {
  739. path: '/orginazition',
  740. component: Layout,
  741. redirect: '/orginazition/index',
  742. children: [
  743. {
  744. path: 'index',
  745. component: () => import('@/views/ncs-orginazition/index'),
  746. name: 'admin-organization',
  747. meta: { title: i18n.t('tab.organization'), icon: 'tree', noCache: true }
  748. }, {
  749. path: 'index/:id?',
  750. component: () => import('@/views/ncs-orginazition/partInfoSetting'),
  751. name: 'admin-part-settings',
  752. meta: { title: i18n.t('tab.shopSetting'), icon: 'nested', noCache: true },
  753. hidden: true
  754. }
  755. ]
  756. },
  757. {
  758. path: '/rolemanager',
  759. component: Layout,
  760. redirect: '/rolemanager/index',
  761. children: [
  762. {
  763. path: 'index',
  764. component: () => import('@/views/ncs-auth/superadmin/defaultRoleManager'),
  765. name: 'admin-rolemanager',
  766. meta: { title: i18n.t('tab.roleManage'), icon: 'authen', noCache: true }
  767. }
  768. ]
  769. },
  770. {
  771. path: '/485',
  772. component: Layout,
  773. redirect: '/485/index',
  774. children: [
  775. {
  776. path: 'index',
  777. component: () => import('@/views/ncs-485/index'),
  778. name: 'admin-485-commissioning',
  779. meta: { title: i18n.t('tab.debugging485'), icon: 'authen', noCache: true }
  780. }
  781. ],
  782. hidden: !enable485
  783. },
  784. {
  785. path: '/interaction_push',
  786. component: Layout,
  787. redirect: '/interaction_push/index',
  788. children: [
  789. {
  790. path: 'index',
  791. component: () => import('@/views/ncs-interaction-push-config/index'),
  792. name: 'admin-interaction-push',
  793. meta: { title: i18n.t('tab.interactionPush'), icon: 'el-icon-s-promotion', noCache: true }
  794. },
  795. {
  796. path: 'paramer-config/:id?',
  797. component: () => import('@/views/ncs-interaction-push-config/param-config'),
  798. name: 'admin-interaction-push-config',
  799. meta: { title: i18n.t('tab.interactionPushParamConfig'), icon: 'el-icon-s-promotion', noCache: true },
  800. hidden: true
  801. }
  802. ]
  803. },
  804. {
  805. path: '/convenient_sync',
  806. component: Layout,
  807. redirect: '/convenient_sync/index',
  808. children: [
  809. {
  810. path: 'index',
  811. component: () => import('@/views/convenient-data-sync/index'),
  812. name: 'convenient-data-sync',
  813. meta: { title: i18n.t('tab.convenientDataSync'), icon: 'el-icon-refresh', noCache: true }
  814. }
  815. ]
  816. },
  817. {
  818. path: '/mysql_backups',
  819. component: Layout,
  820. redirect: '/mysql_backups/index',
  821. children: [
  822. {
  823. path: 'index',
  824. component: () => import('@/views/mysql-backups/index'),
  825. name: 'mysql-backups-index',
  826. meta: { title: '数据备份', icon: 'el-icon-refresh', noCache: true }
  827. }
  828. ]
  829. },
  830. {
  831. path: '/device_frame',
  832. component: Layout,
  833. redirect: '/device_frame/index',
  834. children: [
  835. {
  836. path: 'index',
  837. component: () => import('@/views/ncs-orginazition/device-frame'),
  838. name: 'admin-device-frame',
  839. meta: { title: i18n.t('tab.deviceFrame'), icon: 'nested', noCache: true },
  840. hidden: true
  841. }
  842. ]
  843. },
  844. { path: '*', redirect: '/404', hidden: true }
  845. ]
  846. const createRouter = () => new Router({
  847. mode: 'history', // require service support
  848. scrollBehavior: () => ({ y: 0 }),
  849. routes: constantRoutes
  850. })
  851. const router = createRouter()
  852. // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
  853. export function resetRouter() {
  854. const newRouter = createRouter()
  855. router.matcher = newRouter.matcher // reset router
  856. }
  857. export default router