mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-09 19:06:48 +08:00
学院段修改
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
<div class="detailinfo">
|
||||
<div class="detailL">
|
||||
<div v-if="data.stageProcessList" v-for="(i, k) in data.stageProcessList" :key="k">
|
||||
{{ loading.close() }}
|
||||
<div v-if="i.stageId == '0' && i.taskProcessList.length == 0"></div>
|
||||
<div v-else class="title">
|
||||
<div class="titleL">{{ i.stageName }}</div>
|
||||
@@ -34,7 +33,7 @@
|
||||
</div>
|
||||
<div v-if="i.stageId == '0' && i.taskProcessList.length == 0"></div>
|
||||
<div v-else class="course"
|
||||
v-for="(value, index) in (i.taskProcessList.sort((a,b)=>{ return a.projectTaskId - b.projectTaskId; })).filter(
|
||||
v-for="(value, index) in (i.taskProcessList.sort((a,b)=>{ return a.id - b.id; })).filter(
|
||||
(e) => !whiteTypes(e.type)
|
||||
)"
|
||||
:key="index">
|
||||
@@ -90,7 +89,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="goclass" @click="toFinish(value, i.stageName, i.stageId)"
|
||||
<div class="goclass" @click="toFinish(value, i.stageName, i.id)"
|
||||
:style="{background:(value.statusName !=='已结束' && (value.statusName || data.unlockMode === 1)) ?'#2478ff':'#999'}">
|
||||
{{ value.statusName || (data.unlockMode === 1 ? types.toName[value.type] : '未解锁') }}
|
||||
</div>
|
||||
@@ -404,72 +403,28 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {computed, reactive, ref, watch} from "vue";
|
||||
import {ElLoading} from 'element-plus'
|
||||
import img from "@/assets/image/uploadimg.png";
|
||||
import {useRequest, request} from "@/api/request";
|
||||
import {
|
||||
PROJECT_PROCESS,
|
||||
ONLINE_PROCESS,
|
||||
ROUTER_PROCESS,
|
||||
LINK_DETAILS,
|
||||
STUDY_RECORD,
|
||||
EvaluationToLearn,
|
||||
CompletionList,
|
||||
PointList,
|
||||
SubmitExternalExam
|
||||
} from "@/api/api";
|
||||
import {computed, onMounted, ref, watch} from "vue";
|
||||
import {ElLoading, ElMessage} from 'element-plus'
|
||||
import {request} from "@/api/request";
|
||||
import {CompletionList, EvaluationToLearn, PointList, STUDY_RECORD, SubmitExternalExam} from "@/api/api";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import store from "@/store";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {PROJECT} from "@/api/CONST";
|
||||
import {PROJECT, TASK_TYPES} from "@/api/CONST";
|
||||
import FileTypeImg from "@/components/FileTypeImg.vue";
|
||||
import {UPDATE_CURRENT_TASK} from "../../api/api";
|
||||
import dayjs from "dayjs";
|
||||
import {UPDATE_CURRENT_TASK} from "@/api/api";
|
||||
import {useStore} from "vuex";
|
||||
|
||||
const {
|
||||
query: {courseId, projectId},
|
||||
} = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const {data} = useRequest(PROJECT_PROCESS, {
|
||||
projectId: projectId || courseId,
|
||||
});
|
||||
|
||||
|
||||
watch(() => data.value.stageProcessList, () => {
|
||||
// data.value.unlockMode 1自由模式 2闯关模式 3 闯关模式 必修 flag true
|
||||
if (data.value.status === -1) {
|
||||
data.value.stageProcessList.forEach((t) => {
|
||||
t.statusName = '已结束';
|
||||
t.taskProcessList?.forEach((s) => s.statusName = '已结束')
|
||||
})
|
||||
return
|
||||
}
|
||||
if (data.value.unlockMode === 1) {
|
||||
data.value.stageProcessList.forEach((t) => {
|
||||
t.statusName = '进行中'
|
||||
const stageState = t.taskProcessList?.every((s) => {
|
||||
s.statusName = s.status === 1 ? '已完成' : types.value.toName[s.type]
|
||||
return s.status === 1
|
||||
})
|
||||
stageState && (t.statusName = '已完成')
|
||||
})
|
||||
return
|
||||
}
|
||||
data.value.stageProcessList.some((t) => {
|
||||
t.statusName = '已完成'
|
||||
const stageState = t.taskProcessList?.some((s) => {
|
||||
s.unlock = true
|
||||
s.statusName = '已完成'
|
||||
s.status !== 1 && (s.statusName = types.value.toName[s.type])
|
||||
return data.value.unlockMode === 2 ? s.status !== 1 : (s.status !== 1 && s.flag)
|
||||
})
|
||||
stageState && (t.statusName = '进行中');
|
||||
return stageState
|
||||
})
|
||||
}, {deep: true})
|
||||
|
||||
const {commit, dispatch, state} = useStore()
|
||||
const store = useStore()
|
||||
const userInfo = computed(()=>state.userInfo)
|
||||
const data = computed(()=>state.projectInfo)
|
||||
onMounted(() => {
|
||||
dispatch('getProjectInfo', {projectId})
|
||||
})
|
||||
const tableRankData = ref([])
|
||||
|
||||
const studyProgress = [
|
||||
{
|
||||
@@ -486,36 +441,15 @@ const stateValue = ref(undefined)
|
||||
const myRate = ref('')
|
||||
const myRateStr = ref('')
|
||||
const choiceStatus = (e) => {
|
||||
console.log(e)
|
||||
tabValue.value = e
|
||||
stateValue.value = e
|
||||
if (e == 2) {
|
||||
// 获取个人完成度
|
||||
request(CompletionList, {projectId: projectId, type: 0}).then(res => {
|
||||
console.log('获取个人完成度---》', res)
|
||||
if (res.code == 200) {
|
||||
tableRankData.value = res.data.datas
|
||||
myIndex.value = res.data.myIndex
|
||||
myRate.value = res.data.myRate
|
||||
myRateStr.value = res.data.myRateStr
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
});
|
||||
} else {
|
||||
// 获取小组完成度
|
||||
request(CompletionList, {projectId: projectId, type: 1}).then(res => {
|
||||
console.log('获取小组完成度---》', res)
|
||||
if (res.code == 200) {
|
||||
tableRankData.value = res.data.datas
|
||||
myIndex.value = res.data.myIndex
|
||||
myRate.value = res.data.myRate
|
||||
myRateStr.value = res.data.myRateStr
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
});
|
||||
}
|
||||
// 获取个人完成度
|
||||
request(CompletionList, {projectId: projectId, type: e === 2 ? 0 : 1}).then(res => {
|
||||
tableRankData.value =res.data.datas
|
||||
myIndex.value = res.data.myIndex
|
||||
myRate.value = res.data.myRate
|
||||
myRateStr.value = res.data.myRateStr
|
||||
})
|
||||
}
|
||||
|
||||
// Tab 展示 --- 默认展示积分排行榜 1 个人完成度 2 小组完成度 3
|
||||
@@ -525,56 +459,21 @@ const tabChange = (tabs) => {
|
||||
tabValue.value = tabs;
|
||||
// 获取项目积分
|
||||
request(PointList, {projectId: projectId}).then(res => {
|
||||
console.log('我是获取的项目积分---》', res)
|
||||
if (res.code == 200) {
|
||||
tableRankData.value = res.data.datas
|
||||
myIndex.value = res.data.myIndex
|
||||
myPoint.value = res.data.myPointsCount
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
});
|
||||
tableRankData.value =res.data.datas
|
||||
myIndex.value = res.data.myIndex
|
||||
myPoint.value = res.data.myPointsCount
|
||||
})
|
||||
tableRankData.value =12
|
||||
}
|
||||
const tableRankData = ref([])
|
||||
const myIndex = ref('')
|
||||
const myPoint = ref('')
|
||||
// 获取项目积分
|
||||
request(PointList, {projectId: projectId}).then(res => {
|
||||
console.log('我是获取的项目积分---》', res)
|
||||
if (res.code == 200) {
|
||||
tableRankData.value = res.data.datas
|
||||
myIndex.value = res.data.myIndex
|
||||
myPoint.value = res.data.myPointsCount
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
});
|
||||
|
||||
const loading = ref(false);
|
||||
loading.value = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
tableRankData.value = res.data.datas
|
||||
myIndex.value = res.data.myIndex
|
||||
myPoint.value = res.data.myPointsCount
|
||||
})
|
||||
|
||||
// const { onlinedata } = useRequest(ONLINE_PROCESS, {
|
||||
// addView: false,
|
||||
// cid:"1042123882713739264"
|
||||
// });
|
||||
// console.log("onlinedata", onlinedata);
|
||||
|
||||
// request(ONLINE_PROCESS, {
|
||||
// addView: false,
|
||||
// cid:"1042123882713739264"
|
||||
// })
|
||||
// .then((res) => {
|
||||
// console.log(res)
|
||||
// }).catch(err=>{
|
||||
// console.log(err)
|
||||
// })
|
||||
|
||||
|
||||
const userInfo = computed(() => store.state.userInfo);
|
||||
const activeName = ref("first");
|
||||
const handleClick = (tab, event) => {
|
||||
console.log(tab, event);
|
||||
@@ -664,7 +563,7 @@ function judgeTaskIsEnd(type, endTimes, status) {
|
||||
}
|
||||
|
||||
async function toFinish(d, sName, chapterOrStageId) {
|
||||
if (data.value.unlockMode !==1 && !d.statusName) {
|
||||
if (data.unlockMode !== 1 && !d.statusName) {
|
||||
ElMessage.warning("当前未解锁")
|
||||
return
|
||||
}
|
||||
@@ -730,7 +629,7 @@ async function toFinish(d, sName, chapterOrStageId) {
|
||||
router.push({
|
||||
path: '/externalexamination',
|
||||
query: {
|
||||
id: d.projectTaskId,
|
||||
id: d.id,
|
||||
type: PROJECT,
|
||||
infoId: data.value.projectId,
|
||||
courseId: d.courseId,
|
||||
@@ -786,7 +685,7 @@ async function toFinish(d, sName, chapterOrStageId) {
|
||||
router.push({
|
||||
path: '/evaluation',
|
||||
query: {
|
||||
id: d.projectTaskId,
|
||||
id: d.id,
|
||||
type: PROJECT,
|
||||
infoId: data.value.projectId,
|
||||
courseId: d.courseId,
|
||||
@@ -806,7 +705,7 @@ async function toFinish(d, sName, chapterOrStageId) {
|
||||
"courseId": d.courseId,
|
||||
"quizKid": d.targetId,
|
||||
"routerOrProjectId": projectId,
|
||||
"studentId": userInfo.value.id,
|
||||
"studentId": userInfo.value.projectId,
|
||||
"studentName": userInfo.value.realName
|
||||
})
|
||||
request(EvaluationToLearn, {
|
||||
@@ -815,7 +714,7 @@ async function toFinish(d, sName, chapterOrStageId) {
|
||||
"courseId": d.courseId,
|
||||
"quizKid": d.targetId,
|
||||
"routerOrProjectId": projectId,
|
||||
"studentId": userInfo.value.id,
|
||||
"studentId": userInfo.value.projectId,
|
||||
"studentName": userInfo.value.realName
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
@@ -830,19 +729,19 @@ async function toFinish(d, sName, chapterOrStageId) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!types.value.path[d.type]) {
|
||||
if (!TASK_TYPES.path[d.type]) {
|
||||
ElMessage.error("暂时未开放");
|
||||
return;
|
||||
}
|
||||
//更新学员当前任务
|
||||
await request(UPDATE_CURRENT_TASK, {id: d.projectTaskId, type: PROJECT, pid: projectId, name: d.name})
|
||||
await request(UPDATE_CURRENT_TASK, {id: d.id, type: PROJECT, pid: projectId, name: d.name})
|
||||
if (d.type == 3 || d.type == 7) {
|
||||
d.status !== 1 && await request(STUDY_RECORD, {
|
||||
studentId: userInfo.value.id,
|
||||
studentId: userInfo.value.projectId,
|
||||
targetId: data.value.routerId,
|
||||
logo: PROJECT,
|
||||
stageOrChapterId: chapterOrStageId,
|
||||
taskId: d.projectTaskId,
|
||||
taskId: d.id,
|
||||
taskType: d.type,
|
||||
});
|
||||
// 此处判断外链跳转详情界面
|
||||
@@ -850,7 +749,7 @@ async function toFinish(d, sName, chapterOrStageId) {
|
||||
router.push({
|
||||
path: '/outerchain',
|
||||
query: {
|
||||
id: d.projectTaskId,
|
||||
id: d.id,
|
||||
type: PROJECT,
|
||||
infoId: data.value.projectId,
|
||||
courseId: d.courseId,
|
||||
@@ -864,16 +763,12 @@ async function toFinish(d, sName, chapterOrStageId) {
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof types.value.path[d.type] === "string") {
|
||||
types.value.path[d.type] &&
|
||||
types.value.path[d.type].startsWith("http") &&
|
||||
window.open(types.value.path[d.type] + d.targetId, '_top');
|
||||
types.value.path[d.type] &&
|
||||
types.value.path[d.type].startsWith("/") &&
|
||||
router.push({
|
||||
path: types.value.path[d.type],
|
||||
if (typeof TASK_TYPES.path[d.type] === "string") {
|
||||
TASK_TYPES.path[d.type] && TASK_TYPES.path[d.type].startsWith("http") && window.open(TASK_TYPES.path[d.type] + d.targetId, '_top');
|
||||
TASK_TYPES.path[d.type] && TASK_TYPES.path[d.type].startsWith("/") && router.push({
|
||||
path: TASK_TYPES.path[d.type],
|
||||
query: {
|
||||
id: d.projectTaskId,
|
||||
id: d.id,
|
||||
type: PROJECT,
|
||||
infoId: data.value.projectId,
|
||||
courseId: d.courseId,
|
||||
@@ -883,8 +778,8 @@ async function toFinish(d, sName, chapterOrStageId) {
|
||||
btype: 1
|
||||
},
|
||||
});
|
||||
} else if (typeof types.value.path[d.type] === "function") {
|
||||
types.value.path[d.type](d);
|
||||
} else if (typeof TASK_TYPES.path[d.type] === "function") {
|
||||
TASK_TYPES.path[d.type](d);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -911,9 +806,9 @@ function downloadFile(url) {
|
||||
|
||||
// 继续学习
|
||||
function continueLearn(lastLearnedId) {
|
||||
data.value.stageProcessList.forEach(stage => {
|
||||
data.stageProcessList.forEach(stage => {
|
||||
stage?.taskProcessList?.forEach(d => {
|
||||
if (d.projectTaskId == lastLearnedId) {
|
||||
if (d.id == lastLearnedId) {
|
||||
toFinish(d, stage.stageName, stage.stageId)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user