+保按考试系统,动态提出滚动条,解决1366分辨率题目完成按钮点不到,改签到系统搜索栏和字段位置
| | |
| | | import router from './router/router'; |
| | | import './permission'; // 权限 |
| | | import './error'; // 日志 |
| | | import './cache';//页面缓存 |
| | | import './cache'; //页面缓存 |
| | | import store from './store'; |
| | | import { loadStyle } from './util/util' |
| | | import { |
| | | loadStyle |
| | | } from './util/util' |
| | | import * as urls from '@/config/env'; |
| | | import Element from 'element-ui'; |
| | | import { |
| | |
| | | }); |
| | | |
| | | Vue.config.productionTip = false; |
| | | // Window.onresize 事件 动态调整窗口 |
| | | import "@/store/onresize"; |
| | | |
| | | new Vue({ |
| | | let myVue = new Vue({ |
| | | router, |
| | | store, |
| | | i18n, |
| | | render: h => h(App) |
| | | }).$mount('#app'); |
| | | |
| | | export default myVue |
| | |
| | | total: 0, |
| | | pageSizes: [15, 30, 50, 100], |
| | | }, |
| | | windowWidth: 1025, |
| | | windowWidth: window.innerWidth, |
| | | windowHeight: window.innerHeight, |
| | | tableWindowHeight: window.innerHeight, |
| | | screenSize: window.screen.width, |
| | | screenHeight: window.screen.height, |
| | | updown: true, |
| | | }, |
| | | actions: { |
| | | changeZoom({ |
| | | state, |
| | | commit, |
| | | dispatch |
| | | }, data) { |
| | | if (window.innerWidth <= 1396 && window.innerHeight <= 798) { |
| | | // var devicewidth = document.documentElement.clientWidth; //获取当前分辨率下的可是区域宽度 |
| | | // console.log(devicewidth) |
| | | let devicewidth = 1143; |
| | | var scale = devicewidth / 1366; // 分母——设计稿的尺寸 |
| | | document.body.style.zoom = scale; //放大缩小相应倍数 |
| | | // console.log("应用1366*768") |
| | | } else { |
| | | if (document.body.style.zoom != 1) { |
| | | document.body.style.zoom = 1; |
| | | // console.log("还原缩放") |
| | | } |
| | | } |
| | | // return; |
| | | //监听可视高度 |
| | | Object.defineProperty(state, "tableWindowHeight", { |
| | | set: function (key, value) { |
| | | // //此处拦截了设置请求 |
| | | // window.console.log(key, value, "tableWindowHeight"); |
| | | //获取答题区域subject_main |
| | | let subject_main = document.querySelector(".subject_main"); |
| | | // console.log(subject_main) |
| | | //获取卡片区域 |
| | | let exam_card_body = document.querySelector(".exam-card-body"); |
| | | // console.log(subject_exam_title.offsetHeight); |
| | | //获取标题 |
| | | let subject_exam_title = document.querySelector(".subject-exam-title"); |
| | | // console.log(subject_exam_title); |
| | | if (subject_main && exam_card_body && subject_exam_title) { |
| | | let ecbh = exam_card_body.offsetHeight; |
| | | let seth = subject_exam_title.offsetHeight; |
| | | console.log(ecbh - seth); |
| | | subject_main.style.maxHeight = ecbh - seth - 60 + "px"; |
| | | } |
| | | }, |
| | | }); |
| | | state.tableWindowHeight + 1; |
| | | }, |
| | | }, |
| | | mutations: { |
| | | setWindowSize: (state, data) => { |
| | | state.windowWidth = data.innerWidth; |
| | | // console.log(data) |
| | | state.windowHeight = data.innerHeight; |
| | | }, |
| | | setScreenSize(state, data) { |
| | | state.screenSize = data.w <= 1366 && data.h <= 768 ? 1366 : data.w; |
| | | state.screenHeight = data.h; |
| | | }, |
| | | setWindowSizeHeight: (state, data) => { |
| | | state.tableWindowHeight = data; |
| | | }, |
| | | setWindowSizeHeightAdd: (state, data) => { |
| | | setTimeout(() => { |
| | | if (state.updown) { |
| | | state.tableWindowHeight += 1; |
| | | state.updown = false; |
| | | } else { |
| | | state.tableWindowHeight -= 1; |
| | | state.updown = true; |
| | | } |
| | | }, 0); |
| | | }, |
| | | } |
| | | }; |
| | |
| | | |
| | | // 设置 init 函数 |
| | | function init() { |
| | | if (_this) { |
| | | let innerWH = { |
| | | innerWidth: window.innerWidth, |
| | | innerHeight: window.innerHeight, |
| | | } |
| | | _this.$store.commit('setWindowSize', innerWH); |
| | | // console.log(' window.innerWidth', window.innerWidth); |
| | | // console.log(' window.innerHeight', window.innerHeight); |
| | | |
| | | if (_this) { |
| | | let innerWH = { |
| | | innerWidth: window.innerWidth, |
| | | innerHeight: window.innerHeight, |
| | | } |
| | | _this.$store.commit('setWindowSize', innerWH); |
| | | // console.log(' window.innerWidth', window.innerWidth); |
| | | // console.log(' window.innerHeight', window.innerHeight); |
| | | _this.$store.commit("setWindowSizeHeight", innerWH.innerHeight); |
| | | _this.$store.commit("setScreenSize", { |
| | | w: window.screen.width, |
| | | h: window.screen.height |
| | | }); |
| | | _this.$store.dispatch("changeZoom"); |
| | | } |
| | | } |
| | | |
| | | // 节流 ms 触发间隔毫秒 |
| | |
| | | var lastClick = Date.now() - ms; |
| | | // 初始化 |
| | | setTimeout(() => { |
| | | init(); |
| | | init(); |
| | | }, 500); |
| | | // 改变窗口大小时重新设置 rem |
| | | // window.onresize = function () { |
| | |
| | | // } |
| | | // } |
| | | window.addEventListener('resize', () => { |
| | | // 节流 |
| | | if (Date.now() - lastClick >= ms) { |
| | | init(); |
| | | lastClick = Date.now(); |
| | | } |
| | | }, false) |
| | | // 节流 |
| | | if (Date.now() - lastClick >= ms) { |
| | | init(); |
| | | lastClick = Date.now(); |
| | | } |
| | | }, false) |
| | |
| | | line-height: 26px !important; |
| | | letter-spacing: 0.1rem !important; |
| | | } |
| | | .subject-options > li label { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | } |
| | | .subject-option-prefix { |
| | | font-size: 24px !important; |
| | |
| | | // } |
| | | |
| | | .avue-crud__search .avue-form__group.avue-form__group--flex .avue-form__menu--center { |
| | | width: 115px !important; |
| | | width: 118px !important; |
| | | } |
| | | .avue-crud__search .avue-form__group.avue-form__group--flex .avue-form__row { |
| | | padding: 0 !important; |
| | |
| | | /* |
| | | * @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; |
| | |
| | | return { |
| | | tabs: "", |
| | | userName: "", |
| | | activeName: "first", |
| | | activeName: "first" |
| | | }; |
| | | }, |
| | | components: { |
| | | tables, |
| | | forms, |
| | | signIn, |
| | | signIn |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo"]), |
| | | ...mapGetters(["userInfo"]) |
| | | }, |
| | | watch: { |
| | | userInfo() { |
| | | // console.log(userInfo); |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.userName = this.userInfo.account; |
| | |
| | | this.$confirm(this.$t("logoutTip"), this.$t("tip"), { |
| | | confirmButtonText: this.$t("submitText"), |
| | | cancelButtonText: this.$t("cancelText"), |
| | | type: "warning", |
| | | type: "warning" |
| | | }).then(() => { |
| | | this.$store.dispatch("LogOut").then(() => { |
| | | resetRouter(); |
| | | this.$router.push({ path: "/login" }); |
| | | }); |
| | | }); |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style lang="scss"> |
| | |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | prop: "idCardNo", |
| | | search: true, |
| | | searchSpan: 9, |
| | | searchLabelWidth: 85, |
| | | searchLabelWidth: 90, |
| | | // searchRange: true, |
| | | // searchValue: this.getuserid(), |
| | | width: 180 |
| | |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | total: 0 |
| | | }, |
| | | query: {}, |
| | | data: [], |
| | |
| | | search: true, |
| | | searchSpan: 5, |
| | | searchLabelWidth: 45, |
| | | width: 70, |
| | | width: 70 |
| | | }, |
| | | { |
| | | label: "公司", |
| | | prop: "deptName", |
| | | search: true, |
| | | searchSpan: 6, |
| | | searchLabelWidth: 45, |
| | | searchLabelWidth: 45 |
| | | }, |
| | | { |
| | | label: "身份证号码", |
| | | prop: "idCardNo", |
| | | search: true, |
| | | searchSpan: 8, |
| | | searchLabelWidth: 80, |
| | | searchLabelWidth: 90, |
| | | // searchRange: true, |
| | | // searchValue: this.getuserid(), |
| | | width: 180, |
| | | }, |
| | | width: 180 |
| | | } |
| | | ], |
| | | delBtn: false, |
| | | editBtn: false, |
| | | addBtn: false, |
| | | }, |
| | | addBtn: false |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | "cardInfor", |
| | | "permission", |
| | | "haveCardid", |
| | | "useZhiWen", |
| | | ]), |
| | | "useZhiWen" |
| | | ]) |
| | | // permissionList() { |
| | | // return { |
| | | // addBtn: this.vaildData(this.permission.notice_add, false), |
| | |
| | | this.onLoad( |
| | | this.page, |
| | | { |
| | | idCardNo: this.cardInfor.id, |
| | | idCardNo: this.cardInfor.id |
| | | }, |
| | | "shibie" |
| | | ); |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | // let dom = document.getElementsByClassName("el-table--small"); |
| | |
| | | // console.log("不刷新"); |
| | | // } |
| | | let t = this; |
| | | window.addEventListener("resize", function () { |
| | | window.addEventListener("resize", function() { |
| | | t.resetHeight(); |
| | | }); |
| | | t.resetHeight(); |
| | |
| | | }, |
| | | getZhiwen(row) { |
| | | let that = this; |
| | | getZhiwen(row.userId).then((res) => { |
| | | getZhiwen(row.userId).then(res => { |
| | | // console.log(res); |
| | | let zhiwen = { |
| | | featuredatas: res.data.data.myPicture, |
| | | imgBMP: res.data.data.fingerprint, |
| | | // url: row.fingerprint, |
| | | isoks: false, |
| | | isoks: false |
| | | }; |
| | | if ( |
| | | zhiwen.featuredatas != "" && |
| | |
| | | registered: row.registered, |
| | | fingerprint: row.fingerprint, |
| | | myPicture: row.myPicture, |
| | | candidateNo: row.candidateNo, |
| | | candidateNo: row.candidateNo |
| | | }; |
| | | upData(b).then((res) => { |
| | | upData(b).then(res => { |
| | | const data = res.data; |
| | | // console.log(data); |
| | | if (data.code == 200) { |
| | |
| | | this.$confirm("签到成功!", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "指纹采集", |
| | | type: "success", |
| | | type: "success" |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "请继续放入身份证进行识别!", |
| | | message: "请继续放入身份证进行识别!" |
| | | }); |
| | | this.$store.commit("setIsClears", true); |
| | | // this.$store.commit("setCardidState", false); |
| | |
| | | // }); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "请采集指纹并点击更新进行签到!", |
| | | message: "请采集指纹并点击更新进行签到!" |
| | | }); |
| | | }); |
| | | } else { |
| | |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | msg: function (type, msg) { |
| | | msg: function(type, msg) { |
| | | this.$message({ |
| | | message: msg, |
| | | type: type, |
| | | type: type |
| | | }); |
| | | }, |
| | | onLoad(page, params = {}, shibie) { |
| | |
| | | this.page.total = 0; |
| | | return; |
| | | } |
| | | getList(page.currentPage, page.pageSize, values).then((res) => { |
| | | getList(page.currentPage, page.pageSize, values).then(res => { |
| | | // console.log(res); |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | |
| | | featuredatas: "", |
| | | imgBMP: "", |
| | | url: "", |
| | | isoks: false, |
| | | isoks: false |
| | | }; |
| | | this.useZhiWen("setZhiwenData", zhiwen); |
| | | } else if (data.total == 1) { |
| | |
| | | featuredatas: "", |
| | | imgBMP: "", |
| | | url: "", |
| | | isoks: false, |
| | | isoks: false |
| | | }; |
| | | this.useZhiWen("setZhiwenData", zhiwen); |
| | | this.msg("warning", "查询出多人,请选择对应人员更新!"); |
| | |
| | | } |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | |
| | | /* |
| | | * @Author: Morpheus |
| | | * @Date: 2021-08-02 09:31:54 |
| | | * @Last Modified by: liu |
| | | * @Last Modified time: 2021-10-09 17:13:00 |
| | | * menu-name 成绩管理 |
| | | */ |
| | | /* * @Author: Morpheus * @Date: 2021-08-02 09:31:54 * @Last Modified by: liu * |
| | | @Last Modified time: 2021-10-09 17:13:00 * menu-name 成绩管理 */ |
| | | <template> |
| | | <div class="exam-end"> |
| | | <!-- <button class="logout" |
| | |
| | | paddWord: "", |
| | | UserData: window.localStorage.getItem("useInfo") |
| | | ? JSON.parse(window.localStorage.getItem("useInfo")) |
| | | : "", |
| | | : "" |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | }, |
| | | computed: { |
| | | ...mapState({ |
| | | examUserData: (state) => state.exam.examUserData, |
| | | scoreId: (state) => |
| | | examUserData: state => state.exam.examUserData, |
| | | scoreId: state => |
| | | state.exam.scoreId |
| | | ? state.exam.scoreId |
| | | : window.localStorage.getItem("scoreId"), |
| | | }), |
| | | : window.localStorage.getItem("scoreId") |
| | | }) |
| | | }, |
| | | mounted() { |
| | | //获取考试成绩 |
| | |
| | | this.$confirm("是否退出系统, 是否继续?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }).then(() => { |
| | | this.$store.dispatch("LogOut").then(() => { |
| | | this.$router.push({ path: "/login" }); |
| | |
| | | var data = { |
| | | // userId: this.$route.query.userId, |
| | | // examId: this.$route.query.examId, |
| | | id: this.scoreId, |
| | | id: this.scoreId |
| | | }; |
| | | getExamScore(data).then((res) => { |
| | | getExamScore(data).then(res => { |
| | | if (res.data.data.theoryGrade != undefined) { |
| | | this.score = res.data.data.theoryGrade; |
| | | } |
| | |
| | | this.$message({ |
| | | showClose: true, |
| | | message: "密码错误!请联系管理员", |
| | | type: "warning", |
| | | type: "warning" |
| | | }); |
| | | return; |
| | | } |
| | | reselfExamScore(this.scoreId).then((res) => { |
| | | reselfExamScore(this.scoreId).then(res => { |
| | | if ((res.data.success = true)) { |
| | | this.$message({ |
| | | showClose: true, |
| | | message: "重置成功,返回主页重新点击开始考试!", |
| | | type: "success", |
| | | type: "success" |
| | | }); |
| | | this.paddWord = ""; |
| | | this.$router.push({ |
| | | path: `/exam/startexam`, |
| | | path: `/exam/startexam` |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | showClose: true, |
| | | message: "重置错误!请联系管理员", |
| | | type: "warning", |
| | | type: "warning" |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | this.dialogVisible = true; |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .exam-end { |
| | | // width: calc(100% - 100px); |
| | | // height: 89%; |
| | | // margin: 2.5% 50px; |
| | | // background-color: rgba($color: #fff, $alpha: 1); |
| | | // display: flex; |
| | | // align-items: center; |
| | | // justify-content: center; |
| | | // flex-direction: column; |
| | | width: calc(100% - 100px); |
| | | height: 89%; |
| | | margin: 2.5% 50px; |
| | | background-color: rgba($color: #fff, $alpha: 1); |
| | | height: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | |
| | | width: 960px; |
| | | height: 300px; |
| | | // border: 1px solid red; |
| | | background-color: #fff; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | |
| | | " |
| | | >完成考试 {{ time }}</el-button |
| | | > --> |
| | | <el-button |
| | | type="success" |
| | | @click="submitExam" |
| | | :disabled="subjectIndex != 60" |
| | | >完成考试 {{ time }}</el-button |
| | | > |
| | | <el-button type="success" @click="submitExam" |
| | | >完成考试 {{ time }} |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | v-for="(value, index) in subjectIds" |
| | | :style="{ background: value.color, color: value.fontColor }" |
| | | :key="index" |
| | | @click="toSubject(value.everyID, value.type, index)" |
| | | > {{ index + 1 }} </el-button |
| | | > |
| | | <!-- @click="toSubject(value.everyID, value.type, index)" --> |
| | | </el-row> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | messageSuccess, |
| | | messageFail, |
| | | messageWarn, |
| | | isNotEmpty, |
| | | isNotEmpty |
| | | } from "@/util/util"; |
| | | import Tinymce from "@/components/Tinymce"; |
| | | import Choices from "@/components/Subjects/Choices"; |
| | |
| | | Choices, |
| | | MultipleChoices, |
| | | PracticalOperation, |
| | | Judgement, |
| | | Judgement |
| | | // ShortAnswer, |
| | | }, |
| | | data() { |
| | |
| | | examRecordId: undefined, |
| | | subjectId: undefined, |
| | | userId: undefined, |
| | | type: 0, |
| | | type: 0 |
| | | }, |
| | | subject: {}, |
| | | answer: "", |
| | |
| | | |
| | | remark: "全国计算机统考练习题10道", |
| | | |
| | | newRecord: false, |
| | | newRecord: false |
| | | }, |
| | | firstFlag: true, |
| | | times: ["30", "00"], |
| | |
| | | timeOTiv: null, |
| | | timesIT: true, |
| | | timesITValue: 0, |
| | | first: true, |
| | | first: true |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapState({ |
| | | userInfo: (state) => state.user.userInfo, |
| | | scoreId: (state) => |
| | | userInfo: state => state.user.userInfo, |
| | | scoreId: state => |
| | | state.exam.scoreId |
| | | ? state.exam.scoreId |
| | | : window.localStorage.getItem("scoreId"), |
| | | : window.localStorage.getItem("scoreId") |
| | | }), |
| | | time() { |
| | | var d = [+this.times[0], +this.times[1]]; |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | var useInfo = this.$store.state.exam.examUserData; |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | countDownS_cb: function () { |
| | | countDownS_cb: function() { |
| | | // console.log(12456); |
| | | messageSuccess(this, "考试开始"); |
| | | this.startTime = this.getCurrentTimes(); |
| | | }, |
| | | countDownE_cb: function () { |
| | | countDownE_cb: function() { |
| | | messageWarn(this, "考试结束"); |
| | | // this.disableSubmit = true; |
| | | // this.submitExam("over"); |
| | |
| | | bottonControl(time) { |
| | | //倒计时循环 |
| | | let times = time * 60; |
| | | var setTime = function (time) { |
| | | var setTime = function(time) { |
| | | let a, b, d; |
| | | a = parseInt(time / 60); |
| | | b = time - a * 60; |
| | |
| | | return d; |
| | | }; |
| | | if (this.timeOTiv == null) { |
| | | this.timeOTiv = setInterval((res) => { |
| | | this.timeOTiv = setInterval(res => { |
| | | times--; |
| | | this.timesITValue = setTime(times); |
| | | }, 1000); |
| | | } else { |
| | | clearTimeout(this.timeOTiv); |
| | | this.timeOTiv = null; |
| | | this.timeOTiv = setInterval((res) => { |
| | | this.timeOTiv = setInterval(res => { |
| | | times--; |
| | | this.timesITValue = setTime(times); |
| | | }, 1000); |
| | | } |
| | | //倒计时定时 |
| | | if (this.timeOut == null) { |
| | | this.timeOut = setTimeout((res) => { |
| | | this.timeOut = setTimeout(res => { |
| | | this.timesIT = false; |
| | | this.timesITValue--; |
| | | }, time * 3600); |
| | | } else { |
| | | clearTimeout(this.timeOut); |
| | | this.timeOut = null; |
| | | this.timeOut = setTimeout((res) => { |
| | | this.timeOut = setTimeout(res => { |
| | | this.timesIT = false; |
| | | }, time * 3600); |
| | | } |
| | | }, |
| | | validateExamTime() { |
| | | getCurrentTime() |
| | | .then((response) => { |
| | | .then(response => { |
| | | // console.log(response, 7777); |
| | | const currentTime = moment(response.data.data); |
| | | if (currentTime.isAfter(this.exam.endTime)) { |
| | |
| | | // this.endTime = current + 60 * 60 * 1000; |
| | | // } |
| | | if (!this.first) { |
| | | getSubjectRefresh(scoreId).then((obj) => { |
| | | getSubjectRefresh(scoreId).then(obj => { |
| | | const objs = obj.data.data; |
| | | // console.log(objs, "objobjobjobjobjobj"); |
| | | const subjectData = objs.examSubjectChoicesVOSList; |
| | |
| | | score: subjectData[i].score, |
| | | color: "#fff", |
| | | fontColor: "#000", |
| | | title: subjectData[i].subjectName, |
| | | title: subjectData[i].subjectName |
| | | }); |
| | | } |
| | | |
| | |
| | | for (var k = 0; k < ans.length; k++) { |
| | | anw.push({ |
| | | key: k + 1, |
| | | value: ans[k], |
| | | value: ans[k] |
| | | }); |
| | | } |
| | | this.subjectIds[i].answer = anw; |
| | |
| | | //适应时间 |
| | | const datyTime = objs.examScore.examTime; |
| | | // console.log(objs, "datyTimedatyTimedatyTime"); |
| | | 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; |
| | |
| | | // 获取题目ID列表 |
| | | // console.log("subjectResponsesubjectResponsesubjectResponse"); |
| | | getSubjectIds(scoreId) |
| | | .then((subjectResponse) => { |
| | | .then(subjectResponse => { |
| | | const subjectData = subjectResponse.data.data; |
| | | // console.log( |
| | | // subjectResponse, |
| | |
| | | answer: "", |
| | | score: subjectData[i].score, |
| | | color: "#fff", |
| | | fontColor: "#000", |
| | | fontColor: "#000" |
| | | }); |
| | | } |
| | | |
| | |
| | | this.updateSubjectIndex(); |
| | | // 获取当前题目信息 |
| | | getSubjectResultInfo({ |
| | | id: this.subjectIds[0].everyID, |
| | | id: this.subjectIds[0].everyID |
| | | }) |
| | | .then((response) => { |
| | | .then(response => { |
| | | if (isNotEmpty(response.data.data)) { |
| | | response.data.data.answer = ""; |
| | | this.setSubjectInfo(response.data.data); |
| | |
| | | if (this.getAnswer() == "") { |
| | | this.$message({ |
| | | message: "请选择答案", |
| | | type: "warning", |
| | | type: "warning" |
| | | }); |
| | | return; |
| | | } |
| | |
| | | if (!goShiCao) { |
| | | this.$message({ |
| | | message: "实操题目请选择完整顺序!", |
| | | type: "warning", |
| | | type: "warning" |
| | | }); |
| | | return; |
| | | } |
| | |
| | | var str = ""; |
| | | |
| | | if (Array.isArray(answerData)) { |
| | | answerData.forEach((item) => { |
| | | answerData.forEach(item => { |
| | | str += item.value + ","; |
| | | }); |
| | | |
| | |
| | | id: nextSubjectId, |
| | | preSubJectId: this.query.subjectId, |
| | | preResult: answerData, |
| | | scoreId: this.scoreId, |
| | | scoreId: this.scoreId |
| | | }; |
| | | getSubjectResultInfo(data) |
| | | .then((response) => { |
| | | .then(response => { |
| | | if (response.data.data !== null) { |
| | | // 保存成功后更新答题卡状态 |
| | | const subject = response.data.data; |
| | |
| | | } |
| | | |
| | | this.setSubjectInfo(subject); |
| | | // console.log(subject); |
| | | console.log(subject); |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | |
| | | // store.dispatch('SetSubjectInfo', subject).then(() => { }) |
| | | } |
| | | // 更新时间 |
| | | getCurrentTime().then((response) => { |
| | | getCurrentTime().then(response => { |
| | | this.subjectStartTime = moment(response.data.data); |
| | | }); |
| | | this.endLoading(nextType); |
| | | }) |
| | | .catch((error) => { |
| | | .catch(error => { |
| | | console.log(error); |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | messageFail(this, "获取题目失败"); |
| | | this.endLoading(nextType); |
| | | }); |
| | |
| | | this.startLoading(nextType); |
| | | |
| | | var data = { |
| | | id: nextSubjectId, |
| | | id: nextSubjectId |
| | | }; |
| | | getSubjectResultInfo(data) |
| | | .then((response) => { |
| | | .then(response => { |
| | | if (response.data.data !== null) { |
| | | // 保存成功后更新答题卡状态 |
| | | const subject = response.data.data; |
| | |
| | | // store.dispatch('SetSubjectInfo', subject).then(() => { }) |
| | | } |
| | | // 更新时间 |
| | | getCurrentTime().then((response) => { |
| | | getCurrentTime().then(response => { |
| | | this.subjectStartTime = moment(response.data.data); |
| | | }); |
| | | this.endLoading(nextType); |
| | | }) |
| | | .catch((error) => { |
| | | .catch(error => { |
| | | console.log(error); |
| | | messageFail(this, "获取题目失败"); |
| | | this.endLoading(nextType); |
| | |
| | | this.$confirm("确定要提交吗?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | this.disableSubmit = true; |
| | |
| | | examTime: this.startTime, |
| | | papersId: this.$route.query.id, |
| | | examEndTime: this.getCurrentTimes(), |
| | | examResultVOS: null, |
| | | examResultVOS: null |
| | | }; |
| | | var arr = []; |
| | | console.log(this.subjectIds); |
| | |
| | | if (item.answer.length > 0) { |
| | | //如果是数组 |
| | | if (item.answer instanceof Array) { |
| | | item.answer.forEach((it) => { |
| | | item.answer.forEach(it => { |
| | | if (it.value != "") { |
| | | str += it.value + ","; |
| | | } |
| | |
| | | arr.push({ |
| | | subjectChoicesId: item.everyID, |
| | | value: a, |
| | | grade: item.score, |
| | | grade: item.score |
| | | }); |
| | | } else { |
| | | arr.push({ |
| | | subjectChoicesId: item.everyID, |
| | | value: item.answer, |
| | | grade: item.score, |
| | | grade: item.score |
| | | }); |
| | | } |
| | | } |
| | |
| | | arr.push({ |
| | | subjectChoicesId: item.everyID, |
| | | value: item.answer, |
| | | grade: item.score, |
| | | grade: item.score |
| | | }); |
| | | } |
| | | } |
| | |
| | | // console.log(obj.examResultVOS, 789); |
| | | |
| | | saveAndNext(obj) |
| | | .then((response) => { |
| | | .then(response => { |
| | | messageSuccess(this, "提交成功"); |
| | | if (response) { |
| | | this.$store.commit("DEL_TAG", this.$store.state.tags.tag); |
| | | var obj = { |
| | | userId: this.userInfo.user_id, |
| | | examId: this.$route.query.id, |
| | | examId: this.$route.query.id |
| | | }; |
| | | this.$router.push({ |
| | | path: `/singleperformance/index`, |
| | | query: obj, |
| | | query: obj |
| | | }); |
| | | } |
| | | }) |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | |
| | | module.exports = { |
| | | //路径前缀 |
| | | publicPath: "/", |
| | | lintOnSave: true, |
| | | productionSourceMap: false, |
| | | chainWebpack: (config) => { |
| | | //忽略的打包文件 |
| | | config.externals({ |
| | | 'vue': 'Vue', |
| | | 'vue-router': 'VueRouter', |
| | | 'vuex': 'Vuex', |
| | | 'axios': 'axios', |
| | | 'element-ui': 'ELEMENT', |
| | | }); |
| | | const entry = config.entry('app'); |
| | | entry.add('babel-polyfill').end(); |
| | | entry.add('classlist-polyfill').end(); |
| | | entry.add('@/mock').end(); |
| | | }, |
| | | css: { |
| | | extract: { |
| | | ignoreOrder: true |
| | | } |
| | | }, |
| | | //开发模式反向代理配置,生产模式请使用Nginx部署并配置反向代理 |
| | | devServer: { |
| | | port: 1888, |
| | | proxy: { |
| | | '/api': { |
| | | //本地服务接口地址 |
| | | // target: 'http://192.168.0.114:81', |
| | | target: 'http://localhost:81', |
| | | // target: 'http://172.20.10.2:81', |
| | | //远程演示服务地址,可用于直接启动项目 |
| | | // target: 'http://2h3f861221.wicp.vip:58646', |
| | | ws: true, |
| | | pathRewrite: { |
| | | '^/api': '/' |
| | | } |
| | | } |
| | | } |
| | | //路径前缀 |
| | | publicPath: "/", |
| | | lintOnSave: true, |
| | | productionSourceMap: false, |
| | | chainWebpack: (config) => { |
| | | //忽略的打包文件 |
| | | config.externals({ |
| | | 'vue': 'Vue', |
| | | 'vue-router': 'VueRouter', |
| | | 'vuex': 'Vuex', |
| | | 'axios': 'axios', |
| | | 'element-ui': 'ELEMENT', |
| | | }); |
| | | const entry = config.entry('app'); |
| | | entry.add('babel-polyfill').end(); |
| | | entry.add('classlist-polyfill').end(); |
| | | entry.add('@/mock').end(); |
| | | }, |
| | | css: { |
| | | extract: { |
| | | ignoreOrder: true |
| | | } |
| | | }; |
| | | }, |
| | | //开发模式反向代理配置,生产模式请使用Nginx部署并配置反向代理 |
| | | devServer: { |
| | | port: 1888, |
| | | proxy: { |
| | | '/api': { |
| | | //本地服务接口地址 |
| | | // target: 'http://192.168.0.114:81', |
| | | // target: 'http://localhost:81', |
| | | // target: 'http://172.20.10.2:81', |
| | | target: 'http://223.82.109.183:2080/api', |
| | | //远程演示服务地址,可用于直接启动项目 |
| | | // target: 'http://2h3f861221.wicp.vip:58646', |
| | | ws: true, |
| | | pathRewrite: { |
| | | '^/api': '/' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }; |