血透系统PC前端

index.js 3.6KB

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