mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-10 03:16:47 +08:00
学院段修改
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
选修
|
||||
</div>
|
||||
<div class="tag3" style="margin-right: 11px; margin-top: 16px">
|
||||
{{ types.typeName[value.type] || "" }}
|
||||
{{ TASK_TYPES.typeName[value.type] || "" }}
|
||||
</div>
|
||||
|
||||
<!-- <div-->
|
||||
@@ -93,7 +93,7 @@
|
||||
<div class="goclass"
|
||||
:style="{background:(value.statusName !=='已结束' && (value.statusName || data.unlockMode === 1)) ?'#2478ff':'#999'}"
|
||||
@click="toFinish(value)">
|
||||
{{ value.statusName || (data.unlockMode === 1 ? types.toName[value.type] : '未解锁') }}
|
||||
{{ value.statusName || (data.unlockMode === 1 ? TASK_TYPES.toName[value.type] : '未解锁') }}
|
||||
</div>
|
||||
<!-- <div :style="{ display: value.status === 1 ? 'block' : 'none' }">-->
|
||||
<!-- <div-->
|
||||
@@ -277,17 +277,17 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {computed, reactive, ref, watch} from "vue";
|
||||
import {computed, onMounted, ref} from "vue";
|
||||
import circle from '@/assets/image/pathdetails/circle.png';
|
||||
import circle2 from '@/assets/image/pathdetails/circle2.png';
|
||||
import {boeRequest, useRequest, request} from "@/api/request";
|
||||
import {ROUTER_PROCESS, LINK_DETAILS, STUDY_RECORD, EvaluationToLearn, SubmitExternalExam} from "@/api/api";
|
||||
import {request} from "@/api/request";
|
||||
import {EvaluationToLearn, STUDY_RECORD, SubmitExternalExam} from "@/api/api";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {ElMessage} from "element-plus";
|
||||
import store from "@/store";
|
||||
import {ROUTER} from "@/api/CONST";
|
||||
import {ROUTER, TASK_TYPES} from "@/api/CONST";
|
||||
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 {
|
||||
query: {routerId, routerName},
|
||||
@@ -296,34 +296,15 @@ const router = useRouter();
|
||||
const returnclick = () => {
|
||||
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");
|
||||
|
||||
watch(() => data.value.taskBoList, () => {
|
||||
// data.value.unlockMode 1自由模式 2闯关模式 3 闯关模式 必修 flag true
|
||||
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})
|
||||
onMounted(() => {
|
||||
dispatch('getRouterInfo', {routerId})
|
||||
})
|
||||
|
||||
const handleClick = (tab, event) => {
|
||||
console.log(tab, event);
|
||||
@@ -333,59 +314,6 @@ const path = {1: "path"};
|
||||
const dialogVisible = ref(false);
|
||||
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) {
|
||||
// type 任务类型 endTime 结束时间 status 任务状态 (状态 0 未完成 1 已完成 2 未开始 3 已结束)
|
||||
@@ -414,7 +342,7 @@ function judgeTaskIsEnd(type, endTimes, status) {
|
||||
}
|
||||
|
||||
async function toFinish(d) {
|
||||
if (data.value.unlockMode !==1 && !d.statusName) {
|
||||
if (data.value.unlockMode !== 1 && !d.statusName) {
|
||||
ElMessage.warning("当前未解锁")
|
||||
return
|
||||
}
|
||||
@@ -423,7 +351,7 @@ async function toFinish(d) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!types.value.path[d.type]) {
|
||||
if (!TASK_TYPES.path[d.type]) {
|
||||
ElMessage.error("暂时未开放");
|
||||
return;
|
||||
}
|
||||
@@ -616,14 +544,12 @@ async function toFinish(d) {
|
||||
return
|
||||
}
|
||||
|
||||
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("/") &&
|
||||
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: types.value.path[d.type],
|
||||
path: TASK_TYPES.path[d.type],
|
||||
query: {
|
||||
id: d.id,
|
||||
type: ROUTER,
|
||||
@@ -635,10 +561,8 @@ async function toFinish(d) {
|
||||
btype: 2
|
||||
},
|
||||
});
|
||||
} else if (typeof types.value.path[d.type] === "function") {
|
||||
console.log("ddddddd", d);
|
||||
types.value.path[d.type](d);
|
||||
// console.log("types.value.path[d.type](d)", d);
|
||||
} else if (typeof TASK_TYPES.path[d.type] === "function") {
|
||||
TASK_TYPES.path[d.type](d);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user