增加项目撤回 无项目状态页面显示返回值为后端返回的

This commit is contained in:
liu
2025-03-04 18:37:26 +08:00
parent 3c1d344735
commit 52419965e0
2 changed files with 237 additions and 92 deletions

View File

@@ -0,0 +1,34 @@
<!--
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-03-01 20:41:06
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-03-17 10:15:42
* @FilePath: /stu_h5/src/views/nottask/LoseEfficacyProject.vue----
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<el-result icon="success" :title="title">
<template #extra>
<el-button type="primary" @click="toIndex">返回首页</el-button>
</template>
</el-result>
</template>
<script setup>
import { toRefs,ref, onMounted } from "vue";
import { useRoute } from "vue-router";
function toIndex() {
window.location.href =
window.location.protocol + import.meta.env.VITE_BOE_HOME;
}
const title = ref("二维码已失效"); //搜索内容
onMounted(() => {
// 接收跳转请求的query参数
let route = useRoute();
console.log(route.query.msg);
if (route.query.msg) {
title.value = route.query.msg;
}
});
</script>

View File

@@ -164,11 +164,41 @@
<!-- <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> -->
<div v-if="data.unlockMode === 1" class="goclass" @click="toFinish(el, item.stageName, item.id, item.studyModel)" :style="{ background: (el.statusName !== '已结束' && (el.statusName || item.studyModel==0)) ? '#2478ff' : '#999' }">
{{ el.statusName || (item.studyModel==0 ? TASK_TYPES.toName[el.type] : '未解锁')}}
<div
v-if="data.unlockMode === 1"
class="goclass"
@click="
toFinish(el, item.stageName, item.id, item.studyModel)
"
:style="{
background:
el.statusName !== '已结束' &&
(el.statusName || item.studyModel == 0)
? '#2478ff'
: '#999',
}"
>
{{
el.statusName ||
(item.studyModel == 0
? TASK_TYPES.toName[el.type]
: "未解锁")
}}
</div>
<div v-else class="goclass" @click="toFinish(el, item.stageName, item.id, item.studyModel)" :style="{ background: (el.statusName !== '已结束' && el.statusName) ? '#2478ff' : '#999' }">
{{ el.statusName || '未解锁' }}
<div
v-else
class="goclass"
@click="
toFinish(el, item.stageName, item.id, item.studyModel)
"
:style="{
background:
el.statusName !== '已结束' && el.statusName
? '#2478ff'
: '#999',
}"
>
{{ el.statusName || "未解锁" }}
</div>
<!-- <template #dropdown v-if="el.type===2 && el.targetId?.split(',')?.length > 1">
<el-dropdown-menu>
@@ -176,8 +206,6 @@
</el-dropdown-menu>
</template> -->
</el-dropdown>
</div>
</div>
</div>
@@ -202,23 +230,82 @@
</div> -->
</div>
<!-- 开课列表弹框 -->
<el-dialog title="" top="120px" v-model="openCourseVisible" :show-close="false"
style="display:flex;justify-content:center;align-items:center;min-height: 320px;padding:0;border-radius: 4px;"
width="80%">
<div style="display: flex;justify-content:space-between;align-items:center;margin-bottom: 22px;width: 100%;">
<div style="width:88px;color:#333333;font-size: 16px;font-weight: 600;">开课列表</div>
<el-dialog
title=""
top="120px"
v-model="openCourseVisible"
:show-close="false"
style="
display: flex;
justify-content: center;
align-items: center;
min-height: 320px;
padding: 0;
border-radius: 4px;
"
width="80%"
>
<div
style="
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 22px;
width: 100%;
"
>
<div
style="width: 88px; color: #333333; font-size: 16px; font-weight: 600"
>
开课列表
</div>
<div
@click="openCourseVisible = false"
style="font-size: 12px;cursor:pointer;">X</div>
style="font-size: 12px; cursor: pointer"
>
X
</div>
</div>
<div style="width: 100%;min-height:210px;margin-top: 12px;">
<div
v-for="item,key in openCourseList"
style="width: 100%;display: flex;justify-content: space-between;align-items: center;margin-bottom: 12px;background: rgb(247, 251, 253);height: 40px;padding: 5px;border-radius: 5px;">
<div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;width: 200px;">{{ item }}</div>
<div
<div style="width: 100%; min-height: 210px; margin-top: 12px">
<div
v-for="(item, key) in openCourseList"
style="
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
background: rgb(247, 251, 253);
height: 40px;
padding: 5px;
border-radius: 5px;
"
>
<div
style="
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 200px;
"
>
{{ item }}
</div>
<div
@click="toOffcoursePlanPage(openCourseIdList[key])"
style="width:60px;height:30px;text-align:center;line-height:30px;background:#0078fc;border-radius:5px;color:#fff;cursor: pointer;">去上课</div>
style="
width: 60px;
height: 30px;
text-align: center;
line-height: 30px;
background: #0078fc;
border-radius: 5px;
color: #fff;
cursor: pointer;
"
>
去上课
</div>
</div>
</div>
</el-dialog>
@@ -237,7 +324,7 @@ import {
UPDATE_CURRENT_TASK,
checkStudentExist,
EvaluationToLearn,
QueryEvaluationTaskStatusOne
QueryEvaluationTaskStatusOne,
} from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import store from "@/store";
@@ -266,7 +353,10 @@ useRequest(PROJECT_PROCESS, { projectId: projectId, type }, (e) => {
console.log("判断任务是否删除", res);
if (res.code === 7) {
router.push({
path: "/loseefficacy",
path: "/loseEfficacyProject",
query: {
msg: res.message,
},
});
} else {
if (res.code === 6) {
@@ -377,7 +467,13 @@ const types = ref({
},
path: {
1: window.location.protocol + import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线
2: ({ targetId }) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${targetId}`, "_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, //考试
@@ -453,24 +549,28 @@ function judgeTaskIsEnd(type, endTimes, status) {
return isEnd;
}
function toFinish(d, sName, chapterOrStageId,studyModel) {
function toFinish(d, sName, chapterOrStageId, studyModel) {
if (studyModel != 0 && !d.statusName) {
ElMessage.warning("当前未解锁")
return
ElMessage.warning("当前未解锁");
return;
}
if(d.statusName == '未解锁'|| d.statusName == ''||!d.hasOwnProperty('statusName')){
ElMessage.warning("当前未解锁")
return
if (
d.statusName == "未解锁" ||
d.statusName == "" ||
!d.hasOwnProperty("statusName")
) {
ElMessage.warning("当前未解锁");
return;
}
if (d.type === 2) {
if(!d.targetId){
return ElMessage.error("还未添加开课,请联系管理员!")
if (!d.targetId) {
return ElMessage.error("还未添加开课,请联系管理员!");
}
if(d.targetId.split(',').length>1){
openCourseList.value = d.targetName?.split(',');
openCourseIdList.value = d.targetId?.split(',');
if (d.targetId.split(",").length > 1) {
openCourseList.value = d.targetName?.split(",");
openCourseIdList.value = d.targetId?.split(",");
openCourseVisible.value = true;
return
return;
}
}
if (judgeTaskIsEnd(d.type, data.value.endTime, data.value.status)) {
@@ -572,66 +672,72 @@ function toFinish(d, sName, chapterOrStageId,studyModel) {
// 肯定没有完成测评
// 调用接口 跳转页面
request(EvaluationToLearn, {
"businessType": "project",
"chapterId": chapterOrStageId,
"courseId": d.courseId,
"quizKid": d.targetId,
"routerOrProjectId": projectId,
"studentId": userInfo.value.id,
"studentName": userInfo.value.realName
}).then(res => {
console.log(res)
if (res.code == 200) {
let jumpUrl = res.data.quizUrl
// 此处写跳转url
window.open(jumpUrl, '_top')
}
}).catch(err => {
console.log(err)
businessType: "project",
chapterId: chapterOrStageId,
courseId: d.courseId,
quizKid: d.targetId,
routerOrProjectId: projectId,
studentId: userInfo.value.id,
studentName: userInfo.value.realName,
})
return
.then((res) => {
console.log(res);
if (res.code == 200) {
let jumpUrl = res.data.quizUrl;
// 此处写跳转url
window.open(jumpUrl, "_top");
}
})
.catch((err) => {
console.log(err);
});
return;
} else {
// 进行中 或者 已完成
// 调用接口 判断当前测评状态 跳转页面
console.log('我是查询测评跳转链接所传递得参数', {
"quizTaskId": d.quizTaskId
})
console.log("我是查询测评跳转链接所传递得参数", {
quizTaskId: d.quizTaskId,
});
request(QueryEvaluationTaskStatusOne, {
"quizTaskId": d.quizTaskId
}).then(res => {
console.log(res)
if (res.code == 200) {
if (res.data.complete_status == 2) {
ElMessage.error("您已完成测评")
return
} else {
// 重新查询跳转
// 调用接口 跳转页面
request(EvaluationToLearn, {
"businessType": "project",
"chapterId": chapterOrStageId,
"courseId": d.courseId,
"quizKid": d.targetId,
"routerOrProjectId": projectId,
"studentId": userInfo.value.id,
"studentName": userInfo.value.realName
}).then(res => {
console.log(res)
if (res.code == 200) {
let jumpUrl = res.data.quizUrl
// 此处写跳转url
window.open(jumpUrl, '_top')
}
}).catch(err => {
console.log(err)
})
return
}
}
}).catch(err => {
console.log(err)
quizTaskId: d.quizTaskId,
})
return
.then((res) => {
console.log(res);
if (res.code == 200) {
if (res.data.complete_status == 2) {
ElMessage.error("您已完成测评");
return;
} else {
// 重新查询跳转
// 调用接口 跳转页面
request(EvaluationToLearn, {
businessType: "project",
chapterId: chapterOrStageId,
courseId: d.courseId,
quizKid: d.targetId,
routerOrProjectId: projectId,
studentId: userInfo.value.id,
studentName: userInfo.value.realName,
})
.then((res) => {
console.log(res);
if (res.code == 200) {
let jumpUrl = res.data.quizUrl;
// 此处写跳转url
window.open(jumpUrl, "_top");
}
})
.catch((err) => {
console.log(err);
});
return;
}
}
})
.catch((err) => {
console.log(err);
});
return;
}
}
@@ -708,8 +814,13 @@ function toFinish(d, sName, chapterOrStageId,studyModel) {
// }
}
function toOffcoursePlanPage(id){
window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${id}`, '_top')
function toOffcoursePlanPage(id) {
window.open(
`${location.protocol}//${location.host}${
import.meta.env.VITE_BASE_API
}/stu/project/redirectDetail?courseId=${id}`,
"_top"
);
}
function whiteTypes(type) {
@@ -730,10 +841,10 @@ const queryAllStatus = (data) => {
<style lang="scss">
.projectdetails {
.el-dialog__body{
.el-dialog__body {
width: 80%;
}
.el-dialog__header{
.el-dialog__header {
display: none;
}
width: 100%;