mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-10 19:36:48 +08:00
学院段修改
This commit is contained in:
@@ -1,3 +1,56 @@
|
|||||||
export const PROJECT = 1;
|
export const PROJECT = 1;
|
||||||
export const ROUTER = 2;
|
export const ROUTER = 2;
|
||||||
export const COURSE = 3;
|
export const COURSE = 3;
|
||||||
|
|
||||||
|
export const TASK_TYPES ={
|
||||||
|
typeName: {
|
||||||
|
1: "在线",
|
||||||
|
2: "面授",
|
||||||
|
3: "案例",
|
||||||
|
4: "作业",
|
||||||
|
5: "考试",
|
||||||
|
6: "直播",
|
||||||
|
7: "外链",
|
||||||
|
8: "讨论",
|
||||||
|
9: "活动",
|
||||||
|
10: "测评",
|
||||||
|
11: "评估",
|
||||||
|
12: "投票",
|
||||||
|
13: "项目",
|
||||||
|
},
|
||||||
|
toName: {
|
||||||
|
1: "去上课",
|
||||||
|
2: "去上课",
|
||||||
|
3: "去阅读",
|
||||||
|
4: "去完成",
|
||||||
|
5: "去完成",
|
||||||
|
6: "去观看",
|
||||||
|
7: "去查看",
|
||||||
|
8: "去讨论",
|
||||||
|
9: "去签到",
|
||||||
|
10: "去完成",
|
||||||
|
11: "去完成",
|
||||||
|
12: "去投票",
|
||||||
|
13: "去完成",
|
||||||
|
},
|
||||||
|
path: {
|
||||||
|
1: window.location.protocol + import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线
|
||||||
|
2: ({courseId}) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${courseId}`, '_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, //考试
|
||||||
|
6: "/livebroadcast",
|
||||||
|
7: ({targetId}) => window.open(targetId, '_top'), //外联
|
||||||
|
8: "/discusspage",
|
||||||
|
9: "/moreactive",
|
||||||
|
10: ({evaType, targetId}) =>
|
||||||
|
window.open(
|
||||||
|
evaType == 0
|
||||||
|
? window.location.protocol + import.meta.env.VITE_BOE_TEST_DETAIL_URL + targetId
|
||||||
|
: window.location.protocol + import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL + targetId + `&quizTaskKid=${routerId}&channelCode=learningpath`
|
||||||
|
, '_top'), //测评
|
||||||
|
11: "/surveydetail",
|
||||||
|
12: "/ballotpage",
|
||||||
|
13: "/projectdetails",
|
||||||
|
},
|
||||||
|
}
|
||||||
55
src/api/useCommon.js
Normal file
55
src/api/useCommon.js
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import {useRoute, useRouter} from "vue-router/dist/vue-router";
|
||||||
|
import {useStore} from "vuex";
|
||||||
|
import {PROJECT, TASK_TYPES} from "@/api/CONST";
|
||||||
|
import {computed, onMounted} from "vue";
|
||||||
|
|
||||||
|
export function useTaskPage() {
|
||||||
|
const router = useRouter()
|
||||||
|
const {query: {id: taskId, type, infoId}} = useRoute()
|
||||||
|
const {state, dispatch} = useStore()
|
||||||
|
const info = computed(() => type == 1 ? state.projectInfo : state.routerInfo)
|
||||||
|
|
||||||
|
const taskList = computed(() => type == 1 ? info.value.stageProcessList.flatMap(t => t.taskProcessList.map(s => ({
|
||||||
|
...s,
|
||||||
|
stageId: t.id,
|
||||||
|
stageName: t.name
|
||||||
|
}))) : info.value.taskBoList)
|
||||||
|
const index = computed(() => taskList.value?.findIndex(t => t.id == taskId))
|
||||||
|
const hasPrev = computed(() => index.value - 1 > 0)
|
||||||
|
const hasNext = computed(() => taskList.value.length > index)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
dispatch('getProjectInfo', {projectId:infoId})
|
||||||
|
})
|
||||||
|
|
||||||
|
function nextPage() {
|
||||||
|
toPage(taskList.value[index.value + 1])
|
||||||
|
}
|
||||||
|
|
||||||
|
function prevPage() {
|
||||||
|
toPage(taskList.value[index.value - 1])
|
||||||
|
}
|
||||||
|
|
||||||
|
function toPage(d) {
|
||||||
|
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.id,
|
||||||
|
type: type,
|
||||||
|
infoId: info.id,
|
||||||
|
courseId: d.courseId,
|
||||||
|
pName: info.name,
|
||||||
|
sName:d.stageName,
|
||||||
|
chapterOrStageId: d.stageId,
|
||||||
|
btype: type
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else if (typeof TASK_TYPES.path[d.type] === "function") {
|
||||||
|
TASK_TYPES.path[d.type](d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {hasPrev, hasNext, nextPage, prevPage}
|
||||||
|
}
|
||||||
@@ -1,15 +1,95 @@
|
|||||||
import {createStore} from 'vuex'
|
import {createStore} from 'vuex'
|
||||||
|
import {PROJECT_PROCESS, ROUTER_PROCESS} from "@/api/api";
|
||||||
|
import {request} from "@/api/request";
|
||||||
|
import {TASK_TYPES} from "@/api/CONST";
|
||||||
|
|
||||||
export default createStore({
|
export default createStore({
|
||||||
state: {
|
state: {
|
||||||
userInfo: {}
|
userInfo: {},
|
||||||
|
projectInfo: {},
|
||||||
|
routerInfo: {}
|
||||||
|
},
|
||||||
|
getters: {
|
||||||
|
|
||||||
},
|
},
|
||||||
getters: {},
|
|
||||||
mutations: {
|
mutations: {
|
||||||
SET_USER(state, userInfo) {
|
SET_USER(state, userInfo) {
|
||||||
state.userInfo = userInfo
|
state.userInfo = userInfo
|
||||||
},
|
},
|
||||||
|
SET_PROJECT_INFO(state, info) {
|
||||||
|
state.projectInfo = info
|
||||||
|
},
|
||||||
|
INIT_PROJECT_INFO(state) {
|
||||||
|
if (state.projectInfo.status === -1) {
|
||||||
|
state.projectInfo.stageProcessList.forEach((t) => {
|
||||||
|
t.statusName = '已结束';
|
||||||
|
t.taskProcessList?.forEach((s) => s.statusName = '已结束')
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (state.projectInfo.unlockMode === 1) {
|
||||||
|
state.projectInfo.stageProcessList.forEach((t) => {
|
||||||
|
t.statusName = '进行中'
|
||||||
|
const stageState = t.taskProcessList?.every((s) => {
|
||||||
|
s.statusName = s.status === 1 ? '已完成' : TASK_TYPES.toName[s.type]
|
||||||
|
return s.status === 1
|
||||||
|
})
|
||||||
|
stageState && (t.statusName = '已完成')
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
state.projectInfo.stageProcessList?.some((t) => {
|
||||||
|
t.statusName = '已完成'
|
||||||
|
const stageState = t.taskProcessList?.some((s) => {
|
||||||
|
s.unlock = true
|
||||||
|
s.statusName = '已完成'
|
||||||
|
s.status !== 1 && (s.statusName = TASK_TYPES.toName[s.type])
|
||||||
|
return state.projectInfo.unlockMode === 2 ? s.status !== 1 : (s.status !== 1 && s.flag)
|
||||||
|
})
|
||||||
|
stageState && (t.statusName = '进行中');
|
||||||
|
return stageState
|
||||||
|
})
|
||||||
|
},
|
||||||
|
SET_ROUTER_INFO(state, info) {
|
||||||
|
state.routerInfo = info
|
||||||
|
},
|
||||||
|
INIT_ROUTER_INFO(state) {
|
||||||
|
// state.routerInfo.unlockMode 1自由模式 2闯关模式 3 闯关模式 必修 flag true
|
||||||
|
if (state.routerInfo.status === -1) {
|
||||||
|
state.routerInfo.statusName = '已结束'
|
||||||
|
state.routerInfo.taskBoList.forEach((t) => t.statusName = '已结束')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
state.routerInfo.statusName = '进行中'
|
||||||
|
if (state.routerInfo.unlockMode === 1) {
|
||||||
|
state.routerInfo.taskBoList?.every((s) => {
|
||||||
|
s.statusName = s.status === 1 ? '已完成' : TASK_TYPES.toName[s.type]
|
||||||
|
return s.status === 1
|
||||||
|
}) && (state.routerInfo.statusName = '已完成')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
state.routerInfo.statusName = '已完成'
|
||||||
|
state.routerInfo.taskBoList?.some((s) => {
|
||||||
|
s.unlock = true
|
||||||
|
s.statusName = '已完成'
|
||||||
|
s.status !== 1 && (s.statusName = TASK_TYPES.toName[s.type])
|
||||||
|
return state.routerInfo.unlockMode === 2 ? s.status !== 1 : (s.status !== 1 && s.flag)
|
||||||
|
}) && (state.routerInfo.statusName = '进行中')
|
||||||
|
},
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
getProjectInfo(content, {projectId}) {
|
||||||
|
content.state.projectInfo.projectId || request(PROJECT_PROCESS, {projectId}).then(res => {
|
||||||
|
content.commit('SET_PROJECT_INFO', res.data)
|
||||||
|
content.commit('INIT_PROJECT_INFO')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getRouterInfo(content, {routerId}) {
|
||||||
|
content.state.routerInfo.routerId || request(ROUTER_PROCESS, {routerId}).then(res => {
|
||||||
|
content.commit('SET_ROUTER_INFO', res.data)
|
||||||
|
content.commit('INIT_ROUTER_INFO')
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
actions: {},
|
|
||||||
modules: {}
|
modules: {}
|
||||||
})
|
})
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,6 @@
|
|||||||
<div class="detailinfo">
|
<div class="detailinfo">
|
||||||
<div class="detailL">
|
<div class="detailL">
|
||||||
<div v-if="data.stageProcessList" v-for="(i, k) in data.stageProcessList" :key="k">
|
<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-if="i.stageId == '0' && i.taskProcessList.length == 0"></div>
|
||||||
<div v-else class="title">
|
<div v-else class="title">
|
||||||
<div class="titleL">{{ i.stageName }}</div>
|
<div class="titleL">{{ i.stageName }}</div>
|
||||||
@@ -34,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="i.stageId == '0' && i.taskProcessList.length == 0"></div>
|
<div v-if="i.stageId == '0' && i.taskProcessList.length == 0"></div>
|
||||||
<div v-else class="course"
|
<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)
|
(e) => !whiteTypes(e.type)
|
||||||
)"
|
)"
|
||||||
:key="index">
|
:key="index">
|
||||||
@@ -90,7 +89,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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'}">
|
:style="{background:(value.statusName !=='已结束' && (value.statusName || data.unlockMode === 1)) ?'#2478ff':'#999'}">
|
||||||
{{ value.statusName || (data.unlockMode === 1 ? types.toName[value.type] : '未解锁') }}
|
{{ value.statusName || (data.unlockMode === 1 ? types.toName[value.type] : '未解锁') }}
|
||||||
</div>
|
</div>
|
||||||
@@ -404,72 +403,28 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {computed, reactive, ref, watch} from "vue";
|
import {computed, onMounted, ref, watch} from "vue";
|
||||||
import {ElLoading} from 'element-plus'
|
import {ElLoading, ElMessage} from 'element-plus'
|
||||||
import img from "@/assets/image/uploadimg.png";
|
import {request} from "@/api/request";
|
||||||
import {useRequest, request} from "@/api/request";
|
import {CompletionList, EvaluationToLearn, PointList, STUDY_RECORD, SubmitExternalExam} from "@/api/api";
|
||||||
import {
|
|
||||||
PROJECT_PROCESS,
|
|
||||||
ONLINE_PROCESS,
|
|
||||||
ROUTER_PROCESS,
|
|
||||||
LINK_DETAILS,
|
|
||||||
STUDY_RECORD,
|
|
||||||
EvaluationToLearn,
|
|
||||||
CompletionList,
|
|
||||||
PointList,
|
|
||||||
SubmitExternalExam
|
|
||||||
} from "@/api/api";
|
|
||||||
import {useRoute, useRouter} from "vue-router";
|
import {useRoute, useRouter} from "vue-router";
|
||||||
import store from "@/store";
|
import {PROJECT, TASK_TYPES} from "@/api/CONST";
|
||||||
import {ElMessage} from "element-plus";
|
|
||||||
import {PROJECT} from "@/api/CONST";
|
|
||||||
import FileTypeImg from "@/components/FileTypeImg.vue";
|
import FileTypeImg from "@/components/FileTypeImg.vue";
|
||||||
import {UPDATE_CURRENT_TASK} from "../../api/api";
|
import {UPDATE_CURRENT_TASK} from "@/api/api";
|
||||||
import dayjs from "dayjs";
|
import {useStore} from "vuex";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
query: {courseId, projectId},
|
query: {courseId, projectId},
|
||||||
} = useRoute();
|
} = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const {commit, dispatch, state} = useStore()
|
||||||
const {data} = useRequest(PROJECT_PROCESS, {
|
const store = useStore()
|
||||||
projectId: projectId || courseId,
|
const userInfo = computed(()=>state.userInfo)
|
||||||
});
|
const data = computed(()=>state.projectInfo)
|
||||||
|
onMounted(() => {
|
||||||
|
dispatch('getProjectInfo', {projectId})
|
||||||
watch(() => data.value.stageProcessList, () => {
|
})
|
||||||
// data.value.unlockMode 1自由模式 2闯关模式 3 闯关模式 必修 flag true
|
const tableRankData = ref([])
|
||||||
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 studyProgress = [
|
const studyProgress = [
|
||||||
{
|
{
|
||||||
@@ -486,36 +441,15 @@ const stateValue = ref(undefined)
|
|||||||
const myRate = ref('')
|
const myRate = ref('')
|
||||||
const myRateStr = ref('')
|
const myRateStr = ref('')
|
||||||
const choiceStatus = (e) => {
|
const choiceStatus = (e) => {
|
||||||
console.log(e)
|
|
||||||
tabValue.value = e
|
tabValue.value = e
|
||||||
stateValue.value = e
|
stateValue.value = e
|
||||||
if (e == 2) {
|
// 获取个人完成度
|
||||||
// 获取个人完成度
|
request(CompletionList, {projectId: projectId, type: e === 2 ? 0 : 1}).then(res => {
|
||||||
request(CompletionList, {projectId: projectId, type: 0}).then(res => {
|
tableRankData.value =res.data.datas
|
||||||
console.log('获取个人完成度---》', res)
|
myIndex.value = res.data.myIndex
|
||||||
if (res.code == 200) {
|
myRate.value = res.data.myRate
|
||||||
tableRankData.value = res.data.datas
|
myRateStr.value = res.data.myRateStr
|
||||||
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)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tab 展示 --- 默认展示积分排行榜 1 个人完成度 2 小组完成度 3
|
// Tab 展示 --- 默认展示积分排行榜 1 个人完成度 2 小组完成度 3
|
||||||
@@ -525,56 +459,21 @@ const tabChange = (tabs) => {
|
|||||||
tabValue.value = tabs;
|
tabValue.value = tabs;
|
||||||
// 获取项目积分
|
// 获取项目积分
|
||||||
request(PointList, {projectId: projectId}).then(res => {
|
request(PointList, {projectId: projectId}).then(res => {
|
||||||
console.log('我是获取的项目积分---》', res)
|
tableRankData.value =res.data.datas
|
||||||
if (res.code == 200) {
|
myIndex.value = res.data.myIndex
|
||||||
tableRankData.value = res.data.datas
|
myPoint.value = res.data.myPointsCount
|
||||||
myIndex.value = res.data.myIndex
|
})
|
||||||
myPoint.value = res.data.myPointsCount
|
tableRankData.value =12
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
const tableRankData = ref([])
|
|
||||||
const myIndex = ref('')
|
const myIndex = ref('')
|
||||||
const myPoint = ref('')
|
const myPoint = ref('')
|
||||||
// 获取项目积分
|
// 获取项目积分
|
||||||
request(PointList, {projectId: projectId}).then(res => {
|
request(PointList, {projectId: projectId}).then(res => {
|
||||||
console.log('我是获取的项目积分---》', res)
|
tableRankData.value = res.data.datas
|
||||||
if (res.code == 200) {
|
myIndex.value = res.data.myIndex
|
||||||
tableRankData.value = res.data.datas
|
myPoint.value = res.data.myPointsCount
|
||||||
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)'
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// 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 activeName = ref("first");
|
||||||
const handleClick = (tab, event) => {
|
const handleClick = (tab, event) => {
|
||||||
console.log(tab, event);
|
console.log(tab, event);
|
||||||
@@ -664,7 +563,7 @@ function judgeTaskIsEnd(type, endTimes, status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function toFinish(d, sName, chapterOrStageId) {
|
async function toFinish(d, sName, chapterOrStageId) {
|
||||||
if (data.value.unlockMode !==1 && !d.statusName) {
|
if (data.unlockMode !== 1 && !d.statusName) {
|
||||||
ElMessage.warning("当前未解锁")
|
ElMessage.warning("当前未解锁")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -730,7 +629,7 @@ async function toFinish(d, sName, chapterOrStageId) {
|
|||||||
router.push({
|
router.push({
|
||||||
path: '/externalexamination',
|
path: '/externalexamination',
|
||||||
query: {
|
query: {
|
||||||
id: d.projectTaskId,
|
id: d.id,
|
||||||
type: PROJECT,
|
type: PROJECT,
|
||||||
infoId: data.value.projectId,
|
infoId: data.value.projectId,
|
||||||
courseId: d.courseId,
|
courseId: d.courseId,
|
||||||
@@ -786,7 +685,7 @@ async function toFinish(d, sName, chapterOrStageId) {
|
|||||||
router.push({
|
router.push({
|
||||||
path: '/evaluation',
|
path: '/evaluation',
|
||||||
query: {
|
query: {
|
||||||
id: d.projectTaskId,
|
id: d.id,
|
||||||
type: PROJECT,
|
type: PROJECT,
|
||||||
infoId: data.value.projectId,
|
infoId: data.value.projectId,
|
||||||
courseId: d.courseId,
|
courseId: d.courseId,
|
||||||
@@ -806,7 +705,7 @@ async function toFinish(d, sName, chapterOrStageId) {
|
|||||||
"courseId": d.courseId,
|
"courseId": d.courseId,
|
||||||
"quizKid": d.targetId,
|
"quizKid": d.targetId,
|
||||||
"routerOrProjectId": projectId,
|
"routerOrProjectId": projectId,
|
||||||
"studentId": userInfo.value.id,
|
"studentId": userInfo.value.projectId,
|
||||||
"studentName": userInfo.value.realName
|
"studentName": userInfo.value.realName
|
||||||
})
|
})
|
||||||
request(EvaluationToLearn, {
|
request(EvaluationToLearn, {
|
||||||
@@ -815,7 +714,7 @@ async function toFinish(d, sName, chapterOrStageId) {
|
|||||||
"courseId": d.courseId,
|
"courseId": d.courseId,
|
||||||
"quizKid": d.targetId,
|
"quizKid": d.targetId,
|
||||||
"routerOrProjectId": projectId,
|
"routerOrProjectId": projectId,
|
||||||
"studentId": userInfo.value.id,
|
"studentId": userInfo.value.projectId,
|
||||||
"studentName": userInfo.value.realName
|
"studentName": userInfo.value.realName
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
@@ -830,19 +729,19 @@ async function toFinish(d, sName, chapterOrStageId) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!types.value.path[d.type]) {
|
if (!TASK_TYPES.path[d.type]) {
|
||||||
ElMessage.error("暂时未开放");
|
ElMessage.error("暂时未开放");
|
||||||
return;
|
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) {
|
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.projectId,
|
||||||
targetId: data.value.routerId,
|
targetId: data.value.routerId,
|
||||||
logo: PROJECT,
|
logo: PROJECT,
|
||||||
stageOrChapterId: chapterOrStageId,
|
stageOrChapterId: chapterOrStageId,
|
||||||
taskId: d.projectTaskId,
|
taskId: d.id,
|
||||||
taskType: d.type,
|
taskType: d.type,
|
||||||
});
|
});
|
||||||
// 此处判断外链跳转详情界面
|
// 此处判断外链跳转详情界面
|
||||||
@@ -850,7 +749,7 @@ async function toFinish(d, sName, chapterOrStageId) {
|
|||||||
router.push({
|
router.push({
|
||||||
path: '/outerchain',
|
path: '/outerchain',
|
||||||
query: {
|
query: {
|
||||||
id: d.projectTaskId,
|
id: d.id,
|
||||||
type: PROJECT,
|
type: PROJECT,
|
||||||
infoId: data.value.projectId,
|
infoId: data.value.projectId,
|
||||||
courseId: d.courseId,
|
courseId: d.courseId,
|
||||||
@@ -864,16 +763,12 @@ async function toFinish(d, sName, chapterOrStageId) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof types.value.path[d.type] === "string") {
|
if (typeof TASK_TYPES.path[d.type] === "string") {
|
||||||
types.value.path[d.type] &&
|
TASK_TYPES.path[d.type] && TASK_TYPES.path[d.type].startsWith("http") && window.open(TASK_TYPES.path[d.type] + d.targetId, '_top');
|
||||||
types.value.path[d.type].startsWith("http") &&
|
TASK_TYPES.path[d.type] && TASK_TYPES.path[d.type].startsWith("/") && router.push({
|
||||||
window.open(types.value.path[d.type] + d.targetId, '_top');
|
path: TASK_TYPES.path[d.type],
|
||||||
types.value.path[d.type] &&
|
|
||||||
types.value.path[d.type].startsWith("/") &&
|
|
||||||
router.push({
|
|
||||||
path: types.value.path[d.type],
|
|
||||||
query: {
|
query: {
|
||||||
id: d.projectTaskId,
|
id: d.id,
|
||||||
type: PROJECT,
|
type: PROJECT,
|
||||||
infoId: data.value.projectId,
|
infoId: data.value.projectId,
|
||||||
courseId: d.courseId,
|
courseId: d.courseId,
|
||||||
@@ -883,8 +778,8 @@ async function toFinish(d, sName, chapterOrStageId) {
|
|||||||
btype: 1
|
btype: 1
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else if (typeof types.value.path[d.type] === "function") {
|
} else if (typeof TASK_TYPES.path[d.type] === "function") {
|
||||||
types.value.path[d.type](d);
|
TASK_TYPES.path[d.type](d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -911,9 +806,9 @@ function downloadFile(url) {
|
|||||||
|
|
||||||
// 继续学习
|
// 继续学习
|
||||||
function continueLearn(lastLearnedId) {
|
function continueLearn(lastLearnedId) {
|
||||||
data.value.stageProcessList.forEach(stage => {
|
data.stageProcessList.forEach(stage => {
|
||||||
stage?.taskProcessList?.forEach(d => {
|
stage?.taskProcessList?.forEach(d => {
|
||||||
if (d.projectTaskId == lastLearnedId) {
|
if (d.id == lastLearnedId) {
|
||||||
toFinish(d, stage.stageName, stage.stageId)
|
toFinish(d, stage.stageName, stage.stageId)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
选修
|
选修
|
||||||
</div>
|
</div>
|
||||||
<div class="tag3" style="margin-right: 11px; margin-top: 16px">
|
<div class="tag3" style="margin-right: 11px; margin-top: 16px">
|
||||||
{{ types.typeName[value.type] || "" }}
|
{{ TASK_TYPES.typeName[value.type] || "" }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div-->
|
<!-- <div-->
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
<div class="goclass"
|
<div class="goclass"
|
||||||
:style="{background:(value.statusName !=='已结束' && (value.statusName || data.unlockMode === 1)) ?'#2478ff':'#999'}"
|
:style="{background:(value.statusName !=='已结束' && (value.statusName || data.unlockMode === 1)) ?'#2478ff':'#999'}"
|
||||||
@click="toFinish(value)">
|
@click="toFinish(value)">
|
||||||
{{ value.statusName || (data.unlockMode === 1 ? types.toName[value.type] : '未解锁') }}
|
{{ value.statusName || (data.unlockMode === 1 ? TASK_TYPES.toName[value.type] : '未解锁') }}
|
||||||
</div>
|
</div>
|
||||||
<!-- <div :style="{ display: value.status === 1 ? 'block' : 'none' }">-->
|
<!-- <div :style="{ display: value.status === 1 ? 'block' : 'none' }">-->
|
||||||
<!-- <div-->
|
<!-- <div-->
|
||||||
@@ -277,17 +277,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {computed, reactive, ref, watch} from "vue";
|
import {computed, onMounted, ref} from "vue";
|
||||||
import circle from '@/assets/image/pathdetails/circle.png';
|
import circle from '@/assets/image/pathdetails/circle.png';
|
||||||
import circle2 from '@/assets/image/pathdetails/circle2.png';
|
import circle2 from '@/assets/image/pathdetails/circle2.png';
|
||||||
import {boeRequest, useRequest, request} from "@/api/request";
|
import {request} from "@/api/request";
|
||||||
import {ROUTER_PROCESS, LINK_DETAILS, STUDY_RECORD, EvaluationToLearn, SubmitExternalExam} from "@/api/api";
|
import {EvaluationToLearn, STUDY_RECORD, SubmitExternalExam} from "@/api/api";
|
||||||
import {useRoute, useRouter} from "vue-router";
|
import {useRoute, useRouter} from "vue-router";
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
import store from "@/store";
|
import {ROUTER, TASK_TYPES} from "@/api/CONST";
|
||||||
import {ROUTER} from "@/api/CONST";
|
|
||||||
import FileTypeImg from "@/components/FileTypeImg.vue";
|
import FileTypeImg from "@/components/FileTypeImg.vue";
|
||||||
import {UPDATE_CURRENT_TASK} from "../../api/api";
|
import {UPDATE_CURRENT_TASK} from "@/api/api";
|
||||||
|
import {useStore} from "vuex";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
query: {routerId, routerName},
|
query: {routerId, routerName},
|
||||||
@@ -296,34 +296,15 @@ const router = useRouter();
|
|||||||
const returnclick = () => {
|
const returnclick = () => {
|
||||||
router.back();
|
router.back();
|
||||||
};
|
};
|
||||||
const {data} = useRequest(ROUTER_PROCESS, {routerId});
|
|
||||||
const userInfo = computed(() => store.state.userInfo);
|
const {commit, dispatch, state} = useStore()
|
||||||
|
const userInfo = computed(() => state.userInfo)
|
||||||
|
const data = computed(() => state.routerInfo)
|
||||||
const activeName = ref("first");
|
const activeName = ref("first");
|
||||||
|
|
||||||
watch(() => data.value.taskBoList, () => {
|
onMounted(() => {
|
||||||
// data.value.unlockMode 1自由模式 2闯关模式 3 闯关模式 必修 flag true
|
dispatch('getRouterInfo', {routerId})
|
||||||
if (data.value.status === -1) {
|
})
|
||||||
data.value.statusName = '已结束'
|
|
||||||
data.value.taskBoList.forEach((t) => t.statusName = '已结束')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
data.value.statusName = '进行中'
|
|
||||||
if (data.value.unlockMode === 1) {
|
|
||||||
data.value.taskBoList?.every((s) => {
|
|
||||||
s.statusName = s.status === 1 ? '已完成' : types.value.toName[s.type]
|
|
||||||
return s.status === 1
|
|
||||||
}) && (data.value.statusName = '已完成')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
data.value.statusName = '已完成'
|
|
||||||
data.value.taskBoList?.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)
|
|
||||||
}) && (data.value.statusName = '进行中')
|
|
||||||
|
|
||||||
}, {deep: true})
|
|
||||||
|
|
||||||
const handleClick = (tab, event) => {
|
const handleClick = (tab, event) => {
|
||||||
console.log(tab, event);
|
console.log(tab, event);
|
||||||
@@ -333,59 +314,6 @@ const path = {1: "path"};
|
|||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false);
|
||||||
const dialogVisibleTip = ref('');
|
const dialogVisibleTip = ref('');
|
||||||
|
|
||||||
const types = ref({
|
|
||||||
typeName: {
|
|
||||||
1: "在线",
|
|
||||||
2: "面授",
|
|
||||||
3: "案例",
|
|
||||||
4: "作业",
|
|
||||||
5: "考试",
|
|
||||||
6: "直播",
|
|
||||||
7: "外链",
|
|
||||||
8: "讨论",
|
|
||||||
9: "活动",
|
|
||||||
10: "测评",
|
|
||||||
11: "评估",
|
|
||||||
12: "投票",
|
|
||||||
13: "项目",
|
|
||||||
},
|
|
||||||
toName: {
|
|
||||||
1: "去上课",
|
|
||||||
2: "去上课",
|
|
||||||
3: "去阅读",
|
|
||||||
4: "去完成",
|
|
||||||
5: "去完成",
|
|
||||||
6: "去观看",
|
|
||||||
7: "去查看",
|
|
||||||
8: "去讨论",
|
|
||||||
9: "去签到",
|
|
||||||
10: "去完成",
|
|
||||||
11: "去完成",
|
|
||||||
12: "去投票",
|
|
||||||
13: "去完成",
|
|
||||||
},
|
|
||||||
path: {
|
|
||||||
1: window.location.protocol + import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线
|
|
||||||
2: ({courseId}) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${courseId}`, '_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, //考试
|
|
||||||
6: "/livebroadcast",
|
|
||||||
7: ({targetId}) => window.open(targetId, '_top'), //外联
|
|
||||||
8: "/discusspage",
|
|
||||||
9: "/moreactive",
|
|
||||||
10: ({evaType, targetId}) =>
|
|
||||||
window.open(
|
|
||||||
evaType == 0
|
|
||||||
? window.location.protocol + import.meta.env.VITE_BOE_TEST_DETAIL_URL + targetId
|
|
||||||
: window.location.protocol + import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL + targetId + `&quizTaskKid=${routerId}&channelCode=learningpath`
|
|
||||||
, '_top'), //测评
|
|
||||||
11: "/surveydetail",
|
|
||||||
12: "/ballotpage",
|
|
||||||
13: "/projectdetails",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// 判断当前任务已结束及时间意义上的结束 提示用户
|
// 判断当前任务已结束及时间意义上的结束 提示用户
|
||||||
function judgeTaskIsEnd(type, endTimes, status) {
|
function judgeTaskIsEnd(type, endTimes, status) {
|
||||||
// type 任务类型 endTime 结束时间 status 任务状态 (状态 0 未完成 1 已完成 2 未开始 3 已结束)
|
// type 任务类型 endTime 结束时间 status 任务状态 (状态 0 未完成 1 已完成 2 未开始 3 已结束)
|
||||||
@@ -414,7 +342,7 @@ function judgeTaskIsEnd(type, endTimes, status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function toFinish(d) {
|
async function toFinish(d) {
|
||||||
if (data.value.unlockMode !==1 && !d.statusName) {
|
if (data.value.unlockMode !== 1 && !d.statusName) {
|
||||||
ElMessage.warning("当前未解锁")
|
ElMessage.warning("当前未解锁")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -423,7 +351,7 @@ async function toFinish(d) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!types.value.path[d.type]) {
|
if (!TASK_TYPES.path[d.type]) {
|
||||||
ElMessage.error("暂时未开放");
|
ElMessage.error("暂时未开放");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -616,14 +544,12 @@ async function toFinish(d) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof types.value.path[d.type] === "string") {
|
if (typeof TASK_TYPES.path[d.type] === "string") {
|
||||||
types.value.path[d.type] &&
|
TASK_TYPES.path[d.type] && TASK_TYPES.path[d.type].startsWith("http") && window.open(TASK_TYPES.path[d.type] + d.targetId, '_top');
|
||||||
types.value.path[d.type].startsWith("http") &&
|
//任务列表 加载
|
||||||
window.open(types.value.path[d.type] + d.targetId, '_top');
|
TASK_TYPES.path[d.type] && TASK_TYPES.path[d.type].startsWith("/") &&
|
||||||
types.value.path[d.type] &&
|
|
||||||
types.value.path[d.type].startsWith("/") &&
|
|
||||||
router.push({
|
router.push({
|
||||||
path: types.value.path[d.type],
|
path: TASK_TYPES.path[d.type],
|
||||||
query: {
|
query: {
|
||||||
id: d.id,
|
id: d.id,
|
||||||
type: ROUTER,
|
type: ROUTER,
|
||||||
@@ -635,10 +561,8 @@ async function toFinish(d) {
|
|||||||
btype: 2
|
btype: 2
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else if (typeof types.value.path[d.type] === "function") {
|
} else if (typeof TASK_TYPES.path[d.type] === "function") {
|
||||||
console.log("ddddddd", d);
|
TASK_TYPES.path[d.type](d);
|
||||||
types.value.path[d.type](d);
|
|
||||||
// console.log("types.value.path[d.type](d)", d);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user