Merge branch 'zcwy-zsx' into 'master'

Zcwy zsx

See merge request !48
This commit is contained in:
joshen
2024-07-12 18:26:51 +08:00
7 changed files with 142 additions and 16 deletions

View File

@@ -34,10 +34,14 @@ export const TASK_OFFCOURSE_NOTASK_SIGN = '/stu/task/offcourse/notask/sign post'
export const TASK_OFFCOURSE_SIGN = '/stu/task/offcourse/sign post'
export const LINK_DETAILS = `/link/getOne`
export const STUDY_RECORD = '/stu/task/thirdTask/submit post'
export const LEARN = `/xboe/m/boe/umu/enterprise/learn post`
export const NOLOGINURL = `/xboe/m/boe/hongshan/noLoginUrl post`
export const TASK_WORK_SUBMIT_LIST = '/workSubmit/queryWorkSubmitDetailById'
export const SUB_STUDENT_DETAIL = `/workSubmit/submitStudentNoWorkDetail post`
export const WORK_HISTROY = '/workSubmit/queryWorkDetailListByStuId'
export const ASSESSMENT_QUERY = assessmentId => `/stu/task/queryAssessmentDetailById`
export const ASSESSMENT_SUBMIT = '/stu/task/evaluate/commit post'
export const TASK_NO_COMMIT = `/stu/task/evaluate/nocommit post`
export const FILE_UPLOAD_ANNEX = import.meta.env.VITE_BASE_API + '/file/stuUploadAnnex'
export const ROUTER_DETAILS = '/admin/router/detail'
export const TASK_LIST = '/stu/tasks'
@@ -88,5 +92,6 @@ export const FILE_UPLOAD_IMG = import.meta.env.VITE_BASE_API + '/file/img'
export const QueryEvaluationTaskStatusOne = `/evaluation/queryEvaluationTaskStatusOne`
// 投票浏览和参与数目
export const EditVoteInvolvedAndBrowse = `/vote/editVoteInvolvedAndBrowse post`
export const NO_COMMIT = `/voteSubmit/vote/nocommit post`
//任务是否删除
export const checkStudentExist = `/admin/taskmanage/checkStudentExist post`

View File

