{"remainingRequest":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\examine-fvue\\src\\views\\examMenu\\components\\formalTestPaper.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\examine-fvue\\src\\views\\examMenu\\components\\formalTestPaper.vue","mtime":1705466684630},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport {\n\tmapState\n} from 'vuex'\nimport {\n\tTableMixin\n} from '@/mixins/tableMixin'\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\nimport paperMenu from '@/api/examination/paperMenu.js'\nimport screenfull from \"screenfull\";\nexport default {\n\tmixins: [TableMixin],\n\tname: 'formalTestPaper',\n\tcomponents: {},\n\tdata() {\n\t\treturn {\n\t\t\tcircleUrl: \"https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png\", //头像\n\t\t\thr: 1,\n\t\t\tmin: 60,\n\t\t\tsec: 0,\n\t\t\tradio: '',\n\t\t\tcheckList: [],\n\t\t\tradio3: '',\n\t\t\tinput: '',\n\t\t\ttextarea: '',\n\t\t\tend: null,\n\t\t\tpaperData: {}, //试卷数据\n\t\t\ttopicList: [], //题目类型\n\t\t\tformalType: false, //正式考试\n\t\t\tparam: {\n\t\t\t\tstatus: 0,\n\t\t\t\trecordId: null,\n\t\t\t\tquestionOptionList: []\n\t\t\t},\n\t\t\tuserKey: null,\n\t\t\tpaperName: null,\n\t\t\tnewParams: {\n\n\t\t\t},\n\t\t\tisFull: false,\n\t\t\tfirstFull: true, //是否第一次全屏\n\t\t\tisScreen: false,\n\t\t\tnums: 0,\n\t\t\tlastTime: 0, //默认上一次点击时间为0 \n\n\t\t}\n\t},\n\tcreated() {\n\t\tthis.topicList = dictUtils.getDictItemsFromCache('sttx')\n\t},\n\twatch: {\n\t\tnums(newvalue, oldvalue) {\n\t\t\tif (this.nums == 2) {\n\t\t\t\tthis.nums = 0\n\t\t\t\tconsole.log('增加一次');\n\t\t\t\tthis.getswitchCount()\n\t\t\t}\n\t\t},\n\t},\n\tmounted() {\n\t\tconst element = document.getElementById('testPaper');\n\t\tdocument.getElementById('full_screen').addEventListener('click', () => {\n\t\t\tif (screenfull.isEnabled) {\n\t\t\t\tscreenfull.request(element); // 元素全屏\n\t\t\t\t// this.firstFull = false\n\t\t\t\tthis.isFull = true\n\t\t\t\tthis.isScreen = false\n\t\t\t}\n\t\t})\n\t\twindow.addEventListener(\"resize\",\n\t\t\tthis.a\n\t\t)\n\n\t},\n\tdestroyed() {\n\t\twindow.removeEventListener('resize',this.a)\n\n\t},\n\tmethods: {\n\t\tContinue() {\n\t\t\tconst element = document.getElementById('testPaper');\n\t\t\tif (screenfull.isEnabled) {\n\t\t\t\tscreenfull.request(element); // 元素全屏\n\t\t\t\tthis.isFull = true\n\t\t\t\tthis.firstFull = false\n\t\t\t\tthis.$set(this.isFull)\n\n\t\t\t}\n\t\t},\n\t\tb() {\n\t\t\tif (window.outerHeight === screen.availHeight) {\n\t\t\t\tif (window.outerWidth === screen.availWidth) {\n\t\t\t\t\tthis.isFull = false\n\t\t\t\t\tthis.firstFull = false\n\t\t\t\t\tthis.isScreen = false\n\t\t\t\t\tconsole.log('退出');\n\t\t\t\t\tthis.getswitchCount()\n\t\t\t\t} else {\n\t\t\t\t\tthis.isScreen = false\n\t\t\t\t\tconsole.log('退出1');\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this.isScreen) {\n\t\t\t\t\tthis.isFull = false\n\t\t\t\t\tthis.firstFull = false\n\t\t\t\t\tthis.nums++\n\t\t\t\t} else {\n\n\t\t\t\t}\n\t\t\t\tthis.isScreen = true\n\n\t\t\t}\n\t\t},\n\t\ta() {\n\t\t\tconsole.log('触发次数+1');\n\t\t\tthis.debounce(this.b(), 1000)\n\t\t},\n\n\t\tgetswitchCount() {\n\t\t\tconsole.log('增加作弊次数');\n\t\t\t// return\n\t\t\tpaperMenu.switchCount(this.param.recordId, res => {\n\t\t\t\tif (res.errorCode == 201) {\n\t\t\t\t\twindow.removeEventListener('resize', this.a)\n\t\t\t\t\tthis.mandatory()\n\t\t\t\t} else {\n\t\t\t\t\tthis.loadData()\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\tdebounce(fn, wait) {\n\t\t\tlet timeout = null;\n\t\t\twait = wait || 3000;\n\t\t\treturn function() {\n\t\t\t\tlet that = this;\n\t\t\t\tif (timeout !== null) clearTimeout(timeout);\n\t\t\t\ttimeout = setTimeout(() => {\n\t\t\t\t\tfn.apply(that);\n\t\t\t\t}, wait);\n\t\t\t}\n\t\t},\n\t\tloadData() {\n\t\t\tconsole.log(this.$route.params);\n\t\t\tif (this.$route.params.paperId !== {} && typeof(this.$route.params.paperId) === 'string') {\n\t\t\t\tthis.userKey = this.$route.params.paperId\n\t\t\t\tthis.paperName = this.$route.params.name\n\t\t\t\tsessionStorage.setItem('userkey', this.userKey) //初次收到userKey,存起来\n\t\t\t\tsessionStorage.setItem('paperName', this.paperName) //初次收到userKey,存起来\n\t\t\t} else {\n\t\t\t\tif (sessionStorage.getItem('userkey')) {\n\t\t\t\t\tthis.userKey = sessionStorage.getItem('userkey') //不是第一次了,取出来\n\t\t\t\t\tthis.paperName = sessionStorage.getItem('paperName') //不是第一次了,取出来\n\t\t\t\t} else {\n\t\t\t\t\t//如果实在是没有了,就直接去store里面取\n\t\t\t\t\tthis.userKey = store.state.user.userInfo.userKey\n\t\t\t\t\tthis.paperName = store.state.user.userInfo.paperName\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet params = {\n\t\t\t\trecordId: this.userKey,\n\t\t\t\tuserId: '',\n\t\t\t}\n\t\t\tpaperMenu.startExam(params, res => {\n\t\t\t\tif (res) {\n\t\t\t\t\tlet minutes = (res.timeLength / 1000) / 60;\n\t\t\t\t\tthis.end = Date.parse(new Date()) + ((1 * minutes * 60)) * 1000\n\t\t\t\t\tthis.countdown()\n\t\t\t\t\tres.questionsInfoVos.forEach(e => {\n\t\t\t\t\t\te.tag = false\n\t\t\t\t\t\tif (e.result) {\n\t\t\t\t\t\t\tif (e.type == 2) {\n\t\t\t\t\t\t\t\tlet arr = JSON.parse(JSON.stringify(e.result.split(\",\")))\n\t\t\t\t\t\t\t\te.result = []\n\t\t\t\t\t\t\t\tarr.forEach(re => {\n\t\t\t\t\t\t\t\t\te.result.push(re)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (e.type == 2) {\n\t\t\t\t\t\t\t\te.result = []\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\te.result = ''\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.topicList.forEach(t => {\n\t\t\t\t\t\t\tif (e.type == t.value) {\n\t\t\t\t\t\t\t\te.typeName = t.name\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t\tthis.paperData = res\n\t\t\t\t\tthis.$set(this.paperData)\n\t\t\t\t\tthis.param.recordId = res.recordId\n\n\t\t\t\t}\n\t\t\t})\n\n\n\t\t},\n\t\tcountdown() {\n\t\t\tconst now = Date.parse(new Date())\n\t\t\tlet msec = this.end - now\n\t\t\tif (msec < 0) return;\n\t\t\tlet day = parseInt(msec / 1000 / 60 / 60 / 24)\n\t\t\tlet hr = parseInt(msec / 1000 / 60 / 60 % 24)\n\t\t\tlet min = parseInt(msec / 1000 / 60 % 60)\n\t\t\tlet sec = parseInt(msec / 1000 % 60)\n\t\t\tthis.day = day\n\t\t\tthis.hr = hr > 9 ? hr : '0' + hr\n\t\t\tthis.min = min > 9 ? min : '0' + min\n\t\t\tthis.sec = sec > 9 ? sec : '0' + sec\n\t\t\tconst that = this\n\t\t\tif (hr >= 0 && min >= 0 && sec >= 0) {\n\t\t\t\t//倒计时结束关闭订单\n\t\t\t\tif (hr == 0 && min == 0 && sec == 0) {\n\t\t\t\t\tthis.$message({\n\t\t\t\t\t\ttype: 'warning',\n\t\t\t\t\t\tmessage: '考试时间结束,已自动提交试卷'\n\t\t\t\t\t});\n\t\t\t\t\tclearInterval(this.timer)\n\t\t\t\t\t// this.submitPaper()\n\t\t\t\t\tthis.param.questionOptionList = []\n\t\t\t\t\tthis.paperData.questionsInfoVos.forEach(e => {\n\t\t\t\t\t\tif (e.type == 2) {\n\t\t\t\t\t\t\tlet ts = \"\"\n\t\t\t\t\t\t\te.result.forEach((r, ri) => {\n\t\t\t\t\t\t\t\tif (ri == 0) {\n\t\t\t\t\t\t\t\t\tts = r\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tts += ',' + r\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\te.result = ts\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.param.questionOptionList.push({\n\t\t\t\t\t\t\tquestionId: e.questionId,\n\t\t\t\t\t\t\tresult: e.result\n\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t\tthis.param.status = 1\n\t\t\t\t\tpaperMenu.submitAnswer(this.param, res => {\n\t\t\t\t\t\tif (res.state) {\n\t\t\t\t\t\t\tclearInterval(this.timer)\n\t\t\t\t\t\t\tthis.$router.go(-2)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\treturn\n\t\t\t\t} else {\n\t\t\t\t\tthis.timer = setTimeout(function() {\n\t\t\t\t\t\tthat.countdown()\n\t\t\t\t\t}, 1000)\n\t\t\t\t}\n\n\t\t\t}\n\t\t},\n\t\tchangeResult(val) {\n\t\t\tconsole.log(val);\n\t\t\tif (val.length > 0 || val != '') {\n\t\t\t\tthis.param.status = 0\n\t\t\t\tthis.newParams = {}\n\t\t\t\tthis.param.questionOptionList = []\n\t\t\t\tthis.newParams = JSON.parse(JSON.stringify(this.paperData))\n\t\t\t\tthis.newParams.questionsInfoVos.forEach(e => {\n\t\t\t\t\tif (e.type == 2) {\n\t\t\t\t\t\tlet ts = \"\"\n\t\t\t\t\t\tif (e.result.length > 0) {\n\t\t\t\t\t\t\te.result.forEach((r, ri) => {\n\t\t\t\t\t\t\t\tif (ri == 0) {\n\t\t\t\t\t\t\t\t\tts = r\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tts += ',' + r\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\te.result = ts\n\t\t\t\t\t}\n\t\t\t\t\tthis.param.questionOptionList.push({\n\t\t\t\t\t\tquestionId: e.questionId,\n\t\t\t\t\t\tresult: e.result\n\n\t\t\t\t\t})\n\n\t\t\t\t})\n\t\t\t\tpaperMenu.submitAnswer(this.param, res => {\n\t\t\t\t\tif (res.state) {}\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\t//提交试卷\n\t\tsubmitPaper() {\n\t\t\t\n\t\t\tconsole.log('提交试卷');\n\t\t\t// return\n\t\t\tthis.param.questionOptionList = []\n\t\t\tthis.paperData.questionsInfoVos.forEach(e => {\n\t\t\t\tif (e.type == 2) {\n\t\t\t\t\tconsole.log(e.result);\n\t\t\t\t\tlet ts = \"\"\n\t\t\t\t\tif (e.result.length > 0) {\n\t\t\t\t\t\te.result.forEach((r, ri) => {\n\t\t\t\t\t\t\tif (ri == 0) {\n\t\t\t\t\t\t\t\tts = r\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tts += ',' + r\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\te.result = ts\n\t\t\t\t\t}else{\n\t\t\t\t\t\te.result = ts\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tthis.param.questionOptionList.push({\n\t\t\t\t\tquestionId: e.questionId,\n\t\t\t\t\tresult: e.result\n\n\t\t\t\t})\n\t\t\t})\n\t\t\t\n\t\t\t\tthis.param.status = 1\n\t\t\t\tpaperMenu.submitAnswer(this.param, res => {\n\t\t\t\t\tif (res.state) {\n\t\t\t\t\t\tclearInterval(this.timer)\n\t\t\t\t\t\tthis.$message({\n\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\tmessage: '提交成功'\n\t\t\t\t\t\t});\n\t\t\t\t\t\tthis.$router.go(-2)\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\n\n\t\t\t// this.$router.push({\n\t\t\t// \tname: 'paperMenu'\n\t\t\t// })\n\t\t\t// this.$router.go(-1)\n\t\t},\n\t\tclickTag(item) {\n\t\t\titem.tag = !item.tag\n\t\t},\n\t\t//强制交卷\n\t\tmandatory() {\n\t\t\tconsole.log('强制交卷');\n\t\t\tthis.param.status = 1\n\t\t\tpaperMenu.submitAnswer(this.param, res => {\n\t\t\t\tif (res.state) {\n\t\t\t\t\tclearInterval(this.timer)\n\t\t\t\t\tthis.$message({\n\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\tmessage: '已强制交卷'\n\t\t\t\t\t});\n\t\t\t\t\tthis.$router.go(-2)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n}\n",null]}