import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: () => import('@/views/home/index.vue'),
      meta: {
        type: 'center',
        title: '首页',
      }
    },
    {
      path: '/',
      name: 'home',
      component: () => import('@/views/home/index.vue'),
      meta: {
        type: 'left',
        title: '项目信息',
      }
    },
    {
      path: '/menberManager',
      name: 'menberManager',
      component: () => import('@/views/menberManager/index.vue'),
      meta: {
        type: 'left',
        title: '人员管理',
      }
    },
    {
      path: '/safeManager',
      name: 'safeManager',
      component: () => import('@/views/safeManager/index.vue'),
      meta: {
        type: 'left',
        title: '安全管理',
      }
    },
    {
      path: '/digitalWorksite',
      name: 'digitalWorksite',
      component: () => import('@/views/digitalWorksite/index.vue'),
      meta: {
        type: 'left',
        title: '数字工地',
      }
    },
    {
      path: '/personnelLocation',
      name: 'personnelLocation',
      component: () => import('@/views/personnelLocation/index.vue'),
      meta: {
        type: 'right',
        title: '人员定位',
      }
    },
    {
      path: '/deviceAlert',
      name: 'deviceAlert',
      component: () => import('@/views/deviceAlert/index.vue'),
      meta: {
        type: 'right',
        title: '设备预警',
      }
    },
    {
      path: '/videoMonitoring',
      name: 'videoMonitoring',
      component: () => import('@/views/videoMonitoring/index.vue'),
      meta: {
        type: 'right',
        title: '视频监控',
      }
    },
    {
      path: '/environmentMonitoring',
      name: 'environmentMonitoring',
      component: () => import('@/views/environmentMonitoring/index.vue'),
      meta: {
        type: 'right',
        title: '环境监测',
      }
    },
  ]
})

// 路由守卫
// router.beforeEach((to, from, next) => {
//   next()
// })

export default router
