This commit is contained in:
linfso 2024-08-04 20:39:23 +08:00
parent 1690733947
commit ae0a60178f
2 changed files with 37 additions and 19 deletions

View File

@ -3,17 +3,6 @@
<div class="pdf-viewer grid2" >
<div style="position: relative;">
<div class="pdf-bar">
<div class="zoom-minus" @click="zoomIn">
<i class="el-icon-minus" title="缩小"></i>
</div>
<div class="scale" >
<el-input v-model.number="scale" size="mini" @keyup.enter.native="setScaleValue">
<template slot="append">%</template>
</el-input>
</div>
<div class="zoom-plus" @click="zoomOut">
<i class="el-icon-plus" title="放大"></i>
</div>
<div class="prev" @click="prePage">
上一页
</div>
@ -29,6 +18,19 @@
<div class="next" @click="nextPage">
下一页
</div>
<div class="zoom-minus" @click="zoomIn" style="margin-left: 10px;">
<i class="el-icon-minus" title="缩小"></i>
</div>
<div class="scale" >
<el-input v-model.number="scale" size="mini" @keyup.enter.native="setScaleValue">
<template slot="append">%</template>
</el-input>
</div>
<div class="zoom-plus" @click="zoomOut">
<i class="el-icon-plus" title="放大"></i>
</div>
<div class="tools">
<div style="width:100%;text-align: right;">
<!-- <el-button title="" type="primary" v-if="isA4" @click="showSinglePage(1)">切换单页</el-button> -->
@ -447,12 +449,22 @@ export default {
.grid2 {
height: 200px;
// background-image: radial-gradient(circle, rgb(165, 165, 165) 1px, #fff 1px);
background-image: radial-gradient(circle, #9b9b9b 1px, #f0f0f0 1px);
background-size: 30px 30px;
background-position: center center;
}
.grid2x {
height: 200px;
// background-image: radial-gradient(circle, rgb(165, 165, 165) 1px, #fff 1px);
background-image: radial-gradient(circle, #4a4a4a 1px, #3f3f3f 1px);
background-size: 15px 15px;
background-position: center center;
}
.grid3 {
height: 200px;
background-image:
@ -501,15 +513,15 @@ export default {
z-index: 1;
width: 100%;
height: 50px;
height: 36px;
border: 1px solid #ddd;
box-sizing: border-box;
text-align: center;
background: #f8f8f8;
display: flex;
justify-content: center;
align-items: center;
// justify-content: center;
// align-items: center;
& > div {
min-width: 36px;
height: 36px;
@ -565,9 +577,9 @@ export default {
}
.pdf-wrapper {
position: absolute;
margin-top: 70px;
margin-top: 40px;
width: 100%;
height: calc(100% - 70px);
height: calc(100% - 40px);
overflow: auto;
}
}

View File

@ -57,13 +57,19 @@
</div>
</div>
<el-dialog :key="resetRefreshId+'.dlg'" class="printPreDialog" title="预览" :resizable="true" :visible.sync="openPdfView" width="50%" :close-on-click-modal="false" :destroy-on-close="true" v-dialogDrag append-to-body @close="handleClose">
<el-dialog v-if="openPdfView&&!isInitA4" :key="resetRefreshId+'.dlg'" class="printPreDialog" title="预览" :resizable="true" :visible.sync="openPdfView" width="50%" :close-on-click-modal="false" :destroy-on-close="true" v-dialogDrag append-to-body @close="handleClose">
<div style="height:100%;width:100%;overflow: auto;">
<PdfViewer :key="resetRefreshId+'.pdf'" ref="pdfViewer" v-if="openPdfView&&!isInitA4" :pdfList="pdfList" :isLoadComplete="isLoadComplete" @onPrint="onPdfViewPrint" @close="handleClose"></PdfViewer>
<A4Viewer :key="resetRefreshId+'.pdf'" ref="pdfViewer" v-if="openPdfView&&isInitA4" :pdfList="pdfList" :isLoadComplete="isLoadComplete" @close="handleClose"></A4Viewer>
<PdfViewer :key="resetRefreshId+'.pdf'" ref="pdfViewer" :pdfList="pdfList" :isLoadComplete="isLoadComplete" @onPrint="onPdfViewPrint" @close="handleClose"></PdfViewer>
</div>
</el-dialog>
<el-dialog v-if="openPdfView&&isInitA4" :key="resetRefreshId+'.dlg'" class="printPreDialog" title="预览" :resizable="true" :visible.sync="openPdfView" width="70%" :close-on-click-modal="false" :destroy-on-close="true" v-dialogDrag append-to-body @close="handleClose">
<div style="height:100%;width:100%;overflow: auto;">
<A4Viewer :key="resetRefreshId+'.pdf'" ref="pdfViewer" :pdfList="pdfList" :isLoadComplete="isLoadComplete" @close="handleClose"></A4Viewer>
</div>
</el-dialog>
</div>