// 页面路由
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: '设备管理',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/device',
        },
      },
    ],
  },
  {
    path: '/video',
    component: Layout,
    redirect: '/video/preview',
    name: 'video',
    meta: {
      title: '视频预览',
      icon: 'icon-video',
    },
    children: [
      {
        path: 'preview',
        name: 'VideoPreview',
        component: () => import('@/views/page/video/index.vue'),
        meta: {
          title: '视频预览',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/video',
        },
      },
    ],
  },
  {
    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: '/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
