diff --git a/src/api/api.js b/src/api/api.js index 821f1ef..f5f697a 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-01-31 17:32:26 + * @LastEditTime: 2023-02-03 12:01:18 * @FilePath: /stu_h5/src/api/api.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -26,12 +26,11 @@ export const STU_OFFCOURSE_DETAIL = '/stu/offcourse/detail post' export const WORK_QUERYWORKDETAILBYID = '/work/queryWorkDetailById' export const EXAMINATION_QUERYEXAMINATIONDETAILBYID = '/examination/queryExaminationDetailById' export const DISCUSS_COLLECTION = '/discussSubmit/clickDiscussCollectionCountOr POST' -export const DISCUSS_LIKE = '/discussSubmit/clickDiscussLikeCountOr POST' export const ACTIVITY = '/activity' export const EXAMINATION_QUERY = examinationId => `/examination/queryExaminationDetailById?examinationId=${examinationId} post` export const TASK_OFFCOURSE_NOTASK_SIGN = '/stu/task/offcourse/notask/sign post' export const TASK_OFFCOURSE_SIGN = '/stu/task/offcourse/sign post' -export const LINK_DETAILS = linkId => `/link/getOne?linkId=${linkId} post` +export const LINK_DETAILS = linkId => `/link/getOne?linkId=${linkId}` export const STUDY_RECORD = '/stu/task/thirdTask/submit post' export const TASK_WORK_SUBMIT_LIST = '/workSubmit/queryWorkSubmitDetailById' export const WORK_HISTROY = '/workSubmit/queryWorkDetailListByStuId' @@ -42,3 +41,17 @@ export const ROUTER_DETAILS = '/admin/router/detail' export const TASK_LIST = '/stu/tasks' export const ONLINE_PROCESS = '/onlineClasses/queryOnlineClassesStudyDetail post' export const PROJECT_PROCESS = '/stu/project/process' +export const EVALUATION_DETAIL = evaluationId => `/evaluation/queryEvaluationDetailById?evaluationId=${evaluationId} post` +export const DISCUSS_LIKE = '/discussSubmit/clickDiscussLikeCountOr post' +export const DISCUSS_LIST = '/discussSubmit/taskList' +export const DISCUSS_DETAIL = '/discussSubmit/detail' +export const DISCUSS_SUBMIT_REVIEW_LIST = '/discussSubmit/queryDiscussSubmitAndReview' +export const VOTE_DETAIL2 = `/voteSubmit/queryVoteTaskDetailById post` +// 投票详情接口 +export const VOTE_DETAIL_SUBMIT = `/voteSubmit/vote/commit post` + +// 讨论模块 +// -- 根据讨论的Id查询讨论发表的帖子 +export const QueryDiscussSubmitDetailByDiscussId = '/discussSubmit/queryDiscussSubmitDetailByDiscussId post' +export const COMMENT_PRAISE = '/comment/praise post' +export const COMMENT_COLLECTION = '/comment/collection post' \ No newline at end of file diff --git a/src/api/request.js b/src/api/request.js index 1f1d4a6..fe05c90 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -3,7 +3,9 @@ import { reactive, ref, toRefs, watch } from "vue"; import axios from 'axios'; import { getCookie } from "@/api/utils"; import JSONBigInt from 'json-bigint'; + const JSONBigIntStr = JSONBigInt({ storeAsString: true }); + export function usePage(_url, param, callback) { const state = reactive({ @@ -38,27 +40,30 @@ export function usePage(_url, param, callback) { fetchData, }; } + export function useRequest(_url, params = {}) { - const data = ref({}) - const loading = ref(false) + const state = reactive({ + data: {}, + loading: false, + + }) watch(params, () => { fetchData() }) function fetchData() { - loading.value = true + state.loading = true request(_url, params).then(r => { - data.value = r.data - loading.value = false + state.data = r.data + state.loading = false }) } fetchData() return { - data, - loading, + ...toRefs(state), fetchData, }; } @@ -94,6 +99,12 @@ export async function request(_url, params) { if (response.code === 1000) { (import.meta.env.MODE === 'development' || import.meta.env.MODE === 'test') ? router.push({ path: '/login' }) : window.open(import.meta.env.VITE_BASE_LOGIN_URL, '_top') } + if (response.code === 2001) { + router.push({ path: '/FaceTeachSignUp', query: { courseId: router.currentRoute.value.query.courseId, type: 3 } }) + } + if (response.code === 2002) { + router.push({ path: '/FaceTeachNoCommon', query: { courseId: router.currentRoute.value.query.courseId, type: 3 } }) + } // if (import.meta.env.DEV && response.code === 1000) { // router.push({path: '/login'}) // } else { @@ -103,12 +114,8 @@ export async function request(_url, params) { // duration: 2, // }); // } - throw new Error('接口异常') } return response - }).catch(e => { - console.log('eeeee', e) - // router.push({path: '/login'}) }) } @@ -140,11 +147,5 @@ export async function boeRequest(_url, params) { return res.text() }).then(res => { return JSONBigIntStr.parse(res) - }).then(res => { - console.log(res) - if (res.status === 500) { - import.meta.env.MODE === 'development' ? router.push({ path: '/login', query: { returnUrl: router.currentRoute.value.fullPath } }) : window.open(import.meta.env.VITE_BASE_LOGIN_URL + window.location.url, '_top') - } - return res }) } \ No newline at end of file diff --git a/src/views/ballotpage/BallotPage.vue b/src/views/ballotpage/BallotPage.vue index 4b2bcfc..1e26c10 100644 --- a/src/views/ballotpage/BallotPage.vue +++ b/src/views/ballotpage/BallotPage.vue @@ -1,23 +1,25 @@ - @@ -148,6 +200,7 @@ export default { width: 100%; .notice { + margin-top: 10px; width: 100%; display: flex; justify-content: center; diff --git a/src/views/discuss/DiscussPage.vue b/src/views/discuss/DiscussPage.vue index 39dafc3..16b7c5c 100644 --- a/src/views/discuss/DiscussPage.vue +++ b/src/views/discuss/DiscussPage.vue @@ -1,9 +1,8 @@ - @@ -157,7 +164,7 @@ export default { .discusspage { width: 100%; .head { - margin-top: 20px; + margin-top: 10px; display: flex; justify-content: center; width: 100%; diff --git a/src/views/evaluation/Evaluation.vue b/src/views/evaluation/Evaluation.vue index 7687113..9830a75 100644 --- a/src/views/evaluation/Evaluation.vue +++ b/src/views/evaluation/Evaluation.vue @@ -21,11 +21,11 @@
{{ data.userInfoBo?.userName }}
-->
-
【测评】{{ data?.linkName }}
+
【测评】{{ data?.evaluationName }}
- {{ data?.liveStartTime + " 至 " + data?.liveEndTime }} + {{ data?.evaluationStartTime + " 至 " + data?.evaluationEndTime }}
@@ -54,7 +54,7 @@
- {{ data.linkDescription }} + {{ data?.evaluationExplain }}
@@ -71,7 +71,7 @@ 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 { LINK_DETAILS, STUDY_RECORD } from "@/api/api"; +import { EVALUATION_DETAIL, STUDY_RECORD } from "@/api/api"; import { useRoute } from "vue-router/dist/vue-router"; import { useRouter } from "vue-router"; import { useUserInfo } from "@/api/utils"; @@ -79,31 +79,47 @@ import { ElMessage } from "element-plus"; import dayjs from "dayjs"; const { - query: { - courseId: linkId, - id: taskId, - type, - status, - chapterOrStageId, - infoId, - studentId, - }, + query: { courseId: evaluationId, evaType, targetId }, } = useRoute(); const router = useRouter(); -console.log("外链信息", linkId); -const { data } = useRequest(LINK_DETAILS(linkId)); -console.log("外链信息", data); +const { data } = useRequest(EVALUATION_DETAIL(evaluationId)); +console.log("测评信息222", data); +//作业倒计时 +let hour = ref(0); +let minute = ref(0); +let seconds = ref(0); +let timer = setInterval(() => { + let endTime = parseInt( + new Date(data.value.evaluationEndTime).getTime() / 1000 + ); + let nowTime = parseInt(new Date().getTime() / 1000); + if (endTime > nowTime) { + hour.value = parseInt( + dayjs(data.value.evaluationEndTime).diff(dayjs(), "minute") / 60 + ); + minute.value = parseInt( + dayjs(data.value.evaluationEndTime).diff(dayjs(), "minute") % 60 + ); + seconds.value = parseInt( + dayjs(data.value.evaluationEndTime).diff(dayjs(), "seconds") - + (hour.value * 60 + minute.value) * 60 + ); + } else { + clearInterval(timer); + } +}, 1000); +onUnmounted(() => { + clearInterval(timer); +}); const goOuterChain = () => { - status != 1 && - request(STUDY_RECORD, { - studentId: studentId, - targetId: infoId, - logo: type, - stageOrChapterId: chapterOrStageId, - taskId: taskId, - }); - - window.open(data.value.linkAddress, "_top"); + window.open( + evaType == 0 + ? import.meta.env.VITE_BOE_TEST_DETAIL_URL + targetId + : import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL + + targetId + + `&quizTaskKid=${routerId}&channelCode=learningpath`, + "_top" + ); //测评 }; diff --git a/src/views/pathmap/PathmapPage.vue b/src/views/pathmap/PathmapPage.vue index 667d3a3..ba6e259 100644 --- a/src/views/pathmap/PathmapPage.vue +++ b/src/views/pathmap/PathmapPage.vue @@ -191,15 +191,16 @@ const types = ref({ // 7: ({ targetId }) => window.open(targetId, "_top"), //外联 8: "/discusspage", 9: "/activitiespage", - 10: ({ evaType, targetId }) => - window.open( - evaType == 0 - ? import.meta.env.VITE_BOE_TEST_DETAIL_URL + targetId - : import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL + - targetId + - `&quizTaskKid=${routerId}&channelCode=learningpath`, - "_top" - ), //测评 + // 10: ({ evaType, targetId }) => + // window.open( + // evaType == 0 + // ? import.meta.env.VITE_BOE_TEST_DETAIL_URL + targetId + // : import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL + + // targetId + + // `&quizTaskKid=${routerId}&channelCode=learningpath`, + // "_top" + // ), //测评 + 10: "/evaluation", //测评 11: "/investigatpage", 12: "/ballotpage", 13: "/projectdetails", @@ -299,7 +300,7 @@ function toFinish(d) { taskId: d.routerTaskId, }); } - console.log("点击跳转"); + console.log("点击跳转", d); if (typeof types.value.path[d.type] === "string") { types.value.path[d.type] && types.value.path[d.type].startsWith("http") && @@ -318,6 +319,8 @@ function toFinish(d) { chapterOrStageId: data.value.currentStageId, studentId: userInfo.value.id, status: d.status, + targetId: d.targetId, + evaType: d.evaType, }, }); } else if (typeof types.value.path[d.type] === "function") { diff --git a/src/views/projectdetails/ProjectPath.vue b/src/views/projectdetails/ProjectPath.vue index 233c56c..868a237 100644 --- a/src/views/projectdetails/ProjectPath.vue +++ b/src/views/projectdetails/ProjectPath.vue @@ -2,7 +2,7 @@ * @Author: lixg lixg@dongwu-inc.com * @Date: 2023-01-19 11:28:11 * @LastEditors: lixg lixg@dongwu-inc.com - * @LastEditTime: 2023-01-31 18:01:11 + * @LastEditTime: 2023-02-02 16:42:01 * @FilePath: /stu_h5/src/views/projectdetails/ProjectPath.vue * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE --> @@ -179,14 +179,14 @@ const handleClick = (tab, event) => { console.log("selectTab", selectTab.value); }; const goDetails = () => { - // router.push({ - // path: "/levelList", - // query: { routerId: 2 }, - // }); router.push({ - path: "/projectdetails", - query: { projectId: 3 }, + path: "/pathmappage", + query: { routerId: 2 }, }); + // router.push({ + // path: "/projectdetails", + // query: { projectId: 3 }, + // }); }; diff --git a/vite.config.js b/vite.config.js index bd6b840..307c7ba 100644 --- a/vite.config.js +++ b/vite.config.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-01-13 18:18:01 + * @LastEditTime: 2023-02-02 17:45:36 * @FilePath: /stu_h5/vite.config.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -101,6 +101,11 @@ export default defineConfig(({ command, mode }) => target: loadEnv(mode, process.cwd()).VITE_PROXY_URL, changeOrigin: true, }, + '/evaluation/queryEvaluationDetailById': { + target: loadEnv(mode, process.cwd()).VITE_PROXY_URL, + changeOrigin: true, + }, + } } })