(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[38],{ /***/ "./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/views/answer-sheet/Preview.vue?vue&type=script&lang=js&": /*!************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/answer-sheet/Preview.vue?vue&type=script&lang=js& ***! \************************************************************************************************************************************************************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.for-each */ "./node_modules/core-js/modules/es.array.for-each.js"); /* harmony import */ var core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.number.constructor */ "./node_modules/core-js/modules/es.number.constructor.js"); /* harmony import */ var core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var core_js_modules_es_object_keys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.keys */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_object_keys__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_keys__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var F_zcg_project_git_code_zsy_as2_web_nx_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2 */ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"); /* harmony import */ var _toPdfHtml_Index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./toPdfHtml/Index */ "./src/views/answer-sheet/toPdfHtml/Index.vue"); /* harmony import */ var _api_answer_sheet__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/api/answer-sheet */ "./src/api/answer-sheet.js"); /* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vuex */ "./node_modules/vuex/dist/vuex.esm.js"); /* harmony import */ var _store_constant__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/store/constant */ "./src/store/constant.js"); // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["default"] = ({ name: "Preview", components: { toPdfHtml: _toPdfHtml_Index__WEBPACK_IMPORTED_MODULE_5__["default"] }, filters: {}, props: {}, data: function data() { return { testFormData: {} }; }, computed: Object(F_zcg_project_git_code_zsy_as2_web_nx_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(F_zcg_project_git_code_zsy_as2_web_nx_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_4__["default"])({}, Object(vuex__WEBPACK_IMPORTED_MODULE_7__["mapGetters"])('answerSheet', ['cardSetting', 'sizeConfig'])), {}, { calcPaperSize: function calcPaperSize() { // store/answer.sheet.js对应字段注释 var pageStatus = this.cardSetting.paperSize, pageDirection = this.cardSetting.direction, pageWidth = this.sizeConfig[pageStatus].width, pageHeight = this.sizeConfig[pageStatus].height; var width = pageDirection === 1 ? pageHeight : pageWidth; var height = pageDirection === 1 ? pageWidth : pageHeight; return { width: width, height: height }; } }), watch: {}, created: function created() {}, mounted: function mounted() { this.getDefaultData(); }, methods: Object(F_zcg_project_git_code_zsy_as2_web_nx_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(F_zcg_project_git_code_zsy_as2_web_nx_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_4__["default"])({}, Object(vuex__WEBPACK_IMPORTED_MODULE_7__["mapMutations"])('answerSheet', { setCardSetting: _store_constant__WEBPACK_IMPORTED_MODULE_8__["SET_CARD_SETTING"], setBigTopicArr: _store_constant__WEBPACK_IMPORTED_MODULE_8__["SET_BIG_TOPIC_ARR"], setPaperListData: _store_constant__WEBPACK_IMPORTED_MODULE_8__["SET_PAPER_LIST_DATA"], setBigTopicPageArr: _store_constant__WEBPACK_IMPORTED_MODULE_8__["SET_PAGETOPIC_ARR"], setAnswerCardType: _store_constant__WEBPACK_IMPORTED_MODULE_8__["SET_ANSWER_CARD_TYPE"], setPaperSource: _store_constant__WEBPACK_IMPORTED_MODULE_8__["SET_PAPER_SOURCE"], setInitPageFlag: _store_constant__WEBPACK_IMPORTED_MODULE_8__["SET_INITPAGE_FLAG"], setTestFormData: _store_constant__WEBPACK_IMPORTED_MODULE_8__["SET_TEST_FORM_DATA"], setIsPreviewBack: _store_constant__WEBPACK_IMPORTED_MODULE_8__["SET_IS_PREVIEW_BACK"], setSubject: _store_constant__WEBPACK_IMPORTED_MODULE_8__["SET_SUBJECT"] })), {}, { getDefaultData: function getDefaultData() { //不经过编辑页直接访问预览页 if (this.cardSetting.examGroupId == 0) { this.cardSetting.examGroupId = this.$route.query.exam_group_id; this.cardType = Number(this.$route.query.card_type); // this.editType = this.$route.query.editType;//只有第三方有 if (this.cardType === undefined) { this.$message.error('无法获取答题卡类型!'); return false; } if (this.cardSetting.examGroupId === undefined) { this.$message.error('无法获取考试id!'); return false; } //知心慧学数学 if (this.cardType === 1) { console.log('知心慧学直接预览'); } else { var resData = JSON.parse(localStorage.getItem('previewPosition')); var position = JSON.parse(resData.savePrintInfo).position; //直接预览第三方答题卡 this.cardSettings = position.cardSetting; this.cardSettings.title = resData.testFormData.examName; this.testFormData = resData.testFormData; this.setSubject(Number(resData.testFormData.subjectId)); this.setCardSetting(this.cardSettings); this.setBigTopicArr(position.bigTopicArr); this.setPaperListData(position.paperListData); this.setBigTopicPageArr(JSON.parse(JSON.stringify(position.bigTopicPageArr))); this.$refs.toPdfHtml.getDefaultData(); } } }, goBack: function goBack() { this.setIsPreviewBack(true); // if(this.testFormData.referrerUrl){ // window.location.href = this.testFormData.referrerUrl+"/isCardReturn=true" // }else{ window.history.back(); // } // this.$router.push({ path: '/AnswerSheet', query: { exam_group_id:this.cardSetting.examGroupId,card_type:1 }}) }, downPdf: function downPdf() { var _this = this; var upData = { width: '210mm', height: '297mm', name: 'pdf', examGroupId: '12345678', pdfHtml: 'pdfHtml' }; var pdfHtm = ''; pdfHtm = pdfHtm + ''; pdfHtm = pdfHtm + ''; pdfHtm = pdfHtm + ''; pdfHtm = pdfHtm + ''; pdfHtm = pdfHtm + 'Document'; pdfHtm = pdfHtm + ''; pdfHtm = pdfHtm + ''; pdfHtm = pdfHtm + ''; pdfHtm = pdfHtm + ''; pdfHtm = pdfHtm + this.$refs.toPdfHtml.$el.outerHTML; pdfHtm = pdfHtm + ''; upData.width = this.calcPaperSize.width + 'mm'; upData.height = this.calcPaperSize.height + 'mm'; upData.name = this.cardSetting.title; upData.pdfHtml = pdfHtm; var uploadForm = new FormData(); Object.keys(upData).forEach(function (key) { uploadForm.append(key, upData[key]); }); Object(_api_answer_sheet__WEBPACK_IMPORTED_MODULE_6__["getOnlinePdf"])(uploadForm).then(function (res) { // let resData = JSON.parse(res); if (res.success == 0) { _this.$message.error('生成pdf失败,请稍后再试!'); return false; } else { location.href = {"apiBaseUrl":"http://zsyas2.dev.xueping.com","siteUrl":"http://zsyas2.dev.xueping.com/vue/index.html#","phpPath":"http://zsyas2.dev.xueping.com/vue","phpBaseUrl":"/","xiaoben":"http://xbas2.dev.xiaoben.com"}.apiBaseUrl + '/third/download?url=' + res.data + '&title=pdf-' + _this.cardSetting.title + '.pdf'; // window.open(res.data) } }); } }) }); /***/ }), /***/ "./node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"305c61fc-vue-loader-template\"}!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/views/answer-sheet/Preview.vue?vue&type=template&id=09bbe1c3&scoped=true&": /*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"305c61fc-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/answer-sheet/Preview.vue?vue&type=template&id=09bbe1c3&scoped=true& ***! \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c("div", { staticClass: "preview" }, [ _c( "div", { staticClass: "preview-card" }, [_c("toPdfHtml", { ref: "toPdfHtml" })], 1 ), _c("div", { staticClass: "btn-box" }, [ _c( "button", { staticClass: "btn btn-go-back", on: { click: _vm.goBack } }, [_vm._v("关闭")] ), _c( "button", { staticClass: "btn btn-card-down", on: { click: _vm.downPdf } }, [_vm._v("下载样例")] ) ]) ]) } var staticRenderFns = [] render._withStripped = true /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/less-loader/dist/cjs.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/views/answer-sheet/Preview.vue?vue&type=style&index=0&id=09bbe1c3&scoped=true&lang=less&": /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--10-oneOf-1-2!./node_modules/less-loader/dist/cjs.js??ref--10-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/answer-sheet/Preview.vue?vue&type=style&index=0&id=09bbe1c3&scoped=true&lang=less& ***! \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".preview[data-v-09bbe1c3] {\n background-color: #666;\n}\n.preview .btn-box[data-v-09bbe1c3] {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 99999;\n}\n.preview .btn-box .btn[data-v-09bbe1c3] {\n margin: 0 10px;\n width: 80px;\n height: 40px;\n line-height: 40px;\n border-radius: 4px;\n text-align: center;\n font-size: 16px;\n color: #fff;\n background: #97b1c7;\n}\n.preview .btn-box .btn-card-save[data-v-09bbe1c3] {\n background: #85b3e7;\n}\n.preview .btn-box .btn-card-down[data-v-09bbe1c3] {\n background: #5bcf9a;\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/vue-style-loader/index.js?!./node_modules/css-loader/dist/cjs.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/less-loader/dist/cjs.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/views/answer-sheet/Preview.vue?vue&type=style&index=0&id=09bbe1c3&scoped=true&lang=less&": /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-style-loader??ref--10-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--10-oneOf-1-2!./node_modules/less-loader/dist/cjs.js??ref--10-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/answer-sheet/Preview.vue?vue&type=style&index=0&id=09bbe1c3&scoped=true&lang=less& ***! \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a