import type { Route } from '@/global'

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

const routes: Route.recordRaw[] = [
  {
    path: '/person',
    component: Layout,
    redirect: '/person/registerList',
    name: 'Person',
    meta: {
      title: '人员管理',
      icon: 'ep:key',
      auth: '/resource/person',
    },
    children: [
      {
        path: 'registerList',
        name: 'RegisterList',
        component: () => import('@/views/resource/person/register/list.vue'),
        meta: {
          title: '人员登记列表',
          auth: '/resource/person/register',
          icon: 'ep:key',
        },
      },
      {
        path: 'register/:type/:id?',
        name: 'RegisterDetail',
        component: () => import('@/views/resource/person/register/detail.vue'),
        meta: {
          title: '人员登记',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/person/registerList',
        },
      },
      {
        path: 'orderList',
        name: 'OrderList',
        component: () => import('@/views/resource/person/order/list.vue'),
        meta: {
          title: '授权（代理）委托书列表',
          auth: '/resource/person/order',
          icon: 'ep:key',
        },
      },
      {
        path: 'order/:type/:id?',
        name: 'OrderDetail',
        component: () => import('@/views/resource/person/order/detail.vue'),
        meta: {
          title: '授权（代理）委托书',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/person/orderList',
        },
      },
      {
        path: 'order/approved/:id',
        name: 'OrderDetailApproved',
        component: () => import('@/views/resource/person/order/approvedDetail.vue'),
        meta: {
          title: '授权（代理）委托书',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/person/orderList',
        },
      },
      {
        path: 'trainList',
        name: 'TrainList',
        component: () => import('@/views/resource/person/train/list.vue'),
        meta: {
          title: '人员训练登记列表',
          auth: '/resource/person/train',
          icon: 'ep:key',
        },
      },
      {
        path: 'train/:type/:id?',
        name: 'TrainDetail',
        component: () => import('@/views/resource/person/train/detail.vue'),
        meta: {
          title: '人员训练登记',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/person/trainList',
        },
      },
      {
        path: 'remindList',
        name: 'RemindList',
        component: () => import('@/views/resource/person/remind/list.vue'),
        meta: {
          title: '证书逾期提醒列表',
          auth: '/resource/person/remind',
          icon: 'ep:key',
        },
      },
      {
        path: 'remind/:type/:id?',
        name: 'RemindDetail',
        component: () => import('@/views/resource/person/remind/detail.vue'),
        meta: {
          title: '证书逾期提醒',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/person/remindList',
        },
      },
    ],
  },
  {
    path: '/system',
    component: Layout,
    redirect: '/system/sysDocList',
    name: 'System',
    meta: {
      title: '体系文件',
      icon: 'ep:key',
      auth: '/resource/system',
    },
    children: [
      {
        path: 'sysDocList',
        name: 'SysDocList',
        component: () => import('@/views/resource/system/sysDoc/list.vue'),
        meta: {
          title: '体系文件列表',
          auth: '/resource/system/sysDoc',
          icon: 'ep:key',
        },
      },
      {
        path: 'sysDoc/:type/:id?',
        name: 'SysDocDetail',
        component: () => import('@/views/resource/system/sysDoc/detail.vue'),
        meta: {
          title: '体系文件',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/person/sysDocList',
        },
      },
      {
        path: 'historyDocList',
        name: 'HistoryDocList',
        component: () => import('@/views/resource/system/historyDoc/list.vue'),
        meta: {
          title: '历史文件列表',
          auth: '/resource/system/historyDoc',
          icon: 'ep:key',
        },
      },
      {
        path: 'historyDoc/:type/:id?',
        name: 'HistoryDocDetail',
        component: () => import('@/views/resource/system/historyDoc/detail.vue'),
        meta: {
          title: '历史文件',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/person/historyDocList',
        },
      },
    ],
  },
  {
    path: '/technology',
    component: Layout,
    redirect: '/technology/methodList',
    name: 'Technology',
    meta: {
      title: '技术文件',
      icon: 'ep:key',
      auth: '/resource/technology',
    },
    children: [
      {
        path: 'methodList',
        name: 'MethodList',
        component: () => import('@/views/resource/technology/method/list.vue'),
        meta: {
          title: '现行测试校准检定方法列表',
          auth: '/resource/technology/method',
          icon: 'ep:key',
        },
      },
      {
        path: 'method/:type/:id?',
        name: 'MethodDetail',
        component: () => import('@/views/resource/technology/method/detail.vue'),
        meta: {
          title: '现行测试校准检定方法',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/technology/methodList',
        },
      },
      {
        path: 'dataList',
        name: 'DataList',
        component: () => import('@/views/resource/technology/data/list.vue'),
        meta: {
          title: '计量资料列表',
          auth: '/resource/technology/data',
          icon: 'ep:key',
        },
      },
      {
        path: 'data/:type/:id?',
        name: 'DataDetail',
        component: () => import('@/views/resource/technology/data/detail.vue'),
        meta: {
          title: '计量资料',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/technology/dataList',
        },
      },
    ],
  },
  {
    path: '/environment',
    component: Layout,
    redirect: '/environment/recordList',
    name: 'Environment',
    meta: {
      title: '环境数据管理',
      icon: 'ep:key',
      auth: '/resource/environment',
    },
    children: [
      {
        path: 'recordList',
        name: 'EnvironmentRecordList',
        component: () => import('@/views/resource/environment/record/list.vue'),
        meta: {
          title: '环境记录单',
          auth: '/resource/environment/record',
          icon: 'ep:key',
        },
      },
      {
        path: 'setting',
        name: 'EnvironmentSetting',
        component: () => import('@/views/resource/environment/record/setting.vue'),
        meta: {
          title: '环境记录单设置',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/environment/recordList',
        },
      },
    ],
  },
  {
    path: '/outsideService',
    component: Layout,
    redirect: '/outsideService/supplierList',
    name: 'OutsideService',
    meta: {
      title: '外部服务管理',
      icon: 'ep:key',
      auth: '/resource/outsideService',
    },
    children: [
      {
        path: 'supplierList',
        name: 'SupplierList',
        component: () => import('@/views/resource/outsideService/supplier/list.vue'),
        meta: {
          title: '合格供方名录',
          auth: '/resource/outsideService/supplier',
          icon: 'ep:key',
        },
      },
      {
        path: ':type/:id?/:status?',
        name: 'SupplierDetail',
        component: () => import('@/views/resource/outsideService/supplier/detail.vue'),
        meta: {
          title: '合格供方名录详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/outsideService/supplierList',
        },
      },
    ],
  },
  {
    path: '/customer',
    component: Layout,
    redirect: '/customer/infoList',
    name: 'InfoList',
    meta: {
      title: '委托方管理',
      icon: 'ep:key',
      auth: '/resource/customer',
    },
    children: [
      {
        path: 'infoList',
        name: 'CustomerInfoList',
        component: () => import('@/views/resource/customer/info/list.vue'),
        meta: {
          title: '委托方名录',
          auth: '/resource/customer/infoList',
          icon: 'ep:key',
        },
      },
      {
        path: 'infoList/:type/:id?/:status?',
        name: 'CustomerInfoDetail',
        component: () => import('@/views/resource/customer/info/detail.vue'),
        meta: {
          title: '委托方详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/customer/infoList',
        },
      },
      {
        path: 'reviewNoticeList',
        name: 'ReviewNoticeList',
        component: () => import('@/views/resource/customer/reviewNotice/list.vue'),
        meta: {
          title: '检测结果复查通知列表',
          auth: '/resource/customer/reviewNotice',
          icon: 'ep:key',
        },
      },
      {
        path: 'reviewNotice/:type/:id?',
        name: 'ReviewNoticeDetail',
        component: () => import('@/views/resource/customer/reviewNotice/detail.vue'),
        meta: {
          title: '检测结果复查通知详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/customer/reviewNoticeList',
        },
      },
      {
        path: 'situationReportList',
        name: 'SituationReportList',
        component: () => import('@/views/resource/customer/situationReport/list.vue'),
        meta: {
          title: '委托方情况报告列表',
          auth: '/resource/customer/situationReport',
          icon: 'ep:key',
        },
      },
      {
        path: 'situationReport/:type/:id?',
        name: 'SituationReportDetail',
        component: () => import('@/views/resource/customer/situationReport/detail.vue'),
        meta: {
          title: '委托方情况报告详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/customer/situationReportList',
        },
      },
      {
        path: 'questionnaireList',
        name: 'QuestionnaireList',
        component: () => import('@/views/resource/customer/questionnaire/list.vue'),
        meta: {
          title: '委托方满意度调查表列表',
          auth: '/resource/customer/questionnaire',
          icon: 'ep:key',
        },
      },
      {
        path: 'questionnaire/:type/:id?',
        name: 'QuestionnaireDetail',
        component: () => import('@/views/resource/customer/questionnaire/detail.vue'),
        meta: {
          title: '委托方满意度调查表详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/customer/questionnaireList',
        },
      },
      {
        path: 'suggestFormList',
        name: 'SuggestFormList',
        component: () => import('@/views/resource/customer/suggestForm/list.vue'),
        meta: {
          title: '委托方意见登记表列表',
          auth: '/resource/customer/suggestForm',
          icon: 'ep:key',
        },
      },
      {
        path: 'suggestForm/:type/:id?',
        name: 'SuggestFormDetail',
        component: () => import('@/views/resource/customer/suggestForm/detail.vue'),
        meta: {
          title: '委托方意见登记表详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/customer/suggestFormList',
        },
      },
      {
        path: 'suggestForm/approved/:id',
        name: 'SuggestFormDetailApproved',
        component: () => import('@/views/resource/customer/suggestForm/approvedDetail.vue'),
        meta: {
          title: '授权（代委托方意见登记表详情理）委托书',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/customer/suggestFormList',
        },
      },
      {
        path: 'examineList',
        name: 'ExamineList',
        component: () => import('@/views/resource/customer/examine/list.vue'),
        meta: {
          title: '要求、委托书及合同评审表列表',
          auth: '/resource/customer/examine',
          icon: 'ep:key',
        },
      },
      {
        path: 'examine/:type/:id?',
        name: 'ExamineDetail',
        component: () => import('@/views/resource/customer/examine/detail.vue'),
        meta: {
          title: '要求、委托书及合同评审表详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/customer/examineList',
        },
      },
      {
        path: 'examine/approved/:id?',
        name: 'ExamineDetailApproved',
        component: () => import('@/views/resource/customer/examine/approvedDetail.vue'),
        meta: {
          title: '要求、委托书及合同评审表详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/customer/examineList',
        },
      },
    ],
  },
  {
    path: '/seal',
    component: Layout,
    redirect: '/seal/infoList',
    name: 'Seal',
    meta: {
      title: '印章管理',
      icon: 'ep:key',
      auth: '/resource/seal',
    },
    children: [
      {
        path: 'infoList',
        name: 'SealInfoList',
        component: () => import('@/views/resource/seal/list/list.vue'),
        meta: {
          title: '印章管理登记',
          auth: '/resource/seal/list',
          icon: 'ep:key',
        },
      },
      {
        path: 'list/:type/:id?',
        name: 'SealInfoDetail',
        component: () => import('@/views/resource/seal/list/detail.vue'),
        meta: {
          title: '印章管理登记详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/seal/infoList',
        },
      },
      {
        path: 'noteList',
        name: 'SealNoteList',
        component: () => import('@/views/resource/seal/note/list.vue'),
        meta: {
          title: '印章使用登记',
          auth: '/resource/seal/note',
          icon: 'ep:key',
        },
      },
      {
        path: 'note/:type/:id?/:status?',
        name: 'SealNoteDetail',
        component: () => import('@/views/resource/seal/note/detail.vue'),
        meta: {
          title: '印章使用登记详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/seal/noteList',
        },
      },
      {
        path: 'seal/logList',
        name: 'SealLogList',
        component: () => import('@/views/resource/seal/note/log.vue'),
        meta: {
          title: '印章使用日志',
          auth: '/resource/seal/log',
          icon: 'ep:key',
        },
      },
    ],
  },
]

export default routes
