import { $postParam, $post } from "@/plugins/axios";

// 培养方案管理相关页面 =====================>
// 培养方案管理 ------------------->
export const trainingPlanListPage = (datas) => {
  return $postParam("/api/admin/obe/culture/program/page", datas);
};
export const deleteTrainingPlan = (id) => {
  return $postParam("/api/admin/obe/culture/program/remove", { id });
};
export const copyTrainingPlan = (id) => {
  return $postParam("/api/admin/obe/culture/program/copy", { id });
};
export const updateTrainingPlan = (datas) => {
  return $post("/api/admin/obe/culture/program/save", datas);
};
export const updateTrainingPlanDescription = (datas) => {
  return $post("/api/admin/obe/culture/program/description/save", datas);
};
export const updateTrainingPlanDetail = (id) => {
  return $postParam("/api/admin/obe/culture/program/get", { id });
};
// 培养方案管理-培养目标 ------------------->
export const trainingPlanTargetListPage = (datas) => {
  return $postParam("/api/admin/obe/culture/program/target/list", datas);
};
export const deleteTrainingPlanTarget = (id) => {
  return $postParam("/api/admin/obe/culture/program/target/remove", { id });
};
export const updateTrainingPlanTarget = (datas) => {
  return $post("/api/admin/obe/culture/program/target/save", datas);
};
// 培养方案管理-毕业要求 ------------------->
export const trainingPlanRequirementListPage = (datas) => {
  return $postParam("/api/admin/obe/culture/program/requirement/list", datas);
};
export const addTrainingPlanRequirementNode = (datas) => {
  return $postParam(
    "/api/admin/obe/culture/program/requirement/node/add",
    datas
  );
};
export const deleteTrainingPlanRequirementNode = (id) => {
  return $postParam("/api/admin/obe/culture/program/requirement/remove", {
    id,
  });
};
export const updateTrainingPlanRequirement = (datas) => {
  return $post("/api/admin/obe/culture/program/requirement/save", datas);
};
export const updateTrainingPlanRequirementPredict = (datas) => {
  return $post("/api/admin/obe/culture/program/requirement/expect/save", datas);
};
// 培养方案管理-培养目标与毕业要求关系矩阵 ------------------->
export const trainingPlanMatrixListPage = (datas) => {
  return $postParam("/api/admin/obe/culture/program/target/matrix/get", datas);
};
export const updateRrainingPlanMatrix = (datas) => {
  return $post("/api/admin/obe/culture/program/target/matrix/save", datas);
};
// 培养方案管理-课程体系 ------------------->
export const trainingPlanCourseListPage = (datas) => {
  return $postParam("/api/admin/obe/culture/program/course/list", datas);
};
export const deleteRrainingPlanCourse = (id) => {
  return $postParam("/api/admin/obe/culture/program/course/remove", { id });
};
export const sortRrainingPlanCourse = (datas) => {
  return $post("/api/admin/obe/culture/program/course/sort", datas);
};
export const trainingPlanCourseQueryList = (datas) => {
  return $postParam("/api/admin/obe/culture/program/course/query_list", datas);
};
export const trainingPlanCourseSave = (datas) => {
  return $post("/api/admin/obe/culture/program/course/save", datas);
};
// 培养方案管理-课程支撑毕业要求达成矩阵 ------------------->
export const trainingPlanCourseMatrixDetail = (datas) => {
  return $postParam("/api/admin/obe/culture/program/course/matrix/get", datas);
};
export const trainingPlanCourseMatrixSave = (datas) => {
  return $post("/api/admin/obe/culture/program/course/matrix/save", datas, {
    silence: true,
  });
};

// 课程大纲管理 ------------------->
export const courseOutlineListPage = (datas) => {
  return $postParam("/api/admin/obe/course_outline/page", datas);
};
export const deleteCourseOutline = (id) => {
  return $postParam("/api/admin/obe/course_outline/delete", { id });
};
export const updateCourseOutline = (datas) => {
  return $post("/api/admin/obe/course_outline/save", datas);
};
export const selectableTrainingPlanList = () => {
  return $postParam(
    "/api/admin/obe/course_outline/can_choose_culture_program",
    {}
  );
};
export const selectableTrainingPlanCourseList = (cultureProgramId) => {
  return $postParam("/api/admin/obe/course_outline/can_choose_course", {
    cultureProgramId,
  });
};
// 课程大纲管理-课程目标 ------------------->
export const courseOutlineTargetListPage = (datas) => {
  return $postParam("/api/admin/obe/course_target/list", datas);
};
export const deleteCourseOutlineTarget = (id) => {
  return $postParam("/api/admin/obe/course_target/delete", { id });
};
export const updateCourseOutlineTarget = (datas) => {
  return $post("/api/admin/obe/course_target/save", datas);
};
export const updateCourseOutlineTargetPredict = (datas) => {
  return $post("/api/admin/obe/course_target/setting_expect_value", datas);
};
export const courseOutlineTargetRequirementList = (datas) => {
  return $postParam("/api/admin/obe/course_target/sub_requirement/list", datas);
};
export const courseOutlineTargetKnowledgeList = (datas) => {
  return $postParam("/api/admin/obe/course_target/dimension_tree", datas);
};
export const courseOutlineTargetRequirementKnowledge = (datas) => {
  return $postParam(
    "/api/admin/obe/course_target/requirement_dimension",
    datas
  );
};

