import type { Route } from '@/global'

const Layout = () => import('@/layouts/index.vue')

const routes: Route.recordRaw[] = [
  {
    path: '/basic/locate',
    component: Layout,
    redirect: '/basic/locate/list',
    name: 'Locate',
    meta: {
      title: '点位管理',
      icon: 'ep:key',
      auth: '/basic/locate',
    },
    children: [
      {
        path: 'list',
        name: 'LocateList',
        component: () => import('@/views/basic/locate/list.vue'),
        meta: {
          title: '点位列表',
          auth: '/basic/locate/list',
          sidebar: true,
          breadcrumb: true,
          activeMenu: '/basic/locate/list',
        },
      },
      {
        path: 'detail/:id?',
        name: 'LocateInfoDetail',
        component: () => import('@/views/basic/locate/detail.vue'),
        meta: {
          title: '点位详情',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/basic/locate/list',
        },
      },
      {
        path: 'pair',
        name: 'LocatePaier',
        component: () => import('@/views/basic/group/list.vue'),
        meta: {
          title: '点位关联管理',
          auth: '/basic/locate/pair',
          sidebar: true,
          breadcrumb: true,
          activeMenu: '/basic/locate/pair',
        },
      },
    ],
  },
  {
    path: '/leak/alarm',
    component: Layout,
    redirect: '/leak/alarm/list',
    name: 'LeakAlarm',
    meta: {
      title: '报警管理',
      icon: 'ep:key',
      auth: '/leak/alarm',
    },
    children: [
      {
        path: 'list',
        name: 'LeakAlarmList',
        component: () => import('@/views/basic/product/list.vue'),
        meta: {
          title: '当前报警',
          auth: '/leak/alarm/list',
          sidebar: true,
          breadcrumb: true,
          activeMenu: '/leak/alarm/list',
        },
      },
      {
        path: 'history',
        name: 'LeakAlarmHistory',
        component: () => import('@/views/basic/product/list.vue'),
        meta: {
          title: '报警记录',
          auth: '/leak/alarm/history',
          sidebar: true,
          breadcrumb: true,
          activeMenu: '/leak/alarm/history',
        },
      },
      {
        path: 'config',
        name: 'LeakAlarmConfig',
        component: () => import('@/views/basic/product/list.vue'),
        meta: {
          title: '报警规则配置',
          auth: '/leak/alarm/config',
          sidebar: true,
          breadcrumb: true,
          activeMenu: '/leak/alarm/config',
        },
      },
    ],
  },
  {
    path: '/basic/device',
    component: Layout,
    redirect: '/basic/device/list',
    name: 'Device',
    meta: {
      title: '设备管理',
      icon: 'ep:key',
      auth: '/basic/device',
    },
    children: [
      {
        path: 'list',
        name: 'DeviceList',
        component: () => import('@/views/basic/device/list.vue'),
        meta: {
          title: '设备列表',
          auth: '/basic/device/list',
          sidebar: true,
          breadcrumb: true,
          activeMenu: '/basic/device/list',
        },
      },
      {
        path: 'detail/:id?',
        name: 'DeviceInfoDetail',
        component: () => import('@/views/basic/device/detail.vue'),
        meta: {
          title: '设备详情',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/basic/device',
        },
      },
      {
        path: 'config',
        name: 'DeviceConfigList',
        component: () => import('@/views/basic/device/list.vue'),
        meta: {
          title: '设备配置',
          auth: '/basic/device/config',
          sidebar: true,
          breadcrumb: true,
          activeMenu: '/basic/device/config',
        },
      },
    ],
  },
  {
    path: '/data/query',
    component: Layout,
    redirect: '/data/query/list',
    name: 'Query',
    meta: {
      title: '数据管理',
      icon: 'ep:key',
      auth: '/data/query',
    },
    children: [
      {
        path: 'list',
        name: 'DataQueryList',
        component: () => import('@/views/data/query/list.vue'),
        meta: {
          title: '数据管理',
          auth: '/data/query/list',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/data/query',
        },
      },
      /* {
        path: 'detail/:id?',
        name: 'GroupInfoDetail',
        component: () => import('@/views/basic/group/detail.vue'),
        meta: {
          title: '分组详情',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/basic/group',
        },
      }, */
    ],
  },
]

export default routes
