startTheExamViews-legacy.088c5d11.js 19 KB

1
  1. !function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e,a,s){var i;return i=function(e,a){if("object"!=t(e)||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var i=s.call(e,a||"default");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===a?String:Number)(e)}(a,"string"),(a="symbol"==t(i)?i:String(i))in e?Object.defineProperty(e,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[a]=s,e}System.register(["./index-legacy.a130dba2.js","./TestQuestionsServers-legacy.439bf0a5.js","./LJFlexBox-legacy.f9c3d416.js","./TestQuestionOptions-legacy.c86f1da7.js","./composables-legacy.0c6ce36a.js","./variable-legacy.37b2506b.js","./sortable.esm-legacy.19def5ad.js"],(function(t,a){"use strict";var s,i,n,o,r,l,c,u,d,m,f,p,v,x,b=document.createElement("style");return b.textContent=".auto-submit-dialog .submit-content[data-v-91f3741c]{text-align:center;display:flex;justify-content:center;align-items:center;flex-wrap:nowrap;padding-bottom:20px}.auto-submit-dialog .submit-content.auto-submit-loading[data-v-91f3741c]{color:#0a77f6}.auto-submit-dialog .submit-content.auto-submit-success[data-v-91f3741c]{color:green}.auto-submit-dialog .submit-content.auto-submit-error[data-v-91f3741c]{color:#ff000a}.auto-submit-dialog .submit-content i[data-v-91f3741c]{font-size:28px}.auto-submit-dialog .submit-content .submit-text[data-v-91f3741c]{font-size:18px;padding:0 10px}.exit-rest-dialog .content[data-v-19951170]{font-size:18px;text-align:center;display:flex;justify-content:center;align-items:center;flex-wrap:nowrap;color:#f56c6c}.exit-rest-dialog .content i[data-v-19951170]{font-size:28px;padding-right:10px}.start-the-exam-views[data-v-8c0f6edb]{user-select:none;position:relative;height:calc(100vh - var(--main-nav-height) - var(--main-tabs-height) - var(--main-footer-height) - 62px);background-color:#fff;border-radius:8px;overflow:hidden;padding:0 20px}.start-the-exam-views .loading-test-paper[data-v-8c0f6edb]{position:absolute;z-index:20;left:0;top:0;width:100%;height:100%;background-color:#fff;z-index:10;display:flex;justify-content:center;align-items:center}.start-the-exam-views .loading-test-paper .loading-test-paper-main[data-v-8c0f6edb]{line-height:30px}.start-the-exam-views .loading-test-paper .loading-test-paper-main .label[data-v-8c0f6edb]{padding-right:10px;color:#5b5b5b}.start-the-exam-views .loading-test-paper .loading-test-paper-main .value[data-v-8c0f6edb]{color:#3c3c3c}.start-the-exam-views .loading-test-paper .loading-test-paper-main .but-list[data-v-8c0f6edb]{display:flex;gap:20px;margin-top:20px;justify-content:center}.start-the-exam-views.is-full-screen[data-v-8c0f6edb]{background-color:#fff;padding:0!important}.start-the-exam-views.is-full-screen .start-the-exam-header .fullscreen-but .icon-open-full-screen[data-v-8c0f6edb]{display:none}.start-the-exam-views.is-full-screen .start-the-exam-header .fullscreen-but .icon-close-full-screen[data-v-8c0f6edb]{display:block}.start-the-exam-views.is-full-screen .start-the-exam-header .name[data-v-8c0f6edb]{padding:0 20px}.start-the-exam-views.is-full-screen .start-the-exam-header .exam-bg .exam-status[data-v-8c0f6edb]{padding:10px 20px}.start-the-exam-views.is-full-screen .start-the-exam-main[data-v-8c0f6edb]{height:calc(100vh - 153px);box-sizing:border-box;padding-bottom:30px}.start-the-exam-views.is-full-screen .start-the-exam-main .test-questions-lists[data-v-8c0f6edb]{padding:0 30px;margin-top:25px}.start-the-exam-views .start-the-exam-header[data-v-8c0f6edb]{height:173px;box-sizing:border-box;border-bottom:1px #cccccc solid;position:relative;z-index:1}.start-the-exam-views .start-the-exam-header .fullscreen-but[data-v-8c0f6edb]{z-index:2;position:absolute;left:15px;top:15px;transition:.1s}.start-the-exam-views .start-the-exam-header .fullscreen-but[data-v-8c0f6edb]:hover{cursor:pointer;text-shadow:0 0 10px #ccc;scale:1.2}.start-the-exam-views .start-the-exam-header .fullscreen-but .iconfont[data-v-8c0f6edb]{font-size:26px;color:#265cf0}.start-the-exam-views .start-the-exam-header .fullscreen-but .icon-close-full-screen[data-v-8c0f6edb]{display:none}.start-the-exam-views .start-the-exam-header .name[data-v-8c0f6edb]{height:80px;line-height:80px;text-align:center;font-size:30px;font-weight:600;letter-spacing:.5em;color:#265cf0}.start-the-exam-views .start-the-exam-header .exam-bg .exam-status[data-v-8c0f6edb]{padding:15px 0;gap:10px;user-select:none;white-space:nowrap}.start-the-exam-views .start-the-exam-header .exam-bg .exam-status .label[data-v-8c0f6edb]{color:#7e7d7e;position:absolute}.start-the-exam-views .start-the-exam-header .exam-bg .exam-status .time[data-v-8c0f6edb]{padding:10px 25px;font-size:24px;background-color:#f6f9fc}.start-the-exam-views .start-the-exam-header .exam-bg .exam-status .time[data-v-8c0f6edb] .el-statistic{width:fit-content}.start-the-exam-views .start-the-exam-header .exam-bg .exam-status .time[data-v-8c0f6edb] .el-statistic .number{font-size:28px;color:#2256e5;font-weight:700}.start-the-exam-views .start-the-exam-header .exam-bg .exam-status .progress[data-v-8c0f6edb]{max-width:500px;min-width:240px}.start-the-exam-views .start-the-exam-header .exam-bg .exam-status .progress .use-num[data-v-8c0f6edb],.start-the-exam-views .start-the-exam-header .exam-bg .exam-status .progress .total-num[data-v-8c0f6edb]{color:#1651ee}.start-the-exam-views .start-the-exam-header .exam-bg .exam-status .progress[data-v-8c0f6edb] .el-progress-bar__innerText{color:#fff!important}.start-the-exam-views .start-the-exam-main[data-v-8c0f6edb]{min-width:600px;height:calc(100vh - var(--main-nav-height) - var(--main-footer-height) - 153px - 150px);overflow-y:auto;overflow-x:auto}.start-the-exam-views .start-the-exam-main .test-questions-lists[data-v-8c0f6edb]{margin-top:25px;border-bottom:1px #cccccc solid}.table-name[data-v-8c0f6edb]{border-radius:8px 8px 0 0;width:524px;text-align:center;height:70px;border:1px solid #EBEBEB;line-height:70px;border-bottom:none;font-size:20px;background-image:linear-gradient(rgba(38,92,240,.1),rgba(38,92,240,.04))}.table-list[data-v-8c0f6edb]{width:524px;border:1px solid #eee;display:flex;height:70px;padding:0 40px}.table-list .table-title[data-v-8c0f6edb],.table-list .table-cont[data-v-8c0f6edb]{width:50%;height:100%;display:flex;align-items:center;font-size:14px}.table-list .table-title[data-v-8c0f6edb]{border-right:1px solid #eee;margin-right:10px;padding-right:20px;color:#666}.table-list .table-cont[data-v-8c0f6edb]{margin-left:10px;justify-content:flex-end;color:#333}[data-v-8c0f6edb] .el-slider__runway.disabled .el-slider__bar,[data-v-8c0f6edb] .el-slider__runway.disabled .el-slider__button{background-color:#2256e5}[data-v-8c0f6edb] .el-slider__runway.disabled .el-slider__button{border-color:#fff}\n",document.head.appendChild(b),{setters:[function(t){s=t.n,i=t.r,n=t.b,o=t.$,r=t.o,l=t.e},function(t){c=t.u},function(t){u=t.L},function(t){d=t.T,m=t.a,f=t.b},function(t){p=t.a,v=t.u},function(t){x=t.O},function(){}],execute:function(){var a={__name:"AutoSubmitDialog",emits:["confirm"],setup:function(t,e){var a=e.expose,s=e.emit,n=i(!1),o=i(!0),r=i("loading"),l=i({loading:"考试时间结束,正在自动为您交卷",success:"考试时间结束,已自动交卷成功",error:"交卷失败,请尝试重新交卷"}),c=function(t){n.value=!0,console.log("考试时间结束,已自动交卷 id:",t)},u=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r.value="loading",n.value=!0,o.value=!0,setTimeout((function(){r.value=t?"success":"error",o.value=!1}),2e3)};function d(){n.value=!1}return a({handleInit:c,handleHide:d}),{__sfc:!0,emits:s,dialogVisible:n,loading:o,submitStatus:r,submitTexts:l,handleInit:c,handleSubmit:u,handleRestSubmit:function(){u(!0)},handleConfirm:function(){n.value=!1,o.value=!1,s("confirm")},handleHide:d}}},b=function(){var t=this,a=t._self._c,s=t._self._setupProxy;return a("div",{staticClass:"auto-submit-dialog"},[a("el-dialog",{attrs:{visible:s.dialogVisible,"append-to-body":!0,width:"460px","show-close":!1,"close-on-press-escape":!1,"close-on-click-modal":!1},on:{"update:visible":function(t){s.dialogVisible=t}}},[a("div",{staticClass:"submit-content",class:e({"is-loading":s.loading},"auto-submit-"+s.submitStatus,s.submitStatus)},[s.loading?a("i",{staticClass:"el-icon-loading"}):t._e(),"success"===s.submitStatus?a("i",{staticClass:"el-icon-success"}):t._e(),"error"===s.submitStatus?a("i",{staticClass:"el-icon-error"}):t._e(),a("span",{staticClass:"submit-text"},[t._v(t._s(s.submitTexts[s.submitStatus]))])]),s.loading?t._e():a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},["success"===s.submitStatus?a("el-button",{attrs:{type:"primary",icon:"el-icon-circle-check"},on:{click:s.handleConfirm}},[t._v(" 确 定 ")]):t._e(),"error"===s.submitStatus?a("el-button",{attrs:{type:"primary",icon:"el-icon-refresh"},on:{click:s.handleRestSubmit}},[t._v(" 重新交卷 ")]):t._e()],1)])],1)},g=[];b._withStripped=!0;var h=s(a,b,g,!1,null,"91f3741c",null,null);h.options.__file="E:/十二科技/项目/九号同事/salary-management-web/src/views/personnelRoot/myExam/components/AutoSubmitDialog.vue";var _=h.exports,w={__name:"ExitRestDialog",emits:["confirm"],setup:function(t,e){var a=e.expose,s=e.emit,n=i(!1),o=function(){console.log("考试时间结束,请退出重考"),n.value=!0};return a({handleInit:o}),{__sfc:!0,dialogVisible:n,emits:s,handleInit:o,handleConfirm:function(){n.value=!1,s("confirm")}}}},y=function(){var t=this,e=t._self._c,a=t._self._setupProxy;return e("div",{staticClass:"exit-rest-dialog"},[e("el-dialog",{attrs:{visible:a.dialogVisible,"append-to-body":!0,width:"460px","show-close":!1,"close-on-press-escape":!1,"close-on-click-modal":!1},on:{"update:visible":function(t){a.dialogVisible=t}}},[e("div",{staticClass:"content"},[e("i",{staticClass:"el-icon-warning-outline"}),e("span",[t._v("考试时间结束,请退出重考")])]),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{attrs:{type:"primary",icon:"el-icon-refresh-left"},on:{click:a.handleConfirm}},[t._v(" 确 定 ")])],1)])],1)},S=[];y._withStripped=!0;var C=s(w,y,S,!1,null,"19951170",null,null);C.options.__file="E:/十二科技/项目/九号同事/salary-management-web/src/views/personnelRoot/myExam/components/ExitRestDialog.vue";var T=C.exports,E={__name:"startTheExamViews",setup:function(t){var e=p(),a=v(),s=i(),b=i(),g=i(),h=i({}),w=i(!0),y=i(e.query.id||null),S=i({}),C=i(e.query.test_paper),E=i(e.query.status||0),k=n((function(){return o.getters.is_taking_exam_ing})),R=i(!1),P=i(!1),j=i(!1),D=i(0),z=i([]),I=n((function(){return z.value.filter((function(t){return t.answer&&"success"===t.answer_status})).length})),q=n((function(){return z.value.length?Number((I.value/z.value.length*100).toFixed(2)):0}));function Q(){o.dispatch("startTakeExam");var t=h.value.answer_time;D.value=Date.now()+6e4*t}function B(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};HTTP.get("test_question_record",{test_record:y.value,fields:"id,test_record,test_question,answer"}).then((function(e){0===e.code&&e.data.results.map((function(t){var e=z.value.findIndex((function(e){return e.id===t.test_question}));e>-1&&(z.value[e].answer=t.answer,z.value[e].answer_status="success")})),t()})).catch((function(t){console.log("error:",t)}))}var A=function(){o.dispatch("endTakeExam")};var F=function(){g.value.handleInit()};var L=function(){a.back()};function H(){HTTP.getById("test_record",y.value).then((function(t){S.value=t.data,O()}))}var O=function(){if(!C.value)return l.exports.Message.error("没有试卷ID");w.value=!0,HTTP.getReadById("test_paper",C.value).then((function(t){h.value=t.data;var e=t.data.test_paper_Questions.map((function(t){return t.answer=null,t.answer_status="",t.options=JSON.parse(t.option),t}));c(e,t.data.total_score),z.value=JSON.parse(JSON.stringify(e))})).catch((function(t){console.log("error:",t)})).finally((function(){setTimeout((function(){w.value=!1}),1e3)}))};function V(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;P.value||R.value||(0===t?P.value=!0:1===t&&(R.value=!0),HTTP.post("submit_test_paper",{test_record_id:y.value,is_overtime:t}).then((function(t){if(0!==t.code)return new Error(t);l.exports.Message.success("交卷成功"),setTimeout((function(){o.dispatch("endTakeExam").then((function(){L()}),1500)}))})).catch((function(t){l.exports.Message.error(t.msg||"交卷失败,请重试")})).finally((function(){setTimeout((function(){R.value&&b.value.handleHide(),P.value=!1,R.value=!1}),200)})))}return r((function(){A(),y.value?H():O()})),{__sfc:!0,route:e,router:a,startTheExamRef:s,autoSubmitDialogRef:b,exitRestDialogRef:g,testPaper:h,testPaperLoading:w,testRecordId:y,testRecordObj:S,testPaperId:C,testRecordStatus:E,takingExamIng:k,autoSubmit:R,userSubmit:P,startLoading:j,deadline:D,test_questions_list:z,use_num:I,user_progress:q,updateStartTakeExam:Q,continueAnswerQuestions:function(){B(Q)},testQuestionRecord:B,handleStartTakeExam:function(){var t=new Date(h.value.start_date).getTime();if((new Date).getTime()<t)return l.exports.Message.warning("考试时间未到");j.value=!0,HTTP.post("start_test",{test_id:C.value}).then((function(t){if(console.log("resp:",t),0!==t.code)return new Error(t);Q()})).catch((function(t){console.log("error:",t),l.exports.Message.error(t.msg||"开始考试失败,请重试")})).finally((function(){setTimeout((function(){return j.value=!1}),1e3)}))},handleEndTakeExam:A,handleAnswerQuestion:function(t,e,a){var s={test_record_id:y.value,question_id:e,answer:t,index:a};z.value[s.index].answer_status="loading",HTTP.post("answer_question",s).then((function(t){if(0!==t.code)return new Error(t);z.value[s.index].answer_status="success"})).catch((function(t){z.value[s.index].answer_status="error",l.exports.Message.error("第".concat(s.index,"题提交答案失败,请重新提交"))}))},handleAutoSubmit:function(){b.value.handleInit()},handleExitRest:F,handleConfirmExitRest:function(){o.dispatch("endTakeExam").then((function(){L()}))},handleBack:L,handleFullScreen:function(){return s.value.tagFullScreen()},getRestRecord:H,getTestQuestions:O,handleAbandoningExams:function(){l.exports.MessageBox.confirm("您即将主动放弃本次考试,是否继续?","放弃考试",{type:"warning"}).then((function(){o.dispatch("endTakeExam").then((function(){L()}))}))},handleSubmit:V,hilarity:function(){k.value&&(1===h.value.overtime_type?F():V(1))},LJFlexBox:u,TestQuestions:d,TestQuestionTitle:m,TestQuestionOptions:f,AutoSubmitDialog:_,ExitRestDialog:T,OVERTIME_TYPE:x}}},k=function(){var t=this,e=t._self._c,a=t._self._setupProxy;return e("div",{directives:[{name:"fullscreen",rawName:"v-fullscreen"}],ref:"startTheExamRef",staticClass:"start-the-exam-views"},[a.takingExamIng?t._e():e("div",{directives:[{name:"loading",rawName:"v-loading",value:a.testPaperLoading,expression:"testPaperLoading"}],staticClass:"loading-test-paper",attrs:{"element-loading-text":"正在加载考试试卷中","element-loading-spinner":"el-icon-loading","element-loading-background":"rgba(0, 0, 0, 0.8)"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),function(){}.apply(null,arguments)}}},[a.testPaperLoading?t._e():e("div",{staticClass:"loading-test-paper-main"},[e("div",{staticClass:"table-name"},[t._v(t._s(a.testPaper.name))]),e("div",{staticClass:"table-list",staticStyle:{"border-bottom":"none","border-top":"none"}},[e("div",{staticClass:"table-title"},[t._v("题数")]),e("div",{staticClass:"table-cont"},[t._v(t._s(a.testPaper.total_num)+"道")])]),e("div",{staticClass:"table-list",staticStyle:{"border-bottom":"none"}},[e("div",{staticClass:"table-title"},[t._v("总分")]),e("div",{staticClass:"table-cont"},[t._v(t._s(a.testPaper.total_score)+"分")])]),e("div",{staticClass:"table-list",staticStyle:{"border-bottom":"none"}},[e("div",{staticClass:"table-title"},[t._v("考试时长")]),e("div",{staticClass:"table-cont"},[t._v(t._s(a.testPaper.answer_time)+"分钟")])]),e("div",{staticClass:"table-list",staticStyle:{"border-bottom":"none"}},[e("div",{staticClass:"table-title"},[t._v("考试时间结束")]),e("div",{staticClass:"table-cont"},[t._v(" "+t._s(a.OVERTIME_TYPE[a.testPaper.overtime_type])+" ")])]),e("div",{staticClass:"table-list",staticStyle:{"border-radius":"0 0 8px 8px"}},[e("div",{staticClass:"table-title"},[t._v("考试截止时间")]),e("div",{staticClass:"table-cont"},[t._v(t._s(a.testPaper.end_date))])]),e("div",{staticClass:"but-list"},[e("el-button",{attrs:{type:"primary",plain:""},on:{click:a.handleBack}},[t._v(" 返 回 ")]),e("el-button",{attrs:{type:"primary",loading:a.startLoading},on:{click:a.handleStartTakeExam}},[t._v(" 开始答题 ")])],1)])]),e("div",{staticClass:"start-the-exam-header"},[e("div",{staticClass:"fullscreen-but",on:{click:a.handleFullScreen}},[e("i",{staticClass:"iconfont icon-open-full-screen",attrs:{title:"点击进入全屏考试"}}),e("i",{staticClass:"iconfont icon-close-full-screen",attrs:{title:"点击退出全屏考试"}})]),e("div",{staticClass:"name"},[t._v(" "+t._s(a.testPaper.name)+" ")]),e("div",{staticClass:"exam-bg",staticStyle:{"background-color":"#F9FAFC"}},[e(a.LJFlexBox,{staticClass:"exam-status",attrs:{"justify-content":"space-between"}},[e("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center"}},[e("div",{staticClass:"label",staticStyle:{"margin-left":"30px"}},[e("i",{staticClass:"el-icon-time",staticStyle:{color:"#2256e5"}}),e("span",{staticStyle:{"margin-left":"5px"}},[t._v("考试倒计时")])]),e("div",{staticClass:"time",staticStyle:{"margin-left":"300px"}},[e("el-statistic",{ref:"statistic",attrs:{format:"HH:mm:ss",value:a.deadline,"time-indices":""},on:{finish:a.hilarity}})],1)]),e("div",{staticClass:"progress",staticStyle:{"margin-right":"60px"}},[e("el-slider",{attrs:{max:a.test_questions_list.length,disabled:""},model:{value:a.use_num,callback:function(t){a.use_num=t},expression:"use_num"}}),e(a.LJFlexBox,{attrs:{"justify-content":"space-between","margin-top":"6px"}},[e("div",{staticClass:"use-num"},[t._v("已完成:"+t._s(a.use_num)+" 题")]),e("div",{staticClass:"total-num"},[t._v("共:"+t._s(a.test_questions_list.length)+" 题")])])],1)])],1)]),e("div",{staticClass:"start-the-exam-main"},[e("div",{staticClass:"test-questions-lists"},t._l(a.test_questions_list,(function(s,i){return e(a.TestQuestions,{key:s.id,attrs:{padding:"15px 0",item:i}},[e(a.TestQuestionTitle,{attrs:{type:"examination",score:s.score,index:i},model:{value:s.content,callback:function(e){t.$set(s,"content",e)},expression:"item.content"}}),e(a.TestQuestionOptions,{attrs:{type:"examination",options:s.options,"answer-status":s.answer_status,"show-answer":!1,padding:"5px 2em"},on:{changeAnswer:function(t){return a.handleAnswerQuestion(t,s.id,i)}},model:{value:s.answer,callback:function(e){t.$set(s,"answer",e)},expression:"item.answer"}})],1)})),1),e(a.LJFlexBox,{attrs:{"justify-content":"center","margin-top":"15px"}},[e("el-button",{attrs:{type:"info",plain:""},on:{click:a.handleAbandoningExams}},[t._v("放弃考试 ")]),e("el-button",{attrs:{type:"primary",loading:a.userSubmit},on:{click:function(t){return a.handleSubmit(0)}}},[t._v(" 完成提交 ")])],1)],1),e(a.AutoSubmitDialog,{ref:"autoSubmitDialogRef"}),e(a.ExitRestDialog,{ref:"exitRestDialogRef",on:{confirm:a.handleConfirmExitRest}})],1)},R=[];k._withStripped=!0;var P=s(E,k,R,!1,null,"8c0f6edb",null,null);P.options.__file="E:/十二科技/项目/九号同事/salary-management-web/src/views/personnelRoot/myExam/startTheExamViews.vue";t("default",P.exports)}}}))}();