@@ -101,7 +101,7 @@ export default createStore({
}
state.routerInfo.statusName = '进行中'
if (state.routerInfo.unlockMode === 1) {
state.routerInfo.taskBoList?.forEach((s) => s.statusName = (s.status === 1) ? '已完成' : TASK_TYPES.toName[s.type])
state.routerInfo.taskBoList?.forEach((s) => s.statusName = (s.status === 1) ? "已完成" : s.status === 2 ? (s.statusName = "进行中") : TASK_TYPES.toName[s.type]);
state.routerInfo.taskBoList?.every((s) => s.status === 1) && (state.routerInfo.statusName = '已完成')
return
}
@@ -109,7 +109,7 @@ export default createStore({
state.routerInfo.taskBoList?.some((s) => {
s.unlock = true
s.statusName = '已完成'
s.status !== 1 && (s.statusName = TASK_TYPES.toName[s.type])
s.status === 2 ? (s.statusName = "进行中") : (!s.status && (s.statusName = TASK_TYPES.toName[s.type]));
return state.routerInfo.unlockMode === 2 ? s.status !== 1 : (s.status !== 1 && s.flag)
}) && (state.routerInfo.statusName = '进行中')
},

View File

@@ -181,6 +181,7 @@ import {
VOTE_DETAIL3,
VOTE_DETAIL_SUBMIT,
EditVoteInvolvedAndBrowse,
NO_COMMIT,
checkStudentExist,
} from "@/api/api";
import dayjs from "dayjs";
@@ -230,6 +231,18 @@ watch(data, () => {
useRequest(EditVoteInvolvedAndBrowse, {
operationType: "2",
voteId: data.value.id,
},(res)=>{
let noCommitParams = {
beginTime: answerTime,
chapterOrStageId: chapterOrStageId ? chapterOrStageId : 0,
result: JSON.stringify(data.value),
targetId: infoId, // 项目 路径图 id
taskId: id,
type: btype, // 1 项目 2 路径图
voteId: data.value.id,
voteName: data.value.voteName,
}
useRequest(NO_COMMIT, noCommitParams);
});
});
console.log("投票基本信息", data);

View File

@@ -99,6 +99,7 @@ import {
TASK_WORK_COMMIT,
TASK_WORK_DETAIL,
TASK_WORK_SUBMIT_LIST,
SUB_STUDENT_DETAIL,
WORK_HISTROY,
checkStudentExist,
} from "@/api/api";
@@ -272,6 +273,17 @@ const dohomework = () => {
// function reUpload(i) {
// uploadRef.value.reUpload(i);
// }
const handleSub = () => {
request(SUB_STUDENT_DETAIL,{
projectOrRouterLogo: type,
workUploadContent: sbValue.value.content,
workUploadAddress: fileList.value.map((e) => e.url).join(",") || "",
workId,
type,
taskId: taskId || infoId,
})
}
handleSub()
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->

View File

@@ -266,6 +266,7 @@ import { request, usePage, useRequest } from "@/api/request";
import {
ASSESSMENT_QUERY,
ASSESSMENT_SUBMIT,
TASK_NO_COMMIT,
checkStudentExist,
} from "@/api/api";
import { ElMessage } from "element-plus";
@@ -416,6 +417,15 @@ onMounted(() => {
chapterOrStageId,
targetId: infoId ? infoId : 0,
},(res)=>{
useRequest(TASK_NO_COMMIT, {
targetId: infoId ? infoId : 0, // 项目、路径图或开课的Id
chapterOrStageId: chapterOrStageId ? chapterOrStageId : 0, // 关卡或者阶段Id 关卡Id不允许为空
assessmentId: courseId,
taskId: taskId ? taskId : 0,
type,
result: JSON.stringify(data.value),
beginTime: answerTime,
})
if (res.data.isSubmit) {
open();
}

View File

@@ -46,7 +46,7 @@
</div>
</div>
<div class="btnbox">
<div class="submitbtn" @click="goOuterChain">去查看</div>
<div class="submitbtn" @click="goOuterChain(data.linkAddress)">去查看</div>
</div>
</div>
</div>
@@ -57,7 +57,7 @@ import ReturnHead from "@/components/ReturnHead.vue";
import { computed, reactive, toRefs, onUnmounted, ref, watch } from "vue";
import img from "@/assets/image/uploadimg.png";
import { request, useRequest } from "@/api/request";
import { LINK_DETAILS, STUDY_RECORD, checkStudentExist } from "@/api/api";
import { LINK_DETAILS, STUDY_RECORD, checkStudentExist,LEARN,NOLOGINURL } from "@/api/api";
import { useRoute } from "vue-router/dist/vue-router";
import { useRouter } from "vue-router";
import { useUserInfo } from "@/api/utils";
@@ -105,19 +105,36 @@ const { data } = useRequest(LINK_DETAILS, { linkId, type }, (e) => {
console.log("外链信息", data);
const userInfo = computed(() => store.state.userInfo);
const goOuterChain = () => {
const goOuterChain = async (url) => {
console.log("userInfo", userInfo);
request(STUDY_RECORD, {
studentId: userInfo.value.id,
targetId: infoId,
logo: type,
stageOrChapterId: chapterOrStageId,
taskId: taskId,
type: type,
taskType: 7,
});
window.open(data.value.linkAddress, "_top");
// request(STUDY_RECORD, {
// studentId: userInfo.value.id,
// targetId: infoId,
// logo: type,
// stageOrChapterId: chapterOrStageId,
// taskId: taskId,
// type: type,
// taskType: 7,
// });
if(url.includes('umu.cn')){
await request(LEARN, {url,userId:userInfo.value.userId}).then(res=>{
console.log(res,'res')
if(res.code == 200){
window.open(res.data, "_top")
}
})
return
}
if(url.includes('firacademy.com')){
await request(NOLOGINURL, {url,userId:userInfo.value.userId}).then(res=>{
if(res.code == 200){
window.open(res.data, "_top")
}
})
return
}
window.open(url);
// window.open(data.value.linkAddress, "_top");
};
</script>

View File

@@ -236,6 +236,8 @@ import {
SubmitExternalExam,
UPDATE_CURRENT_TASK,
checkStudentExist,
EvaluationToLearn,
QueryEvaluationTaskStatusOne
} from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import store from "@/store";
@@ -565,6 +567,73 @@ function toFinish(d, sName, chapterOrStageId,studyModel) {
return;
}
}
if (d.type == 10) {
if (d.quizTaskId == null) {
// 肯定没有完成测评
// 调用接口 跳转页面
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
} else {
// 进行中 或者 已完成
// 调用接口 判断当前测评状态 跳转页面
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)
})
return
}
}
if (!TASK_TYPES.path[d.type]) {
ElMessage.error("暂时未开放");