import { createRouter, createWebHistory } from 'vue-router'
import NotFound from '@/views/404/index.vue'
import Layout from '@/layout/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: Layout,
      redirect: '/home',
      props(route) {
        return route.query
      },
      children: [
        {
          path: 'home',
          name: 'home',
          meta: { title: '奉节县旅游指挥调度中心' },
          component: () => import('@/views/home/index.vue')
        },
        {
          path: '/monitor',
          name: 'monitor',
          component: () => import('@/views/monitor/index.vue')
        },
        {
          path: '/scenic',
          name: 'scenic',
          component: () => import('@/views/scenic/index.vue')
        },
        {
          path: 'sentiment',
          name: 'sentiment',
          component: () => import('@/views/sentiment/index.vue')
        },
        {
          path: '/workOrder',
          name: 'workOrder',
          component: () => import('@/views/workOrder/index.vue')
        },
        {
          path: '/traffic',
          name: 'traffic',
          component: () => import('@/views/traffic/index.vue')
        },
        {
          path: '/sceneTesting',
          name: 'sceneTesting',
          component: () => import('@/views/testing/index.vue')
        },
        {
          path: '/roadTesting',
          name: 'roadTesting',
          component: () => import('@/views/testing/road.vue')
        },
        {
          path: '/hotel',
          name: 'hotel',
          component: () => import('@/views/hotel/index.vue')
        },
		{
		  path: '/vehicles',
		  name: 'vehicles',
		  component: () => import('@/views/vehicles/index.vue')
		},
		{
		  path: '/collect',
		  name: 'collect',
		  component: () => import('@/views/collect/index.vue')
		},
      ]
    },
    {
      path: '/404',
      name: 'NotFound',
      component: NotFound
    },
    {
      path: '/:pathMatch(.*)*',
      redirect: '/404'
    }
  ]
})

export default router
