This commit is contained in:
yuping
2022-12-15 17:54:34 +08:00
parent f736dedf48
commit a39fa683f5
4 changed files with 63 additions and 120 deletions

2
.env
View File

@@ -11,3 +11,5 @@ VITE_BOE_TEST_OUT_DETAIL_URL=https://u-pre.boe.com/api/b1/tale/do-quiz?quizKid=
VITE_BOE_EXAM_DETAIL_URL=https://u-pre.boe.com/pc/exam/test?id=
VITE_BOE_API_URL=https://u-pre.boe.com
VITE_TASK_WHITE_TYPE=8,12

View File

@@ -7,6 +7,7 @@
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div style="background: #0078FC;height: 150px;width:100%;position: absolute;top:0;z-index: 1"></div>
<div id="container">
<!-- <div id="nav">
<router-link
@@ -21,7 +22,7 @@
{{ item.name }}
</router-link>
</div> -->
<main>
<main style="z-index: 2;">
<router-view />
</main>
</div>

View File

@@ -30,7 +30,7 @@
</div>
<div
class="course"
v-for="(value, index) in i.taskProcessList"
v-for="(value, index) in i.taskProcessList.filter(e=>!whiteTypes(e.type))"
:key="index"
>
<div>
@@ -311,6 +311,7 @@ import {useRequest, request} from "@/api/request";
import {PROJECT_PROCESS, ROUTER_PROCESS, LINK_DETAILS} from "@/api/api";
import {useRoute, useRouter} from "vue-router";
import store from "@/store";
import {ElMessage} from "element-plus";
const {
query: {courseId, projectId},
@@ -364,16 +365,13 @@ const types = ref({
4: "/homeworkpage",
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
6: "/livebroadcast",
7: " ",
7: ({courseId}) => request(LINK_DETAILS(courseId), {}).then(({data: {linkAddress}}) => window.open(linkAddress)),//外联
8: "/discusspage",
9: "/moreactive",
10: [
import.meta.env.VITE_BOE_TEST_DETAIL_URL,
import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL,
], //测评
10: ({evaTyp, targetId}) => window.open((evaTyp === 1 ? import.meta.env.VITE_BOE_TEST_DETAIL_URL : import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL) + targetId), //测评
11: "/surveydetail",
12: "/ballotpage",
13: "去完成",
13: "/projectdetails",
},
});
@@ -382,46 +380,19 @@ function toFinish(d) {
ElMessage.error("暂时未开放");
return;
}
if (d.type == 10) {
let url = "";
if (d.evaTyp == 1) {
url = types.value.path[d.type][1] + d.targetId;
} else {
url = types.value.path[d.type][0] + d.targetId;
}
// import.meta.env.DEV
// ? (window.location.href = url)
// : (window.parent.location.href = url);
window.open(url)
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)
types.value.path[d.type] && types.value.path[d.type].startsWith("/") && router.push({
path: types.value.path[d.type],
query: {id: d.routerTaskId, type: 1, courseId: d.courseId, pName: data.value.name, sName},
})
} else if (typeof types.value.path[d.type] === 'function') {
types.value.path[d.type](d)
}
if (types.value.path[d.type] && types.value.path[d.type].startsWith("http")) {
//配置文件
const url = types.value.path[d.type] + d.targetId;
// import.meta.env.DEV
// ? (window.location.href = url)
// : (window.parent.location.href = url);
window.open(url)
return;
}
if (d.type === 7) {
// console.log("url", d, url);
request(LINK_DETAILS(d.courseId), {}).then((res) => {
console.log("resssss", res);
if (res.code === 200) {
const url = res.data.linkAddress;
// import.meta.env.DEV
// ? (window.location.href = url)
// : (window.parent.location.href = url);
window.open(url)
}
});
return;
}
router.push({
path: types.value.path[d.type],
query: {id: d.projectTaskId, type: 2, courseId: d.courseId},
});
}
function whiteTypes(type){
return import.meta.env.VITE_TASK_WHITE_TYPE.includes(type+'')
}
</script>

View File

