index.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import Vue from 'vue'
  2. import VueRouter, { RouteConfig } from 'vue-router'
  3. // 解决Vue-Router升级导致的Uncaught(in promise) navigation guard问题
  4. const originalPush = VueRouter.prototype.push
  5. // @ts-ignore
  6. VueRouter.prototype.push = function push(location, onResolve, onReject) {
  7. if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
  8. // @ts-ignore
  9. return originalPush.call(this, location).catch((err) => err)
  10. }
  11. Vue.use(VueRouter)
  12. const routes: Array<RouteConfig> = [
  13. // 项目概况
  14. {
  15. path: '/',
  16. name: 'Overview',
  17. // redirect: '/otherMatter',
  18. component: () => import(/* webpackChunkName: "overview" */ '../views/overview/index.vue'),
  19. meta: {
  20. keepAlive: true,
  21. showTabbar: true,
  22. },
  23. },
  24. // 项目概况
  25. {
  26. path: '/overview',
  27. name: 'overview',
  28. component: () => import(/* webpackChunkName: "overview" */ '../views/overview/index.vue'),
  29. meta: {
  30. keepAlive: true,
  31. showTabbar: true,
  32. },
  33. },
  34. // 楼层功能
  35. {
  36. path: '/floorFunc',
  37. name: 'FloorFunc',
  38. component: () => import(/* webpackChunkName: "floorFunc" */ '../views/FloorFunc.vue'),
  39. meta: {
  40. keepAlive: true,
  41. showTabbar: true,
  42. },
  43. },
  44. // 设备设施
  45. {
  46. path: '/equipmentFacilities',
  47. name: 'EquipmentFacilities',
  48. component: () => import(/* webpackChunkName: "equipmentFacilities" */ '../views/EquipmentFacilities.vue'),
  49. meta: {
  50. keepAlive: true,
  51. showTabbar: true,
  52. },
  53. },
  54. // 其他事项
  55. {
  56. path: '/otherMatter',
  57. name: 'OtherMatter',
  58. component: () => import(/* webpackChunkName: "otherMatter" */ '../views/otherMatter/index.vue'),
  59. meta: {
  60. keepAlive: true,
  61. showTabbar: true,
  62. },
  63. },
  64. // 其他事项 --> 综合事项
  65. {
  66. path: '/comprehensiveMatter',
  67. name: 'ComprehensiveMatter',
  68. component: () => import(/* webpackChunkName: "comprehensiveMatter" */ '../views/otherMatter/ComprehensiveMatter.vue'),
  69. meta: {
  70. keepAlive: true,
  71. showTabbar: true,
  72. },
  73. },
  74. // 其他事项 --> 辅助用房
  75. {
  76. path: '/auxiliaryRoom',
  77. name: 'AuxiliaryRoom',
  78. component: () => import(/* webpackChunkName: "comprehensiveMatter" */ '../views/otherMatter/AuxiliaryRoom.vue'),
  79. meta: {
  80. keepAlive: true,
  81. showTabbar: true,
  82. },
  83. },
  84. // 说明书更新记录
  85. {
  86. path: '/updateRecord',
  87. name: 'UpdateRecord',
  88. component: () => import(/* webpackChunkName: "updateRecord" */ '../views/overview/UpdateRecord.vue'),
  89. meta: {
  90. keepAlive: false,
  91. showTabbar: false,
  92. hideNarBar: true,
  93. },
  94. },
  95. // 说明书更新记录详情
  96. {
  97. path: '/updateRecordDetail',
  98. name: 'UpdateRecordDetail',
  99. component: () => import(/* webpackChunkName: "updateRecord" */ '../views/overview/UpdateRecordDetail.vue'),
  100. meta: {
  101. keepAlive: false,
  102. showTabbar: false,
  103. hideNarBar: true,
  104. },
  105. },
  106. // 平面图查看
  107. {
  108. path: '/mapView',
  109. name: 'MapView',
  110. component: () => import(/* webpackChunkName: "mapView" */ '../views/overview/MapView.vue'),
  111. meta: {
  112. keepAlive: false,
  113. showTabbar: false,
  114. hideNarBar: true,
  115. },
  116. },
  117. ]
  118. const router = new VueRouter({
  119. mode: 'history',
  120. base: process.env.BASE_URL,
  121. routes,
  122. })
  123. export default router