// 页面路由
import type { Route } from '@/global'

const Layout = () => import('@/layouts/index.vue')
const routes: Route.recordRaw[] = [
  {
    path: '/device',
    component: Layout,
    redirect: '/device/list',
    name: 'device',
    meta: {
      title: '设备管理',
      icon: 'icon-device',
    },
    children: [
      {
        path: 'list',
        name: 'DeviceList',
        component: () => import('@/views/page/device/index.vue'),
        meta: {
          title: '点位管理',
          breadcrumb: true,
          sidebar: true,
          activeMenu: '/device',
        },
      },
      {
        path: 'preview',
        name: 'VideoPreview',
        component: () => import('@/views/page/video/index.vue'),
        meta: {
          title: '视频预览',
          sidebar: true,
          breadcrumb: true,
          activeMenu: '/device',
        },
      },
    ],
  },
  {
    path: '/sence',
    component: Layout,
    redirect: '/sence/manage',
    name: 'sence',
    meta: {
      title: '场景管理',
      icon: 'icon-sence',
    },
    children: [
      {
        path: 'manage',
        name: 'SenceManage',
        component: () => import('@/views/page/sence/index.vue'),
        meta: {
          title: '场景管理',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/sence',
        },
      },
    ],
  },
  {
    path: '/model',
    component: Layout,
    redirect: '/model/manage',
    name: 'model',
    meta: {
      title: '算法管理',
      icon: 'icon-model',
    },
    children: [
      {
        path: 'manage',
        name: 'ModelManage',
        component: () => import('@/views/page/model/index.vue'),
        meta: {
          title: '算法管理',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/model',
        },
      },
    ],
  },

  {
    path: '/gas',
    component: Layout,
    redirect: '/gas/list',
    name: 'gas',
    meta: {
      title: '甲烷数据',
      icon: 'icon-gas',
    },
    children: [
      {
        path: 'list',
        name: 'GasList',
        component: () => import('@/views/page/gas/index.vue'),
        meta: {
          title: '甲烷数据',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/gas',
        },
      },
    ],
  },
  {
    path: '/identify',
    component: Layout,
    redirect: '/identify/result',
    name: 'identify',
    meta: {
      title: '识别结果',
      icon: 'icon-identify',
    },
    children: [
      {
        path: 'result',
        name: 'IdentifyResult',
        component: () => import('@/views/page/result/index.vue'),
        meta: {
          title: '识别结果',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/identify',
        },
      },
    ],
  },
]

export default routes
