import type { Route } from '@/global'
// 业务管理
const Layout = () => import('@/layouts/index.vue')

const routes: Route.recordRaw[] = [
  {
    path: '/businessManage',
    component: Layout,
    redirect: '/businessManage/bench',
    name: 'BussinessBench',
    meta: {
      title: '工作台',
      icon: 'ep:key',
      auth: '/business/bench',
    },
    children: [
      {
        path: 'bench',
        name: 'BusinessBenchPage',
        component: () => import('@/views/business/bench/bench.vue'),
        meta: {
          title: '工作台',
          auth: '/business/bench',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/businessManage',
        },
      },
    ],
  },
  {
    path: '/board',
    component: Layout,
    redirect: '/board/overdueReminderList',
    name: 'Board',
    meta: {
      title: '业务看板',
      icon: 'ep:key',
      auth: '/business/board',
    },
    children: [
      {
        path: 'overdueReminderList',
        name: 'OverdueReminderList',
        component: () => import('@/views/business/board/overdueReminder/list.vue'),
        meta: {
          title: '样品超期提醒',
          icon: 'ep:key',
          auth: '/business/board/overdueReminder',
        },
      },
      {
        path: 'overdueReminderDetail/:id',
        name: 'OverdueReminderDetail',
        component: () => import('@/views/business/board/overdueReminder/detail.vue'),
        meta: {
          title: '样品超期提醒详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/board/overdueReminderList',
        },
      },
      {
        path: 'equipmentReminderList',
        name: 'EquipmentReminderList',
        component: () => import('@/views/business/board/equipmentReminder/list.vue'),
        meta: {
          title: '设备到期提醒',
          icon: 'ep:key',
          auth: '/business/board/equipmentExpirationReminder',
        },
      },
      {
        path: 'equipmentReminderDetail/:type/:id',
        name: 'EquipmentReminderDetail',
        component: () => import('@/views/business/board/equipmentReminder/detail.vue'),
        meta: {
          title: '设备到期提醒详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/board/equipmentReminderList',
        },
      },
      {
        path: 'standardReminderList',
        name: 'StandardReminderList',
        component: () => import('@/views/business/board/standardReminder/list.vue'),
        meta: {
          title: '装置到期提醒',
          icon: 'ep:key',
          auth: '/business/board/expirationReminder',
        },
      },
      {
        path: ':type/:id?',
        name: 'StandardReminderDetail',
        component: () => import('@/views/business/board/standardReminder/detail.vue'),
        meta: {
          title: '装置到期提醒详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/standard/list',
        },
      },
      {
        path: 'jobAccount',
        name: 'JobAccountList',
        component: () => import('@/views/business/board/jobAccount/list.vue'),
        meta: {
          title: '实时工作统计',
          icon: 'ep:key',
          auth: '/business/board/jobAccount',
        },
      },
      {
        path: 'departmentalOutputAnalysis',
        name: 'DepartmentalOutputAnalysis',
        component: () => import('@/views/business/board/depOutputAnalysis/list.vue'),
        meta: {
          title: '部门产值分析',
          icon: 'ep:key',
          auth: '/business/board/departmentalOutputAnalysis',
        },
      },
      {
        path: 'workloadAnalysis',
        name: 'WorkloadAnalysis',
        component: () => import('@/views/business/board/workloadAnalysis/list.vue'),
        meta: {
          title: '业务工作量分析',
          icon: 'ep:key',
          auth: '/business/board/businessWorkloadAnalysis',
        },
      },
      {
        path: 'depComprehensive',
        name: 'DepComprehensive',
        component: () => import('@/views/business/board/depComprehensive/list.vue'),
        meta: {
          title: '部门综合分析',
          icon: 'ep:key',
          auth: '/business/board/departmentalComprehensiveAnalysis',
        },
      },
    ],
  },
  {
    path: '/schedule',
    component: Layout,
    redirect: '/schedule/orderList',
    name: 'Schedule',
    meta: {
      title: '业务调度',
      icon: 'ep:key',
      auth: '/schedule',
    },
    children: [
      {
        path: 'orderList',
        name: 'OrderList',
        component: () => import('@/views/business/schedule/order/orderList.vue'),
        meta: {
          title: '委托书',
          icon: 'ep:key',
          auth: '/schedule/orderList',
        },
      },
      {
        path: 'order/:type/:id?/:status?',
        name: 'OrderDetail',
        component: () => import('@/views/business/schedule/order/orderEdit.vue'),
        meta: {
          title: '委托书详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/schedule/orderList',
        },
      },
      {
        path: 'interchangeList',
        name: 'InterchangeList',
        component: () => import('@/views/business/schedule/interchange/interchangeList.vue'),
        meta: {
          title: '设备收发',
          icon: 'ep:key',
          auth: '/schedule/interchangeList',
        },
      },
      {
        path: 'interchange/:type/:id?',
        name: 'InterchangeDetail',
        component: () => import('@/views/business/schedule/interchange/interchangeDetail.vue'),
        meta: {
          title: '设备收发详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/schedule/interchangeList',
        },
      },
      {
        path: 'receiptList',
        name: 'InterchangeReceiptList',
        component: () => import('@/views/business/schedule/interchangeReceipt/receiptList.vue'),
        meta: {
          title: '设备交接单',
          icon: 'ep:key',
          auth: '/schedule/receiptList',
        },
      },
      {
        path: 'receipt/:type/:id?',
        name: 'InterchangeReceiptDetail',
        component: () => import('@/views/business/schedule/interchangeReceipt/receiptEdit.vue'),
        meta: {
          title: '设备交接单详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/schedule/receiptList',
        },
      },
      {
        path: 'taskList',
        name: 'TaskList',
        component: () => import('@/views/business/schedule/task/taskList.vue'),
        meta: {
          title: '任务分发',
          icon: 'ep:key',
          auth: '/schedule/taskList',
        },
      },
      {
        path: 'task/:role/:id?',
        name: 'TaskDetail',
        component: () => import('@/views/business/schedule/task/taskEdit.vue'),
        meta: {
          title: '任务分发详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/schedule/taskList',
        },
      },
      {
        path: 'certPrintList',
        name: 'CerPrintList',
        component: () => import('@/views/business/schedule/certPrint/certList.vue'),
        meta: {
          title: '证书打印',
          icon: 'ep:key',
          auth: '/schedule/certPrint',
        },
      },
      {
        path: 'cert/detail/:id?',
        name: 'certPrintDetail',
        component: () => import('@/views/business/schedule/certPrint/certDetail.vue'),
        meta: {
          title: '证书详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/schedule/certPrintList',
        },
      },
    ],
  },
  {
    path: '/lab',
    component: Layout,
    redirect: '/lab/myMeasureList',
    name: 'Lab',
    meta: {
      title: '实验室检测',
      icon: 'ep:key',
      auth: '/business/lab',
    },
    children: [
      {
        path: 'myMeasureList',
        name: 'MyMeasure',
        component: () => import('@/views/business/lab/myMeasure/myMeasureList.vue'),
        meta: {
          title: '我的检测',
          icon: 'ep:key',
          auth: '/lab/myMeasure',
        },
      },
      {
        path: 'myMeasureDetail/:role/:id',
        name: 'MyMeasureDetail',
        component: () => import('@/views/business/lab/myMeasure/measureDetail.vue'),
        meta: {
          title: '我的检测详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          auth: '/lab/myMeasure',
          activeMenu: '/lab/myMeasureList',
        },
      },
      {
        path: 'deptMeasureList',
        name: 'DeptMeasureList',
        component: () => import('@/views/business/lab/deptMeasure/deptMeasureList.vue'),
        meta: {
          title: '部门检测',
          icon: 'ep:key',
          auth: '/lab/deptMeasureList',
        },
      },
      {
        path: 'myMeasureDetail/:role/:id',
        name: 'MyMeasureDetail',
        component: () => import('@/views/business/lab/myMeasure/measureDetail.vue'),
        meta: {
          title: '部门检测详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          auth: '/lab/deptMeasureList',
          activeMenu: '/lab/deptMeasureList',
        },
      },
      {
        path: 'reportOnCredentialsApproval',
        name: 'ReportOnCredentialsApproval',
        component: () => import('@/views/business/lab/reportOnCredentials/reportOnCredentialsApproval.vue'),
        meta: {
          title: '证书报告',
          icon: 'ep:key',
          auth: '/lab/reportOnCredentialsApproval',
        },
      },
      {
        path: 'reportOnCredentialsApproval/:type/:id?',
        name: 'reportOnCredentialsAdd',
        component: () => import('@/views/business/lab/reportOnCredentials/components/reportOnCredentialsAdd.vue'),
        meta: {
          title: '证书报告详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/lab/reportOnCredentialsApproval',
        },
      },
      {
        path: 'primitiveLogList',
        name: 'PrimitiveLogList',
        component: () => import('@/views/business/lab/primitiveLog/primitiveLogList.vue'),
        meta: {
          title: '原始记录',
          icon: 'ep:key',
          auth: '/lab/primitiveLogList',
        },
      },
      {
        path: 'primitiveLogList/:type/:id?',
        name: 'PrimitiveLogAdd',
        component: () => import('@/views/business/lab/primitiveLog/primitveLogAdd.vue'),
        meta: {
          title: '原始记录详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/lab/primitiveLogList',
        },
      },
      {
        path: 'environmentalList',
        name: 'EnvironmentalList',
        component: () => import('@/views/business/lab/environmental/environmentalList.vue'),
        meta: {
          title: '环境记录单',
          icon: 'ep:key',
          auth: '/lab/environmentalList',
        },
      },
      {
        path: 'environmentalList/:type/:id?',
        name: 'EnvironmentalAdd',
        component: () => import('@/views/business/lab/environmental/environmentalAdd.vue'),
        meta: {
          title: '环境记录单详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/lab/environmentalList',
        },
      },
    ],
  },
  {
    path: '/subpackage',
    component: Layout,
    redirect: '/subpackage/itemApply', // 子路由
    name: 'Subpackage',
    meta: {
      title: '分包管理',
      icon: 'ep:key',
      auth: '/business/subpackage',
    },
    children: [
      {
        path: 'itemApply',
        name: 'ItemApply',
        component: () => import('@/views/business/subpackage/apply/list.vue'),
        meta: {
          title: '分包项目申请',
          icon: 'ep:key',
          auth: '/subpackage/itemApply',
        },
      },
      {
        path: 'subpackage/apply/:type/:id?',
        name: 'subpackageApplyDetail',
        component: () => import('@/views/business/subpackage/apply/edit.vue'),
        meta: {
          title: '分包项目申请详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/subpackage/itemApply',
        },
      },
      {
        path: 'itemCheck',
        name: 'ItemCheck',
        component: () => import('@/views/business/subpackage/check/list.vue'),
        meta: {
          title: '分包项目验收',
          icon: 'ep:key',
          auth: '/subpackage/itemCheck',
        },
      },
      {
        path: 'subpackage/check/:type/:id?',
        name: 'subpackageCheckDetail',
        component: () => import('@/views/business/subpackage/check/edit.vue'),
        meta: {
          title: '分包项目验收详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/subpackage/itemCheck',
        },
      },
      {
        path: 'archives',
        name: 'Archives',
        component: () => import('@/views/business/subpackage/record/list.vue'),
        meta: {
          title: '分包方档案',
          icon: 'ep:key',
          auth: '/subpackage/archives',
        },
      },
      {
        path: 'archives/:type/:id?',
        name: 'subpackageArchivesDetail',
        component: () => import('@/views/business/subpackage/record/edit.vue'),
        meta: {
          title: '分包方档案',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/subpackage/archives',
        },
      },
      {
        path: 'qualificationApprove',
        name: 'QualificationApprove',
        component: () => import('@/views/business/subpackage/approve/list.vue'),
        meta: {
          title: '分包方资格审批',
          icon: 'ep:key',
          auth: '/subpackage/qualificationApprove',
        },
      },
      {
        path: 'subpackage/qualificationApprove/:type/:id?',
        name: 'subpackageQualificationApproveDetail',
        component: () => import('@/views/business/subpackage/approve/edit.vue'),
        meta: {
          title: '分包方资格审批详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/subpackage/qualificationApprove',
        },
      },
      {
        path: 'certificate',
        name: 'Certificate',
        component: () => import('@/views/business/subpackage/certificate/list.vue'),
        meta: {
          title: '分包证书管理列表',
          icon: 'ep:key',
          auth: '/subpackage/certificate',
        },
      },
      {
        path: ':type/:id?',
        name: 'subpackageCertificateDetail',
        component: () => import('@/views/business/subpackage/certificate/edit.vue'),
        meta: {
          title: '分包证书详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/subpackage/certificate',
        },
      },
    ],
  },
  {
    path: '/fieldTest',
    component: Layout,
    redirect: '/fieldTest/record', // 子路由
    name: 'FieldTest',
    meta: {
      title: '现场检测',
      icon: 'ep:key',
      auth: '/business/fieldTest',
    },
    children: [
      {
        path: 'record',
        name: 'FieldTestRecord',
        component: () => import('@/views/business/fieldTest/record/list.vue'),
        meta: {
          title: '现场检测记录',
          icon: 'ep:key',
          auth: '/fieldTest/record',
        },
      },
      {
        path: 'record/:type/:id?',
        name: 'FieldTestRecordDetail',
        component: () => import('@/views/business/fieldTest/record/edit.vue'),
        meta: {
          title: '现场检测记录详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/fieldTest/record',
        },
      },
      {
        path: 'approve',
        name: 'FieldTestApprove',
        component: () => import('@/views/business/fieldTest/approve/list.vue'),
        meta: {
          title: '现场检测审批',
          icon: 'ep:key',
          auth: '/fieldTest/approve',
        },
      },
      {
        path: 'approve/:type/:id?',
        name: 'FieldTestApproveDetail',
        component: () => import('@/views/business/fieldTest/approve/edit.vue'),
        meta: {
          title: '现场检测审批详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/fieldTest/approve',
        },
      },
    ],
  },
]

export default routes
