import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';

const BASE: AppRouteRecordRaw = {
  path: '/base',
  name: 'base',
  component: DEFAULT_LAYOUT,
  meta: {
    requiresAuth: true,
  },
  children: [
    // 主页导览
    {
      path: '/home-guide',
      name: 'HomeGuide',
      component: () => import('@/views/HomeGuide.vue'),
      meta: {
        title: '主页导览',
        requiresAuth: true,
      },
    },
    {
      path: '/user-manage',
      name: 'UserManage',
      component: () => import('@/views/user/UserManage.vue'),
      meta: {
        title: '用户管理',
        requiresAuth: true,
      },
    },
    {
      path: '/student-manage',
      name: 'StudentManage',
      component: () => import('@/views/student/StudentManage.vue'),
      meta: {
        title: '考生管理',
        requiresAuth: true,
      },
    },
    {
      path: '/scan-manage',
      name: 'ScanManage',
      component: () => import('@/views/scan/ScanManage.vue'),
      meta: {
        title: '扫描进度',
        requiresAuth: true,
      },
    },
    {
      path: '/subject-manage',
      name: 'SubjectManage',
      component: () => import('@/views/subject/SubjectManage.vue'),
      meta: {
        title: '科目管理',
        requiresAuth: true,
      },
    },
    {
      path: '/subject/paper-struct-edit/:subjectCode',
      name: 'PaperStructEdit',
      component: () => import('@/views/subject/PaperStructEdit.vue'),
      meta: {
        title: '试卷结构编辑',
        requiresAuth: true,
        relationRoutes: ['SubjectManage'],
      },
    },
    {
      path: '/subject/optional-rule-edit/:subjectCode',
      name: 'OptionalRuleEdit',
      component: () => import('@/views/subject/OptionalRuleEdit.vue'),
      meta: {
        title: '选择题设置',
        requiresAuth: true,
        relationRoutes: ['SubjectManage'],
      },
    },
    {
      path: '/exam-manage',
      name: 'ExamManage',
      component: () => import('@/views/exam/ExamManage.vue'),
      meta: {
        title: '考试管理',
        requiresAuth: true,
      },
    },
    {
      path: '/exam-edit',
      name: 'ExamEdit',
      component: () => import('@/views/exam/ExamEdit.vue'),
      meta: {
        title: '编辑考试',
        requiresAuth: true,
        relationRoutes: ['ExamManage'],
      },
    },
    {
      path: '/reject-manage',
      name: 'RejectManage',
      component: () => import('@/views/reject/RejectManage.vue'),
      meta: {
        title: '打回卷',
        requiresAuth: true,
      },
    },
    {
      path: '/rejcect-record',
      name: 'RejectRecord',
      component: () => import('@/views/reject/RejectRecord.vue'),
      meta: {
        title: '打回记录',
        requiresAuth: true,
      },
    },
    {
      path: 'reject-statistics',
      name: 'RejectStatistics',
      component: () => import('@/views/reject/RejectStatistics.vue'),
      meta: {
        title: '打回统计',
        requiresAuth: true,
      },
    },
    {
      path: '/issue-paper',
      name: 'IssuePaper',
      component: () => import('@/views/issue-paper/IssuePaper.vue'),
      meta: {
        title: '问题试卷',
        requiresAuth: true,
      },
    },
    {
      path: '/score-query',
      name: 'ScoreQuery',
      component: () => import('@/views/score/ScoreQuery.vue'),
      meta: {
        title: '成绩查询',
        requiresAuth: true,
      },
    },
    {
      path: '/analysis-manage',
      name: 'AnalysisManage',
      component: () => import('@/views/analysis/AnalysisManage.vue'),
      meta: {
        title: '科目分析',
        requiresAuth: true,
      },
    },
    {
      path: '/log-manage',
      name: 'LogManage',
      component: () => import('@/views/log/LogManage.vue'),
      meta: {
        title: '操作日志',
        requiresAuth: true,
      },
    },
    {
      path: '/result-check',
      name: 'ResultCheck',
      component: () => import('@/views/check/ResultCheck.vue'),
      meta: {
        title: '识别结果检查',
        requiresAuth: true,
      },
    },
    {
      path: '/image-check',
      name: 'ImageCheck',
      component: () => import('@/views/check/ImageCheck.vue'),
      meta: {
        title: '图片检查',
        requiresAuth: true,
      },
    },
    {
      path: '/manual-confirm',
      name: 'ManualConfirm',
      component: () => import('@/views/check/ManualConfirm.vue'),
      meta: {
        title: '人工确认',
        requiresAuth: true,
      },
    },
    {
      path: '/score-review-statistics',
      name: 'ScoreReviewStatistics',
      component: () => import('@/views/review/ScoreReviewStatistics.vue'),
      meta: {
        title: '复核进度统计',
        requiresAuth: true,
      },
    },
    {
      path: '/all-review',
      name: 'AllReview',
      component: () => import('@/views/review/AllReview.vue'),
      meta: {
        title: '全卷复核',
        requiresAuth: true,
      },
    },
    {
      path: '/score-check',
      name: 'ScoreCheck',
      component: () => import('@/views/review/ScoreQuery.vue'),
      meta: {
        title: '成绩校验',
        requiresAuth: true,
      },
    },
    {
      path: '/mark-progress',
      name: 'MarkProgress',
      component: () => import('@/views/mark/MarkProgress.vue'),
      meta: {
        title: '评卷进度',
        requiresAuth: true,
      },
    },
    {
      path: '/mark-manage',
      name: 'MarkManage',
      component: () => import('@/views/mark/MarkManage.vue'),
      meta: {
        title: '评卷管理',
        requiresAuth: true,
      },
      children: [
        // 分组管理
        {
          path: '/mark-manage/group',
          name: 'GroupManage',
          component: () => import('@/views/mark/GroupManage.vue'),
          meta: {
            title: '分组管理',
            requiresAuth: true,
            relationRoutes: ['MarkManage'],
          },
        },
        {
          // 编辑分组
          path: '/mark-manage/group/:subjectCode/edit/:groupNumber?',
          name: 'GroupEdit',
          component: () => import('@/views/mark/group-edit/GroupEdit.vue'),
          meta: {
            title: '编辑分组',
            requiresAuth: true,
            relationRoutes: ['MarkManage', 'GroupManage'],
          },
        },
        // 评卷员管理
        {
          path: '/mark-manage/marker',
          name: 'MarkerManage',
          component: () => import('@/views/mark/MarkerManage.vue'),
          meta: {
            title: '评卷员管理',
            requiresAuth: true,
            relationRoutes: ['MarkManage'],
          },
        },
        // 试评管理
        {
          path: '/mark-manage/trial',
          name: 'TrialManage',
          component: () => import('@/views/mark/TrialManage.vue'),
          meta: {
            title: '试评管理',
            requiresAuth: true,
            relationRoutes: ['MarkManage'],
          },
        },
        // 任务管理
        {
          path: '/mark-manage/task',
          name: 'TaskManage',
          component: () => import('@/views/mark/TaskManage.vue'),
          meta: {
            title: '任务管理',
            requiresAuth: true,
            relationRoutes: ['MarkManage'],
          },
        },
        // 仲裁管理
        {
          path: '/mark-manage/arbitration',
          name: 'ArbitrationManage',
          component: () => import('@/views/mark/ArbitrationManage.vue'),
          meta: {
            title: '仲裁管理',
            requiresAuth: true,
            relationRoutes: ['MarkManage'],
          },
        },
        // 质量监控
        {
          path: '/quality-monitor',
          name: 'QualityMonitor',
          component: () =>
            import('@/views/mark/quality-monitor/QualityMonitor.vue'),
          meta: {
            title: '质量监控',
            requiresAuth: true,
            relationRoutes: ['MarkManage'],
          },
        },
        // 给分曲线
        {
          path: '/quality-monitor/score-curve',
          name: 'ScoreCurve',
          component: () =>
            import('@/views/mark/quality-monitor/ScoreCurve.vue'),
          meta: {
            title: '给分曲线',
            requiresAuth: true,
            relationRoutes: ['MarkManage', 'QualityMonitor'],
          },
        },
      ],
    },
  ],
};

export default BASE;
