import type { Route } from '@/global'

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

const routes: Route.recordRaw[] = [
  // 运行总览
  {
    path: '/labOverview',
    component: Layout,
    redirect: '/overview',
    name: 'LabOverview',
    meta: {
      title: '运行总览',
      icon: 'ep:key',
      auth: '/lab/overview',
    },
    children: [
      {
        path: '/overview',
        component: () => import('@/views/laboratory/overview/index.vue'),
        name: 'Overview',
        meta: {
          title: '运行总览',
          icon: 'ep:key',
          auth: '/lab/overview',
          sidebar: false,
          breadcrumb: false,
          activeMenu: '/labOverview',
        },
      },
    ],
  },
  {
    path: '/labEquipment',
    component: Layout,
    redirect: '/labEquipment/list',
    name: 'Manager',
    meta: {
      title: '设备管理',
      icon: 'ep:key',
      auth: '/lab/equipment',
    },
    children: [
      {
        path: 'list',
        name: 'LabEquipmentList',
        component: () => import('@/views/laboratory/equipment/list/list.vue'),
        meta: {
          title: '设备列表',
          auth: '/lab/equipment/list',
          icon: 'ep:key',
        },
      },
      {
        path: 'config',
        name: 'LabEquipmentConfig',
        component: () => import('@/views/laboratory/equipment/config/list.vue'),
        meta: {
          title: '设备配置',
          auth: '/lab/equipment/config',
          icon: 'ep:key',
        },
      },
      {
        path: ':type/:id?',
        name: 'BusinessManagerOderDetail',
        component: () => import('@/views/business/manager/order/detail.vue'),
        meta: {
          title: '任务单管理',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/manager/orderList',
        },
      },
    ],
  },
  {
    path: '/labData',
    component: Layout,
    redirect: '/labData/list',
    name: 'LabData',
    meta: {
      title: '数据列表',
      icon: 'ep:key',
      auth: '/lab/data',
    },
    children: [
      {
        path: 'list',
        name: 'LabDataList',
        component: () => import('@/views/laboratory/data/list.vue'),
        meta: {
          title: '数据列表',
          auth: '/lab/data/list',
          icon: 'ep:key',
        },
      },
    ],
  },
  {
    path: '/labPlace',
    component: Layout,
    redirect: '/labPlace/list',
    name: 'LabData',
    meta: {
      title: '地点管理',
      icon: 'ep:key',
      auth: '/lab/place',
    },
    children: [
      {
        path: 'list',
        name: 'LabDataList',
        component: () => import('@/views/laboratory/place/list.vue'),
        meta: {
          title: '地点管理',
          auth: '/lab/place/list',
          icon: 'ep:key',
        },
      },
    ],
  },
  {
    path: '/labAlarm',
    component: Layout,
    redirect: '/labAlarm/list',
    name: 'LabAlarm',
    meta: {
      title: '报警管理',
      icon: 'ep:key',
      auth: '/lab/alarm',
    },
    children: [
      {
        path: 'eventList',
        name: 'labAlarmEventList',
        component: () => import('@/views/laboratory/event/list.vue'),
        meta: {
          title: '事件管理',
          auth: '/lab/alarm/eventList',
          icon: 'ep:key',
        },
      },
      {
        path: 'currentList',
        name: 'labAlarmCurrentList',
        component: () => import('@/views/laboratory/current/list.vue'),
        meta: {
          title: '当前告警',
          auth: '/lab/alarm/currentList',
          icon: 'ep:key',
        },
      },
      {
        path: 'recordList',
        name: 'labAlarmCurrentList',
        component: () => import('@/views/laboratory/record/list.vue'),
        meta: {
          title: '报警记录',
          auth: '/lab/alarm/recordList',
          icon: 'ep:key',
        },
      },
    ],
  },
  {
    path: '/labStatement',
    component: Layout,
    redirect: '/labStatement/list',
    name: 'LabStatement',
    meta: {
      title: '报表管理',
      icon: 'ep:key',
      auth: '/lab/statement',
    },
    children: [
      {
        path: 'list',
        name: 'LabDataList',
        component: () => import('@/views/laboratory/statement/environment/list.vue'),
        meta: {
          title: '环境记录单',
          auth: '/lab/statement/environmentList',
          icon: 'ep:key',
        },
      },
    ],
  },
  // 系统管理
  {
    path: '/labSystem',
    component: Layout,
    redirect: '/labSystem/list',
    name: 'LabSystem',
    meta: {
      title: '系统管理',
      icon: 'ep:key',
      auth: '/lab/system',
    },
    children: [
      {
        path: 'fileConfigList',
        name: 'FileConfigList',
        component: () => import('@/views/system/fileConfiguration/configuration.vue'),
        meta: {
          title: '文件配置管理',
          auth: '/lab/system/fileConfigList',
          icon: 'ep:key',
        },
      },
      {
        path: 'dict',
        name: 'Dict',
        component: () => import('@/views/system/dict/listDict.vue'),
        meta: {
          title: '字典管理',
          icon: 'ep:key',
          auth: '/lab/system/dict',
        },
      },
      {
        path: 'businessLog',
        name: 'BusinessLog',
        component: () => import('@/views/system/log/listLog.vue'),
        meta: {
          title: '业务日志',
          icon: 'ep:key',
          auth: '/lab/system/log/biz/list',
        },
      },
      {
        path: 'error',
        name: 'ErrorLog',
        component: () => import('@/views/system/log/listErrorLog.vue'),
        meta: {
          title: '异常日志',
          icon: 'ep:key',
          auth: '/lab/system/log/error/list',
        },
      },
      {
        path: 'loginDiary',
        name: 'LoginDiaryLog',
        component: () => import('@/views/system/log/LoginLog.vue'),
        meta: {
          title: '登录日志',
          icon: 'ep:key',
          auth: '/lab/system/loginLog',
        },
      },
    ],
  },
]

export default routes