// 暂时不做
// 课程大纲管理-知识点 ------------------->
// export const courseOutlineKnowledgeListPage = (datas) => {
//   return $postParam("/api/admin/obe/culture/program/course/list", datas);
// };
// export const deleteCourseOutlineKnowledge = (id) => {
//   return $postParam("/api/admin/obe/culture/program/course/remove", { id });
// };
// export const sortCourseOutlineKnowledge = (datas) => {
//   return $post("/api/admin/obe/culture/program/course/sort", datas);
// };
// export const updateCourseOutlineKnowledge = (datas) => {
//   return $post("/api/admin/basic/professional/save", datas);
// };

// 课程大纲管理-审核  ------------------->
export const courseOutlineAuditReport = (obeCourseOutlineId) => {
  return $postParam("/api/admin/obe/course_outline/audit_report", {
    obeCourseOutlineId,
  });
};
export const courseOutlineAuditRationalityReport = (obeCourseOutlineId) => {
  return $postParam("/api/admin/obe/course_outline/audit_rationality_report", {
    obeCourseOutlineId,
  });
};
export const courseOutlineAuditSave = (datas) => {
  return $post("/api/admin/obe/course_outline/audit/save", datas);
};

// 课程考核设置 ------------------->
export const courseExamineListPage = (datas) => {
  return $postParam(
    "/api/admin/obe/course_outline/assessment_setting_page",
    datas
  );
};
export const deleteCourseExamine = (id) => {
  return $postParam("/api/admin/obe/course_outline/assessment_setting_delete", {
    id,
  });
};
// 课程考核设置-评价方式 ------------------->
export const courseExamineEvaluationListPage = (datas) => {
  return $postParam("/api/admin/obe/course_evaluation/list", datas);
};
export const deleteCourseExamineEvaluation = (id) => {
  return $postParam("/api/admin/obe/course_evaluation/delete", { id });
};
export const updateCourseExamineEvaluation = (datas) => {
  return $post("/api/admin/obe/course_evaluation/save", datas);
};
export const courseExamineWeightSettingStatus = (datas) => {
  return $postParam(
    "/api/admin/obe/course_outline/find_course_weight_setting_status",
    datas
  );
};
// 课程考核设置-权重设置 ------------------->
export const courseExamineWeightDetail = (datas) => {
  return $postParam("/api/admin/obe/course_weight/find", datas);
};
export const courseExamineWeightSave = (datas) => {
  return $post("/api/admin/obe/course_weight/save", datas);
};

// 统计相关页面 =====================>
// 毕业要求达成度统计 ------------------->
export const requirementStatisticsListPage = (datas) => {
  return $postParam("/api/admin/obe/requirements/list", datas);
};
export const requirementStatisticsRadar = (datas) => {
  return $postParam("/api/admin/obe/requirements/radar/report", datas);
};
export const requirementStatisticsDetail = (datas) => {
  return $postParam("/api/admin/obe/requirements/detail/report", datas);
};
export const requirementStatisticsCalculate = (datas) => {
  return $postParam("/api/admin/obe/requirements/again/calculate", datas);
};

// 课程目标达成度统计 ------------------->
export const targetStatisticsListPage = (datas) => {
  return $postParam("/api/admin/course/degree/report/list", datas);
};
export const targetStatisticsCalculate = (datas) => {
  return $postParam("/api/admin/course/degree/report/again/calculate", datas);
};
export const targetStatisticsDetail = (datas) => {
  return $postParam("/api/admin/course/degree/report/view", datas);
};
export const targetStatisticsSave = (datas) => {
  return $post("/api/admin/course/degree/report/save", datas);
};
export const targetStatisticsReport = (datas) => {
  return $postParam("/api/admin/course/degree/report/export", datas, {
    responseType: "blob",
  });
};
export const targetStatisticsNormalScoreExport = (datas) => {
  return $postParam(
    "/api/admin/course/degree/report/usual_score/export",
    datas,
    {
      responseType: "blob",
    }
  );
};
export const targetStatisticsChangeCheck = (datas) => {
  return $postParam("/api/admin/course/degree/report/change", datas);
};

