From 2546f61f044e7aea221370b2816e80eb101ec196 Mon Sep 17 00:00:00 2001 From: lixg Date: Wed, 1 Mar 2023 20:00:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E6=8A=95=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api.js | 5 +- src/components/PathDetailImage.vue | 2 +- src/views/ballotpage/BallotPage.vue | 91 +++++--------------------- src/views/evaluation/Evaluation.vue | 17 ++--- src/views/examination/ExternalExam.vue | 6 +- src/views/pathmap/PathDetails.vue | 4 +- src/views/pathmap/PathmapPage.vue | 11 ++++ 7 files changed, 47 insertions(+), 89 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index bdc1404..62ab106 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-02-27 15:35:34 + * @LastEditTime: 2023-03-01 19:07:28 * @FilePath: /stu_h5/src/api/api.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -48,8 +48,9 @@ export const DISCUSS_LIST = '/discussSubmit/taskList' export const DISCUSS_DETAIL = '/discussSubmit/detail' export const DISCUSS_SUBMIT_REVIEW_LIST = '/discussSubmit/queryDiscussSubmitAndReview' export const VOTE_DETAIL2 = `/vote/queryVoteById` +export const VOTE_DETAIL3 = voteId => `/vote/queryVoteById?voteId=${voteId}` // 投票详情接口 -export const VOTE_DETAIL_SUBMIT = `/voteSubmit/vote/commit post` +export const VOTE_DETAIL_SUBMIT = `voteSubmit/vote/commit post` // 讨论模块 // -- 根据讨论的Id查询讨论发表的帖子 diff --git a/src/components/PathDetailImage.vue b/src/components/PathDetailImage.vue index 997bebe..c5f2a46 100644 --- a/src/components/PathDetailImage.vue +++ b/src/components/PathDetailImage.vue @@ -47,7 +47,7 @@ const visiable = ref(true); // const back = ref("require('@/assets/images/pathdetails/pathDetailBack.png')"); const imageAttrs = { - "路径图背景-1671015331292.png": { + 路径图背景: { width: 1437, height: 594, positions: [ diff --git a/src/views/ballotpage/BallotPage.vue b/src/views/ballotpage/BallotPage.vue index c0f68e9..e03b8e4 100644 --- a/src/views/ballotpage/BallotPage.vue +++ b/src/views/ballotpage/BallotPage.vue @@ -124,7 +124,7 @@ :style="{ backgroundColor: elem.isAnswer ? '#ddd' : '#2478ff', }" - @click="choiceQuestion(key, elem.optionId, data, index)" + @click="choiceQuestion(item, elem)" > 投票 @@ -177,7 +177,7 @@ import { reactive, toRefs, computed, onUnmounted, ref } from "vue"; import ReturnHead from "@/components/ReturnHead.vue"; // import TitleHead from "@/components/TitleHead.vue"; import { useRequest, request } from "@/api/request"; -import { VOTE_DETAIL2, VOTE_DETAIL_SUBMIT } from "@/api/api"; +import { VOTE_DETAIL3, VOTE_DETAIL_SUBMIT } from "@/api/api"; import dayjs from "dayjs"; import store from "@/store"; import { ElMessage } from "element-plus"; @@ -187,13 +187,7 @@ const { query: { courseId, chapterOrStageId, infoId, id, btype }, } = useRoute(); const userInfo = computed(() => store.state.userInfo); -const { data } = useRequest(VOTE_DETAIL2, { - // chapterOrStageId: chapterOrStageId ? chapterOrStageId : 0, - voteId: courseId, - // studentId: userInfo.value.id, - // targetId: infoId, - // type: btype, -}); +const { data } = useRequest(VOTE_DETAIL3(courseId), {}); console.log("投票基本信息", data); //投票倒计时 let hour = ref(0); @@ -224,22 +218,14 @@ onUnmounted(() => { // 答题时间 const answerTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"); // 选择题目 -const choiceQuestion = (order, id, dates, torder) => { - console.log("dates", dates); +const choiceQuestion = (item, value) => { // 当已经提交过时候 不让选择题目 if (data.value.isSubmit) { return; } - console.log("当前选择题目的id及序号", order, id, dates, torder); - for ( - let i = 0; - i < dates.ballotVo.voteStemVoList[torder].optionDetailList.length; - i++ - ) { - dates.ballotVo.voteStemVoList[torder].optionDetailList[i].isAnswer = false; - } - dates.ballotVo.voteStemVoList[torder].optionDetailList[order].isAnswer = true; - console.log(data); + console.log("value", value); + item.optionDetailList?.forEach((t) => (t.isAnswer = false)); + value.isAnswer = true; }; // 提交投票 const submitVote = () => { @@ -258,35 +244,11 @@ const submitVote = () => { if (data.value.isSubmit) { return; } - data.value.isSubmit = true; - let isSubmit = true; - let isSubArr = []; - console.log( - " data.ballotVo.voteStemVoList", - data.value.ballotVo.voteStemVoList - ); - for (let i = 0; i < data.value.ballotVo.voteStemVoList.length; i++) { - for ( - let j = 0; - j < data.value.ballotVo.voteStemVoList[i].optionDetailList.length; - j++ - ) { - if (data.value.ballotVo.voteStemVoList[i].optionDetailList[j].isAnswer) { - isSubArr[i] = - data.value.ballotVo.voteStemVoList[i].optionDetailList[j].isAnswer; - break; - } else { - isSubArr[i] = false; - } - } - } - for (let i = 0; i < isSubArr.length; i++) { - if (isSubArr[i] == false) { - isSubmit = false; - } - } - - if (isSubmit == false) { + if ( + data.value.voteStemDtoList.some((t) => + t.optionDetailList.every((s) => !s.isAnswer) + ) + ) { ElMessage.error("请选择投票问题后进行提交"); return; } @@ -298,30 +260,13 @@ const submitVote = () => { targetId: infoId, // 项目 路径图 id taskId: id, type: btype, // 1 项目 2 路径图 - voteId: data.value.voteId, + voteId: data.value.id, + voteName: data.value.voteName, }; - - console.log("我是投票提交的信息", obj); - - useRequest(VOTE_DETAIL_SUBMIT, obj, (e) => { - console.log("eeeeeee", e); - request(VOTE_DETAIL2, { - chapterOrStageId: chapterOrStageId ? chapterOrStageId : 0, - courseId: courseId, - studentId: userInfo.value.id, - targetId: infoId, - type: btype, - taskId: id, - }) - .then((res) => { - console.log("投票结果", res); - ElMessage.success("投票成功"); - data.value = res.data; - }) - .catch((err) => { - console.log(err); - }); - }); + data.value.isSubmit = !data.value.isSubmit; + console.log("我是投票提交的信息", obj, data); + ElMessage.success("投票成功"); + useRequest(VOTE_DETAIL_SUBMIT, obj); }; diff --git a/src/views/evaluation/Evaluation.vue b/src/views/evaluation/Evaluation.vue index b1d424b..cc55d41 100644 --- a/src/views/evaluation/Evaluation.vue +++ b/src/views/evaluation/Evaluation.vue @@ -71,13 +71,13 @@ import ReturnHead from "@/components/ReturnHead.vue"; import { computed, reactive, toRefs, onUnmounted, ref } from "vue"; import img from "@/assets/image/uploadimg.png"; import { request, useRequest } from "@/api/request"; -import { EVALUATION_DETAIL, STUDY_RECORD } from "@/api/api"; +import { EVALUATION_DETAIL, STUDY_RECORD, EvaluationToLearn } from "@/api/api"; import { useRoute } from "vue-router/dist/vue-router"; import { useRouter } from "vue-router"; import { useUserInfo } from "@/api/utils"; import { ElMessage } from "element-plus"; import dayjs from "dayjs"; - +import store from "@/store"; const { query: { courseId: evaluationId, @@ -120,10 +120,11 @@ onUnmounted(() => { clearInterval(timer); }); const goOuterChain = () => { + console.log("点击去查看"); request(EvaluationToLearn, { businessType: btype == 1 ? "project" : "learningpath", chapterId: chapterOrStageId, - courseId: courseId, + courseId: evaluationId, quizKid: data.value.evaluationTypeId, routerOrProjectId: infoId, studentId: userInfo.value.id, @@ -131,11 +132,11 @@ const goOuterChain = () => { }) .then((res) => { console.log(res); - if (res.code == 200) { - let jumpUrl = res.data.quizUrl; - // 此处写跳转url - window.open(jumpUrl, "_top"); - } + // if (res.code == 200) { + // let jumpUrl = res.data.quizUrl; + // // 此处写跳转url + // window.open(jumpUrl, "_top"); + // } }) .catch((err) => { console.log(err); diff --git a/src/views/examination/ExternalExam.vue b/src/views/examination/ExternalExam.vue index eba238e..0498598 100644 --- a/src/views/examination/ExternalExam.vue +++ b/src/views/examination/ExternalExam.vue @@ -2,7 +2,7 @@ * @Author: lixg lixg@dongwu-inc.com * @Date: 2023-02-06 18:26:23 * @LastEditors: lixg lixg@dongwu-inc.com - * @LastEditTime: 2023-02-19 18:16:49 + * @LastEditTime: 2023-03-01 18:27:31 * @FilePath: /stu_h5/src/views/examination/ExternalExam.vue * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE --> @@ -28,8 +28,8 @@
考试说明
{{ - state.datainfo.externalExplain - ? state.datainfo.externalExplain + state.datainfo.examinationExplain + ? state.datainfo.examinationExplain : "暂无考试说明" }}
diff --git a/src/views/pathmap/PathDetails.vue b/src/views/pathmap/PathDetails.vue index 65dcac9..4be0e38 100644 --- a/src/views/pathmap/PathDetails.vue +++ b/src/views/pathmap/PathDetails.vue @@ -2,7 +2,7 @@ * @Author: lixg lixg@dongwu-inc.com * @Date: 2023-01-19 14:59:34 * @LastEditors: lixg lixg@dongwu-inc.com - * @LastEditTime: 2023-03-01 14:42:05 + * @LastEditTime: 2023-03-01 18:03:05 * @FilePath: /stu_h5/src/views/pathmap/LevelList.vue * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE --> @@ -27,7 +27,7 @@
diff --git a/src/views/pathmap/PathmapPage.vue b/src/views/pathmap/PathmapPage.vue index 1294124..8d2e30b 100644 --- a/src/views/pathmap/PathmapPage.vue +++ b/src/views/pathmap/PathmapPage.vue @@ -428,6 +428,17 @@ function toFinish(d) { pid: routerId, name: d.name, }); + // 项目任务 直接跳转项目详情 + if (d.type == 13) { + // 此处判断跳转项目详情界面 + router.push({ + path: "/projectdetails", + query: { + projectId: d.courseId, + }, + }); + return; + } const path = typeof TASK_TYPES.path[d.type] === "string" ? TASK_TYPES.path[d.type]