import dayjs from "dayjs";
//导出文件名称
export function GetFileName(examName, reportParam) {
  //0-联考 1-学校分组 2-具体学校
  let schoolName = "";
  if (reportParam.schoolLevel == 0) {
    schoolName = "联校";
  }else if (reportParam.schoolLevel == 1) {
    schoolName = reportParam.schoolGroupName;
  } else {
    schoolName = reportParam.schoolName;
  }
  return `${examName}_${reportParam.subjectName}_${schoolName}${
    reportParam.schoolLevel == 2 ? "_" + reportParam.classGroupName : ""
  }`;
}
//导出时间
export function GetExportDate() {
  return dayjs().format("MM-DD");
}
//成绩单缺考、违纪、不计入学生名单表头
export function ScrolReportStaticHeaderData(isClassType) {
  if (isClassType) {
    return [
      { display: true, label: "序号", prop: "index" },
      { display: true, label: "账号", prop: "studentRegistrationCode" },
      { display: true, label: "姓名", prop: "studentUserName" },
      { display: true, label: "学号", prop: "studentUserCode" },
      { display: true, label: "考号", prop: "studentExamCode" },
      { display: true, label: "行政班", prop: "className" },
      { display: true, label: "教学班", prop: "teachClassName" },
      { display: true, label: "状态", prop: "studentStatusName" },
    ];
  } else {
    return [
      { display: true, label: "序号", prop: "index" },
      { display: true, label: "账号", prop: "studentRegistrationCode" },
      { display: true, label: "姓名", prop: "studentUserName" },
      { display: true, label: "学号", prop: "studentUserCode" },
      { display: true, label: "考号", prop: "studentExamCode" },
      { display: true, label: "行政班", prop: "className" },
      { display: true, label: "状态", prop: "studentStatusName" },
    ];
  }
}
//学校对比
export function schoolComparisonStaticHeaderData() {
  return [
    { display: true, label: "序号", prop: "index" },
    { display: true, label: "学校", prop: "schoolName" },
    { display: true, label: "教师", prop: "teacherName" }
  ];
}
//学科对比
export function subjectStaticHeaderData() {
  return [
    { display: true, label: "序号", prop: "index" },
    { display: true, label: "科目", prop: "subjectName" },
    { display: true, label: "教师", prop: "teacherName" }
  ];
}
//班级对比
export function classComparisonStaticHeaderData() {
  return [
    { display: true, label: "序号", prop: "index" },
    { display: true, label: "班级", prop: "keyName" },
    { display: true, label: "教师", prop: "teacherName" }
  ];
}
//学籍对比
export function registerComparisonStaticHeaderData() {
  return [
    { display: true, label: "序号", prop: "index" },
    { display: true, label: "学籍", prop: "statusName" },
    { display: true, label: "教师", prop: "teacherName" }
  ];
}
//学科质量
export function subjectQualityStaticHeaderData() {
  return [
    { display: true, label: "序号", prop: "index" },
    { display: true, label: "科目", prop: "courseName" },
    { display: true, label: "教师", prop: "teacherName" },
    { display: true, label: "实考人数", prop: "actualNumber" },
    { display: true, label: "满分", prop: "fullScore" },
    { display: true, label: "平均分", prop: "averageScore" },
    { display: true, label: "最高分", prop: "highestScore" },
    { display: true, label: "最低分", prop: "lowestScore" },
    { display: true, label: "得分率", prop: "scoreRate" },
    { display: true, label: "难度", prop: "difficulty" },
    { display: true, label: "区分度", prop: "discrimination" },
    { display: true, label: "信度", prop: "reliability" },
    { display: true, label: "效度", prop: "validity" }
  ];
}
//G组科目
export function gGroupTotalSubjectStaticHeaderData() {
  return [
    { display: true, label: "序号", prop: "index" },
    { display: true, label: "科目", prop: "subjectName" },
    { display: true, label: "教师", prop: "classTeacherName" },
    { display: true, label: "实考人数", prop: "actualExaminessNum" }
  ];
}
//G组学校/班级
export function schoolClassStaticHeaderData(type,schoolLevel) {
  if(type == 1){
    return [
      { display: true, label: "序号", prop: "index" },
      { display: true, label: schoolLevel==2?'班级':'学校', prop: "courseName" },
      { display: true, label: "教师", prop: "classTeacherName" },
      { display: true, label: "实考人数", prop: "actualExaminessNum" }
    ];
  }else if(type == 2){
    return [
      { display: true, label: "考试", prop: "examName" },
      { display: true, label: schoolLevel==2?'班级':'学校', prop: "keyName" },
      { display: true, label: "教师", prop: "teacherName" },
      { display: true, label: "实考人数", prop: "actualExaminessNum" }
    ];
  }else if(type == 3){
    return [
      { display: true, label: "考试", prop: "examName" },
      { display: true, label: schoolLevel==2?'班级':'学校', prop: "keyName" },
      { display: true, label: "教师", prop: "teacherName" },
      { display: true, label: "实考人数", prop: "actualExaminessNum" }
    ];
  }else if(type == 4){
    if(schoolLevel!=2){
      return [
        { display: true, label: "序号", prop: "index" },
        { display: true, label: '学校', prop: "schoolName" },
        { display: true, label: "学号", prop: "studentNo" },
        { display: true, label: "姓名", prop: "studentName" },
        { display: true, label: "班级", prop: "className" }
      ];
    }else{
      return [
        { display: true, label: "序号", prop: "index" },
        { display: true, label: "学号", prop: "studentNo" },
        { display: true, label: "姓名", prop: "studentName" },
        { display: true, label: "班级", prop: "className" }
      ];
    }
  }
  
}
//四分位分析表
export function quartileanStaticHeaderData(schoolLevel) {
  if(schoolLevel == 2){
    return [
      { display: true, label: "序号", prop: "index" },
      { display: true, label: schoolLevel == 2 ? '班级' : '学校', prop: "name" },
      { display: true, label: "教师", prop: "teacherName" },
      { display: true, label: "平均分", prop: "avgScore" },
      { display: true, label: "最高分", prop: "maxScore" },
      { display: true, label: "最低分", prop: "minScore" },
      { display: true, label: "最大值", prop: "maxValue" },
      { display: true, label: "最大值异常学生", prop: "maxStudentScoreList" },
      { display: true, label: "Q3", prop: "q3" },
      { display: true, label: "中位数", prop: "q2" },
      { display: true, label: "Q1", prop: "q1" },
      { display: true, label: "最小值", prop: "minValue" },
      { display: true, label: "最小值异常学生", prop: "minxStudentScoreList" }
    ];
  }else{
    return [
      { display: true, label: "序号", prop: "index" },
      { display: true, label: schoolLevel == 2 ? '班级' : '学校', prop: "name" },
      { display: true, label: "平均分", prop: "avgScore" },
      { display: true, label: "最高分", prop: "maxScore" },
      { display: true, label: "最低分", prop: "minScore" },
      { display: true, label: "最大值", prop: "maxValue" },
      { display: true, label: "最大值异常学生", prop: "maxStudentScoreList" },
      { display: true, label: "Q3", prop: "q3" },
      { display: true, label: "中位数", prop: "q2" },
      { display: true, label: "Q1", prop: "q1" },
      { display: true, label: "最小值", prop: "minValue" },
      { display: true, label: "最小值异常学生", prop: "minxStudentScoreList" }
    ];
  }
}
//错题分析表
export function errorQuestionDataStaticHeaderData() {
  return [
    { display: true, label: "小题名称", prop: "questionName" },
    { display: true, label: "题型", prop: "questionType" },
    { display: true, label: "满分", prop: "questionScore" },
    { display: true, label: "难度", prop: "difficulty" },
    { display: true, label: "区分度", prop: "discrimination" },
    { display: true, label: "平均分", prop: "averageScore" },
    { display: true, label: "得分率", prop: "scoreRate" },
    { display: true, label: "答题人数", prop: "studentCount" },
    { display: true, label: "错题人数", prop: "errorCount" },
    { display: true, label: "正确答案", prop: "answerValue" },
  ];
}
export function errorQuestionDataChildHeaderData(headerData) {
  return headerData.map(item=>({
    display: true, label: "错题详情", prop: item
  }))
}
//命题分析表
export function propositionAnalysisStaticHeaderData() {
  return [
    { display: true, label: "题号", prop: "questionCode" },
    { display: true, label: "题型", prop: "questionTypeName" },
    { display: true, label: "实考人数", prop: "studentCount" },
    { display: true, label: "满分", prop: "fullMark" },
    { display: true, label: "难度", prop: "difficulty" },
    { display: true, label: "区分度", prop: "discrimination" },
    { display: true, label: "平均分", prop: "averageScore" },
    { display: true, label: "最高分", prop: "maxScore" },
    { display: true, label: "最低分", prop: "minScore" },
    { display: true, label: "得分率", prop: "scoreRate" },
    { display: true, label: "标准差", prop: "standardDeviation" }
  ];
}
//客观题分析表
export function selectQuestionAnalysisStaticHeaderData() {
  return [
    { display: true, label: "题号", prop: "questionName" },
    { display: true, label: "题型", prop: "questionType" },
    { display: true, label: "分数", prop: "answerScore" },
    { display: true, label: "平均分", prop: "averageScore" },
    { display: true, label: "得分率", prop: "scoreRate" },
    { display: true, label: "答案", prop: "answerValue" }
  ];
}
export function selectQuestionAnalysisDynamicsHeaderData() {
  return [
    { display: true, label: "各选项选择人数", prop: "" },
    { display: true, label: "各选项选择人数占比", prop: "" }
  ];
}
//学生详情 历次考试分析表
export function previousExamStaticHeaderData() {
  return [
    { display: true, label: "科目", prop: "courseName" }
  ];
}
export function previousExamChildHeaderData() {
  return [
    { display: true, label: "分数", prop: "studentScore" },
    { display: true, label: "标准分", prop: "standardScore" },
    { display: true, label: "得分率", prop: "scoreRate" },
    { display: true, label: "班排", prop: "classRanking" },
    { display: true, label: "校排", prop: "gradeRanking" },
    { display: true, label: "联排", prop: "examRanking" }
  ];
}
//学生详情 小题分析表
export function questionDataStaticHeaderData() {
  return [
    { display: true, label: "小题", prop: "questionCode" },
    { display: true, label: "类型", prop: "questionTypeName" },
    { display: true, label: "难度", prop: "difficulty" },
    { display: true, label: "满分", prop: "fullMark" },
    { display: true, label: "个人得分", prop: "studentScore" }
  ];
}
export function questionDataDynamicsHeaderData() {
  return [
    { display: true, label: "得分率", prop: "" }
  ];
}
export function questionDataChildHeaderData() {
  return [
    { display: true, label: "个人", prop: "studentScoreRate" },
    { display: true, label: "班级", prop: "classScoreRate" },
    { display: true, label: "年级", prop: "gradeScoreRate" },
    { display: true, label: "联校", prop: "examScoreRate" }
  ];
}
//学生详情 分析表
export function moduleDataStaticHeaderData(name) {
  return [
    { display: true, label: name, prop: "name" },
    { display: true, label: "包含小题", prop: "questionCodes" },
    { display: true, label: "难度", prop: "difficulty" },
    { display: true, label: "满分", prop: "fullMark" },
    { display: true, label: "个人得分", prop: "studentScore" }
  ];
}
export function moduleDataDynamicsHeaderData() {
  return [
    { display: true, label: "得分率", prop: "" }
  ];
}
export function moduleDataChildHeaderData() {
  return [
    { display: true, label: "个人", prop: "studentScoreRate" },
    { display: true, label: "班级", prop: "classScoreRate" },
    { display: true, label: "年级", prop: "gradeScoreRate" },
    { display: true, label: "联校", prop: "examScoreRate" }
  ];
}
//人数弹框
export function studentListStaticHeaderData(isAssign) {
  if(isAssign == 0){
      return [
      { display: true, label: "序号", prop: "index" },
      { display: true, label: "学号", prop: "studentUserCode" },
      { display: true, label: "姓名", prop: "studentUserName" },
      { display: true, label: "行政班", prop: "className" },
      { display: true, label: "教学班", prop: "teachClassName" },
      { display: true, label: "得分", prop: "score" }

    ];
  }else{
    return [
      { display: true, label: "序号", prop: "index" },
      { display: true, label: "学号", prop: "studentUserCode" },
      { display: true, label: "姓名", prop: "studentUserName" },
      { display: true, label: "行政班", prop: "className" },
      { display: true, label: "教学班", prop: "teachClassName" },
      { display: true, label: "原始分", prop: "score" },
      { display: true, label: "赋分", prop: "rateScore" }
    ];
  }
}