PdfPreview.vue
1.01 KB
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
<template>
  <div>
    <a-modal
      :title="'PDF预览'"
      :width="800"
      :visible="batchVisible"
      :confirmLoading="confirmLoading"
      @ok="handleBatchCancel"
      @cancel="handleBatchCancel"
      cancelText="关闭"
      wrapClassName="ant-modal-cust-warp"
      style="top:5%;height: 85%;overflow-y: hidden">
    <iframe
      :id="id"
      :src="url"
      frameborder="0"
      width="100%"
      height="650px" >
    </iframe>
    </a-modal>
  </div>
</template>
<script>
  export default {
    name: "PdfPreviewModal",
    data () {
      return {
        batchVisible: false,
        confirmLoading: false,
        url: '',
        id:"pdfPreviewIframe",
        headers:{}
      }
    },
    created () {
    },
    computed:{
    },
    mounted(){
    },
    methods: {
      handleBatchCancel() {
        this.url = ''
        this.batchVisible = false
      },
      previewFiles (url) {
        this.url=url
        this.batchVisible=true
      },
    }
  }
</script>
<style scoped>
</style>