| | |
| | | /* |
| | | * @Author: Morpheus |
| | | * @Date: 2021-07-31 16:31:54 |
| | | * @Last Modified by: liu |
| | | * @Last Modified time: 2021-12-13 14:37:49 |
| | | * menu-name 考试管理 |
| | | */ |
| | | /* * @Author: Morpheus * @Date: 2021-07-31 16:31:54 * @Last Modified by: liu * |
| | | @Last Modified time: 2021-12-13 14:37:49 * menu-name 考试管理 */ |
| | | <template> |
| | | <!-- <div class="exam"> |
| | | <button class="logout" |
| | |
| | | </div> |
| | | </template> |
| | | |
| | | |
| | | <script> |
| | | import CountDown from "vue2-countdown"; |
| | | import { getCurrentTime } from "@/api/exam/examRecord"; |
| | |
| | | import { |
| | | getExamDetail, |
| | | getNowTime, |
| | | calculations, |
| | | calculations |
| | | } from "@/api/examapi/examination"; |
| | | import { updateApplyStatus } from "@/api/examapi/applyexam"; |
| | | import moment from "moment"; |
| | |
| | | messageSuccess, |
| | | messageFail, |
| | | messageWarn, |
| | | isNotEmpty, |
| | | isNotEmpty |
| | | } from "@/util/util"; |
| | | export default { |
| | | components: { |
| | | CountDown, |
| | | CountDown |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | span: 8, |
| | | data: [ |
| | | { |
| | | list: [], |
| | | }, |
| | | ], |
| | | }, |
| | | list: [] |
| | | } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapState({ |
| | | userInfo: (state) => state.user.userInfo, |
| | | }), |
| | | userInfo: state => state.user.userInfo |
| | | }) |
| | | }, |
| | | mounted() { |
| | | //获取数据 |
| | |
| | | }, |
| | | methods: { |
| | | //继续考试时间 |
| | | countDownS_c: function () { |
| | | countDownS_c: function() { |
| | | // console.log(12112); |
| | | messageSuccess(this, "请继续考试"); |
| | | // this.startTime = this.getCurrentTimes(); |
| | | }, |
| | | countDownE_c: function () { |
| | | countDownE_c: function() { |
| | | messageWarn(this, "考试结束123"); |
| | | this.overExam(); |
| | | // this.disableSubmit = true; |
| | |
| | | this.$confirm("是否退出系统, 是否继续?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }).then(() => { |
| | | this.$store.dispatch("LogOut").then(() => { |
| | | this.$router.push({ path: "/login" }); |
| | |
| | | console.log(that.resData); |
| | | that.$router.push({ |
| | | path: `/startexam/${that.resData.scoreId}`, |
| | | query: that.resData, |
| | | query: that.resData |
| | | }); |
| | | return; |
| | | } |
| | |
| | | if (this.isTime == 3) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "未到考试时间!", |
| | | message: "未到考试时间!" |
| | | }); |
| | | return; |
| | | } |
| | |
| | | if (this.isTime == 1) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "已过考试时间!", |
| | | message: "已过考试时间!" |
| | | }); |
| | | return; |
| | | } |
| | |
| | | examType: this.resData.examType, |
| | | examId: this.resData.id, |
| | | userId: this.userInfo.user_id, |
| | | candidateNo: this.resData.candidateNo, |
| | | candidateNo: this.resData.candidateNo |
| | | }; |
| | | // this.$notify({ |
| | | // message: |
| | |
| | | // // type: "warning", |
| | | // }); |
| | | // return; |
| | | updateApplyStatus(data).then((res) => { |
| | | updateApplyStatus(data).then(res => { |
| | | that.resData["examScoreId"] = res.data.id; |
| | | this.$store.commit("SetScoreId", res.data.id); |
| | | // console.log(res.data.id, "ididididiidididididid"); |
| | |
| | | "考试期间切勿退出登入、关闭浏览器, 否则考试成绩无效, 如有问题及时联系管理人员!", |
| | | duration: 6000, |
| | | showClose: false, |
| | | customClass: "beginS", |
| | | customClass: "beginS" |
| | | // type: "warning", |
| | | }); |
| | | that.$router.push({ |
| | | path: `/startexam/${that.resData.id}`, |
| | | query: that.resData, |
| | | query: that.resData |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | color: color, |
| | | isExam: isExam, |
| | | subtext: subtext, |
| | | click: function () { |
| | | click: function() { |
| | | window.parent.startExam(); |
| | | }, |
| | | list: [ |
| | | { |
| | | title: "姓名: ", |
| | | value: that.resData.realName, |
| | | check: true, |
| | | check: true |
| | | }, |
| | | { |
| | | title: "准考证号: ", |
| | | value: that.resData.candidateNo, |
| | | check: true, |
| | | check: true |
| | | }, |
| | | { |
| | | title: "身份证号: ", |
| | | value: that.resData.idCardNo, |
| | | check: true, |
| | | check: true |
| | | }, |
| | | { |
| | | title: "性别: ", |
| | | value: that.sex, |
| | | check: true, |
| | | }, |
| | | ], |
| | | }, |
| | | check: true |
| | | } |
| | | ] |
| | | } |
| | | ]; |
| | | that.$store.commit("SetexamUserData", that.option.data[0]); |
| | | }; |
| | | var duibiTime = function (newTime, oldTime) { |
| | | var duibiTime = function(newTime, oldTime) { |
| | | var newYear = newTime.split(" ")[0], |
| | | newDat = newTime.split(" ")[1], |
| | | oldYear = oldTime.split(" ")[0], |
| | |
| | | let newD = { |
| | | s: +newDat.split(":")[0], |
| | | f: +newDat.split(":")[1], |
| | | m: +newDat.split(":")[2], |
| | | m: +newDat.split(":")[2] |
| | | }; |
| | | let oldD = { |
| | | s: +oldDat.split(":")[0], |
| | | f: +oldDat.split(":")[1], |
| | | m: +oldDat.split(":")[2], |
| | | m: +oldDat.split(":")[2] |
| | | }; |
| | | if (newD.s - oldD.s > 1) { |
| | | return false; |
| | |
| | | }; |
| | | |
| | | var data = { |
| | | userId:this.userInfo.user_id |
| | | } |
| | | userId: this.userInfo.user_id |
| | | }; |
| | | getExamDetail(data).then( |
| | | (res) => { |
| | | res => { |
| | | that.resData = res.data.data[0]; |
| | | |
| | | var data = res.data.data[0]; |
| | |
| | | startD = new Date(data.startTime), |
| | | //考试截止时间 |
| | | endD = new Date(data.endTime); |
| | | getNowTime().then((res) => { |
| | | getNowTime().then(res => { |
| | | nowD = new Date(res.data.data); |
| | | //对比时间 |
| | | //getTime() 方法可返回距 1970 年 1 月 1 日之间的毫秒数。 |
| | |
| | | setData({ color: "success", subtext: "继续考试", isExam: 3 }); |
| | | const currentTimeSTART = moment(data.examStartTime); |
| | | const currentSTART = currentTimeSTART.valueOf(); |
| | | getCurrentTime().then((response) => { |
| | | getCurrentTime().then(response => { |
| | | that.currentTime = currentSTART; |
| | | that.startTime = currentSTART; |
| | | var listTime = duibiTime( |
| | |
| | | }); |
| | | }, |
| | | |
| | | (error) => { |
| | | error => { |
| | | window.console.log(error); |
| | | } |
| | | ); |
| | |
| | | confirmButtonText: "确定", |
| | | callback: () => { |
| | | calculations(scoreId) |
| | | .then((response) => { |
| | | .then(response => { |
| | | messageSuccess(that, "提交成功"); |
| | | if (response) { |
| | | that.$store.commit("DEL_TAG", that.$store.state.tags.tag); |
| | | var obj = { |
| | | userId: that.userInfo.user_id, |
| | | examId: that.$route.query.id, |
| | | examId: that.$route.query.id |
| | | }; |
| | | that.$router.push({ |
| | | path: `/singleperformance/index`, |
| | | query: obj, |
| | | query: obj |
| | | }); |
| | | } |
| | | }) |
| | |
| | | that.disableSubmit = false; |
| | | messageFail(that, "提交题目失败"); |
| | | }); |
| | | }, |
| | | } |
| | | }); |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style lang="scss"> |
| | |
| | | position: relative; |
| | | // top: -20px; |
| | | } |
| | | //最终 |
| | | .startexam { |
| | | //登入页面样式 |
| | | // border: 1px solid red; |
| | | width: calc(100% - 100px); |
| | | height: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | flex-direction: column; |
| | | .startexam_heard { |
| | | font-size: 34px; |
| | | color: rgb(240, 114, 29); |
| | | margin-bottom: 5%; |
| | | // position: absolute; |
| | | // top: 10%; |
| | | } |
| | | .startexam_main { |
| | | width: 960px; |
| | | height: 300px; |
| | | // border: 1px solid red; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | background-color: #fff; |
| | | box-shadow: 0px 0px 5px 3px rgba($color: #797979, $alpha: 0.2); |
| | | .s_m_img { |
| | | width: 50%; |
| | | height: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | img { |
| | | width: 90%; |
| | | height: 90%; |
| | | } |
| | | } |
| | | .s_m_value { |
| | | width: 50%; |
| | | height: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | flex-direction: column; |
| | | div { |
| | | width: 90%; |
| | | height: 15%; |
| | | font-size: 17px; |
| | | .s_m_v_title { |
| | | display: inline-block; |
| | | width: 100px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //最终 |
| | | .startexamOld { |
| | | // width: 100%; |
| | | // height: 100%; |
| | | // border: 1px solid red; |
| | |
| | | .startexam_heard { |
| | | font-size: 34px; |
| | | color: rgb(240, 114, 29); |
| | | position: relative; |
| | | top: -10%; |
| | | position: absolute; |
| | | top: 10%; |
| | | } |
| | | .startexam_main { |
| | | width: 960px; |