|
@@ -0,0 +1,37 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="pdf-box">
|
|
|
|
+ <iframe id="pdfIframe" :src="url" frameborder="0" style="width: 100%; height: 100vh; z-index: 0; position: relative;" @contextmenu.prevent />
|
|
|
|
+ <!-- <div class="pdf-mark" @contextmenu.prevent /> -->
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+export default {
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ url: ''
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ const { fileId, resource } = this.$route.query
|
|
|
|
+ this.url = `${process.env.VUE_APP_BASE_API}/system/fileStorage/preview?fileId=${fileId}&resource=${resource}#toolbar=0&navpanes=0&scrollbar=0`
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ console.log(window.frames['pdfIframe'].contentWindow, 8888)
|
|
|
|
+ console.log(window.frames['pdfIframe'].contentDocument.getElementById('viewer'), 11111111)
|
|
|
|
+ console.log(window.frames['pdfIframe'].document, 2222)
|
|
|
|
+ window.frames['pdfIframe'].contentDocument.body.oncontextmenu = function() {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.pdf-box {
|
|
|
|
+ width: 100vw;
|
|
|
|
+ height: 100vh;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ opacity: 0.99;
|
|
|
|
+}
|
|
|
|
+</style>
|