feat:修改跳转等问题

This commit is contained in:
lixg
2023-02-19 15:41:58 +08:00
31 changed files with 2526 additions and 318 deletions

View File

@@ -1,13 +1,19 @@
<template>
<div class="pathmap">
<ReturnHead
text="路径详情"
:showfile="true"
:courseId="routerId"
:type="2"
></ReturnHead>
<div class="main">
<div class="up">
<div class="notice">
<!-- <div class="notice">
<span class="text"
>请各位选课的同学提前阅读本课程的教学大纲与计划请各位选课的同学提前阅读本课程的教学大纲与计划</span
>
<span class="close"></span>
</div>
</div> -->
<div class="content">
<div class="title">{{ data?.name }}</div>
<div class="text2">
@@ -18,48 +24,30 @@
<div class="down">
<div class="project_title">学习路径内容</div>
<!-- <div
class="project_first"
>
<div class="course1_first">
<div class="text8">管理者如何持续找到发力点</div>
<div class="course1_right">
<div class="circular"></div>
<div class="text9">进行中</div>
<div class="btn1"></div>
</div>
</div>
<div class="course_content">
<div class="study1">
<div class="firstclass"></div>
<div class="firstprogress">
<span class="firsttext">BOE端到端体系 - 第七章</span>
<span class="secondtext">70%</span>
<div class="progressbox">
<div class="progressboxpart"></div>
</div>
</div>
</div>
<div class="study2">
<div class="secondclass"></div>
<div class="secondprogress">
<span class="firsttext">中级产品经理项目 - 产品经理</span>
<span class="secondtext">52%</span>
<div class="progressbox">
<div class="progressboxpart"></div>
</div>
</div>
</div>
</div>
</div> -->
<div class="project_second">
<div class="course1_first">
<div class="text8">{{ data?.currentStageName }}</div>
<div class="course1_right">
<div class="circular"></div>
<div class="text9">进行中</div>
<div class="btn1"></div>
<div
class="circular"
:style="
(stageStatusName === '未开始' ||
stageStatusName === '已结束') &&
'border: 1px solid #999;'
"
></div>
<!-- <div class="text9">进行中</div> -->
<div
class="text9"
:style="
(stageStatusName === '未开始' ||
stageStatusName === '已结束') &&
'color:#999'
"
>
{{ stageStatusName }}
</div>
<!-- <div class="btn1"></div> -->
</div>
</div>
<div class="secondcontent">
@@ -67,11 +55,63 @@
class="question"
v-for="(el, index) in data?.taskBoList"
:key="index"
:style="{
height: el.type === 1 ? '90px' : '72px',
}"
>
<div style="width: calc(100% - 80px)">
<div class="issue">
{{ el.name }}
</div>
<div v-if="el.type === 1" class="progressBox">
<!-- <div>当前进度</div> -->
<div
class="progress"
style="
display: flex;
align-items: center;
margin-bottom: 3px;
"
>
<div style="width: 200px">
<el-progress
:percentage="parseInt(el.currentRatio)"
:show-text="false"
:stroke-width="8"
:color="
{
0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)',
2: 'rgba(39, 122, 255, 1)',
3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)',
}[parseInt(parseInt(el.currentRatio) / 20)]
"
/>
</div>
<div
style="
font-size: 12px;
font-weight: 500;
color: #277aff;
margin-left: 10px;
"
:style="{
color: {
0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)',
2: 'rgba(39, 122, 255, 1)',
3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)',
}[parseInt(parseInt(el.currentRatio) / 20)],
}"
>
{{ parseInt(el.currentRatio) }}%
</div>
</div>
</div>
<div class="coursetag">
<div
class="tag1"
@@ -120,12 +160,18 @@ import { computed, reactive, ref, watch } from "vue";
// import circle from "../../assets/image/pathdetails/circle.png";
// import circle2 from "../../assets/image/pathdetails/circle2.png";
import { boeRequest, useRequest, request } from "@/api/request";
import { ROUTER_PROCESS, LINK_DETAILS, STUDY_RECORD } from "@/api/api";
import {
ROUTER_PROCESS,
LINK_DETAILS,
STUDY_RECORD,
SubmitExternalExam,
UPDATE_CURRENT_TASK,
} from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import { ElMessage } from "element-plus";
import store from "@/store";
import { ROUTER } from "@/api/CONST";
import ReturnHead from "@/components/ReturnHead.vue";
const {
query: { routerId, routerName },
} = useRoute();
@@ -134,6 +180,21 @@ const returnclick = () => {
router.back();
};
const { data } = useRequest(ROUTER_PROCESS, { routerId: routerId });
const stageStatusName = computed(() => {
if (data.value.status !== 1) {
return "已结束";
}
if (!data.value.taskBoList?.filter((t) => t.status === 1)?.length) {
return "未开始";
}
if (
data.value.taskBoList.filter((t) => t.status === 1).length ===
data.value.taskBoList.length
) {
return "已完成";
}
return "进行中";
});
const userInfo = computed(() => store.state.userInfo);
console.log("lalalallala", data, userInfo);
const activeName = ref("first");
@@ -178,11 +239,17 @@ const types = ref({
13: "去完成",
},
path: {
1: import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线
2: "/faceteach",
3: import.meta.env.VITE_BOE_CASS_DETAIL_URL, //案例
1: window.location.protocol + import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线
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, //案例
4: "/homeworkpage",
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
5: window.location.protocol + import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
// 5: "/externalexam",
6: "/liveboradcast",
7: "/outerchain", //外联
@@ -212,46 +279,60 @@ function toFinish(d) {
ElMessage.error("暂时未开放");
return;
}
// 在线课 停用 -- 暂时没有在线课停用标记
if (d.type == 1) {
if (d.taskStatus == 1 || d.taskStatus == 2) {
ElMessage.warning("该任务无法学习,请联系管理员进行替换!");
return;
}
}
if (d.type == 2) {
if (d.taskStatus == 1 || d.taskStatus == 2) {
ElMessage.warning("该任务无法学习,请联系管理员进行替换!");
return;
}
let date1 = new Date(d.endTime).getTime();
let date2 = new Date().getTime();
if (date1 < date2) {
dialogVisibleTip.value = "当前面授课已结束";
dialogVisible.value = true;
//return
ElMessage.warning("当前面授课已结束");
return;
}
}
if (d.type === 3) {
ElMessage.warning("请在pc端查看");
return;
}
if (d.type == 4) {
let date1 = new Date(d.endTime).getTime();
let date2 = new Date().getTime();
if (date1 < date2) {
dialogVisibleTip.value = "当前作业已结束";
dialogVisible.value = true;
//return
}
}
// 直播结束时间
if (d.type == 6) {
let date1 = new Date(d.endTime).getTime();
let date2 = new Date().getTime();
if (date1 < date2) {
dialogVisibleTip.value = "当前直播已结束";
dialogVisible.value = true;
//return
ElMessage.warning("当前作业已结束");
return;
}
}
// 考试 停用
if (d.type == 5) {
if (d.taskStatus == 1 || d.taskStatus == 2) {
// ElMessage.error("该任务无法学习,请联系管理员进行替换。")
dialogVisibleTip.value = "该任务无法学习,请联系管理员进行替换!";
dialogVisible.value = true;
ElMessage.warning("该任务无法学习,请联系管理员进行替换");
return;
}
// 此处判断外部考试跳转
if (d.startTime == null || d.endTime == null) {
// 点击即更新状态 进行中
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: "/externalexam",
query: {
@@ -261,12 +342,12 @@ function toFinish(d) {
return;
}
}
// 评估 停用
if (d.type == 11) {
if (d.taskStatus == 1 || d.taskStatus == 2) {
// ElMessage.error("该任务无法学习,请联系管理员进行替换。")
dialogVisibleTip.value = "该任务无法学习,请联系管理员进行替换!";
dialogVisible.value = true;
// 直播结束时间
if (d.type == 6) {
let date1 = new Date(d.endTime).getTime();
let date2 = new Date().getTime();
if (date1 < date2) {
ElMessage.warning("当前直播已结束");
return;
}
}
@@ -275,41 +356,33 @@ function toFinish(d) {
let date1 = new Date(d.endTime).getTime();
let date2 = new Date().getTime();
if (date1 < date2) {
dialogVisibleTip.value = "当前活动已结束";
dialogVisible.value = true;
//return
}
}
// 在线课 停用 -- 暂时没有在线课停用标记
if (d.type == 1) {
if (d.taskStatus == 1 || d.taskStatus == 2) {
// ElMessage.error("该任务无法学习,请联系管理员进行替换。")
dialogVisibleTip.value = "该任务无法学习,请联系管理员进行替换!";
dialogVisible.value = true;
ElMessage.warning("当前活动已结束");
return;
}
}
// 面授课 停用
if (d.type == 2) {
// 评估 停用
if (d.type == 11) {
if (d.taskStatus == 1 || d.taskStatus == 2) {
// ElMessage.error("该任务无法学习,请联系管理员进行替换。")
dialogVisibleTip.value = "该任务无法学习,请联系管理员进行替换!";
dialogVisible.value = true;
ElMessage.warning("该任务无法学习,请联系管理员进行替换");
return;
}
}
if (d.type === 3) {
d.status !== 1 &&
request(STUDY_RECORD, {
studentId: userInfo.value.id,
targetId: data.value.routerId,
logo: ROUTER,
stageOrChapterId: data.value.currentStageId,
taskId: d.routerTaskId,
});
}
console.log("点击跳转", d);
console.log("点击跳转", d, d.id);
//更新学员当前任务
request(UPDATE_CURRENT_TASK, {
id: d.id,
type: ROUTER,
pid: routerId,
name: d.name,
});
if (typeof types.value.path[d.type] === "string") {
// console.log(
// "types.value.path[d.type]",
// types.value.path[d.type],
// import.meta.env.VITE_BOE_EXAM_DETAIL_URL,
// import.meta.env.VITE_BOE_ONLINE_CLASS_URL
// );
types.value.path[d.type] &&
types.value.path[d.type].startsWith("http") &&
window.open(types.value.path[d.type] + d.targetId, "_top");
@@ -318,7 +391,7 @@ function toFinish(d) {
router.push({
path: types.value.path[d.type],
query: {
id: d.routerTaskId,
id: d.id,
type: ROUTER,
infoId: routerId,
courseId: d.courseId,
@@ -351,6 +424,7 @@ function toFinish(d) {
display: flex;
flex-direction: column;
//justify-content: center;
margin-top: 10px;
.up {
width: 100%;
height: 162px;
@@ -700,11 +774,12 @@ function toFinish(d) {
.issue {
width: 100%;
font-size: 13px;
line-height: 30.29px;
// line-height: 30.29px;
color: rgba(110, 123, 132, 1);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-bottom: 2px;
}
.coursetag {
display: flex;