|
|
@ -1,6 +1,6 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-dialog title="导出" :visible.sync="exportVisible" width="100%" :modal="false" v-loading="loading" top="5500px"> |
|
|
|
<el-dialog title="导出" :visible.sync="exportVisible" width="1800px" :modal="false" v-loading="loading" top="5500px"> |
|
|
|
<div class="testpaper" id="pdfDom"> |
|
|
|
<div class="testpaper" id="pdfDom"> |
|
|
|
<h1 class="title">{{paperName}}</h1> |
|
|
|
<h1 class="title">{{paperName}}</h1> |
|
|
|
<ul class="types"> |
|
|
|
<ul class="types"> |
|
|
@ -169,9 +169,9 @@ function getUrlBase64(url, ext, callback) { |
|
|
|
img.crossOrigin = 'Anonymous'; |
|
|
|
img.crossOrigin = 'Anonymous'; |
|
|
|
img.src = url; |
|
|
|
img.src = url; |
|
|
|
img.onload = function () { |
|
|
|
img.onload = function () { |
|
|
|
canvas.height = 300; //指定画板的高度,自定义 |
|
|
|
canvas.width = 1400; //指定画板的宽度,自定义 |
|
|
|
canvas.width = 300; //指定画板的宽度,自定义 |
|
|
|
canvas.height = 800; //指定画板的高度,自定义 |
|
|
|
ctx.drawImage(img, 0, 0, 300, 300); //参数可自定义 |
|
|
|
ctx.drawImage(img, 0, 0, 1400, 800); //参数可自定义 |
|
|
|
var dataURL = canvas.toDataURL("image/" + ext); |
|
|
|
var dataURL = canvas.toDataURL("image/" + ext); |
|
|
|
callback.call(this, dataURL); //回掉函数获取Base64编码 |
|
|
|
callback.call(this, dataURL); //回掉函数获取Base64编码 |
|
|
|
canvas = null; |
|
|
|
canvas = null; |
|
|
@ -335,10 +335,9 @@ export default { |
|
|
|
list[i].map(n => { |
|
|
|
list[i].map(n => { |
|
|
|
let src = reg.exec(n.questionStem) |
|
|
|
let src = reg.exec(n.questionStem) |
|
|
|
if(src){ |
|
|
|
if(src){ |
|
|
|
console.log(11,src,src[0],reg.lastIndex) |
|
|
|
|
|
|
|
src = src[0].replace('<img src="','').replace('">','') |
|
|
|
src = src[0].replace('<img src="','').replace('">','') |
|
|
|
getUrlBase64(src, 'jpg', function (base64) { |
|
|
|
getUrlBase64(src, 'jpg', function (base64) { |
|
|
|
n.questionStem = n.questionStem.replace(reg,`<img width="300" src="${base64}">`) |
|
|
|
n.questionStem = n.questionStem.replace(reg,`<img width="1400" height="800" src="${base64}">`) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
@ -500,15 +499,14 @@ export default { |
|
|
|
.title{ |
|
|
|
.title{ |
|
|
|
margin-bottom: 30px; |
|
|
|
margin-bottom: 30px; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
font-size: 30px; |
|
|
|
font-size: 29px; |
|
|
|
font-weight: bold; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
.types{ |
|
|
|
.types{ |
|
|
|
&>li{ |
|
|
|
&>li{ |
|
|
|
margin-bottom: 30px; |
|
|
|
margin-bottom: 30px; |
|
|
|
.type{ |
|
|
|
.type{ |
|
|
|
margin-bottom: 10px; |
|
|
|
margin-bottom: 10px; |
|
|
|
font-size: 16px; |
|
|
|
font-size: 18px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.ques{ |
|
|
|
.ques{ |
|
|
@ -517,7 +515,8 @@ export default { |
|
|
|
.stem{ |
|
|
|
.stem{ |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
margin-bottom: 10px; |
|
|
|
margin-bottom: 10px; |
|
|
|
font-size: 14px; |
|
|
|
font-size: 16px; |
|
|
|
|
|
|
|
line-height: 1.5; |
|
|
|
.index{ |
|
|
|
.index{ |
|
|
|
margin: 2px 10px 0 0; |
|
|
|
margin: 2px 10px 0 0; |
|
|
|
} |
|
|
|
} |
|
|
@ -526,7 +525,8 @@ export default { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
p{ |
|
|
|
p{ |
|
|
|
margin-right: 20px; |
|
|
|
margin-right: 20px; |
|
|
|
font-size: 12px; |
|
|
|
font-size: 16px; |
|
|
|
|
|
|
|
line-height: 1.5; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|