123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- import Vue from 'vue'
- import VueRouter, { RouteConfig } from 'vue-router'
- // 解决Vue-Router升级导致的Uncaught(in promise) navigation guard问题
- const originalPush = VueRouter.prototype.push
- // @ts-ignore
- VueRouter.prototype.push = function push(location, onResolve, onReject) {
- if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
- // @ts-ignore
- return originalPush.call(this, location).catch((err) => err)
- }
- Vue.use(VueRouter)
- const routes: Array<RouteConfig> = [
- // 项目概况
- {
- path: '/',
- name: 'Overview',
- // redirect: '/otherMatter',
- component: () => import(/* webpackChunkName: "overview" */ '../views/overview/index.vue'),
- meta: {
- keepAlive: true,
- showTabbar: true,
- },
- },
- // 项目概况
- {
- path: '/overview',
- name: 'overview',
- component: () => import(/* webpackChunkName: "overview" */ '../views/overview/index.vue'),
- meta: {
- keepAlive: true,
- showTabbar: true,
- },
- },
- // 楼层功能
- {
- path: '/floorFunc',
- name: 'FloorFunc',
- component: () => import(/* webpackChunkName: "floorFunc" */ '../views/FloorFunc.vue'),
- meta: {
- keepAlive: true,
- showTabbar: true,
- },
- },
- // 设备设施
- {
- path: '/equipmentFacilities',
- name: 'EquipmentFacilities',
- component: () => import(/* webpackChunkName: "equipmentFacilities" */ '../views/EquipmentFacilities.vue'),
- meta: {
- keepAlive: true,
- showTabbar: true,
- },
- },
- // 其他事项
- {
- path: '/otherMatter',
- name: 'OtherMatter',
- component: () => import(/* webpackChunkName: "otherMatter" */ '../views/otherMatter/index.vue'),
- meta: {
- keepAlive: true,
- showTabbar: true,
- },
- },
- // 其他事项 --> 综合事项
- {
- path: '/comprehensiveMatter',
- name: 'ComprehensiveMatter',
- component: () => import(/* webpackChunkName: "comprehensiveMatter" */ '../views/otherMatter/ComprehensiveMatter.vue'),
- meta: {
- keepAlive: true,
- showTabbar: true,
- },
- },
- // 其他事项 --> 辅助用房
- {
- path: '/auxiliaryRoom',
- name: 'AuxiliaryRoom',
- component: () => import(/* webpackChunkName: "comprehensiveMatter" */ '../views/otherMatter/AuxiliaryRoom.vue'),
- meta: {
- keepAlive: true,
- showTabbar: true,
- },
- },
- // 说明书更新记录
- {
- path: '/updateRecord',
- name: 'UpdateRecord',
- component: () => import(/* webpackChunkName: "updateRecord" */ '../views/overview/UpdateRecord.vue'),
- meta: {
- keepAlive: false,
- showTabbar: false,
- hideNarBar: true,
- },
- },
- // 说明书更新记录详情
- {
- path: '/updateRecordDetail',
- name: 'UpdateRecordDetail',
- component: () => import(/* webpackChunkName: "updateRecord" */ '../views/overview/UpdateRecordDetail.vue'),
- meta: {
- keepAlive: false,
- showTabbar: false,
- hideNarBar: true,
- },
- },
- // 平面图查看
- {
- path: '/mapView',
- name: 'MapView',
- component: () => import(/* webpackChunkName: "mapView" */ '../views/overview/MapView.vue'),
- meta: {
- keepAlive: false,
- showTabbar: false,
- hideNarBar: true,
- },
- },
- ]
- const router = new VueRouter({
- mode: 'history',
- base: process.env.BASE_URL,
- routes,
- })
- export default router
|