1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<template>
<div>
<el-dialog
custom-class="pdfDialog"
:title="''"
:width="dWidth + 'px'"
:visible.sync="showPdf"
:close-on-click-modal="true"
:close-on-press-escape="false"
:show-close="true"
:destroy-on-close="true"
top="2vh"
>
<div class="innerBody">
<div class="title">{{ curPdf.articleTitle }}</div>
<div class="refuteList">
<!-- <pdf :src="pdfSrc"></pdf> -->
<pdf-view ref="pdfView" :pdfUrl="pdfSrc" @scale="setScale"></pdf-view>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import PdfView from "../PdfView/index"
export default {
components: { PdfView },
props: {
curPdf: {
type: Object,
},
pdfSrc: String,
},
data() {
return {
showPdf: false,
width: 750,
dWidth: 750,
}
},
methods: {
setScale(val) {
console.log(val)
this.dWidth = this.width * (val / 100)
},
},
watch: {
showPdf(v) {
if (v) {
setTimeout(() => {
this.$refs.pdfView.loadPDF()
}, 250)
}
},
},
}
</script>
<style lang="scss" scoped>
.innerBody {
padding: 0 50px 0px;
// width: 790px;
// height: 882px;
.title {
font-size: 24px;
font-family: AlibabaPuHuiTiM;
color: #333333;
text-align: center;
margin-bottom: 0px;
}
.refuteList {
// height: 600px;
overflow: auto;
}
}
</style>
<style lang="scss">
.pdfDialog {
max-height: 958px;
.el-dialog__header {
// display: none;
padding: 0px !important;
}
}
</style>