mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-11 20:06:49 +08:00
fix bug
This commit is contained in:
@@ -2,7 +2,7 @@ export const PROJECT = 1;
|
|||||||
export const ROUTER = 2;
|
export const ROUTER = 2;
|
||||||
export const COURSE = 3;
|
export const COURSE = 3;
|
||||||
|
|
||||||
export const TASK_TYPES ={
|
export const TASK_TYPES = {
|
||||||
typeName: {
|
typeName: {
|
||||||
1: "在线",
|
1: "在线",
|
||||||
2: "面授",
|
2: "面授",
|
||||||
@@ -38,9 +38,9 @@ export const TASK_TYPES ={
|
|||||||
2: ({courseId}) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${courseId}`, '_top'),
|
2: ({courseId}) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${courseId}`, '_top'),
|
||||||
3: window.location.protocol + import.meta.env.VITE_BOE_CASS_DETAIL_URL, //案例
|
3: window.location.protocol + import.meta.env.VITE_BOE_CASS_DETAIL_URL, //案例
|
||||||
4: "/homeworkpage",
|
4: "/homeworkpage",
|
||||||
5: window.location.protocol + import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
|
5: ({examType}) => examType === 2 ? '/externalexamination' : (window.location.protocol + import.meta.env.VITE_BOE_EXAM_DETAIL_URL), //考试
|
||||||
6: "/livebroadcast",
|
6: "/livebroadcast",
|
||||||
7: ({targetId}) => window.open(targetId, '_top'), //外联
|
7: '/outerchain', //外联
|
||||||
8: "/discusspage",
|
8: "/discusspage",
|
||||||
9: "/moreactive",
|
9: "/moreactive",
|
||||||
10: ({evaType, targetId}) =>
|
10: ({evaType, targetId}) =>
|
||||||
|
|||||||
@@ -280,12 +280,11 @@ import {computed, onMounted, ref} from "vue";
|
|||||||
import circle from '@/assets/image/pathdetails/circle.png';
|
import circle from '@/assets/image/pathdetails/circle.png';
|
||||||
import circle2 from '@/assets/image/pathdetails/circle2.png';
|
import circle2 from '@/assets/image/pathdetails/circle2.png';
|
||||||
import {request} from "@/api/request";
|
import {request} from "@/api/request";
|
||||||
import {EvaluationToLearn, STUDY_RECORD, SubmitExternalExam} from "@/api/api";
|
import {STUDY_RECORD, UPDATE_CURRENT_TASK} from "@/api/api";
|
||||||
import {useRoute, useRouter} from "vue-router";
|
import {useRoute, useRouter} from "vue-router";
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
import {ROUTER, TASK_TYPES} from "@/api/CONST";
|
import {ROUTER, TASK_TYPES} from "@/api/CONST";
|
||||||
import FileTypeImg from "@/components/FileTypeImg.vue";
|
import FileTypeImg from "@/components/FileTypeImg.vue";
|
||||||
import {UPDATE_CURRENT_TASK} from "@/api/api";
|
|
||||||
import {useStore} from "vuex";
|
import {useStore} from "vuex";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -323,19 +322,19 @@ function judgeTaskIsEnd(type, endTimes, status) {
|
|||||||
let endTime = new Date().getTime(endTimes);
|
let endTime = new Date().getTime(endTimes);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 1:
|
case 1:
|
||||||
status == -1 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
|
status == -1 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
|
||||||
break;
|
break;
|
||||||
// case 3:
|
// case 3:
|
||||||
// status == 3 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
|
// status == 3 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
|
||||||
// break;
|
// break;
|
||||||
case 5:
|
case 5:
|
||||||
status == -1 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
|
status == -1 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
status == -1 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
|
status == -1 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
status == -1 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
|
status == -1 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return isEnd;
|
return isEnd;
|
||||||
@@ -346,7 +345,7 @@ async function toFinish(d) {
|
|||||||
ElMessage.warning("当前未解锁")
|
ElMessage.warning("当前未解锁")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (judgeTaskIsEnd(d.type, data.value.endTime, data.value.status)) {
|
if (data.value.endTime && judgeTaskIsEnd(d.type, data.value.endTime, data.value.status)) {
|
||||||
ElMessage.error("当前任务已结束")
|
ElMessage.error("当前任务已结束")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -393,37 +392,6 @@ async function toFinish(d) {
|
|||||||
dialogVisible.value = true;
|
dialogVisible.value = true;
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 此处判断外部考试跳转
|
|
||||||
if (d.examType == 2) {
|
|
||||||
|
|
||||||
// 点击即更新状态 进行中
|
|
||||||
request(SubmitExternalExam, {
|
|
||||||
"chapterId": data.value.currentStageId,
|
|
||||||
"externalId": d.courseId,
|
|
||||||
"externalName": d.name,
|
|
||||||
"targetId": routerId,
|
|
||||||
"studentNo": userInfo.value.userNo
|
|
||||||
}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
})
|
|
||||||
|
|
||||||
router.push({
|
|
||||||
path: '/externalexamination',
|
|
||||||
query: {
|
|
||||||
id: d.id,
|
|
||||||
type: ROUTER,
|
|
||||||
infoId: routerId,
|
|
||||||
courseId: d.courseId,
|
|
||||||
pName: data.value.name,
|
|
||||||
sName: data.value.currentStageName,
|
|
||||||
chapterOrStageId: data.value.currentStageId,
|
|
||||||
exname: d.name, // 考试名称
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 评估 停用
|
// 评估 停用
|
||||||
if (d.type == 11) {
|
if (d.type == 11) {
|
||||||
@@ -464,38 +432,19 @@ async function toFinish(d) {
|
|||||||
}
|
}
|
||||||
//更新学员当前任务
|
//更新学员当前任务
|
||||||
await request(UPDATE_CURRENT_TASK, {id: d.id, type: ROUTER, pid: routerId, name: d.name})
|
await request(UPDATE_CURRENT_TASK, {id: d.id, type: ROUTER, pid: routerId, name: d.name})
|
||||||
if (d.type === 3 || d.type === 7) {
|
if (d.type === 3 || d.type === 7 || (d.type === 5 && d.examType === 2)) {
|
||||||
d.status !== 1 && await request(STUDY_RECORD, {
|
d.status !== 1 && await request(STUDY_RECORD, {
|
||||||
studentId: userInfo.value.id,
|
studentId: userInfo.value.id,
|
||||||
targetId: data.value.id,
|
targetId: data.value.id,
|
||||||
logo: ROUTER,
|
logo: ROUTER,
|
||||||
|
type: ROUTER,
|
||||||
stageOrChapterId: data.value.currentStageId,
|
stageOrChapterId: data.value.currentStageId,
|
||||||
taskId: d.id,
|
taskId: d.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 此处判断外链跳转详情界面
|
|
||||||
if (d.type == 7) {
|
|
||||||
router.push({
|
|
||||||
path: '/outerchain',
|
|
||||||
query: {
|
|
||||||
id: d.id,
|
|
||||||
type: ROUTER,
|
|
||||||
infoId: routerId,
|
|
||||||
courseId: d.courseId,
|
|
||||||
pName: data.value.name,
|
|
||||||
sName: data.value.currentStageName,
|
|
||||||
chapterOrStageId: data.value.currentStageId,
|
|
||||||
exname: d.name, // 外链名称
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 测评模块 请求接口跳转新的页面 - 新增 暂时未调试 目前无测评数据 2023-02-04
|
// 测评模块 请求接口跳转新的页面 - 新增 暂时未调试 目前无测评数据 2023-02-04
|
||||||
if (d.type == 10) {
|
if (d.type == 10) {
|
||||||
|
|
||||||
|
|
||||||
// 此处判断测评跳转详情界面
|
// 此处判断测评跳转详情界面
|
||||||
router.push({
|
router.push({
|
||||||
path: '/evaluation',
|
path: '/evaluation',
|
||||||
@@ -525,27 +474,22 @@ async function toFinish(d) {
|
|||||||
});
|
});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
const path = typeof TASK_TYPES.path[d.type] === "string" ? TASK_TYPES.path[d.type] : TASK_TYPES.path[d.type](d);
|
||||||
|
path && path.startsWith("http") ? window.open(path + d.targetId, '_top') : path.startsWith("/") ?
|
||||||
|
router.push({
|
||||||
|
path,
|
||||||
|
query: {
|
||||||
|
id: d.id,
|
||||||
|
type: ROUTER,
|
||||||
|
infoId: routerId,
|
||||||
|
courseId: d.courseId,
|
||||||
|
pName: data.value.name,
|
||||||
|
sName: data.value.currentStageName,
|
||||||
|
chapterOrStageId: data.value.currentStageId,
|
||||||
|
btype: 2
|
||||||
|
},
|
||||||
|
}) : ''
|
||||||
|
|
||||||
if (typeof TASK_TYPES.path[d.type] === "string") {
|
|
||||||
TASK_TYPES.path[d.type] && TASK_TYPES.path[d.type].startsWith("http") && window.open(TASK_TYPES.path[d.type] + d.targetId, '_top');
|
|
||||||
//任务列表 加载
|
|
||||||
TASK_TYPES.path[d.type] && TASK_TYPES.path[d.type].startsWith("/") &&
|
|
||||||
router.push({
|
|
||||||
path: TASK_TYPES.path[d.type],
|
|
||||||
query: {
|
|
||||||
id: d.id,
|
|
||||||
type: ROUTER,
|
|
||||||
infoId: routerId,
|
|
||||||
courseId: d.courseId,
|
|
||||||
pName: data.value.name,
|
|
||||||
sName: data.value.currentStageName,
|
|
||||||
chapterOrStageId: data.value.currentStageId,
|
|
||||||
btype: 2
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else if (typeof TASK_TYPES.path[d.type] === "function") {
|
|
||||||
TASK_TYPES.path[d.type](d);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user