fix:修改在线案例考试测评跳转

This commit is contained in:
lixg
2022-12-15 11:49:39 +08:00
parent 1e21f20508
commit 333c87befa
10 changed files with 107 additions and 64 deletions

View File

@@ -306,7 +306,7 @@ import medal1 from "@/assets/image/medal/medal1.png";
import medal2 from "@/assets/image/medal/medal2.png";
import medal3 from "@/assets/image/medal/medal3.png";
import img from "@/assets/image/uploadimg.png";
import { useRequest } from "@/api/request";
import { useRequest, request } from "@/api/request";
import { PROJECT_PROCESS, ROUTER_PROCESS } from "@/api/api";
import { useRoute, useRouter } from "vue-router";
@@ -535,16 +535,16 @@ const types = ref({
13: "去完成",
},
path: {
1: "去上课",
1: import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线
2: "/faceteach",
3: "案例",
3: import.meta.env.VITE_BOE_CASS_DETAIL_URL, //案例
4: "/homeworkpage",
5: "去完成",
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
6: "/livebroadcast",
7: "外链",
7: " ",
8: "/discusspage",
9: "/moreactive",
10: "/starttest",
10: import.meta.env.VITE_BOE_TEST_DETAIL_URL, //测评
11: "/surveydetail",
12: "/ballotpage",
13: "去完成",
@@ -552,6 +552,32 @@ const types = ref({
});
function toFinish(d) {
if (!types.value.path[d.type]) {
ElMessage.error("暂时未开放");
return;
}
if (types.value.path[d.type] && types.value.path[d.type].startsWith("http")) {
//配置文件
const url = types.value.path[d.type] + d.targetId;
console.log("url", d, url);
import.meta.env.DEV
? (window.location.href = url)
: (window.parent.location.href = url);
return;
}
if (d.type === 7) {
// console.log("url", d, url);
request(LINK_DETAILS(d.courseId), {}).then((res) => {
console.log("resssss", res);
if (res.code === 200) {
const url = res.data.linkAddress;
import.meta.env.DEV
? (window.location.href = url)
: (window.parent.location.href = url);
}
});
return;
}
router.push({
path: types.value.path[d.type],
query: { id: d.projectTaskId, type: 2, courseId: d.courseId },