fix:修改学习路径问题

This commit is contained in:
wyx
2023-02-20 18:01:44 +08:00
parent 46d6dada14
commit aee1eb58e8
5 changed files with 43 additions and 53 deletions

View File

@@ -52,6 +52,7 @@ export const COMMENT_LIST = '/comment/list'
export const VOTE_DETAIL2 = `/voteSubmit/queryVoteTaskDetailById post` export const VOTE_DETAIL2 = `/voteSubmit/queryVoteTaskDetailById post`
export const VOTE_DETAIL3 = voteId => `/vote/queryVoteById?voteId=${voteId}`
// 投票详情接口 // 投票详情接口
export const VOTE_DETAIL_SUBMIT = `/voteSubmit/vote/commit post` export const VOTE_DETAIL_SUBMIT = `/voteSubmit/vote/commit post`

View File

@@ -83,7 +83,7 @@
<div class="join"> <div class="join">
<div <div
v-for="(item, index) in state.dataInfo.ballotVo?.voteStemVoList" v-for="(item, index) in state.dataInfo.voteStemDtoList"
:key="index" :key="index"
style="margin-bottom: 41px" style="margin-bottom: 41px"
> >
@@ -190,6 +190,7 @@
import {useRequest,request} from "@/api/request"; import {useRequest,request} from "@/api/request";
import { import {
VOTE_DETAIL2, VOTE_DETAIL2,
VOTE_DETAIL3,
VOTE_DETAIL_SUBMIT VOTE_DETAIL_SUBMIT
} from "@/api/api"; } from "@/api/api";
import dayjs from "dayjs"; import dayjs from "dayjs";
@@ -231,13 +232,7 @@ let timer = setInterval(() => {
"type": btype "type": btype
}) })
request(VOTE_DETAIL2, { request(VOTE_DETAIL3(courseId), {}).then(res=>{
"chapterOrStageId": chapterOrStageId ? chapterOrStageId : 0,
"courseId": courseId,
"studentId": userInfo.value.id,
"targetId": infoId,
"type": btype
}).then(res=>{
console.log(res) console.log(res)
state.dataInfo = res.data state.dataInfo = res.data
}).catch(err=>{ }).catch(err=>{
@@ -320,20 +315,27 @@ const submitVote = () => {
useRequest(VOTE_DETAIL_SUBMIT,obj,(e)=>{ useRequest(VOTE_DETAIL_SUBMIT,obj,(e)=>{
console.log(e) console.log(e)
request(VOTE_DETAIL2, { request(VOTE_DETAIL3(courseId), {}).then(res=>{
"chapterOrStageId": chapterOrStageId ? chapterOrStageId : 0,
"courseId": courseId,
"studentId": userInfo.value.id,
"targetId": infoId,
"type": btype,
taskId: id
}).then(res=>{
console.log(res) console.log(res)
ElMessage.success("投票成功") ElMessage.success("投票成功")
state.dataInfo = res.data state.dataInfo = res.data
}).catch(err=>{ }).catch(err=>{
console.log(err) console.log(err)
}); });
// request(VOTE_DETAIL2, {
// "chapterOrStageId": chapterOrStageId ? chapterOrStageId : 0,
// "courseId": courseId,
// "studentId": userInfo.value.id,
// "targetId": infoId,
// "type": btype,
// taskId: id
// }).then(res=>{
// console.log(res)
// ElMessage.success("投票成功")
// state.dataInfo = res.data
// }).catch(err=>{
// console.log(err)
// });
}) })
}; };
</script> </script>

View File

@@ -300,6 +300,7 @@ const returnclick = () => {
const {commit, dispatch, state} = useStore() const {commit, dispatch, state} = useStore()
const userInfo = computed(() => state.userInfo) const userInfo = computed(() => state.userInfo)
const data = computed(() => state.routerInfo) const data = computed(() => state.routerInfo)
console.log(data)
const activeName = ref("first"); const activeName = ref("first");
onMounted(() => { onMounted(() => {
@@ -316,26 +317,26 @@ const dialogVisibleTip = ref('');
// 判断当前任务已结束及时间意义上的结束 提示用户 // 判断当前任务已结束及时间意义上的结束 提示用户
function judgeTaskIsEnd(type, endTimes, status) { function judgeTaskIsEnd(type, endTimes, status) {
// type 任务类型 endTime 结束时间 status 任务状态 (状态 0 未完成 1 已完成 2 未开始 3 已结束) // type 任务类型 endTime 结束时间 status 任务状态 (状态 0 未完成 1 已完成 2 未开始 -1 已结束)
console.log(type, endTimes, status); console.log(type, endTimes, status);
let isEnd = false; let isEnd = false;
let nowTime = new Date().getTime(); let nowTime = new Date().getTime();
let endTime = new Date().getTime(endTimes); let endTime = new Date().getTime(endTimes);
switch (type) { switch (type) {
case 1: case 1:
status == 3 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false; status == -1 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
break; break;
// case 3: // case 3:
// status == 3 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false; // status == 3 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
// break; // break;
case 5: case 5:
status == 3 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false; status == -1 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
break; break;
case 7: case 7:
status == 3 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false; status == -1 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
break; break;
case 10: case 10:
status == 3 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false; status == -1 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
break; break;
} }
return isEnd; return isEnd;
@@ -467,7 +468,7 @@ async function toFinish(d) {
if (d.type === 3 || d.type === 7) { if (d.type === 3 || d.type === 7) {
d.status !== 1 && await request(STUDY_RECORD, { d.status !== 1 && await request(STUDY_RECORD, {
studentId: userInfo.value.id, studentId: userInfo.value.id,
targetId: data.value.routerId, targetId: data.value.id,
logo: ROUTER, logo: ROUTER,
stageOrChapterId: data.value.currentStageId, stageOrChapterId: data.value.currentStageId,
taskId: d.id, taskId: d.id,
@@ -512,35 +513,17 @@ async function toFinish(d) {
}, },
}); });
return return
// 调用接口 跳转页面
console.log('我是查询测评跳转链接所传递得参数', {
"businessType": "learningpath",
"chapterId": data.value.currentStageId,
"courseId": d.courseId,
"quizKid": d.targetId,
"routerOrProjectId": routerId,
"studentId": userInfo.value.id,
"studentName": userInfo.value.realName
})
request(EvaluationToLearn, {
"businessType": "learningpath",
"chapterId": data.value.currentStageId,
"courseId": d.courseId,
"quizKid": d.targetId,
"routerOrProjectId": routerId,
"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) // 项目任务 直接跳转项目详情
}) if (d.type == 13) {
// 此处判断跳转项目详情界面
router.push({
path: '/projectdetails',
query: {
projectId: d.courseId
},
});
return return
} }

View File

@@ -348,6 +348,7 @@ const returnclick = () => {
}; };
const {nextPage,prevPage,hasPrev, hasNext} = useTaskPage() const {nextPage,prevPage,hasPrev, hasNext} = useTaskPage()
const { data } = useRequest(ASSESSMENT_QUERY(courseId), { id: courseId, type, chapterOrStageId, targetId: infoId ? infoId : 0 }); const { data } = useRequest(ASSESSMENT_QUERY(courseId), { id: courseId, type, chapterOrStageId, targetId: infoId ? infoId : 0 });
console.log(data)
console.log('我是查询评估的参数', { id: courseId, type, chapterOrStageId, targetId: infoId ? infoId : 0 }) console.log('我是查询评估的参数', { id: courseId, type, chapterOrStageId, targetId: infoId ? infoId : 0 })
console.log('我是需要排序得题目', data) console.log('我是需要排序得题目', data)
@@ -374,8 +375,8 @@ const questionList = ref([])
const timers = setInterval(() => { const timers = setInterval(() => {
console.log(data) console.log(data)
console.log(data.value.assessmentId) console.log(data.value.id)
if(data.value.assessmentId){ if(data.value.id){
clearInterval(timers) clearInterval(timers)
console.log([data.value.essayQuestionVoList, data.value.multipleStemVoList, data.value.scoringQuestionVoList, data.value.singleStemVoList]) console.log([data.value.essayQuestionVoList, data.value.multipleStemVoList, data.value.scoringQuestionVoList, data.value.singleStemVoList])
questionList.value = formateArr([data.value.essayQuestionVoList, data.value.multipleStemVoList, data.value.scoringQuestionVoList, data.value.singleStemVoList]) questionList.value = formateArr([data.value.essayQuestionVoList, data.value.multipleStemVoList, data.value.scoringQuestionVoList, data.value.singleStemVoList])

View File

@@ -158,7 +158,10 @@ export default defineConfig(({ command, mode }) =>
},'/statement/getMoreComments': { },'/statement/getMoreComments': {
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL, target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
changeOrigin: true, changeOrigin: true,
}, },'/vote/queryVoteById': {
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
changeOrigin: true,
}
} }
} }
}) })