mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-06 09:26:46 +08:00
增加项目撤回 无项目状态页面显示返回值为后端返回的
This commit is contained in:
34
src/views/nottask/LoseEfficacyProject.vue
Normal file
34
src/views/nottask/LoseEfficacyProject.vue
Normal 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>
|
||||||
@@ -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' }">
|
<!-- <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] : "未解锁")}}
|
{{el.statusName || (data.unlockMode === 1 ? TASK_TYPES.toName[el.type] : "未解锁")}}
|
||||||
</div> -->
|
</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' }">
|
<div
|
||||||
{{ el.statusName || (item.studyModel==0 ? TASK_TYPES.toName[el.type] : '未解锁')}}
|
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>
|
||||||
<div v-else class="goclass" @click="toFinish(el, item.stageName, item.id, item.studyModel)" :style="{ background: (el.statusName !== '已结束' && el.statusName) ? '#2478ff' : '#999' }">
|
<div
|
||||||
{{ el.statusName || '未解锁' }}
|
v-else
|
||||||
|
class="goclass"
|
||||||
|
@click="
|
||||||
|
toFinish(el, item.stageName, item.id, item.studyModel)
|
||||||
|
"
|
||||||
|
:style="{
|
||||||
|
background:
|
||||||
|
el.statusName !== '已结束' && el.statusName
|
||||||
|
? '#2478ff'
|
||||||
|
: '#999',
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{ el.statusName || "未解锁" }}
|
||||||
</div>
|
</div>
|
||||||
<!-- <template #dropdown v-if="el.type===2 && el.targetId?.split(',')?.length > 1">
|
<!-- <template #dropdown v-if="el.type===2 && el.targetId?.split(',')?.length > 1">
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
@@ -176,8 +206,6 @@
|
|||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template> -->
|
</template> -->
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -202,23 +230,82 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<!-- 开课列表弹框 -->
|
<!-- 开课列表弹框 -->
|
||||||
<el-dialog title="" top="120px" v-model="openCourseVisible" :show-close="false"
|
<el-dialog
|
||||||
style="display:flex;justify-content:center;align-items:center;min-height: 320px;padding:0;border-radius: 4px;"
|
title=""
|
||||||
width="80%">
|
top="120px"
|
||||||
<div style="display: flex;justify-content:space-between;align-items:center;margin-bottom: 22px;width: 100%;">
|
v-model="openCourseVisible"
|
||||||
<div style="width:88px;color:#333333;font-size: 16px;font-weight: 600;">开课列表</div>
|
: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
|
<div
|
||||||
@click="openCourseVisible = false"
|
@click="openCourseVisible = false"
|
||||||
style="font-size: 12px;cursor:pointer;">X</div>
|
style="font-size: 12px; cursor: pointer"
|
||||||
|
>
|
||||||
|
X
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 100%;min-height:210px;margin-top: 12px;">
|
<div style="width: 100%; min-height: 210px; margin-top: 12px">
|
||||||
<div
|
<div
|
||||||
v-for="item,key in openCourseList"
|
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;">
|
style="
|
||||||
<div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;width: 200px;">{{ item }}</div>
|
width: 100%;
|
||||||
<div
|
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])"
|
@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>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -237,7 +324,7 @@ import {
|
|||||||
UPDATE_CURRENT_TASK,
|
UPDATE_CURRENT_TASK,
|
||||||
checkStudentExist,
|
checkStudentExist,
|
||||||
EvaluationToLearn,
|
EvaluationToLearn,
|
||||||
QueryEvaluationTaskStatusOne
|
QueryEvaluationTaskStatusOne,
|
||||||
} from "@/api/api";
|
} from "@/api/api";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
@@ -266,7 +353,10 @@ useRequest(PROJECT_PROCESS, { projectId: projectId, type }, (e) => {
|
|||||||
console.log("判断任务是否删除", res);
|
console.log("判断任务是否删除", res);
|
||||||
if (res.code === 7) {
|
if (res.code === 7) {
|
||||||
router.push({
|
router.push({
|
||||||
path: "/loseefficacy",
|
path: "/loseEfficacyProject",
|
||||||
|
query: {
|
||||||
|
msg: res.message,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (res.code === 6) {
|
if (res.code === 6) {
|
||||||
@@ -377,7 +467,13 @@ const types = ref({
|
|||||||
},
|
},
|
||||||
path: {
|
path: {
|
||||||
1: window.location.protocol + import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线
|
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, //案例
|
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: window.location.protocol + import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
|
||||||
@@ -453,24 +549,28 @@ function judgeTaskIsEnd(type, endTimes, status) {
|
|||||||
return isEnd;
|
return isEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
function toFinish(d, sName, chapterOrStageId,studyModel) {
|
function toFinish(d, sName, chapterOrStageId, studyModel) {
|
||||||
if (studyModel != 0 && !d.statusName) {
|
if (studyModel != 0 && !d.statusName) {
|
||||||
ElMessage.warning("当前未解锁")
|
ElMessage.warning("当前未解锁");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
if(d.statusName == '未解锁'|| d.statusName == ''||!d.hasOwnProperty('statusName')){
|
if (
|
||||||
ElMessage.warning("当前未解锁")
|
d.statusName == "未解锁" ||
|
||||||
return
|
d.statusName == "" ||
|
||||||
|
!d.hasOwnProperty("statusName")
|
||||||
|
) {
|
||||||
|
ElMessage.warning("当前未解锁");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (d.type === 2) {
|
if (d.type === 2) {
|
||||||
if(!d.targetId){
|
if (!d.targetId) {
|
||||||
return ElMessage.error("还未添加开课,请联系管理员!")
|
return ElMessage.error("还未添加开课,请联系管理员!");
|
||||||
}
|
}
|
||||||
if(d.targetId.split(',').length>1){
|
if (d.targetId.split(",").length > 1) {
|
||||||
openCourseList.value = d.targetName?.split(',');
|
openCourseList.value = d.targetName?.split(",");
|
||||||
openCourseIdList.value = d.targetId?.split(',');
|
openCourseIdList.value = d.targetId?.split(",");
|
||||||
openCourseVisible.value = true;
|
openCourseVisible.value = true;
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (judgeTaskIsEnd(d.type, data.value.endTime, data.value.status)) {
|
if (judgeTaskIsEnd(d.type, data.value.endTime, data.value.status)) {
|
||||||
@@ -572,66 +672,72 @@ function toFinish(d, sName, chapterOrStageId,studyModel) {
|
|||||||
// 肯定没有完成测评
|
// 肯定没有完成测评
|
||||||
// 调用接口 跳转页面
|
// 调用接口 跳转页面
|
||||||
request(EvaluationToLearn, {
|
request(EvaluationToLearn, {
|
||||||
"businessType": "project",
|
businessType: "project",
|
||||||
"chapterId": chapterOrStageId,
|
chapterId: chapterOrStageId,
|
||||||
"courseId": d.courseId,
|
courseId: d.courseId,
|
||||||
"quizKid": d.targetId,
|
quizKid: d.targetId,
|
||||||
"routerOrProjectId": projectId,
|
routerOrProjectId: projectId,
|
||||||
"studentId": userInfo.value.id,
|
studentId: userInfo.value.id,
|
||||||
"studentName": userInfo.value.realName
|
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
|
.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 {
|
} else {
|
||||||
// 进行中 或者 已完成
|
// 进行中 或者 已完成
|
||||||
// 调用接口 判断当前测评状态 跳转页面
|
// 调用接口 判断当前测评状态 跳转页面
|
||||||
console.log('我是查询测评跳转链接所传递得参数', {
|
console.log("我是查询测评跳转链接所传递得参数", {
|
||||||
"quizTaskId": d.quizTaskId
|
quizTaskId: d.quizTaskId,
|
||||||
})
|
});
|
||||||
request(QueryEvaluationTaskStatusOne, {
|
request(QueryEvaluationTaskStatusOne, {
|
||||||
"quizTaskId": d.quizTaskId
|
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)
|
|
||||||
})
|
})
|
||||||
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){
|
function toOffcoursePlanPage(id) {
|
||||||
window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${id}`, '_top')
|
window.open(
|
||||||
|
`${location.protocol}//${location.host}${
|
||||||
|
import.meta.env.VITE_BASE_API
|
||||||
|
}/stu/project/redirectDetail?courseId=${id}`,
|
||||||
|
"_top"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function whiteTypes(type) {
|
function whiteTypes(type) {
|
||||||
@@ -730,10 +841,10 @@ const queryAllStatus = (data) => {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.projectdetails {
|
.projectdetails {
|
||||||
.el-dialog__body{
|
.el-dialog__body {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
}
|
}
|
||||||
.el-dialog__header{
|
.el-dialog__header {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
Reference in New Issue
Block a user