index.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771
  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: 'part-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. path: 'device',
  95. name: 'part-device',
  96. component: () => import('@/views/ncs-device/index'),
  97. redirect: '/frame/device/list',
  98. meta: {
  99. title: i18n.t('deviceManage.deviceManage'),
  100. icon: 'devices'
  101. },
  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: 'device_menu',
  160. component: () => import('@/views/ncs-device-menu/index'),
  161. name: 'device-menu',
  162. meta: { title: i18n.t('tab.deviceMenuManager'), icon: 'el-icon-menu', noCache: true }
  163. },
  164. {
  165. path: 'led',
  166. component: () => import('@/views/ncs-led/ledDeviceManagement'),
  167. name: 'led-manager',
  168. meta: { title: i18n.t('tab.ledDeviceManager'), icon: 'led', noCache: true },
  169. hidden: uiVersion === 2
  170. },
  171. {
  172. path: 'led-control',
  173. component: () => import('@/views/ncs-led/ledControl'),
  174. name: 'led-control',
  175. meta: { title: i18n.t('tab.ledDevice'), icon: 'el-icon-message-solid', noCache: true }, // LED点阵屏
  176. hidden: true
  177. }
  178. ]
  179. }
  180. ]
  181. },
  182. //职员相关
  183. {
  184. path: '/clerk',
  185. component: Layout,
  186. redirect: '/clerk/list',
  187. name: 'part-clerk',
  188. meta: { title: i18n.t('tab.clerkManage'), icon: 'peoples', noCache: true },
  189. children: [
  190. {
  191. path: 'list',
  192. component: () => import('@/views/ncs-clerk/clerkManagement'),
  193. name: 'clerk-list',
  194. meta: { title: i18n.t('tab.clerkManage'), icon: 'el-icon-user-solid', noCache: true }
  195. },
  196. {
  197. path: 'nfc_interaction_list',
  198. component: () => import('@/views/nfc-interaction/index'),
  199. name: 'nfc-interaction-list',
  200. meta: { title: i18n.t('tab.clerkCalendar'), icon: 'el-icon-date', noCache: true }
  201. }
  202. ]
  203. },
  204. //门禁
  205. {
  206. path: '/entrace_guard',
  207. component: Layout,
  208. name: 'entrace-guard',
  209. hidden: !enableEntraceguard,
  210. children: [
  211. {
  212. path: 'users',
  213. component: () => import('@/views/entrace-guard/users'),
  214. name: 'entrace-guard',
  215. meta: { title: i18n.t('tab.entraceguardUser'), icon: 'pass_through', noCache: true },
  216. hidden: !enableEntraceguard
  217. }]
  218. },
  219. //客户信息
  220. {
  221. path: '/customer',
  222. component: Layout,
  223. redirect: '/customer/list',
  224. name: 'customer',
  225. children: [
  226. {
  227. path: 'list',
  228. component: () => uiVersion === 1 ? import('@/views/customer/patientManagement') : uiVersion === 2 ? import('@/views/customer/customerManagement') : import('@/views/customer/elderlyCareManagement'),
  229. name: 'customer-manager',
  230. meta: {
  231. title: uiVersion === 1 ? i18n.t('tab.patientManage') : i18n.t('tab.customerManage'),
  232. icon: 'el-icon-s-custom',
  233. noCache: true
  234. }
  235. },
  236. {
  237. path: 'map',
  238. component: () => import('@/views/customer/allMap'),
  239. name: 'map',
  240. meta: { title: '用户分布', icon: 'area', noCache: true },
  241. hidden: true
  242. },
  243. {
  244. path: '/advice/:id?',
  245. component: () => import('@/views/ncs-advice/index'),
  246. name: 'advice',
  247. meta: { title: i18n.t('tab.customerAdvice'), icon: 'area', noCache: true },
  248. hidden: true
  249. }
  250. ]
  251. },
  252. //便签
  253. {
  254. path: '/remark',
  255. component: Layout,
  256. name: 'remark-list',
  257. children: [
  258. {
  259. path: 'list',
  260. component: () => import('@/views/ncs-remark/index'),
  261. name: 'remark-list',
  262. meta: { title: i18n.t('tab.remarkManage'), icon: 'el-icon-s-order', noCache: true }
  263. }
  264. ]
  265. },
  266. //任务
  267. {
  268. path: '/task',
  269. component: Layout,
  270. name: 'task-list',
  271. children: [
  272. {
  273. path: 'list',
  274. component: () => import('@/views/ncs-task/index'),
  275. name: 'task-list',
  276. meta: { title: i18n.t('tab.taskManage'), icon: 'table', noCache: true }
  277. }
  278. ]
  279. },
  280. //交互信息
  281. {
  282. path: '/interaction',
  283. component: Layout,
  284. redirect: '/interaction/history',
  285. name: 'interaction',
  286. meta: { title: i18n.t('tab.interaction'), icon: 'list', noCache: true },
  287. children: [
  288. {
  289. path: 'history',
  290. component: () => import('@/views/ncs-interaction/index'),
  291. name: 'interaction-history',
  292. meta: { title: i18n.t('tab.interactionHistory'), icon: 'list', noCache: true }
  293. },{
  294. path: 'chars',
  295. component: () => import('@/views/ncs-chars/index'),
  296. name: 'interaction-chars',
  297. meta: { title: i18n.t('tab.interactionChars'), icon: 'el-icon-pie-chart', noCache: true }
  298. }
  299. ]
  300. },
  301. //广播
  302. {
  303. path: '/broadcast',
  304. component: Layout,
  305. name: 'broadcast',
  306. hidden: !enableBroadcast || uiVersion !== 1,
  307. children: [
  308. {
  309. path: 'index',
  310. component: () => import('@/views/ncs-broadcast/index'),
  311. name: 'broadcast',
  312. meta: { title: i18n.t('tab.broadcastManage'), icon: 'el-icon-headset', noCache: true }, // 广播设置
  313. hidden: !enableBroadcast || uiVersion !== 1
  314. },
  315. {
  316. path: 'edit/:id?',
  317. component: () => import('@/views/ncs-broadcast/broadcastEdit'),
  318. name: 'broadcast-edit',
  319. meta: { title: i18n.t('tab.broadcastEdit'), icon: 'area', noCache: true },
  320. hidden: true
  321. }
  322. ]
  323. },{
  324. path: '/infoboard_designer',
  325. component: Layout,
  326. name: 'infoboard-designer',
  327. children: [
  328. {
  329. path: 'index/:id?',
  330. component: () => import('@/views/custom-infoboard/infoboard-designer'), // 自定义看板 component: () => import('@/views/custom-infoboard/infoboard-designer'),资阳 component: () => import('@/views/custom-infoboard/screen-designer')
  331. name: 'infoboard-designer',
  332. meta: { title: i18n.t('tab.customBoardDesigner'), icon: 'el-icon-data-board', noCache: true }
  333. }
  334. ],
  335. hidden: true
  336. },{
  337. path: '/settings',
  338. component: Layout,
  339. redirect: '/settings/index',
  340. name: 'part-settings',
  341. meta: {
  342. title: i18n.t('tab.settings'),
  343. icon: 'el-icon-s-tools'
  344. },
  345. children: [
  346. {
  347. path: 'index',
  348. component: () => import('@/views/calling-setting/index'),
  349. name: 'part-settings',
  350. meta: { title: i18n.t('tab.partSettings'), icon: 'el-icon-s-tools', noCache: true } // 机构设置
  351. },{
  352. path: 'nurse_config',
  353. component: () => import('@/views/ncs-nurse-config/index'),
  354. name: 'nurse-config',
  355. meta: { title: i18n.t('tab.nurseConfig'), icon: 'care1', noCache: true }, // 护理参数
  356. hidden: uiVersion !== 1
  357. },{
  358. path: 'channel',
  359. component: () => import('@/views/ncs-channel/index'),
  360. name: 'channel',
  361. meta: { title: i18n.t('tab.channelManage'), icon: 'el-icon-mobile-phone', noCache: true },
  362. children: [{
  363. path: 'history/:id?',
  364. component: () => import('@/views/ncs-channel/channelImHistory'),
  365. name: 'channel-im-history',
  366. meta: { title: i18n.t('tab.channelImHistory'), icon: 'area', noCache: true },
  367. hidden: true
  368. }
  369. ]
  370. },{
  371. path: 'event_list',
  372. component: () => import('@/views/ncs-event/index'),
  373. name: 'event-list',
  374. meta: { title: i18n.t('tab.eventManage'), icon: 'el-icon-notebook-2', noCache: true }
  375. },{
  376. path: 'components',
  377. component: () => import('@/views/hospitalFrame/index'),
  378. redirect: '/settings/components/function_mapping',
  379. name: 'beds-side',
  380. meta: {
  381. title: i18n.t('tab.bedsideInteration'),
  382. icon: 'component'
  383. },
  384. children: [
  385. {
  386. path: 'function_mapping',
  387. component: () => import('@/views/function-mapping/index'),
  388. name: 'function-mapping',
  389. meta: { title: i18n.t('tab.functionRoleMapping'), icon: 'function', noCache: true }
  390. },
  391. {
  392. path: 'interaction_chain',
  393. component: () => import('@/views/interaction-chain/index'),
  394. name: 'interaction-chain',
  395. meta: { title: i18n.t('tab.interactionChain'), icon: 'squence', noCache: true } // 交互接收顺序
  396. },
  397. {
  398. path: 'countdonw',
  399. component: () => import('@/views/ncs-countdown-config/index'),
  400. name: 'countdown-config',
  401. meta: { title: i18n.t('tab.countdownConfig'), icon: 'countdown', noCache: true }
  402. },
  403. {
  404. path: 'screentip',
  405. component: () => import('@/views/ncs-screentip/index'),
  406. name: 'screen-tip',
  407. meta: { title: i18n.t('tab.screentip'), icon: 'screen_tip', noCache: true }
  408. }
  409. ]
  410. },{
  411. path: '/frame_group',
  412. component: () => import('@/views/hospitalFrame/index'),
  413. name: 'frame-group',
  414. children: [
  415. {
  416. path: 'index',
  417. component: () => import('@/views/hospitalFrame/frameGroup'),
  418. name: 'frame-group',
  419. meta: { title: i18n.t('tab.frameGroupManage'), icon: 'area', noCache: true }
  420. },
  421. {
  422. path: 'edit/:id?',
  423. component: () => import('@/views/hospitalFrame/frameGroupEdit'),
  424. name: 'frame-group-edit',
  425. meta: { title: i18n.t('tab.frameGroupEdit'), icon: 'area', noCache: true },
  426. hidden: true
  427. },
  428. {
  429. path: 'watch_frame/:id?',
  430. component: () => import('@/views/hospitalFrame/nurse_watch_frame'),
  431. name: 'nurse-watch-frame',
  432. meta: { title: i18n.t('tab.watchFrameManage'), icon: 'area', noCache: true },
  433. hidden: true
  434. }
  435. ]
  436. }
  437. ]
  438. },
  439. { path: '*', redirect: '/404', hidden: true }
  440. ]
  441. export const hospitalRoutes = [
  442. {
  443. path: '/hospital/ncs_frame',
  444. component: Layout,
  445. redirect: '/ncs_frame/index',
  446. children: [
  447. {
  448. path: 'index',
  449. component: () => import('@/views/hospital/ncs_frame/frameTreeView'),
  450. name: 'hospital_frameTreeView',
  451. meta: { title: i18n.t('tab.frameManage'), icon: 'tree', noCache: true }
  452. }
  453. ]
  454. },
  455. {
  456. path: '/hospital/ncs_device',
  457. component: Layout,
  458. redirect: '/ncs_device/index',
  459. children: [
  460. {
  461. path: 'index',
  462. component: () => import('@/views/hospital/deviceManagement'),
  463. name: 'hospital_deviceList',
  464. meta: { title: i18n.t('tab.deviceManage'), icon: 'component', noCache: true }
  465. }
  466. ]
  467. },
  468. {
  469. path: '/hospital/ncs_clerk',
  470. component: Layout,
  471. redirect: '/ncs_clerk/index',
  472. children: [
  473. {
  474. path: 'index',
  475. component: () => import('@/views/hospital/clerkManager'),
  476. name: 'hospital_clerkList',
  477. meta: { title: i18n.t('tab.clerkManage'), icon: 'peoples', noCache: true }
  478. }
  479. ]
  480. },
  481. {
  482. path: '/hospital/ncs_customer',
  483. component: Layout,
  484. redirect: '/ncs_customer/index',
  485. children: [
  486. {
  487. path: 'index',
  488. component: () => import('@/views/hospital/customerManagement'),
  489. name: 'customer-list',
  490. meta: { title: i18n.t('tab.customerManage'), icon: 'el-icon-s-custom', noCache: true }
  491. }
  492. ]
  493. },
  494. {
  495. path: '/hospital/ncs_led',
  496. component: Layout,
  497. redirect: '/ncs_led/index',
  498. children: [
  499. {
  500. path: 'index',
  501. component: () => import('@/views/hospital/ledControl'),
  502. name: 'hospital_led',
  503. meta: { title: i18n.t('tab.ledDevice'), icon: 'el-icon-message-solid', noCache: true }
  504. }
  505. ]
  506. },
  507. { path: '*', redirect: '/404', hidden: true }
  508. ]
  509. export const adminRoutes = [
  510. {
  511. path: '/frame',
  512. component: Layout,
  513. redirect: '/frame/index',
  514. children: [
  515. {
  516. path: 'index',
  517. component: () => import('@/views/hospitalFrame/frameTreeView-admin'),
  518. name: 'admin-frame',
  519. meta: { title: i18n.t('tab.frameManage'), icon: 'tree', noCache: true }
  520. }
  521. ]
  522. },
  523. {
  524. path: '/clerk',
  525. component: Layout,
  526. redirect: '/clerk/index',
  527. children: [
  528. {
  529. path: 'index',
  530. component: () => import('@/views/ncs-clerk/clerk-admin'),
  531. name: 'admin-clerk',
  532. meta: { title: i18n.t('tab.allClerk'), icon: 'peoples', noCache: true }
  533. }
  534. ]
  535. },
  536. {
  537. path: '/customer',
  538. component: Layout,
  539. redirect: '/customer/index',
  540. children: [
  541. {
  542. path: 'index',
  543. component: () => import('@/views/customer/customer-admin'),
  544. name: 'admin-customer',
  545. meta: { title: i18n.t('tab.allCustomer'), icon: 'el-icon-s-custom', noCache: true }
  546. }
  547. ]
  548. },
  549. {
  550. path: '/device',
  551. component: Layout,
  552. redirect: '/device/index',
  553. meta: {
  554. title: i18n.t('deviceManage.deviceManage'),
  555. icon: 'devices'
  556. },
  557. children: [
  558. {
  559. path: 'index',
  560. component: () => import('@/views/ncs-device/device-admin'),
  561. name: 'admin-device',
  562. meta: { title: i18n.t('tab.allDevice'), icon: 'component', noCache: true }
  563. },
  564. {
  565. path: 'device_menu',
  566. component: () => import('@/views/ncs-device-menu/deviceMenuManagement'),
  567. name: 'admin-device_menu',
  568. meta: { title: i18n.t('tab.deviceMenuManager'), icon: 'el-icon-menu', noCache: true }
  569. },
  570. {
  571. path: 'linux_version',
  572. component: () => import('@/views/ncs-linux-version/linuxVersionSetting'),
  573. name: 'admin-linux-version',
  574. meta: { title: i18n.t('tab.linuxVersion'), icon: 'nested', noCache: true },
  575. hidden: !enableLinux
  576. },
  577. {
  578. path: 'led_device',
  579. component: () => import('@/views/ncs-led/led-admin'),
  580. name: 'admin-led-device',
  581. meta: { title: i18n.t('tab.ledDeviceManager'), icon: 'led', noCache: true }
  582. }
  583. ]
  584. },
  585. {
  586. path: '/event',
  587. component: Layout,
  588. redirect: '/event/index',
  589. children: [
  590. {
  591. path: 'index',
  592. component: () => import('@/views/ncs-event/eventManagement'),
  593. name: 'admin-event',
  594. meta: { title: i18n.t('tab.eventManage'), icon: 'el-icon-notebook-2', noCache: true }
  595. }
  596. ]
  597. },
  598. {
  599. path: '/his',
  600. component: Layout,
  601. redirect: '/his/index',
  602. children: [
  603. {
  604. path: 'index',
  605. component: () => import('@/views/ncs-his/hisManagement'),
  606. name: 'admin-hist',
  607. meta: { title: i18n.t('tab.hisManage'), icon: 'el-icon-search', noCache: true }
  608. },
  609. {
  610. path: 'patient/:keyval?',
  611. component: () => import('@/views/ncs-his/his-patient/hisPatientManage'),
  612. name: 'admin-his-patient',
  613. meta: { title: i18n.t('his.hisPatient'), icon: 'el-icon-search', noCache: true },
  614. hidden: true
  615. },
  616. {
  617. path: 'clerk/:keyval?',
  618. component: () => import('@/views/ncs-his/his-clerk/hisClerkManager'),
  619. name: 'admin-his-clerk',
  620. meta: { title: i18n.t('his.hisClerk'), icon: 'el-icon-search', noCache: true },
  621. hidden: true
  622. },
  623. {
  624. path: 'nurse_config/:keyval?',
  625. component: () => import('@/views/ncs-his/his-nurse-config/hisNurseConfigManager'),
  626. name: 'admin-his-nurse-config',
  627. meta: { title: i18n.t('his.hisNurseConfig'), icon: 'el-icon-search', noCache: true },
  628. hidden: true
  629. }
  630. ]
  631. },
  632. {
  633. path: '/error_log',
  634. component: Layout,
  635. redirect: '/error_log/index',
  636. children: [
  637. {
  638. path: 'index',
  639. component: () => import('@/views/calling-ncError/index'),
  640. name: 'admin-error-log',
  641. meta: { title: i18n.t('tab.errorLog'), icon: 'bug', noCache: true }
  642. }
  643. ]
  644. },
  645. {
  646. path: '/system_config',
  647. component: Layout,
  648. redirect: '/system_config/index',
  649. children: [
  650. {
  651. path: 'index',
  652. component: () => import('@/views/ncs-system-config/index'),
  653. name: 'admin-system-config',
  654. meta: { title: i18n.t('tab.systemConfig'), icon: 'nested', noCache: true }
  655. }
  656. ]
  657. },{
  658. path: '/menu',
  659. component: Layout,
  660. redirect: '/menu/index',
  661. children: [
  662. {
  663. path: 'index',
  664. component: () => import('@/views/ncs-menu/menuManager'),
  665. name: 'admin-menu',
  666. meta: { title: i18n.t('tab.menuManage'), icon: 'function', noCache: true }
  667. }
  668. ]
  669. },
  670. {
  671. path: '/orginazition',
  672. component: Layout,
  673. redirect: '/orginazition/index',
  674. children: [
  675. {
  676. path: 'index',
  677. component: () => import('@/views/ncs-orginazition/index'),
  678. name: 'admin-organization',
  679. meta: { title: i18n.t('tab.organization'), icon: 'tree', noCache: true }
  680. },{
  681. path: 'index/:id?',
  682. component: () => import('@/views/ncs-orginazition/partInfoSetting'),
  683. name: 'admin-part-settings',
  684. meta: { title: i18n.t('tab.shopSetting'), icon: 'nested', noCache: true },
  685. hidden: true
  686. }
  687. ]
  688. },
  689. {
  690. path: '/rolemanager',
  691. component: Layout,
  692. redirect: '/rolemanager/index',
  693. children: [
  694. {
  695. path: 'index',
  696. component: () => import('@/views/ncs-auth/superadmin/defaultRoleManager'),
  697. name: 'admin-rolemanager',
  698. meta: { title: i18n.t('tab.roleManage'), icon: 'authen', noCache: true }
  699. }
  700. ]
  701. },
  702. {
  703. path: '/485',
  704. component: Layout,
  705. redirect: '/485/index',
  706. children: [
  707. {
  708. path: 'index',
  709. component: () => import('@/views/ncs-485/index'),
  710. name: 'admin-485-commissioning',
  711. meta: { title: i18n.t('tab.debugging485'), icon: 'authen', noCache: true }
  712. }
  713. ],
  714. hidden: !enable485
  715. },
  716. {
  717. path: '/interaction_push',
  718. component: Layout,
  719. redirect: '/interaction_push/index',
  720. children: [
  721. {
  722. path: 'index',
  723. component: () => import('@/views/ncs-interaction-push-config/index'),
  724. name: 'admin-interaction-push',
  725. meta: { title: i18n.t('tab.interactionPush'), icon: 'el-icon-s-promotion', noCache: true }
  726. },
  727. {
  728. path: 'paramer-config/:id?',
  729. component: () => import('@/views/ncs-interaction-push-config/param-config'),
  730. name: 'admin-interaction-push-config',
  731. meta: { title: i18n.t('tab.interactionPushParamConfig'), icon: 'el-icon-s-promotion', noCache: true },
  732. hidden: true
  733. }
  734. ]
  735. },
  736. {
  737. path: '/device_frame',
  738. component: Layout,
  739. redirect: '/device_frame/index',
  740. children: [
  741. {
  742. path: 'index',
  743. component: () => import('@/views/ncs-orginazition/device-frame'),
  744. name: 'admin-device-frame',
  745. meta: { title: i18n.t('tab.deviceFrame'), icon: 'nested', noCache: true },
  746. hidden: true
  747. }
  748. ]
  749. },
  750. { path: '*', redirect: '/404', hidden: true }
  751. ]
  752. const createRouter = () => new Router({
  753. mode: 'history', // require service support
  754. scrollBehavior: () => ({ y: 0 }),
  755. routes: constantRoutes
  756. })
  757. const router = createRouter()
  758. // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
  759. export function resetRouter() {
  760. const newRouter = createRouter()
  761. router.matcher = newRouter.matcher // reset router
  762. }
  763. export default router