| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- import Vue from 'vue'
- import VueRouter from 'vue-router'
- import Home from '../views/home/Index.vue'
- Vue.use(VueRouter)
- const routes = [
- {
- path: '/',
- redirect: '/login'
- },
- {
- path: '/home',
- redirect: '/home/cockpitManage',
- name: 'home',
- component: Home,
- children: [
- // 驾驶舱
- {
- path: 'cockpitManage',
- name: 'cockpitManage',
- component: () => import('../views/admin/cockpitManage/Index.vue')
- },
- // 电子地图
- {
- path: 'electronic-map',
- name: 'electronicMap',
- component: () =>
- import('../views/admin/cockpitManage/electronicMap.vue')
- },
- //数据操作
- {
- path: 'dataAdministration',
- name: 'dataAdministration',
- component: () =>
- import('../views/dataAdministration/index.vue')
- },
- //企业信息
- {
- path: 'enterprise',
- name: 'enterprise',
- component: () =>
- import('../views/ledger/enterprise.vue')
- },
- //风场信息
- {
- path: 'windsite',
- name: 'windsite',
- component: () =>
- import('../views/ledger/windsite.vue')
- },
- // 风机信息
- {
- path: 'draught',
- name: 'draught',
- component: () =>
- import('../views/ledger/draught.vue')
- },
- // 机型信息
- {
- path: 'milltype',
- name: 'milltype',
- component: () =>
- import('../views/ledger/milltype.vue')
- },
- // 测风塔信息
- {
- path: 'anemometer',
- name: 'anemometer',
- component: () =>
- import('../views/ledger/anemometer.vue')
- },
- ]
- },
- {
- path: '/login',
- name: 'login',
- component: () => import('../views/login/Index.vue')
- },
- {
- path: '/:pathMatch(.*)*',
- component: () => import('@/views/error/404.vue'),
- meta: { hidden: true }
- }
- // {
- // path: '*',
- // redirect: '/'
- // }
- ]
- const router = new VueRouter({
- mode: 'history',
- base: process.env.BASE_URL,
- scrollBehavior: () => ({
- y: 0
- }),
- routes
- })
- const originalPush = VueRouter.prototype.push
- VueRouter.prototype.push = function push(location) {
- return originalPush.call(this, location).catch((err) => err)
- }
- export default router
|