import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '../views/Home/Home.vue'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
  },
  {
    path: '/about',
    name: 'About',
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue'),
  },
  {
    path: '/status', // 状态监视
    name: 'Status',
    component: () => import(/* webpackChunkName: "status" */ '../views/Status/Status.vue'),
  },
  {
    path: '/agc', // AGC 监视
    name: 'Agc',
    component: () => import(/* webpackChunkName: "agc" */ '../views/Agc/Agc.vue'),
  },
  {
    path: '/windsite',
    name: 'WindSite',
    component: () => import(/* webpackChunkName: "windsite" */ '../views/WindSite/WindSite.vue'),
    children: [{
      path: 'home',  // 场站监视
      component: () => import(/* webpackChunkName: "windsitehome" */ '../views/WindSite/pages/Home/Home.vue'),
    }, {
      path: 'draughtfanlist',
      component: () => import(/* webpackChunkName: "windsitedraughtfanlist" */ '../views/WindSite/pages/DraughtFanList.vue'),
    }, {
      path: 'matrix', // 风场矩阵
      component: () => import(/* webpackChunkName: "windsitematrix" */ '../views/WindSite/pages/Matrix.vue'),
    }, {
      path: 'lightmatrix',
      component: () => import(/* webpackChunkName: "windsitelightmatrix" */ '../views/WindSite/pages/LightMatrix.vue'),
    }, {
      path: 'box',
      component: () => import(/* webpackChunkName: "windsitebox" */ '../views/WindSite/pages/Box.vue'),
    }, {
      path: 'info',
      component: () => import(/* webpackChunkName: "windsitebox" */ '../views/WindSite/pages/Info/Info.vue'),
    }, {
      path: 'tower',
      component: () => import(/* webpackChunkName: "windsitetower" */ '../views/WindSite/pages/Tower.vue'),
    }, {
      path: 'inverter-info',
      component: () => import(/* webpackChunkName: "windsitetower" */ '../views/WindSite/pages/Inverter-Info.vue'),
    }, {
      path: 'map',
      component: () => import(/* webpackChunkName: "windsitemap" */ '../views/WindSite/pages/Map.vue'),
    }]
  },
  {
    path: '/lightmatrix', // 光伏明细矩阵
    name: 'LightMatrix',
    component: () => import(/* webpackChunkName: "lightmatrix" */ '../views/LightMatrix/LightMatrix.vue'),
  },
  {
    path: '/lightmatrix1', // 基础矩阵
    name: 'LightMatrix1',
    component: () => import(/* webpackChunkName: "lightmatrix1" */ '../views/LightMatrix1/LightMatrix1.vue'),
  },
  {
    path: '/lightmatrix2', // 欠发矩阵
    name: 'LightMatrix2',
    component: () => import(/* webpackChunkName: "lightmatrix2" */ '../views/LightMatrix2/LightMatrix2.vue'),
  }, {
    path: '/lightmatrix3', // 明细矩阵
    name: 'LightMatrix3',
    component: () => import(/* webpackChunkName: "lightmatrix3" */ '../views/LightMatrix3/LightMatrix3.vue'),
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  base: '/zhfx/',
  routes
})

router.beforeEach((to, from, next) => {
  next()
})

export default router
