import { getNavs } from "@/plugins/utils";

// 管理员（科组长）分档模块
import Grading from "../modules/grading/Grading";
import GradingProgress from "../modules/grading/GradingProgress";
import GradingDetail from "../modules/grading/GradingDetail";
import GradingUserManage from "../modules/grading/GradingUserManage";
import GradingGroupManage from "../modules/grading/GradingGroupManage";
// 阅卷员分档
import GradingOperation from "../modules/grading/GradingOperation";

const gradingRoutes = [
  {
    path: "grading-progress",
    name: "GradingProgress",
    component: GradingProgress,
    meta: {
      title: "分档进度"
    }
  },
  {
    path: "grading-detail",
    name: "GradingDetail",
    component: GradingDetail,
    meta: {
      title: "分档详情"
    }
  },
  {
    path: "grading-user-manage",
    name: "GradingUserManage",
    component: GradingUserManage,
    meta: {
      title: "用户管理"
    }
  },
  {
    path: "grading-group-manage",
    name: "GradingGroupManage",
    component: GradingGroupManage,
    meta: {
      title: "分档分组"
    }
  }
];

export const navs = getNavs(gradingRoutes);

// tips: subjectId == `workId-subject`
export default [
  {
    path: "/grading/:workId(\\d+)/:subjectId",
    name: "Grading",
    component: Grading,
    redirect: { name: "GradingProgress" },
    children: gradingRoutes
  },
  {
    path: "/grading-operation/:workId(\\d+)/:subjectId",
    name: "GradingOperation",
    component: GradingOperation,
    meta: {
      title: "阅卷员分档"
    }
  }
];
