import type { Route } from '@/global'

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

const routes: Route.recordRaw[] = [
  {
    path: '/bench',
    component: Layout,
    redirect: '/bench/list',
    name: 'Bench',
    meta: {
      title: '工作台',
      icon: 'ep:key',
      auth: '/measure/bench',
    },
    children: [
      {
        path: 'list',
        name: 'BenchList',
        component: () => import('@/views/measure/bench/bench.vue'),
        meta: {
          title: '工作台',
          auth: '/measure/bench',
          sidebar: false,
          breadcrumb: true,
        },
      },
    ],
  },
  {
    path: '/file',
    component: Layout,
    redirect: '/file/quality',
    name: 'File',
    meta: {
      title: '计量文件',
      icon: 'ep:key',
      auth: '/file',
    },
    children: [
      {
        path: 'quality',
        name: 'QualityFile',
        component: () => import('@/views/measure/file/quality.vue'),
        meta: {
          title: '质量文件',
          icon: 'ep:key',
          auth: '/file/quality',
        },
      },
      {
        path: 'rules',
        name: 'Rules',
        component: () => import('@/views/measure/file/rules.vue'),
        meta: {
          title: '规章制度',
          icon: 'ep:key',
          auth: '/file/rules',
        },
      },
      {
        path: 'manageMethod',
        name: '',
        component: () => import('@/views/measure/file/manageMethod.vue'),
        meta: {
          title: '管理办法',
          icon: 'ep:key',
          auth: '/file/ManageMethod',
        },
      },
      {
        path: 'testingMethod',
        name: '',
        component: () => import('@/views/measure/file/testingMethod.vue'),
        meta: {
          title: '校准检测办法',
          icon: 'ep:key',
          auth: '/file/testingMethod',
        },
      },
      {
        path: 'measureRule',
        name: '',
        component: () => import('@/views/measure/file/measureRule.vue'),
        meta: {
          title: '计量规程',
          icon: 'ep:key',
          auth: '/file/measureRule',
        },
      },
      {
        path: 'approve',
        name: '',
        component: () => import('@/views/measure/file/approve.vue'),
        meta: {
          title: '文件审批',
          icon: 'ep:key',
          auth: '/file/approve',
        },
      },
    ],
  },
  {
    path: '/person',
    component: Layout,
    redirect: '/measure/person/list',
    name: 'Person',
    meta: {
      title: '计量人员',
      icon: 'ep:key',
      auth: '/measure/person',
    },
    children: [
      {
        path: 'list',
        name: 'PersonList',
        component: () => import('@/views/measure/person/list.vue'),
        meta: {
          title: '计量人员列表',
          icon: 'ep:key',
          auth: '/measure/person/list',
        },
      },
      {
        path: 'certificateLog',
        name: 'CertificateLog',
        component: () => import('@/views/measure/person/certificateLog.vue'),
        meta: {
          title: '证书记录',
          icon: 'ep:key',
          auth: '/measure/person/certificateLog',
        },
      },
      {
        path: 'remind',
        name: 'Remind',
        component: () => import('@/views/measure/person/remind.vue'),
        meta: {
          title: '证书到期提醒',
          icon: 'ep:key',
          auth: '/measure/person/remind',
        },
      },
    ],
  },
  {
    path: '/train',
    component: Layout,
    redirect: '/measure/train/plan',
    name: 'Train',
    meta: {
      title: '培训管理',
      icon: 'ep:key',
      auth: '/measure/train',
    },
    children: [
      {
        path: 'plan',
        name: 'TrainPlan',
        component: () => import('@/views/measure/train/plan.vue'),
        meta: {
          title: '培训计划',
          icon: 'ep:key',
          auth: '/measure/train/plan',
        },
      },
      {
        path: 'trainPlanApprove',
        name: 'TrainPlanApprove',
        component: () => import('@/views/measure/train/trainPlanApprove.vue'),
        meta: {
          title: '培训计划审批',
          icon: 'ep:key',
          auth: '/measure/train/trainPlanApprove',
        },
      },
      {
        path: 'trainLog',
        name: 'TrainLog',
        component: () => import('@/views/measure/train/trainLog.vue'),
        meta: {
          title: '培训记录',
          icon: 'ep:key',
          auth: '/measure/train/trainLog',
        },
      },
    ],
  },
  {
    path: '/measureDept',
    component: Layout,
    redirect: '/measure/measureDept/bm',
    name: 'MeasureDept',
    meta: {
      title: '计量组织',
      icon: 'ep:key',
      auth: '/measure/measureDept',
    },
    children: [
      {
        path: 'bm',
        name: 'Bm',
        component: () => import('@/views/measure/measureDept/bm.vue'),
        meta: {
          title: '部门管理',
          icon: 'ep:key',
          auth: '/measure/measureDept/bm',
        },
      },
      {
        path: 'ks',
        name: 'Ks',
        component: () => import('@/views/measure/measureDept/ks.vue'),
        meta: {
          title: '科室管理',
          icon: 'ep:key',
          auth: '/measure/measureDept/ks',
        },
      },
      {
        path: 'gcz',
        name: 'Gcz',
        component: () => import('@/views/measure/measureDept/gcz.vue'),
        meta: {
          title: '工程组管理',
          icon: 'ep:key',
          auth: '/measure/measureDept/gcz',
        },
      },
    ],
  },
  {
    path: '/source',
    component: Layout,
    redirect: '/measure/measureSource/list',
    name: 'MeasureSource',
    meta: {
      title: '溯源供方',
      icon: 'ep:key',
      auth: '/measure/measureSource',
    },
    children: [
      {
        path: 'list',
        name: 'measureSourceList',
        component: () => import('@/views/measure/source/list.vue'),
        meta: {
          title: '溯源供方列表',
          icon: 'ep:key',
          auth: '/measure/measureSource/list',
        },
      },
      {
        path: 'approve',
        name: 'SourceApprove',
        component: () => import('@/views/measure/source/approve.vue'),
        meta: {
          title: '溯源供方审批',
          icon: 'ep:key',
          auth: '/measure/measureSource/approve',
        },
      },
    ],
  },
  {
    path: '/price',
    component: Layout,
    redirect: '/measure/measurePrice/list',
    name: 'MeasurePrice',
    meta: {
      title: '价格库',
      icon: 'ep:key',
      auth: '/measure/measurePrice',
    },
    children: [
      {
        path: 'list',
        name: 'measurePriceList',
        component: () => import('@/views/measure/price/list.vue'),
        meta: {
          title: '价格表',
          icon: 'ep:key',
          auth: '/measure/measurePrice/list',
        },
      },
    ],
  },
]

export default routes
