|
|
|
@ -34,7 +34,7 @@ |
|
|
|
|
</div> |
|
|
|
|
<div class="right" id="right"> |
|
|
|
|
<div class="text-right"> |
|
|
|
|
<el-button type="primary" @click="exportPage">导出报告</el-button> |
|
|
|
|
<el-button type="primary" :loading="exporting" @click="exportPage">导出报告</el-button> |
|
|
|
|
</div> |
|
|
|
|
<h6 class="r-title">标准成绩报告</h6> |
|
|
|
|
<div class="info"> |
|
|
|
@ -144,8 +144,10 @@ |
|
|
|
|
</div> |
|
|
|
|
<template v-if="item.questionType === 'essay'"> |
|
|
|
|
<div v-if="ques.stemAttachment" class="m-b-10"> |
|
|
|
|
<el-link class="m-r-10" type="primary">{{ ques.stemAttachment }}</el-link> |
|
|
|
|
<el-button type="primary" size="mini" round @click="download(ques.stemAttachment)">下载</el-button> |
|
|
|
|
<el-link class="m-r-10" type="primary" @click="preview(ques.stemAttachment)">{{ ques.fileName || |
|
|
|
|
ques.stemAttachment }}</el-link> |
|
|
|
|
<el-button type="primary" size="mini" round |
|
|
|
|
@click="download(ques.fileName || ques.stemAttachment, ques.stemAttachment)">下载</el-button> |
|
|
|
|
</div> |
|
|
|
|
<div v-if="ques.uploadInstructions" class="line m-b-10"> |
|
|
|
|
<span>考生上传附件说明:</span> |
|
|
|
@ -180,7 +182,8 @@ |
|
|
|
|
<div v-if="ques.attachmentUrl" class="line"> |
|
|
|
|
<span class="line-label">考生上传附件:</span> |
|
|
|
|
<el-link class="m-r-10" type="primary">{{ ques.attachmentName }}</el-link> |
|
|
|
|
<el-button type="primary" size="mini" round @click="download(ques)">下载</el-button> |
|
|
|
|
<el-button type="primary" size="mini" round |
|
|
|
|
@click="download(ques.attachmentName, ques.attachmentUrl)">下载</el-button> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
@ -219,15 +222,25 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog title="图片预览" :visible.sync="previewImgVisible" width="800px" :close-on-click-modal="false"> |
|
|
|
|
<el-image style="max-width: 100px; max-height: 100px" :src="previewImg" :preview-src-list="[previewImg]"> |
|
|
|
|
</el-image> |
|
|
|
|
</el-dialog> |
|
|
|
|
<PdfDia :key="pdfVisible" :visible.sync="pdfVisible" :src.sync="pdfSrc" /> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import PdfDia from '@/components/pdf' |
|
|
|
|
import QuesConst from '@/const/ques' |
|
|
|
|
import TestPaperConst from '@/const/testPaper' |
|
|
|
|
import Util from '@/libs/util' |
|
|
|
|
import _ from 'lodash' |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
PdfDia |
|
|
|
|
}, |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
numToLetter: Util.numToLetter, |
|
|
|
@ -268,6 +281,11 @@ export default { |
|
|
|
|
outlines: [], |
|
|
|
|
paper: [], |
|
|
|
|
essayExist: 0, |
|
|
|
|
previewImgVisible: false, |
|
|
|
|
previewImg: '', |
|
|
|
|
pdfVisible: false, |
|
|
|
|
pdfSrc: '', |
|
|
|
|
exporting: false, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
@ -427,33 +445,32 @@ export default { |
|
|
|
|
return stem |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 预览附件 |
|
|
|
|
preview (url) { |
|
|
|
|
const ext = url.split('.').pop() |
|
|
|
|
if (Util.isDoc(ext)) { |
|
|
|
|
window.open('https://view.officeapps.live.com/op/view.aspx?src=' + url) |
|
|
|
|
} else if (Util.isImg(ext)) { |
|
|
|
|
this.previewImgVisible = true |
|
|
|
|
this.previewImg = url |
|
|
|
|
} else if (ext === 'pdf') { |
|
|
|
|
this.pdfVisible = true |
|
|
|
|
this.pdfSrc = url |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 下载附件 |
|
|
|
|
download (ques) { |
|
|
|
|
Util.downloadFile(ques.attachmentName, ques.attachmentUrl) |
|
|
|
|
download (name, url) { |
|
|
|
|
Util.downloadFile(name, url) |
|
|
|
|
}, |
|
|
|
|
// 导出 |
|
|
|
|
exportPage () { |
|
|
|
|
const form = Object.assign(this.form, this.info) |
|
|
|
|
const list = JSON.parse(JSON.stringify(this.expData)) |
|
|
|
|
list.map((e, i) => { |
|
|
|
|
const item = this.userScores.find(n => n.judgmentId == e.judgmentId) |
|
|
|
|
if (item && item.runThePicture) e.runThePicture = item.runThePicture |
|
|
|
|
if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList |
|
|
|
|
e.id = i + 1 |
|
|
|
|
// if (e.referenceAnswer && typeof e.referenceAnswer === 'string') e.referenceAnswer = e.referenceAnswer.replace(/<[^>]+>/g, '').replace(/( |&|%s)/g, '').replace(/>/g, '>').replace(/</g, '<') |
|
|
|
|
if (e.answer && typeof e.answer === 'string') e.answer = e.answer.replace(/<[^>]+>/g, '').replace(/( |&|%s)/g, '').replace(/>/g, '>').replace(/</g, '<') |
|
|
|
|
async exportPage () { |
|
|
|
|
this.exporting = true |
|
|
|
|
const res = await this.$get(this.api.exportExamPaperReport, { |
|
|
|
|
reportId: this.reportId |
|
|
|
|
}) |
|
|
|
|
for (const i in form) { |
|
|
|
|
if (form[i] && typeof form[i] === 'string') form[i] = form[i].replace(/<[^>]+>/g, '') |
|
|
|
|
} |
|
|
|
|
form.purpose = form.purpose.replace(/<[^>]+>/g, '') |
|
|
|
|
this.$post(this.project ? this.api.exportBankExperimentReport : this.api.exportLabReport, { |
|
|
|
|
...form, |
|
|
|
|
experimentalData: list |
|
|
|
|
}).then(res => { |
|
|
|
|
console.log(res) |
|
|
|
|
Util.downloadFileDirect(`实验报告.docx`, new Blob([res])) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
console.log(res) |
|
|
|
|
Util.downloadFileDirect(`标准实验报告.docx`, new Blob([res])) |
|
|
|
|
this.exporting = false |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|