+
上次学到:{{ lastLearned.taskName }}
继续学习
@@ -459,14 +459,12 @@ import { ElMessage } from "element-plus";
import { request } from "@/api/request";
import { growthRequest } from "@/api/growthRequest";
import {
- CompletionList,
EvaluationToLearn,
- PointList,
QueryEvaluationTaskStatusOne,
STUDY_RECORD,
SubmitExternalExam,
- UPDATE_CURRENT_TASK,
PROFESSIONAL_STUDENT_TASKLIST,
+ PROFESSIONAL_STUDENT_LEARN,
} from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import { GROWTH, TASK_TYPES } from "@/api/CONST";
@@ -481,7 +479,9 @@ const { commit, dispatch, state } = useStore();
const userInfo = computed(() => state.userInfo);
const data = computed(() => state.growthInfo);
const errorData = computed(() => state.projectError);
-
+const lastLearned = computed(() =>
+ stageProcessList.value.find((item) => item.lastStudy)
+);
// 查询条件
const queryParams = reactive({
type: 1,
@@ -597,11 +597,16 @@ const openCourseIdList = ref([]);
const dialogVisible = ref(false);
const dialogVisibleTip = ref("该任务无法学习,请联系管理员进行替换!");
-async function toFinish(d, sName, chapterOrStageId, studyModel) {
+async function toFinish(d) {
if (d.completionStatus == 10) {
ElMessage.warning("当前未解锁");
return;
}
+ //更新学员当前任务
+ await growthRequest(PROFESSIONAL_STUDENT_LEARN, {
+ growthId: routerId,
+ taskId: d.taskId,
+ });
if (d.courseType === "2") {
if (!d.targetId) {
@@ -614,6 +619,7 @@ async function toFinish(d, sName, chapterOrStageId, studyModel) {
return;
}
}
+
// 作业过期判断
if (d.courseType == 4) {
let date1 = new Date(d.info.submitEndTime).getTime();
@@ -626,7 +632,7 @@ async function toFinish(d, sName, chapterOrStageId, studyModel) {
}
// 直播结束时间
if (d.courseType == 6) {
- let date1 = new Date(d.endTime).getTime();
+ let date1 = new Date(d.info.liveEndTime).getTime();
let date2 = new Date().getTime();
if (date1 < date2) {
dialogVisibleTip.value = "当前直播已结束";
@@ -670,10 +676,10 @@ async function toFinish(d, sName, chapterOrStageId, studyModel) {
return;
}
}
-
+
// 其他活动 结束时间
if (d.courseType == 9) {
- let date1 = new Date(d.endTime).getTime();
+ let date1 = new Date(d.info.activityEndTime).getTime();
let date2 = new Date().getTime();
if (date1 < date2) {
dialogVisibleTip.value = "当前活动已结束";
@@ -681,26 +687,17 @@ async function toFinish(d, sName, chapterOrStageId, studyModel) {
//return
}
}
-
+
// 测评模块 请求接口跳转新的页面 - 新增 暂时未调试 目前无测评数据 2023-02-04
if (d.courseType == 10) {
- if (d.quizTaskId == null) {
+ if (d.completionStatus != 1) {
// 肯定没有完成测评
// 调用接口 跳转页面
- console.log("我是查询测评跳转链接所传递得参数", {
- businessType: "project",
- chapterId: 0,
- courseId: d.courseId,
- quizKid: d.targetId,
- routerOrProjectId: routerId,
- studentId: userInfo.value.id,
- studentName: userInfo.value.realName,
- });
request(EvaluationToLearn, {
businessType: "project",
chapterId: 0,
courseId: d.courseId,
- quizKid: d.targetId,
+ quizKid: d.info.evaluationTypeId,
routerOrProjectId: routerId,
studentId: userInfo.value.id,
studentName: userInfo.value.realName,
@@ -739,7 +736,7 @@ async function toFinish(d, sName, chapterOrStageId, studyModel) {
businessType: "project",
chapterId: 0,
courseId: d.courseId,
- quizKid: d.targetId,
+ quizKid: d.info.evaluationTypeId,
routerOrProjectId: routerId,
studentId: userInfo.value.id,
studentName: userInfo.value.realName,
@@ -748,7 +745,7 @@ async function toFinish(d, sName, chapterOrStageId, studyModel) {
businessType: "project",
chapterId: 0,
courseId: d.courseId ? d.courseId : d.info.id,
- quizKid: d.targetId,
+ quizKid: d.info.evaluationTypeId,
routerOrProjectId: routerId,
studentId: userInfo.value.id,
studentName: userInfo.value.realName,
@@ -779,13 +776,7 @@ async function toFinish(d, sName, chapterOrStageId, studyModel) {
ElMessage.error("暂时未开放");
return;
}
- //更新学员当前任务
- await request(UPDATE_CURRENT_TASK, {
- id: d.id,
- type: GROWTH,
- pid: routerId,
- name: d.taskName,
- });
+
if (
d.courseType == 3 ||
d.courseType == 7 ||
@@ -802,6 +793,7 @@ async function toFinish(d, sName, chapterOrStageId, studyModel) {
taskType: d.courseType,
});
}
+
if (typeof TASK_TYPES.path[d.courseType] === "string") {
TASK_TYPES.path[d.courseType] &&
TASK_TYPES.path[d.courseType].startsWith("http") &&
@@ -813,6 +805,7 @@ async function toFinish(d, sName, chapterOrStageId, studyModel) {
query: {
id: d.id,
type: GROWTH,
+ projectId: d.courseId,
infoId: data.value.id,
courseId: d.courseId ? d.courseId : d.info.id,
pName: data.value.growthName,
@@ -847,17 +840,6 @@ function toOffcoursePlanPage(id) {
"_top"
);
}
-
-// 继续学习
-function continueLearn(lastLearnedId) {
- data.value.stageProcessList.forEach((stage) => {
- stage?.taskProcessList?.forEach((d) => {
- if (d.id == lastLearnedId) {
- toFinish(d, stage.stageName, stage.stageId);
- }
- });
- });
-}