// 预警圈路由
const warningCircleRoutes = [
  {
    path: '/WarningCircle',
    name: 'warningCircle',
    component: () => import('@/views/WarningCircle.vue'),
    meta: {
      showFooter: true
    }
  },
  {
    path: '/WarningCircle/add',
    name: 'AddCircle',
    component: () => import('@/views/WarningCircle/AddCircle.vue'),
    meta: {
      showFooter: false
    }
  }
]

// 首页路由
const homeRoutes = [
  {
    path: '/home',
    name: 'Home',
    component: () => import('@/views/Home.vue'),
    meta: {
      showFooter: true
    }
  },
  {
    path: '/email',
    name: 'Email',
    component: () => import('@/views/Home/Email/Email.vue'),
    meta: {
      showFooter: false
    }
  }
]

/**
 * 路由配置
 * @type {import('vue-router').RouteRecordRaw[]}
 */
const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/layout',
    name: 'Layout',
    redirect: '/warningCircle',
    component: () => import('@/views/LayOut.vue'),
    children: [
      ...warningCircleRoutes,
      ...homeRoutes,
      {
        path: '/ai',
        name: 'Ai',
        component: () => import('@/views/Ai.vue'),
        meta: {
          showFooter: true
        }
      },
      {
        path: '/mine',
        name: 'Mine',
        component: () => import('@/views/Mine.vue'),
        meta: {
          showFooter: true
        }
      },
      {
        path: '/message',
        name: 'Message',
        component: () => import('@/views/Message.vue'),
        meta: {
          showFooter: true
        }
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login.vue')
  }
]

export default routes