@@ -30,7 +30,7 @@
</div>
<div
class="course"
v-for="(value, index) in i.taskProcessList"
v-for="(value, index) in i.taskProcessList.filter(e=>!whiteTypes(e.type))"
:key="index"
>
<div>
@@ -149,31 +149,31 @@
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="课程公告" name="first">
<div class="notice">
{{data.remark || '暂无公告'}}
{{ data.remark || '暂无公告' }}
</div>
</el-tab-pane>
<el-tab-pane label="共享文档" name="second">
<!-- <div style="padding: 19px 30px 17px 28px">-->
<!-- <div-->
<!-- v-for="(value, index) in sharedoc"-->
<!-- :key="index"-->
<!-- style="-->
<!-- display: flex;-->
<!-- align-items: center;-->
<!-- margin-bottom: 15px;-->
<!-- "-->
<!-- >-->
<!-- <img :src="value.img" style="width: 22px; height: 26px"/>-->
<!-- <div class="sharedocname">{{ value.name }}</div>-->
<!-- <div class="download">-->
<!-- <img-->
<!-- src="../../assets/image/download.png"-->
<!-- style="width: 16px; height: 15px"-->
<!-- />-->
<!-- <div style="margin-left: 7px">下载</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div style="padding: 19px 30px 17px 28px">-->
<!-- <div-->
<!-- v-for="(value, index) in sharedoc"-->
<!-- :key="index"-->
<!-- style="-->
<!-- display: flex;-->
<!-- align-items: center;-->
<!-- margin-bottom: 15px;-->
<!-- "-->
<!-- >-->
<!-- <img :src="value.img" style="width: 22px; height: 26px"/>-->
<!-- <div class="sharedocname">{{ value.name }}</div>-->
<!-- <div class="download">-->
<!-- <img-->
<!-- src="../../assets/image/download.png"-->
<!-- style="width: 16px; height: 15px"-->
<!-- />-->
<!-- <div style="margin-left: 7px">下载</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</el-tab-pane>
</el-tabs>
</div>
@@ -200,9 +200,9 @@
<div style="margin-right: 5px">
{{ useInfo?.realName }}
</div>
<!-- <div v-for="(item, key) in data.userInfoBo?.medal" :key="key">-->
<!-- <img class="teacherMedal" :src="item"/>-->
<!-- </div>-->
<!-- <div v-for="(item, key) in data.userInfoBo?.medal" :key="key">-->
<!-- <img class="teacherMedal" :src="item"/>-->
<!-- </div>-->
</div>
<div class="introduce">{{ useInfo?.bandDesc }}</div>
</div>
@@ -350,7 +350,7 @@ import {useUserInfo} from "@/api/utils";
import store from "@/store";
const {
query: {routerId,routerName},
query: {routerId, routerName},
} = useRoute();
const router = useRouter();
const {data} = useRequest(ROUTER_PROCESS, {routerId});
@@ -402,13 +402,10 @@ const types = ref({
4: "/homeworkpage",
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
6: "/livebroadcast",
7: "1",
7: ({courseId}) => request(LINK_DETAILS(courseId), {}).then(({data: {linkAddress}}) => window.open(linkAddress)),//外联
8: "/discusspage",
9: "/moreactive",
10: [
import.meta.env.VITE_BOE_TEST_DETAIL_URL,
import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL,
], //测评
10: ({evaTyp, targetId}) => window.open((evaTyp === 1 ? import.meta.env.VITE_BOE_TEST_DETAIL_URL : import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL) + targetId), //测评
11: "/surveydetail",
12: "/ballotpage",
13: "/projectdetails",
@@ -416,51 +413,23 @@ const types = ref({
});
function toFinish(d, sName) {
console.log("ddd", d);
if (!types.value.path[d.type]) {
ElMessage.error("暂时未开放");
return;
}
if (d.type == 10) {
let url = "";
if (d.evaTyp == 1) {
url = types.value.path[d.type][1] + d.targetId;
} else {
url = types.value.path[d.type][0] + d.targetId;
}
window.open(url)
// import.meta.env.DEV
// ? (window.location.href = url)
// : (window.parent.location.href = url);
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)
types.value.path[d.type] && types.value.path[d.type].startsWith("/") && router.push({
path: types.value.path[d.type],
query: {id: d.routerTaskId, type: 1, courseId: d.courseId, pName: data.value.name, sName},
})
} else if (typeof types.value.path[d.type] === 'function') {
types.value.path[d.type](d)
}
if (types.value.path[d.type] && types.value.path[d.type].startsWith("http")) {
//配置文件
const url = types.value.path[d.type] + d.targetId;
// import.meta.env.DEV
// ? (window.location.href = url)
// : (window.parent.location.href = url);
window.open(url)
return;
}
if (d.type === 7) {
// console.log("url", d, url);
request(LINK_DETAILS(d.courseId), {}).then((res) => {
console.log("resssss", res);
if (res.code === 200) {
const url = res.data.linkAddress;
// import.meta.env.DEV
// ? (window.location.href = url)
// : (window.parent.location.href = url);
window.open(url)
}
});
return;
}
router.push({
path: types.value.path[d.type],
query: {id: d.routerTaskId, type: 1, courseId: d.courseId, pName: data.value.name, sName},
});
}
function whiteTypes(type){
return import.meta.env.VITE_TASK_WHITE_TYPE.includes(type+'')
}
</script>