{"remainingRequest":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!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\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"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":["import \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.function.name\";\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 { mapState } from 'vuex';\nimport { TableMixin } from '@/mixins/tableMixin';\nimport dictUtils from '@/components/dict/DictSelectUtils.js';\nimport paperMenu from '@/api/examination/paperMenu.js';\nimport screenfull from \"screenfull\";\nexport default {\n  mixins: [TableMixin],\n  name: 'formalTestPaper',\n  components: {},\n  data: function data() {\n    return {\n      circleUrl: \"https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png\",\n      //头像\n      hr: 1,\n      min: 60,\n      sec: 0,\n      radio: '',\n      checkList: [],\n      radio3: '',\n      input: '',\n      textarea: '',\n      end: null,\n      paperData: {},\n      //试卷数据\n      topicList: [],\n      //题目类型\n      formalType: false,\n      //正式考试\n      param: {\n        status: 0,\n        recordId: null,\n        questionOptionList: []\n      },\n      userKey: null,\n      paperName: null,\n      newParams: {},\n      isFull: false,\n      firstFull: true,\n      //是否第一次全屏\n      isScreen: false,\n      nums: 0,\n      lastTime: 0 //默认上一次点击时间为0 \n\n    };\n  },\n  created: function created() {\n    this.topicList = dictUtils.getDictItemsFromCache('sttx');\n  },\n  watch: {\n    nums: function nums(newvalue, oldvalue) {\n      if (this.nums == 2) {\n        this.nums = 0;\n        console.log('增加一次');\n        this.getswitchCount();\n      }\n    }\n  },\n  mounted: function mounted() {\n    var _this = this;\n\n    var element = document.getElementById('testPaper');\n    document.getElementById('full_screen').addEventListener('click', function () {\n      if (screenfull.isEnabled) {\n        screenfull.request(element); // 元素全屏\n        // this.firstFull = false\n\n        _this.isFull = true;\n        _this.isScreen = false;\n      }\n    });\n    window.addEventListener(\"resize\", this.a);\n  },\n  destroyed: function destroyed() {\n    window.removeEventListener('resize', this.a);\n  },\n  methods: {\n    Continue: function Continue() {\n      var element = document.getElementById('testPaper');\n\n      if (screenfull.isEnabled) {\n        screenfull.request(element); // 元素全屏\n\n        this.isFull = true;\n        this.firstFull = false;\n        this.$set(this.isFull);\n      }\n    },\n    b: function b() {\n      if (window.outerHeight === screen.availHeight) {\n        if (window.outerWidth === screen.availWidth) {\n          this.isFull = false;\n          this.firstFull = false;\n          this.isScreen = false;\n          console.log('退出');\n          this.getswitchCount();\n        } else {\n          this.isScreen = false;\n          console.log('退出1');\n        }\n      } else {\n        if (this.isScreen) {\n          this.isFull = false;\n          this.firstFull = false;\n          this.nums++;\n        } else {}\n\n        this.isScreen = true;\n      }\n    },\n    a: function a() {\n      console.log('触发次数+1');\n      this.debounce(this.b(), 1000);\n    },\n    getswitchCount: function getswitchCount() {\n      var _this2 = this;\n\n      console.log('增加作弊次数'); // return\n\n      paperMenu.switchCount(this.param.recordId, function (res) {\n        if (res.errorCode == 201) {\n          window.removeEventListener('resize', _this2.a);\n\n          _this2.mandatory();\n        } else {\n          _this2.loadData();\n        }\n      });\n    },\n    debounce: function debounce(fn, wait) {\n      var timeout = null;\n      wait = wait || 3000;\n      return function () {\n        var that = this;\n        if (timeout !== null) clearTimeout(timeout);\n        timeout = setTimeout(function () {\n          fn.apply(that);\n        }, wait);\n      };\n    },\n    loadData: function loadData() {\n      var _this3 = this;\n\n      console.log(this.$route.params);\n\n      if (this.$route.params.paperId !== {} && typeof this.$route.params.paperId === 'string') {\n        this.userKey = this.$route.params.paperId;\n        this.paperName = this.$route.params.name;\n        sessionStorage.setItem('userkey', this.userKey); //初次收到userKey，存起来\n\n        sessionStorage.setItem('paperName', this.paperName); //初次收到userKey，存起来\n      } else {\n        if (sessionStorage.getItem('userkey')) {\n          this.userKey = sessionStorage.getItem('userkey'); //不是第一次了，取出来\n\n          this.paperName = sessionStorage.getItem('paperName'); //不是第一次了，取出来\n        } else {\n          //如果实在是没有了，就直接去store里面取\n          this.userKey = store.state.user.userInfo.userKey;\n          this.paperName = store.state.user.userInfo.paperName;\n        }\n      }\n\n      var params = {\n        recordId: this.userKey,\n        userId: ''\n      };\n      paperMenu.startExam(params, function (res) {\n        if (res) {\n          var minutes = res.timeLength / 1000 / 60;\n          _this3.end = Date.parse(new Date()) + 1 * minutes * 60 * 1000;\n\n          _this3.countdown();\n\n          res.questionsInfoVos.forEach(function (e) {\n            e.tag = false;\n\n            if (e.result) {\n              if (e.type == 2) {\n                var arr = JSON.parse(JSON.stringify(e.result.split(\",\")));\n                e.result = [];\n                arr.forEach(function (re) {\n                  e.result.push(re);\n                });\n              }\n            } else {\n              if (e.type == 2) {\n                e.result = [];\n              } else {\n                e.result = '';\n              }\n            }\n\n            _this3.topicList.forEach(function (t) {\n              if (e.type == t.value) {\n                e.typeName = t.name;\n              }\n            });\n          });\n          _this3.paperData = res;\n\n          _this3.$set(_this3.paperData);\n\n          _this3.param.recordId = res.recordId;\n        }\n      });\n    },\n    countdown: function countdown() {\n      var _this4 = this;\n\n      var now = Date.parse(new Date());\n      var msec = this.end - now;\n      if (msec < 0) return;\n      var day = parseInt(msec / 1000 / 60 / 60 / 24);\n      var hr = parseInt(msec / 1000 / 60 / 60 % 24);\n      var min = parseInt(msec / 1000 / 60 % 60);\n      var sec = parseInt(msec / 1000 % 60);\n      this.day = day;\n      this.hr = hr > 9 ? hr : '0' + hr;\n      this.min = min > 9 ? min : '0' + min;\n      this.sec = sec > 9 ? sec : '0' + sec;\n      var that = this;\n\n      if (hr >= 0 && min >= 0 && sec >= 0) {\n        //倒计时结束关闭订单\n        if (hr == 0 && min == 0 && sec == 0) {\n          this.$message({\n            type: 'warning',\n            message: '考试时间结束,已自动提交试卷'\n          });\n          clearInterval(this.timer); // this.submitPaper()\n\n          this.param.questionOptionList = [];\n          this.paperData.questionsInfoVos.forEach(function (e) {\n            if (e.type == 2) {\n              var ts = \"\";\n              e.result.forEach(function (r, ri) {\n                if (ri == 0) {\n                  ts = r;\n                } else {\n                  ts += ',' + r;\n                }\n              });\n              e.result = ts;\n            }\n\n            _this4.param.questionOptionList.push({\n              questionId: e.questionId,\n              result: e.result\n            });\n          });\n          this.param.status = 1;\n          paperMenu.submitAnswer(this.param, function (res) {\n            if (res.state) {\n              clearInterval(_this4.timer);\n\n              _this4.$router.go(-2);\n            }\n          });\n          return;\n        } else {\n          this.timer = setTimeout(function () {\n            that.countdown();\n          }, 1000);\n        }\n      }\n    },\n    changeResult: function changeResult(val) {\n      var _this5 = this;\n\n      console.log(val);\n\n      if (val.length > 0 || val != '') {\n        this.param.status = 0;\n        this.newParams = {};\n        this.param.questionOptionList = [];\n        this.newParams = JSON.parse(JSON.stringify(this.paperData));\n        this.newParams.questionsInfoVos.forEach(function (e) {\n          if (e.type == 2) {\n            var ts = \"\";\n\n            if (e.result.length > 0) {\n              e.result.forEach(function (r, ri) {\n                if (ri == 0) {\n                  ts = r;\n                } else {\n                  ts += ',' + r;\n                }\n              });\n            }\n\n            e.result = ts;\n          }\n\n          _this5.param.questionOptionList.push({\n            questionId: e.questionId,\n            result: e.result\n          });\n        });\n        paperMenu.submitAnswer(this.param, function (res) {\n          if (res.state) {}\n        });\n      }\n    },\n    //提交试卷\n    submitPaper: function submitPaper() {\n      var _this6 = this;\n\n      console.log('提交试卷'); // return\n\n      this.param.questionOptionList = [];\n      this.paperData.questionsInfoVos.forEach(function (e) {\n        if (e.type == 2) {\n          console.log(e.result);\n          var ts = \"\";\n\n          if (e.result.length > 0) {\n            e.result.forEach(function (r, ri) {\n              if (ri == 0) {\n                ts = r;\n              } else {\n                ts += ',' + r;\n              }\n            });\n            e.result = ts;\n          } else {\n            e.result = ts;\n          }\n        }\n\n        _this6.param.questionOptionList.push({\n          questionId: e.questionId,\n          result: e.result\n        });\n      });\n      this.param.status = 1;\n      paperMenu.submitAnswer(this.param, function (res) {\n        if (res.state) {\n          clearInterval(_this6.timer);\n\n          _this6.$message({\n            type: 'success',\n            message: '提交成功'\n          });\n\n          _this6.$router.go(-2);\n        }\n      }); // this.$router.push({\n      // \tname: 'paperMenu'\n      // })\n      // this.$router.go(-1)\n    },\n    clickTag: function clickTag(item) {\n      item.tag = !item.tag;\n    },\n    //强制交卷\n    mandatory: function mandatory() {\n      var _this7 = this;\n\n      console.log('强制交卷');\n      this.param.status = 1;\n      paperMenu.submitAnswer(this.param, function (res) {\n        if (res.state) {\n          clearInterval(_this7.timer);\n\n          _this7.$message({\n            type: 'success',\n            message: '已强制交卷'\n          });\n\n          _this7.$router.go(-2);\n        }\n      });\n    }\n  }\n};",null]}