diff --git a/src/api/api.js b/src/api/api.js index 62ab106..f196a15 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -2,7 +2,7 @@ * @Author: lixg lixg@dongwu-inc.com * @Date: 2023-01-13 11:42:48 * @LastEditors: lixg lixg@dongwu-inc.com - * @LastEditTime: 2023-03-01 19:07:28 + * @LastEditTime: 2023-03-02 18:04:53 * @FilePath: /stu_h5/src/api/api.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -82,4 +82,6 @@ export const SubmitExternalExam = `/stu/externalExam/submitExternalExam post` export const UPDATE_CURRENT_TASK = `/admin/student/updateCurrentTask post` // 测评任务去学习 export const EvaluationToLearn = '/evaluation/evaluationToLearn post' -export const FILE_UPLOAD_IMG = import.meta.env.VITE_BASE_API + 'file/img' \ No newline at end of file +export const FILE_UPLOAD_IMG = import.meta.env.VITE_BASE_API + 'file/img' +// 查询单个测评的状态 +export const QueryEvaluationTaskStatusOne = `/evaluation/queryEvaluationTaskStatusOne` \ No newline at end of file diff --git a/src/views/evaluation/Evaluation.vue b/src/views/evaluation/Evaluation.vue index c864c91..9b71199 100644 --- a/src/views/evaluation/Evaluation.vue +++ b/src/views/evaluation/Evaluation.vue @@ -71,7 +71,12 @@ import ReturnHead from "@/components/ReturnHead.vue"; import { computed, reactive, toRefs, onUnmounted, ref, watch } from "vue"; import img from "@/assets/image/uploadimg.png"; import { request, useRequest } from "@/api/request"; -import { EVALUATION_DETAIL, STUDY_RECORD, EvaluationToLearn } from "@/api/api"; +import { + EVALUATION_DETAIL, + STUDY_RECORD, + EvaluationToLearn, + QueryEvaluationTaskStatusOne, +} from "@/api/api"; import { useRoute } from "vue-router/dist/vue-router"; import { useRouter } from "vue-router"; import { useUserInfo } from "@/api/utils"; @@ -86,6 +91,7 @@ const { chapterOrStageId, infoId, btype, + quizTaskId, }, } = useRoute(); const router = useRouter(); @@ -128,26 +134,77 @@ onUnmounted(() => { }); const goOuterChain = () => { console.log("点击去查看"); - request(EvaluationToLearn, { - businessType: btype == 1 ? "project" : "learningpath", - chapterId: chapterOrStageId, - courseId: evaluationId, - quizKid: data.value.evaluationTypeId, - routerOrProjectId: infoId, - studentId: userInfo.value.id, - studentName: userInfo.value.realName, - }) - .then((res) => { - console.log(res); - if (res.code == 200) { - let jumpUrl = res.data.quizUrl; - // 此处写跳转url - window.open(jumpUrl, "_top"); - } + if (quizTaskId == null) { + request(EvaluationToLearn, { + businessType: btype == 1 ? "project" : "learningpath", + chapterId: chapterOrStageId, + courseId: evaluationId, + quizKid: data.value.evaluationTypeId, + routerOrProjectId: infoId, + studentId: userInfo.value.id, + studentName: userInfo.value.realName, }) - .catch((err) => { - console.log(err); - }); + .then((res) => { + console.log(res); + if (res.code == 200) { + let jumpUrl = res.data.quizUrl; + // 此处写跳转url + window.open(jumpUrl, "_top"); + } + }) + .catch((err) => { + console.log(err); + }); + } else { + request(QueryEvaluationTaskStatusOne, { + quizTaskId: quizTaskId, + }) + .then((res) => { + console.log(res); + if (res.code == 200) { + if (res.data.complete_status == 2) { + ElMessage.error("您已完成测评"); + return; + } else { + // 重新查询跳转 + // 调用接口 跳转页面 + console.log("我是查询测评跳转链接所传递得参数", { + businessType: btype === 2 ? "learningpath" : "project", + chapterId: chapterOrStageId, + courseId: evaluationId, + quizKid: data.value.evaluationTypeId, + routerOrProjectId: infoId, + studentId: userInfo.value.id, + studentName: userInfo.value.realName, + }); + request(EvaluationToLearn, { + businessType: "learningpath", + chapterId: chapterOrStageId, + courseId: evaluationId, + quizKid: data.value.evaluationTypeId, + routerOrProjectId: infoId, + studentId: userInfo.value.id, + studentName: userInfo.value.realName, + }) + .then((res) => { + console.log(res); + if (res.code == 200) { + let jumpUrl = res.data.quizUrl; + // 此处写跳转url + window.open(jumpUrl, "_top"); + } + }) + .catch((err) => { + console.log(err); + }); + } + } + }) + .catch((err) => { + console.log(err); + }); + } + // window.open( // evaType == 0 // ? window.location.protocol + diff --git a/src/views/faceteach/FaceTeach.vue b/src/views/faceteach/FaceTeach.vue index d7608d7..e7573c0 100644 --- a/src/views/faceteach/FaceTeach.vue +++ b/src/views/faceteach/FaceTeach.vue @@ -314,7 +314,7 @@ name="third" :disabed="dayjs().isBefore(dayjs(data.planDto?.beginTime))" > -