1 |
- {"version":3,"sources":["webpack:///src/views/answer-sheet/Preview.vue","webpack:///./src/views/answer-sheet/Preview.vue?cae3","webpack:///./src/views/answer-sheet/Preview.vue?5a74","webpack:///./src/views/answer-sheet/Preview.vue?d98f","webpack:///./src/views/answer-sheet/Preview.vue","webpack:///./src/views/answer-sheet/Preview.vue?69c0","webpack:///./src/views/answer-sheet/Preview.vue?3827","webpack:///./src/views/answer-sheet/Preview.vue?3f69"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;AACA;AACA;AACA;AAWA;AACA,iBADA;AAEA;AACA;AADA,GAFA;AAKA,aALA;AAMA,WANA;AAOA,MAPA,kBAOA;AACA;AACA;AADA;AAGA,GAXA;AAYA,sSACA,qGADA;AAEA,iBAFA,2BAEA;AACA;AACA;AAAA,UACA,0CADA;AAAA,UAEA,6CAFA;AAAA,UAGA,+CAHA;AAKA;AACA;AACA;AACA,oBADA;AAEA;AAFA;AAIA;AAfA,IAZA;AA6BA,WA7BA;AA8BA,SA9BA,qBA8BA,CACA,CA/BA;AAgCA,SAhCA,qBAgCA;AACA;AACA,GAlCA;AAmCA,qSACA;AAAA;AACA,qFADA;AAEA,yFAFA;AAGA,yFAHA;AAIA,2FAJA;AAKA,oFALA;AAMA,sFANA;AAOA,uFAPA;AAQA,yFARA;AASA;AATA,IADA;AAYA,kBAZA,4BAYA;AACA;AACA;AAEA;AACA,4DAHA,CAIA;;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA,SAZA,CAaA;;;AACA;AACA;AACA,SAFA,MAEA;AACA;AACA,oEAFA,CAIA;;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA,KAlDA;AAmDA,UAnDA,oBAmDA;AACA,kCADA,CAEA;AACA;AACA;;AACA,4BALA,CAMA;AACA;AACA,KA3DA;AA4DA,WA5DA,qBA4DA;AAAA;;AACA;AACA,sBADA;AAEA,uBAFA;AAGA,mBAH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;AACe,gF;;;;;;;;;;;;ACvCf;AAAA;AAAA,wCAAgS,CAAgB,wUAAG,EAAC,C;;;;;;;;;;;;ACApT;AAAA;AAAA;AAAA;AAAgiB,CAAgB,siBAAG,EAAC,C;;;;;;;;;;;;ACApjB;AAAA;AAAA;AAAA;AAAA;AAAA","file":"js/38.js","sourcesContent":["<template>\r\n <div class=\"preview\">\r\n <div class=\"preview-card\">\r\n <toPdfHtml ref=\"toPdfHtml\"></toPdfHtml>\r\n </div>\r\n <div class=\"btn-box\">\r\n <button class=\"btn btn-go-back\" @click=\"goBack\">关闭</button>\r\n <button class=\"btn btn-card-down\" @click=\"downPdf\">下载样例</button>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport toPdfHtml from './toPdfHtml/Index'\r\nimport {getOnlinePdf} from \"@/api/answer-sheet\";\r\nimport {mapGetters, mapMutations} from \"vuex\";\r\nimport {\r\n SET_ANSWER_CARD_TYPE,\r\n SET_BIG_TOPIC_ARR,\r\n SET_CARD_SETTING,\r\n SET_INITPAGE_FLAG,\r\n SET_PAGETOPIC_ARR,\r\n SET_PAPER_LIST_DATA,\r\n SET_PAPER_SOURCE,\r\n SET_TEST_FORM_DATA,\r\n SET_IS_PREVIEW_BACK, SET_SUBJECT\r\n} from \"@/store/constant\";\r\nexport default {\r\n name: \"Preview\",\r\n components:{\r\n toPdfHtml\r\n },\r\n filters:{},\r\n props:{},\r\n data(){\r\n return {\r\n testFormData:{}\r\n }\r\n },\r\n computed:{\r\n ...mapGetters('answerSheet',['cardSetting','sizeConfig',]),\r\n calcPaperSize(){\r\n // store/answer.sheet.js对应字段注释\r\n let pageStatus = this.cardSetting.paperSize,\r\n pageDirection = this.cardSetting.direction,\r\n pageWidth = this.sizeConfig[pageStatus].width,\r\n pageHeight = this.sizeConfig[pageStatus].height;\r\n\r\n let width = pageDirection === 1 ? pageHeight : pageWidth;\r\n let height = pageDirection === 1 ? pageWidth : pageHeight;\r\n return {\r\n width,\r\n height\r\n }\r\n },\r\n },\r\n watch:{},\r\n created(){\r\n },\r\n mounted(){\r\n this.getDefaultData();\r\n },\r\n methods:{\r\n ...mapMutations('answerSheet', {setCardSetting:SET_CARD_SETTING,\r\n setBigTopicArr: SET_BIG_TOPIC_ARR,\r\n setPaperListData:SET_PAPER_LIST_DATA,\r\n setBigTopicPageArr:SET_PAGETOPIC_ARR,\r\n setAnswerCardType:SET_ANSWER_CARD_TYPE,\r\n setPaperSource:SET_PAPER_SOURCE,\r\n setInitPageFlag:SET_INITPAGE_FLAG,\r\n setTestFormData:SET_TEST_FORM_DATA,\r\n setIsPreviewBack:SET_IS_PREVIEW_BACK,\r\n setSubject:SET_SUBJECT,\r\n }),\r\n getDefaultData(){\r\n //不经过编辑页直接访问预览页\r\n if(this.cardSetting.examGroupId==0){\r\n\r\n this.cardSetting.examGroupId = this.$route.query.exam_group_id;\r\n this.cardType = Number(this.$route.query.card_type);\r\n // this.editType = this.$route.query.editType;//只有第三方有\r\n if(this.cardType===undefined){\r\n this.$message.error('无法获取答题卡类型!')\r\n return false\r\n }\r\n if(this.cardSetting.examGroupId===undefined){\r\n this.$message.error('无法获取考试id!')\r\n return false\r\n }\r\n //知心慧学数学\r\n if(this.cardType===1){\r\n console.log('知心慧学直接预览')\r\n }else {\r\n let resData = JSON.parse(localStorage.getItem('previewPosition'));\r\n let position = JSON.parse(resData.savePrintInfo).position;\r\n\r\n //直接预览第三方答题卡\r\n this.cardSettings = position.cardSetting;\r\n this.cardSettings.title = resData.testFormData.examName;\r\n this.testFormData = resData.testFormData;\r\n\r\n this.setSubject(Number(resData.testFormData.subjectId));\r\n this.setCardSetting(this.cardSettings)\r\n this.setBigTopicArr(position.bigTopicArr)\r\n this.setPaperListData(position.paperListData);\r\n this.setBigTopicPageArr(JSON.parse(JSON.stringify(position.bigTopicPageArr)));\r\n\r\n this.$refs.toPdfHtml.getDefaultData();\r\n\r\n }\r\n\r\n }\r\n },\r\n goBack(){\r\n this.setIsPreviewBack(true);\r\n // if(this.testFormData.referrerUrl){\r\n // window.location.href = this.testFormData.referrerUrl+\"/isCardReturn=true\"\r\n // }else{\r\n window.history.back();\r\n // }\r\n // this.$router.push({ path: '/AnswerSheet', query: { exam_group_id:this.cardSetting.examGroupId,card_type:1 }})\r\n },\r\n downPdf(){\r\n let upData = {\r\n width: '210mm',\r\n height: '297mm',\r\n name: 'pdf',\r\n examGroupId: '12345678',\r\n pdfHtml: 'pdfHtml'\r\n }\r\n let pdfHtm = '';\r\n pdfHtm = pdfHtm+'<!DOCTYPE html>';\r\n pdfHtm = pdfHtm+'<html lang=\"en\">';\r\n pdfHtm = pdfHtm+'<head>';\r\n pdfHtm = pdfHtm+'<meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">';\r\n pdfHtm = pdfHtm+'<title>Document</title>';\r\n pdfHtm = pdfHtm+'<link rel=\"stylesheet\" href=\"'+process.env.projectConfig.phpPath+'/answer-sheet/toPdfHtml.css\">';\r\n pdfHtm = pdfHtm+'<link rel=\"stylesheet\" href=\"'+process.env.projectConfig.phpPath+'/answer-sheet/fonts/iconfont.css\">';\r\n pdfHtm = pdfHtm+'</head>';\r\n pdfHtm = pdfHtm+'<body>';\r\n pdfHtm = pdfHtm+this.$refs.toPdfHtml.$el.outerHTML;\r\n pdfHtm = pdfHtm+'</body></html>';\r\n\r\n\r\n upData.width = this.calcPaperSize.width+'mm'\r\n upData.height = this.calcPaperSize.height+'mm'\r\n upData.name = this.cardSetting.title\r\n upData.pdfHtml = pdfHtm;\r\n\r\n let uploadForm = new FormData();\r\n Object.keys(upData).forEach((key) => {\r\n uploadForm.append(key, upData[key]);\r\n });\r\n getOnlinePdf(uploadForm).then(res =>{\r\n // let resData = JSON.parse(res);\r\n if(res.success==0){\r\n this.$message.error('生成pdf失败,请稍后再试!')\r\n return false\r\n }else {\r\n location.href = process.env.projectConfig.apiBaseUrl+'/third/download?url='+res.data+'&title=pdf-'+this.cardSetting.title+'.pdf'\r\n // window.open(res.data)\r\n }\r\n })\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped lang=\"less\">\r\n.preview{\r\n background-color: #666;\r\n .preview-card{\r\n\r\n }\r\n .btn-box{\r\n position: fixed;\r\n top: 20px;\r\n right: 20px;\r\n z-index: 99999;\r\n .btn{\r\n margin: 0 10px;\r\n width: 80px;\r\n height: 40px;\r\n line-height: 40px;\r\n border-radius: 4px;\r\n text-align: center;\r\n font-size: 16px;\r\n color: #fff;\r\n background: #97b1c7;\r\n }\r\n .btn-card-save{\r\n background: #85b3e7;\r\n }\r\n .btn-card-down{\r\n background: #5bcf9a;\r\n }\r\n }\r\n}\r\n</style>\r\n","var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"preview\" }, [\n _c(\n \"div\",\n { staticClass: \"preview-card\" },\n [_c(\"toPdfHtml\", { ref: \"toPdfHtml\" })],\n 1\n ),\n _c(\"div\", { staticClass: \"btn-box\" }, [\n _c(\n \"button\",\n { staticClass: \"btn btn-go-back\", on: { click: _vm.goBack } },\n [_vm._v(\"关闭\")]\n ),\n _c(\n \"button\",\n { staticClass: \"btn btn-card-down\", on: { click: _vm.downPdf } },\n [_vm._v(\"下载样例\")]\n )\n ])\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".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\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!../../../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/index.js??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/index.js??vue-loader-options!./Preview.vue?vue&type=style&index=0&id=09bbe1c3&scoped=true&lang=less&\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar add = require(\"!../../../node_modules/vue-style-loader/lib/addStylesClient.js\").default\nvar update = add(\"0c5a3238\", content, false, {\"sourceMap\":false,\"shadowMode\":false});\n// Hot Module Replacement\nif(module.hot) {\n // When the styles change, update the <style> tags\n if(!content.locals) {\n module.hot.accept(\"!!../../../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/index.js??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/index.js??vue-loader-options!./Preview.vue?vue&type=style&index=0&id=09bbe1c3&scoped=true&lang=less&\", function() {\n var newContent = require(\"!!../../../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/index.js??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/index.js??vue-loader-options!./Preview.vue?vue&type=style&index=0&id=09bbe1c3&scoped=true&lang=less&\");\n if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n update(newContent);\n });\n }\n // When the module is disposed, remove the <style> tags\n module.hot.dispose(function() { update(); });\n}","import { render, staticRenderFns } from \"./Preview.vue?vue&type=template&id=09bbe1c3&scoped=true&\"\nimport script from \"./Preview.vue?vue&type=script&lang=js&\"\nexport * from \"./Preview.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Preview.vue?vue&type=style&index=0&id=09bbe1c3&scoped=true&lang=less&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"09bbe1c3\",\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"F:\\\\zcg-project\\\\git-code\\\\zsy-as2-web-nx\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('09bbe1c3')) {\n api.createRecord('09bbe1c3', component.options)\n } else {\n api.reload('09bbe1c3', component.options)\n }\n module.hot.accept(\"./Preview.vue?vue&type=template&id=09bbe1c3&scoped=true&\", function () {\n api.rerender('09bbe1c3', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/views/answer-sheet/Preview.vue\"\nexport default component.exports","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Preview.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Preview.vue?vue&type=script&lang=js&\"","import mod from \"-!../../../node_modules/vue-style-loader/index.js??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/index.js??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/index.js??vue-loader-options!./Preview.vue?vue&type=style&index=0&id=09bbe1c3&scoped=true&lang=less&\"; export default mod; export * from \"-!../../../node_modules/vue-style-loader/index.js??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/index.js??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/index.js??vue-loader-options!./Preview.vue?vue&type=style&index=0&id=09bbe1c3&scoped=true&lang=less&\"","export * from \"-!../../../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/index.js??vue-loader-options!./Preview.vue?vue&type=template&id=09bbe1c3&scoped=true&\""],"sourceRoot":""}
|