feat:增加外部考试等

This commit is contained in:
lixg
2023-02-06 18:56:55 +08:00
parent 074c2da761
commit 5f60601581
14 changed files with 457 additions and 62 deletions

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-01-13 11:42:48
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-02-03 12:01:18
* @LastEditTime: 2023-02-06 18:39:13
* @FilePath: /stu_h5/src/api/api.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -54,4 +54,7 @@ export const VOTE_DETAIL_SUBMIT = `/voteSubmit/vote/commit post`
// -- 根据讨论的Id查询讨论发表的帖子
export const QueryDiscussSubmitDetailByDiscussId = '/discussSubmit/queryDiscussSubmitDetailByDiscussId post'
export const COMMENT_PRAISE = '/comment/praise post'
export const COMMENT_COLLECTION = '/comment/collection post'
export const COMMENT_COLLECTION = '/comment/collection post'
// 外部考试详情接口
export const EXTERNALEXAM = `/external/exam/queryExternalExam`

View File

@@ -41,7 +41,7 @@ export function usePage(_url, param, callback) {
};
}
export function useRequest(_url, params = {}) {
export function useRequest(_url, params = {}, callback) {
const state = reactive({
data: {},
@@ -58,6 +58,7 @@ export function useRequest(_url, params = {}) {
request(_url, params).then(r => {
state.data = r.data
state.loading = false
callback(r)
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-01-16 17:26:39
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-01-31 17:19:27
* @LastEditTime: 2023-02-06 17:58:35
* @FilePath: /stu_h5/src/components/ReturnHead.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -23,13 +23,20 @@
/>
<div style="margin-left: 5px; color: #2478ff">发布</div>
</div>
<div class="publish" v-else-if="showfile" @click="publishClick">
<div class="publish" v-else-if="showfile">
<img
style="width: 21px; height: 18px; margin-left: 25px; cursor: pointer"
src="../assets/image/file/file.png"
@click="goFileStorage"
/>
</div>
<div class="publish" v-else-if="ispublish" @click="goPublish">
<img
style="width: 14px; height: 14px"
src="../assets/image/publishDis.png"
/>
<div style="margin-left: 5px; color: #2478ff">发表</div>
</div>
<div class="publish" v-else></div>
</div>
@@ -48,6 +55,11 @@ export default {
type: Function,
default: null,
},
ispublish: {
type: Boolean,
default: false,
},
showfile: {
type: Boolean,
default: false,
@@ -66,7 +78,6 @@ export default {
props.publishWork && props.publishWork();
};
const goFileStorage = () => {
console.log("props.courseId", props.courseId);
router.push({
path: "/fileStorag",
query: {
@@ -74,10 +85,19 @@ export default {
},
});
};
const goPublish = () => {
router.push({
path: "/discussupload",
// query: {
// courseId: props.courseId,
// },
});
};
return {
returnclick,
publishClick,
goFileStorage,
goPublish,
};
},
};
@@ -101,7 +121,7 @@ export default {
margin-left: 11px;
}
.publish {
width: 46px;
width: 48px;
display: flex;
align-items: center;
}

View File

@@ -84,27 +84,72 @@
<div class="mani">
<div class="joininfo">参加投票</div>
<div class="line"></div>
<div class="contentone">
<div class="contentone" style="margin-top: 15px">
<div class="ballotjoincontainer">
<div class="ballotjoin">
<div
class="ballotitem"
v-for="(item, index) in ballot"
:key="item.id"
v-for="(item, index) in data?.ballotVo?.voteStemVoList"
:key="index"
>
<div class="upitem">
<div class="stem">
{{ item.voteStemName }}
</div>
<div
class="upitem"
v-for="(elem, key) in item?.optionDetailList"
:key="key"
>
<div class="left">
<img
class="leftimg"
src="../../assets/image/ballotpage/left.png"
/>
<div class="leftcontent">{{ item.content }}</div>
<div class="leftcontent">{{ elem.optionName }}</div>
</div>
<button class="btn" @click="getId(item.id)">投票</button>
<button
class="btn"
:style="{
backgroundColor: elem.isAnswer ? '#ddd' : '#2478ff',
}"
@click="choiceQuestion(key, elem.optionId, data, index)"
>
投票
</button>
</div>
<div
:class="index === ballot.length - 1 ? null : 'thinline'"
></div>
<!-- <div
:class="
index === data?.ballotVo?.voteStemVoList.length - 1
? null
: 'thinline'
"
></div> -->
</div>
<div
style="
width: 100%;
display: flex;
justify-content: center;
margin-top: 30px;
"
>
<button
class="submitbtn btn01"
:style="{
background:
new Date().getTime() >
new Date(data.voteEndTime).getTime() ||
new Date().getTime() <
new Date(data.voteStartTime).getTime()
? '#ccc'
: data.isSubmit
? '#ccc'
: '',
}"
@click="submitVote(data)"
>
{{ data.isSubmit ? "已提交" : "提交" }}
</button>
</div>
</div>
</div>
@@ -182,9 +227,106 @@ const state = reactive({
},
],
});
// 答题时间
const answerTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss");
// 选择题目
const choiceQuestion = (order, id, dates, torder) => {
console.log("dates", dates);
// 当已经提交过时候 不让选择题目
if (data.value.isSubmit) {
return;
}
console.log("当前选择题目的id及序号", order, id, dates, torder);
for (
let i = 0;
i < dates.ballotVo.voteStemVoList[torder].optionDetailList.length;
i++
) {
dates.ballotVo.voteStemVoList[torder].optionDetailList[i].isAnswer = false;
}
dates.ballotVo.voteStemVoList[torder].optionDetailList[order].isAnswer = true;
console.log(data);
};
// 提交投票
const submitVote = () => {
console.log("投票详情", data.value);
let nowTime = new Date().getTime();
let maxTime = new Date(data.value.voteEndTime).getTime();
let minTime = new Date(data.value.voteStartTime).getTime();
console.log(nowTime, maxTime, minTime);
// 当未到开始时间
if (nowTime < minTime || nowTime > maxTime) {
ElMessage.error("未到投票开始时间");
return;
}
const getId = (id) => {
console.log(id);
// 当已经提交过时候 不让提交即可
if (data.value.isSubmit) {
return;
}
data.value.isSubmit = true;
let isSubmit = true;
let isSubArr = [];
console.log(
" data.ballotVo.voteStemVoList",
data.value.ballotVo.voteStemVoList
);
for (let i = 0; i < data.value.ballotVo.voteStemVoList.length; i++) {
for (
let j = 0;
j < data.value.ballotVo.voteStemVoList[i].optionDetailList.length;
j++
) {
if (data.value.ballotVo.voteStemVoList[i].optionDetailList[j].isAnswer) {
isSubArr[i] =
data.value.ballotVo.voteStemVoList[i].optionDetailList[j].isAnswer;
break;
} else {
isSubArr[i] = false;
}
}
}
for (let i = 0; i < isSubArr.length; i++) {
if (isSubArr[i] == false) {
isSubmit = false;
}
}
if (isSubmit == false) {
ElMessage.error("请选择投票问题后进行提交");
return;
}
let obj = {
beginTime: answerTime,
chapterOrStageId: chapterOrStageId ? chapterOrStageId : 0,
result: JSON.stringify(data.value),
targetId: infoId, // 项目 路径图 id
taskId: id,
type: btype, // 1 项目 2 路径图
voteId: data.value.voteId,
};
console.log("我是投票提交的信息", obj);
useRequest(VOTE_DETAIL_SUBMIT, obj, (e) => {
console.log("eeeeeee", e);
request(VOTE_DETAIL2, {
chapterOrStageId: chapterOrStageId ? chapterOrStageId : 0,
courseId: courseId,
studentId: studentId,
targetId: infoId,
type: btype,
})
.then((res) => {
console.log("投票结果", res);
ElMessage.success("投票成功");
data.value = res.data;
})
.catch((err) => {
console.log(err);
});
});
};
</script>
@@ -317,13 +459,35 @@ const getId = (id) => {
width: 100%;
justify-content: center;
.ballotjoin {
width: 85%;
width: 100%;
// height:100px;
// background-color: #bfa;
.ballotitem {
.upitem {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
.stem {
width: 95%;
height: 49px;
background: #f2f5f7;
border-radius: 10px;
display: flex;
align-items: center;
font-size: 14px;
font-weight: bold;
color: #333330;
line-height: 24px;
padding-left: 5%;
}
.upitem {
width: 90%;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid rgba(241, 242, 243, 1);
height: 50px;
.left {
display: flex;
.leftimg {
@@ -358,6 +522,20 @@ const getId = (id) => {
margin-bottom: 17px;
}
}
.submitbtn {
width: 73px;
height: 30px;
background: #2478ff;
box-shadow: 0px 1px 4px 0px rgba(56, 125, 247, 0.7);
border-radius: 2px;
// width: 66px;
font-size: 14px;
font-weight: 800;
color: #ffffff;
line-height: 24px;
border: 0;
cursor: pointer;
}
}
}
}

View File

@@ -1,7 +1,7 @@
<template>
<div class="discussdetail">
<!-- <TitleHead text="【直播】管理者进阶腾飞班 - 毕业典礼"></TitleHead> -->
<ReturnHead text="评论详情"></ReturnHead>
<div class="tithead">
<div class="headin">
<div class="vaa">
@@ -155,12 +155,12 @@
<script>
import { reactive, toRefs } from "vue";
// import TitleHead from "@/components/TitleHead.vue";
import px from '@/assets/image/discuss/px.jpg'
import ReturnHead from "@/components/ReturnHead.vue";
import px from "@/assets/image/discuss/px.jpg";
export default {
name: "DiscussDetail",
components: {
// TitleHead,
ReturnHead,
},
setup() {
const state = reactive({
@@ -208,7 +208,7 @@ export default {
.discussdetail {
width: 100%;
.tithead {
margin-top: 20px;
margin-top: 10px;
height: 77px;
width: 100%;
display: flex;

View File

@@ -1,6 +1,6 @@
<template>
<div class="discusspage">
<ReturnHead text="讨论详情"></ReturnHead>
<ReturnHead text="讨论详情" :ispublish="true"></ReturnHead>
<div class="head clearfix">
<div class="title">{}</div>
</div>
@@ -38,13 +38,16 @@
<div class="thinline"></div>
<div class="bott">
<div class="dicon">
<div class="imgcont">
<div class="imgcont" @click="goDetails">
<img
class="imgs"
src="../../assets/image/discuss/pinglun.png"
/>
<div class="samei" style="margin-top: 2px">
{{ item.pinglun }}
</div>
</div>
<div class="samei">{{ item.pinglun }}</div>
<div class="imgcont">
<img
v-if="item.isGood"
@@ -60,9 +63,12 @@
class="imgs"
src="../../assets/image/discuss/dianzan.png"
/>
</div>
<div :class="item.isGood ? 'sameii' : 'samei'">
{{ item.dianzan }}
<div
:class="item.isGood ? 'sameii' : 'samei'"
style="margin-top: 2px"
>
{{ item.dianzan }}
</div>
</div>
</div>
</div>
@@ -88,7 +94,7 @@ import {
DISCUSS_LIST,
QueryDiscussSubmitDetailByDiscussId,
} from "@/api/api";
const router = useRouter();
const state = reactive({
onfo: true,
discuss: [
@@ -151,6 +157,16 @@ const {
} = useRoute();
const { data } = useRequest(DISCUSS_LIST, { id: 23, type });
console.log("获取讨论", data);
//跳转到讨论详情
const goDetails = () => {
router.push({
path: "/discussdetail",
// query: {
// courseId: props.courseId,
// },
});
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
@@ -314,6 +330,8 @@ console.log("获取讨论", data);
// background-color: #bfa;
.imgcont {
margin-top: 10px;
display: flex;
align-items: center;
.imgs {
width: 14px;
height: 14px;

View File

@@ -1,4 +1,9 @@
<template>
<ReturnHead
text="发讨论"
:showpublish="true"
:publishWork="publishWork"
></ReturnHead>
<div
class="discussupload"
:style="{
@@ -37,17 +42,25 @@
<script>
import { reactive, toRefs } from "vue";
import ReturnHead from "@/components/ReturnHead.vue";
export default {
name: "UploadWork",
components: {},
components: {
ReturnHead,
},
setup() {
const state = reactive({
text: "",
textarea: "",
screenHeight: document.body.clientHeight, // 屏幕高度
});
//发布讨论
const publishWork = () => {
console.log("点击了发布");
};
return {
...toRefs(state),
publishWork,
};
},
};
@@ -66,7 +79,7 @@ clearfix:after {
background-color: #fff;
// margin-top: 73.5px;
.inputcontainer {
margin-top: 20px;
margin-top: 10px;
background-color: #fff;
width: 100%;
// height: 100px;

View File

@@ -0,0 +1,118 @@
<!--
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-02-06 18:26:23
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-02-06 18:51:05
* @FilePath: /stu_h5/src/views/examination/ExternalExam.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="externalexam">
<ReturnHead text="考试详情"></ReturnHead>
<div class="notice">
<div class="noticebox">
<div class="main">
<div class="e_title">考试{{ state.datainfo?.externalName }}</div>
<div class="et_detail">
数据来源
<div class="et_time">
{{ state.datainfo.source ? state.datainfo.source : "-" }}
</div>
</div>
</div>
</div>
<div class="noticebox">
<div class="btnbox">考试说明</div>
<div class="e_form">
{{
state.datainfo.externalExplain
? state.datainfo.externalExplain
: "暂无考试说明"
}}
</div>
</div>
</div>
</div>
</template>
<script setup>
import ReturnHead from "@/components/ReturnHead.vue";
import { useRequest, request } from "@/api/request";
import { EXTERNALEXAM } from "@/api/api";
import { reactive } from "vue";
import { useRoute, useRouter } from "vue-router/dist/vue-router";
const {
query: { courseId },
} = useRoute();
const state = reactive({
datainfo: {},
});
//获取基本信息
request(EXTERNALEXAM, { externalId: courseId })
.then((res) => {
console.log("获取考试", res);
state.datainfo = res.data;
})
.catch((err) => {
console.log(err);
});
</script>
<style lang="scss" scoped>
.externalexam {
width: 100%;
background-color: #f2f5f7;
.notice {
width: 100%;
margin-top: 10px;
font-size: 14px;
}
.noticebox {
width: 100%;
background: #fff;
margin-bottom: 11.5px;
.main {
width: 90%;
margin: 0 auto;
padding-top: 18px;
padding-bottom: 18px;
}
}
.e_title {
margin-bottom: 14.5px;
font-weight: 600;
}
.et_detail {
display: flex;
margin-bottom: 11.5px;
align-items: center;
.et_time {
color: #6e7b84;
}
}
.btnbox {
width: 100%;
height: 50px;
border-bottom: 1px solid #f1f2f3;
display: flex;
align-items: center;
font-size: 16px;
font-weight: bold;
color: #0d233a;
line-height: 24px;
padding-left: 5%;
}
.e_form {
width: 90%;
min-height: 40px;
display: flex;
flex-direction: column;
font-size: 12px;
color: #6e7b84;
margin-left: 5%;
line-height: 30px;
margin-top: 20px;
}
}
</style>

View File

@@ -16,7 +16,7 @@
<div class="answerLcontainer">
<div class="answerL">
<div>完全没用</div>
<div>非常</div>
<div>非常有帮助/启发</div>
</div>
</div>
<div class="answer">
@@ -60,7 +60,6 @@
<div
v-for="(values, indexs) in value.assessmentSingleChoiceVoList"
:key="indexs"
style="display: flex; align-items: center"
:style="{ 'margin-top': '22px' }"
@click="
() => {
@@ -74,20 +73,32 @@
}
"
>
<img
style="width: 14px; height: 14px"
:src="values.select ? checkbox : checkbox2"
/>
<div
class="people"
style="
font-size: 13px;
margin-left: 7px;
margin-top: -2.5px;
"
>
{{ values.singleOptionName }}
<div style="display: flex; align-items: center">
<img
style="width: 14px; height: 14px"
:src="values.select ? checkbox : checkbox2"
/>
<div
class="people"
style="
font-size: 13px;
margin-left: 7px;
margin-top: -2.5px;
"
>
{{ values.singleOptionName }}
</div>
</div>
<img
v-if="values.singleOptionPictureAddress"
:src="values.singleOptionPictureAddress"
style="
width: 70px;
height: 70px;
margin-left: 20px;
margin-top: 10px;
"
/>
</div>
</div>
</div>

View File

@@ -186,6 +186,7 @@ const types = ref({
3: import.meta.env.VITE_BOE_CASS_DETAIL_URL, //案例
4: "/homeworkpage",
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
// 5: "/externalexam",
6: "/liveboradcast",
7: "/outerchain", //外联
// 7: ({ targetId }) => window.open(targetId, "_top"), //外联
@@ -252,6 +253,16 @@ function toFinish(d) {
dialogVisible.value = true;
return;
}
// 此处判断外部考试跳转
if (d.startTime == null || d.endTime == null) {
router.push({
path: "/externalexam",
query: {
courseId: d.courseId,
},
});
return;
}
}
// 评估 停用
if (d.type == 11) {
@@ -321,6 +332,7 @@ function toFinish(d) {
status: d.status,
targetId: d.targetId,
evaType: d.evaType,
btype: 2,
},
});
} else if (typeof types.value.path[d.type] === "function") {

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-01-19 11:28:11
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-02-02 16:42:01
* @LastEditTime: 2023-02-06 16:35:56
* @FilePath: /stu_h5/src/views/projectdetails/ProjectPath.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -181,7 +181,7 @@ const handleClick = (tab, event) => {
const goDetails = () => {
router.push({
path: "/pathmappage",
query: { routerId: 2 },
query: { routerId: 290 },
});
// router.push({
// path: "/projectdetails",

View File

@@ -226,19 +226,21 @@ const types = ref({
3: import.meta.env.VITE_BOE_CASS_DETAIL_URL, //案例
4: "/homeworkpage",
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
// 5: "/externalexam",
6: "/livebroadcast",
7: ({ targetId }) => window.open(targetId, "_top"),
8: "/discusspage",
9: "/moreactive",
10: ({ evaType, targetId }) =>
window.open(
evaType == 0
? import.meta.env.VITE_BOE_TEST_DETAIL_URL + targetId
: import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL +
targetId +
`&quizTaskKid=${projectId}&channelCode=project`,
"_top"
), //测评
// 10: ({ evaType, targetId }) =>
// window.open(
// evaType == 0
// ? import.meta.env.VITE_BOE_TEST_DETAIL_URL + targetId
// : import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL +
// targetId +
// `&quizTaskKid=${projectId}&channelCode=project`,
// "_top"
// ), //测评
10: "/evaluation", //测评
11: "/surveydetail",
12: "/ballotpage",
13: "/projectdetails",
@@ -341,6 +343,16 @@ function toFinish(d, sName, chapterOrStageId) {
dialogVisible.value = true;
return;
}
// 此处判断外部考试跳转
if (d.startTime == null || d.endTime == null) {
router.push({
path: "/externalexam",
query: {
courseId: d.courseId,
},
});
return;
}
}
// 评估 停用
if (d.type == 11) {
@@ -410,7 +422,12 @@ function toFinish(d, sName, chapterOrStageId) {
courseId: d.courseId,
pName: data.value.name,
sName,
chapterOrStageId,
chapterOrStageId: data.value.currentStageId,
studentId: userInfo.value.id,
status: d.status,
targetId: d.targetId,
evaType: d.evaType,
btype: 1,
},
});
} else if (typeof types.value.path[d.type] === "function") {

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-01-13 11:42:48
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-02-02 17:45:36
* @LastEditTime: 2023-02-06 18:39:40
* @FilePath: /stu_h5/vite.config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -105,6 +105,10 @@ export default defineConfig(({ command, mode }) =>
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
changeOrigin: true,
},
'/external/exam/queryExternalExam': {
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
changeOrigin: true,
},
}
}