血透系统PC前端

index.js 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. Vue.use(Router)
  4. /* Layout */
  5. import Layout from '@/views/layout/Layout'
  6. import data_dict from './modules/data_dict'
  7. import device from './modules/device'
  8. import dialysis from './modules/dialysis'
  9. import patient from './modules/patient'
  10. import qcd from './modules/qcd'
  11. import role from './modules/role'
  12. import stock from './modules/stock'
  13. import weight_sign from './modules/weight_sign'
  14. import workforce from './modules/workforce'
  15. import service from './modules/service'
  16. import org from './modules/org'
  17. /** note: submenu only apppear when children.length>=1
  18. * detail see https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
  19. **/
  20. /**
  21. * hidden: true if `hidden:true` will not show in the sidebar(default is false)
  22. * alwaysShow: true if set true, will always show the root menu, whatever its child routes length
  23. // 详见 xt_permission.xt_filterAsyncRouter 函数的逻辑
  24. is_menu: false 加载路由时验证用的(即该路由是否要在侧边栏展示,需要展示的即需要),为 false 时表示该路由不需要进行权限验证
  25. * if not set alwaysShow, only more than one route under the children
  26. * it will becomes nested mode, otherwise not show the root menu
  27. * redirect: noredirect if `redirect:noredirect` will no redirct in the breadcrumb
  28. * name:'router-name' the name is used by <keep-alive> (must set!!!)
  29. * meta : {
  30. title: 'title' the name show in submenu and breadcrumb (recommend set)
  31. icon: 'svg-name' the icon show in the sidebar,
  32. noCache: true if true ,the page will no be cached(default is false)
  33. // 详见 xt_permission.xt_filterAsyncRouter 函数的逻辑
  34. is_menu: false 加载路由时验证用的,为 false 时表示该路由不需要进行权限验证
  35. hidden: false 加载路由时验证用的,is_menu 为true时才有作用,为 true 时表示该路由需要进行权限验证
  36. }
  37. **/
  38. var _constant_router_map = [{
  39. path: '/token/verify',
  40. component: () => import('@/xt_pages/index/verify_token'),
  41. hidden: true
  42. },
  43. {
  44. path: '/404',
  45. component: () => import('@/views/errorPage/404'),
  46. hidden: true
  47. },
  48. {
  49. path: '/401',
  50. component: () => import('@/views/errorPage/401'),
  51. hidden: true
  52. },
  53. {
  54. path: '',
  55. component: Layout,
  56. redirect: '/home',
  57. children: [{
  58. path: '/home',
  59. component: () => import('@/xt_pages/home/index'),
  60. name: 'home',
  61. meta: {
  62. title: 'home',
  63. icon: 'dashboard',
  64. noCache: true
  65. }
  66. }]
  67. },
  68. service
  69. ]
  70. var _asy_router_map = [
  71. patient,
  72. workforce,
  73. weight_sign,
  74. dialysis,
  75. stock,
  76. qcd,
  77. data_dict,
  78. device,
  79. role,
  80. org
  81. ]
  82. var is_asy_router = process.env.NODE_ENV === 'production' // true; 设置为 true 强制进行路由验证
  83. if (!is_asy_router) {
  84. _constant_router_map = _constant_router_map.concat(_asy_router_map)
  85. _asy_router_map = []
  86. } else {
  87. }
  88. export const xt_constantRouterMap = _constant_router_map
  89. export const xt_asyncRouterMap = _asy_router_map
  90. export default new Router({
  91. // mode: 'history', // require service support
  92. scrollBehavior: () => ({
  93. y: 0
  94. }),
  95. routes: xt_constantRouterMap
  96. })