--demand 面授课

This commit is contained in:
yuping
2023-03-17 14:56:51 +08:00
parent 2891f14245
commit fe88fa1f8c
3 changed files with 52 additions and 51 deletions

View File

@@ -159,24 +159,19 @@
</div>
</div>
</div>
<div
class="goclass"
@click="toFinish(el, item.stageName, item.id)"
:style="{
background:
el.statusName !== '已结束' &&
(el.statusName || data.unlockMode === 1)
? '#2478ff'
: '#999',
}"
>
{{
el.statusName ||
(data.unlockMode === 1
? TASK_TYPES.toName[el.type]
: "未解锁")
}}
</div>
<el-dropdown trigger="click" v-if="isStudy == 'true'">
<div class="goclass" @click="toFinish(el, item.stageName, item.id)" :style="{ background: el.statusName !== '已结束' &&(el.statusName || data.unlockMode === 1) ? '#2478ff' : '#999' }">
{{el.statusName || (data.unlockMode === 1 ? TASK_TYPES.toName[el.type] : "未解锁")}}
</div>
<template #dropdown v-if="el.type===2 && el.targetId?.split(',')?.length > 1">
<el-dropdown-menu>
<el-dropdown-item v-for="(name,key) in el.targetName?.split(',')" :key="key" @click="toOffcoursePlanPage(el.targetId?.split(',')[key])">{{ name }}</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</div>
</div>
@@ -332,13 +327,7 @@ const types = ref({
},
path: {
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"
),
2: ({ targetId }) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${targetId}`, "_top"),
3: window.location.protocol + import.meta.env.VITE_BOE_CASS_DETAIL_URL, //案例
4: "/homeworkpage",
5: window.location.protocol + import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
@@ -419,8 +408,14 @@ function toFinish(d, sName, chapterOrStageId) {
ElMessage.warning("当前未解锁");
return;
}
console.log("dddddd", data, d, sName, chapterOrStageId);
if (d.type === 2) {
if(!d.targetId){
return ElMessage.error("还未添加开课,请联系管理员!")
}
if(d.targetId.split(',').length>1){
return
}
}
if (judgeTaskIsEnd(d.type, data.value.endTime, data.value.status)) {
ElMessage.error("当前任务已结束");
return;
@@ -588,6 +583,11 @@ function toFinish(d, sName, chapterOrStageId) {
// types.value.path[d.type](d);
// }
}
function toOffcoursePlanPage(id){
window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${id}`, '_top')
}
function whiteTypes(type) {
return import.meta.env.VITE_TASK_WHITE_TYPE.includes("-" + type + "-");
}