123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- import Vue from 'vue'
- import store from '@/store'
- import VueRouter, { RouteConfig } from 'vue-router'
- const originalPush = VueRouter.prototype.push
- VueRouter.prototype.push = function push(location, onResolve, onReject) {
- if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
-
- return originalPush.call(this, location).catch((err) => err)
- }
- import { getPvUv } from '@/api/public.js'
- Vue.use(VueRouter)
- const routes: Array<RouteConfig> = [
-
- {
- path: '/',
- name: 'Overview',
-
- component: () => import( '../views/overview/index.vue'),
- meta: {
- keepAlive: true,
- showTabbar: true,
- },
- },
-
- {
- path: '/overview',
- name: 'Overview',
- component: () => import( '../views/overview/index.vue'),
- meta: {
- keepAlive: true,
- showTabbar: true,
- },
- },
-
- {
- path: '/floorFunc',
- name: 'FloorFunc',
- component: () => import( '../views/FloorFunc.vue'),
- meta: {
- keepAlive: true,
- showTabbar: true,
- },
- },
-
- {
- path: '/equipmentFacilities',
- name: 'EquipmentFacilities',
- component: () => import( '../views/equipmentFacilities/index.vue'),
- meta: {
- keepAlive: true,
- showTabbar: true,
- },
- },
-
- {
- path: '/equipmentList',
- name: 'EquipmentList',
- component: () => import( '../views/equipmentFacilities/EquipmentList.vue'),
- meta: {
- keepAlive: false,
- showTabbar: false,
- hideNarBar: true,
- },
- },
-
- {
- path: '/moreEquipmentList',
- name: 'MoreEquipmentList',
- component: () => import( '../views/equipmentFacilities/MoreEquipmentList.vue'),
- meta: {
- keepAlive: false,
- showTabbar: false,
- hideNarBar: true,
- },
- },
-
- {
- path: '/engineRoomPicture',
- name: 'EngineRoomPicture',
- component: () => import( '../views/equipmentFacilities/EngineRoomPicture.vue'),
- meta: {
- keepAlive: false,
- showTabbar: false,
- hideNarBar: true,
- },
- },
-
- {
- path: '/systemFloor',
- name: 'SystemFloor',
- component: () => import( '../views/equipmentFacilities/SystemFloor.vue'),
- meta: {
- keepAlive: false,
- showTabbar: true,
- hideNarBar: true,
- },
- },
-
- {
- path: '/electricWell',
- name: 'ElectricWell',
- component: () => import( '../views/equipmentFacilities/ElectricWell.vue'),
- meta: {
- keepAlive: false,
- showTabbar: false,
- hideNarBar: true,
- },
- },
-
- {
- path: '/lowVoltageCabinet',
- name: 'LowVoltageCabinet',
- component: () => import( '../views/equipmentFacilities/LowVoltageCabinet.vue'),
- meta: {
- keepAlive: false,
- showTabbar: false,
- hideNarBar: true,
- },
- },
-
- {
- path: '/otherMatter',
- name: 'OtherMatter',
- component: () => import( '../views/otherMatter/index.vue'),
- meta: {
- keepAlive: true,
- showTabbar: true,
- },
- },
-
- {
- path: '/comprehensiveMatter',
- name: 'ComprehensiveMatter',
- component: () => import( '../views/otherMatter/ComprehensiveMatter.vue'),
- meta: {
- keepAlive: true,
- showTabbar: true,
- },
- },
-
- {
- path: '/comprehensiveMatterList',
- name: 'ComprehensiveMatterList',
- component: () => import( '../views/otherMatter/ComprehensiveMatterList.vue'),
- meta: {
- keepAlive: false,
- showTabbar: false,
- hideNarBar: true,
- },
- },
-
- {
- path: '/auxiliaryRoom',
- name: 'AuxiliaryRoom',
- component: () => import( '../views/otherMatter/AuxiliaryRoom.vue'),
- meta: {
- keepAlive: false,
- showTabbar: true,
- },
- },
-
- {
- path: '/updateRecord',
- name: 'UpdateRecord',
- component: () => import( '../views/overview/UpdateRecord.vue'),
- meta: {
- keepAlive: true,
- showTabbar: false,
- hideNarBar: true,
- },
- },
-
- {
- path: '/updateRecordDetail',
- name: 'UpdateRecordDetail',
- component: () => import( '../views/overview/UpdateRecordDetail.vue'),
- meta: {
- keepAlive: false,
- showTabbar: false,
- hideNarBar: true,
- },
- },
-
- {
- path: '/mapView',
- name: 'MapView',
- component: () => import( '../views/overview/MapView.vue'),
- meta: {
- keepAlive: false,
- showTabbar: false,
- hideNarBar: true,
- },
- },
-
- {
- path: '/globalSearch',
- name: 'GlobalSearch',
- component: () => import( '../views/GlobalSearch.vue'),
- meta: {
- keepAlive: false,
- showTabbar: false,
- hideNarBar: true,
- },
- },
-
- {
- path: '/assetDetail',
- name: 'AssetDetail',
- component: () => import( '../views/AssetDetail.vue'),
- meta: {
- keepAlive: false,
- showTabbar: false,
- hideNarBar: true,
- },
- },
- ]
- const router = new VueRouter({
- mode: 'history',
- base: process.env.BASE_URL,
- routes,
- })
- router.afterEach((to, from) => {
-
-
- let pupvArr = ['Overview', 'FloorFunc', 'EquipmentFacilities', 'OtherMatter']
-
-
- if (!pupvArr.includes(to.name) || !pupvArr.includes(from.name)) {
- return true
- }
- let postParams = {
- type: 'router',
- target: to.name,
- parameter: to.path,
- app: 'H5',
- }
- const data = {
- plazaId: store.getters['plazaId'],
- }
- getPvUv(data, postParams)
- .then((res: any) => {
-
- })
- .catch((res: any) => {
-
- })
- })
- export default router
|