// 学生毕业要求达成度 ------------------->
export const studentTargetListPage = (datas) => {
  return $postParam("/api/admin/obe/student_requirement/page", datas);
};
export const studentTargetDetail = (datas) => {
  return $postParam("/api/admin/obe/student_requirement/detail", datas);
};
export const studentTargetCalculate = (datas) => {
  return $postParam(
    "/api/admin/obe/student_requirement/again/calculate",
    datas
  );
};

// 成绩管理 =====================>
// 成绩管理
export const targetScoreListPage = (datas) => {
  return $postParam("/api/admin/course/degree/score/list", datas);
};
// 成绩管理-平时成绩 ------------------->
// 成绩管理-导入平时成绩-下载模版
export const scoreTemplateDownload = (datas) => {
  return $postParam(
    "/api/admin/course/degree/usual_score/template_download",
    datas,
    {
      responseType: "blob",
    }
  );
};
// 成绩管理-平时成绩列表
export const normalScoreListPage = (datas) => {
  return $postParam("/api/admin/course/degree/usual_score/list", datas);
};
// 成绩管理-平时成绩编辑
export const normalScoreEdit = (datas) => {
  return $post("/api/admin/course/degree/usual_score/edit", datas);
};
// 成绩管理-平时成绩保存
export const normalScoreSave = (datas) => {
  return $post("/api/admin/course/degree/usual_score/save", datas);
};
// 成绩管理-平时成绩启用/禁用
export const normalScoreEnable = (datas) => {
  return $postParam("/api/admin/course/degree/usual_score/enable", datas);
};

// 成绩管理-导入平时成绩时获取评价方式列表
export const courseEvaluationList = (datas) => {
  // cultureProgramId,courseId
  return $postParam(
    "/api/admin/course/degree/usual_score/template_download/list",
    datas
  );
};

// 成绩管理-期末成绩 ------------------->
// 成绩管理-导入期末成绩-下载模版
export const endScoreTemplateDownload = (datas) => {
  return $postParam(
    "/api/admin/course/degree/final_score/template_download",
    datas,
    {
      responseType: "blob",
    }
  );
};
// 成绩管理-期末成绩列表
export const endScoreListPage = (datas) => {
  return $postParam("/api/admin/course/degree/final_score/list", datas);
};
// 成绩管理-期末成绩编辑
export const endScoreEdit = (datas) => {
  return $post("/api/admin/course/degree/final_score/edit", datas);
};
// 成绩管理-期末成绩保存
export const endScoreSave = (datas) => {
  return $post("/api/admin/course/degree/final_score/save", datas);
};
// 成绩管理-期末成绩同步
export const endScoreSync = (datas) => {
  return $postParam("/api/admin/course/degree/final_score/sync", datas);
};
// 成绩管理-期末成绩启用/禁用
export const endScoreEnable = (datas) => {
  return $postParam("/api/admin/course/degree/final_score/enable", datas);
};
// 成绩管理-试卷蓝图详情
export const endScorePaperPositiveDetail = (datas) => {
  return $postParam(
    "/api/admin/course/degree/final_score/paper_struct/query",
    datas
  );
};
// 成绩管理-保存试卷蓝图
export const endScorePaperPositiveSave = (datas) => {
  return $post("/api/admin/course/degree/final_score/paper_struct/save", datas);
};
// 成绩管理-同步试卷蓝图
export const endScorePaperPositiveSync = (datas) => {
  return $postParam(
    "/api/admin/course/degree/final_score/paper_struct_dimension/sync",
    datas
  );
};
// 成绩管理-同步选择试卷
export const endScoreSyncPaperList = (datas) => {
  return $postParam("/api/admin/course/degree/final_score/choose_paper", datas);
};
// 成绩管理-清除试卷结构
export const endScorePaperStructClear = (datas) => {
  return $postParam(
    "/api/admin/course/degree/final_score/paper_struct/clear",
    datas
  );
};

// 报告管理 ------------------->
export const targetReportListPage = (datas) => {
  return $postParam("/api/admin/course/degree/report/list", datas);
};
// 报告管理-查看报告
export const targetReportDetail = (datas) => {
  return $postParam("/api/admin/course/degree/report/view", datas);
};
// 报告管理-保存报告
export const targetReportSave = (datas) => {
  return $post("/api/admin/course/degree/report/save", datas);
};
// 报告管理-导出报告
export const exportTargetReport = (datas) => {
  return $postParam("/api/admin/course/degree/report/export", datas, {
    responseType: "blob",
  });
};
// 报告管理-报告数据发生变化
export const targetReportChangeCheck = (datas) => {
  return $postParam("/api/admin/course/degree/report/change", datas);
};
