提交 bcb2d9a7 authored 作者: lihuihui's avatar lihuihui

update:下载pdf

上级 87792985
差异被折叠。
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
"lodash": "^4.17.21", "lodash": "^4.17.21",
"query-string": "^7.0.1", "query-string": "^7.0.1",
"vue": "^2.6.14", "vue": "^2.6.14",
"vue-html2pdf": "^1.8.0",
"vue-router": "^3.5.3", "vue-router": "^3.5.3",
"vuex": "^3.6.2" "vuex": "^3.6.2"
}, },
......
<template> <template>
<div class="container"> <vue-html2pdf
<el-row type="flex" class="row-bg" justify="space-between" style="margin-bottom: 30px"> pdf-format="a1"
<el-col :show-layout="false"
><h1 style="padding-left: 0px; font-size: 30px"> :float-layout="false"
{{ $route.query.examination_name }} <span style="color: #c01540; font-size: 14px">*部分数据未进行评价</span> :enable-download="true"
</h1> :preview-modal="false"
</el-col> :manual-pagination="true"
<el-col :span="10"> :paginate-elements-by-height="500"
<el-select v-model="value" placeholder="请选择"> filename="file"
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option> pdf-content-width="100%"
</el-select> ref="html2Pdf"
<el-button type="text" style="margin-left: 30px">导出pdf</el-button> >
</el-col> <section slot="pdf-content">
</el-row> <div class="container">
<template v-if="dataInfo.paper_info"> <el-row type="flex" class="row-bg" justify="space-between" style="margin-bottom: 30px">
<el-row :gutter="10" class="row-bg"> <el-col
<el-col :span="8" class="col"><exam-info :dataInfo="dataInfo" /></el-col> ><h1 style="padding-left: 0px; font-size: 30px">
<el-col :span="8" class="col"><submission :dataInfo="dataInfo" /></el-col> {{ $route.query.examination_name }} <span style="color: #c01540; font-size: 14px">*部分数据未进行评价</span>
<el-col :span="7"><score :dataInfo="dataInfo" /></el-col> </h1>
</el-row> </el-col>
<el-row :gutter="10" class="row-bg"> <el-col :span="10">
<el-col :span="12" class="col" <el-select v-model="value" placeholder="请选择">
><ScoreRanking <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
:course_id="$route.query.course_id" </el-select>
:examination_id="$route.query.examination_id" <el-button type="text" style="margin-left: 30px" @click="$refs.html2Pdf.generatePdf()">导出pdf</el-button>
:chapter_id="$route.query.chapter_id" </el-col>
:type="$route.query.type" </el-row>
:dataInfo="dataInfo.need_check_num" <template v-if="dataInfo.paper_info">
/></el-col> <el-row :gutter="10" class="row-bg">
<el-col :span="11" <el-col :span="8" class="col"><exam-info :dataInfo="dataInfo" /></el-col>
><TitleData <el-col :span="8" class="col"><submission :dataInfo="dataInfo" /></el-col>
:course_id="$route.query.course_id" <el-col :span="7"><score :dataInfo="dataInfo" /></el-col>
:examination_id="$route.query.examination_id" </el-row>
:chapter_id="$route.query.chapter_id" <el-row :gutter="10" class="row-bg">
:type="$route.query.type" <el-col :span="12" class="col"
:dataInfo="dataInfo.need_check_num" ><ScoreRanking
/></el-col> :course_id="$route.query.course_id"
</el-row> :examination_id="$route.query.examination_id"
<el-row :gutter="10" class="row-bg"> :chapter_id="$route.query.chapter_id"
<el-col :span="8" class="col"><result :dataInfo="dataInfo" /></el-col> :type="$route.query.type"
<el-col :span="8" class="col"><score-range :dataInfo="dataInfo" /></el-col> :dataInfo="dataInfo.need_check_num"
<el-col :span="7"><question-type :dataInfo="dataInfo" /></el-col> /></el-col>
</el-row> <el-col :span="11"
</template> ><TitleData
</div> :course_id="$route.query.course_id"
:examination_id="$route.query.examination_id"
:chapter_id="$route.query.chapter_id"
:type="$route.query.type"
:dataInfo="dataInfo.need_check_num"
/></el-col>
</el-row>
<el-row :gutter="10" class="row-bg">
<el-col :span="8" class="col"><result :dataInfo="dataInfo" /></el-col>
<el-col :span="8" class="col"><score-range :dataInfo="dataInfo" /></el-col>
<el-col :span="7"><question-type :dataInfo="dataInfo" /></el-col>
</el-row>
</template>
</div>
</section>
</vue-html2pdf>
</template> </template>
<script> <script>
import { getExamDataInfo } from '../api' import { getExamDataInfo } from '../api'
import VueHtml2pdf from 'vue-html2pdf'
import ExamInfo from '../components/ExamInfo.vue' import ExamInfo from '../components/ExamInfo.vue'
import Submission from '../components/Submission.vue' import Submission from '../components/Submission.vue'
import Score from '../components/Score.vue' import Score from '../components/Score.vue'
...@@ -57,7 +73,7 @@ import Result from '../components/Result.vue' ...@@ -57,7 +73,7 @@ import Result from '../components/Result.vue'
import ScoreRange from '../components/ScoreRange.vue' import ScoreRange from '../components/ScoreRange.vue'
import QuestionType from '../components/QuestionType.vue' import QuestionType from '../components/QuestionType.vue'
export default { export default {
components: { ExamInfo, Submission, Score, ScoreRanking, TitleData, Result, ScoreRange, QuestionType }, components: { VueHtml2pdf, ExamInfo, Submission, Score, ScoreRanking, TitleData, Result, ScoreRange, QuestionType },
data() { data() {
return { return {
options: [ options: [
......
...@@ -15,6 +15,11 @@ export default defineConfig({ ...@@ -15,6 +15,11 @@ export default defineConfig({
}, },
proxy: { proxy: {
'/api': 'https://project-api.ezijing.com' '/api': 'https://project-api.ezijing.com'
// '/api': {
// target: 'http://localhost-zy-api.ezijing.com',
// changeOrigin: true,
// rewrite: path => path.replace(/^\/api\/zy/, '')
// }
} }
}, },
resolve: { resolve: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论