Forráskód Böngészése

fix(AddInfo.vue):AddInfo.vue冲突

李晓萍 2 hónapja%!(EXTRA string=óta)
szülő
commit
66ba7b5f80

+ 1 - 0
src/components/Upload/index.vue

@@ -452,6 +452,7 @@ export default {
         const newName = `预览图片${fileType || type}`
         window.open(`#/perview?fileId=${idNum}&absolutePath=${absolutePath}&name=${newName}`)
       } else {
+        // window.open(`#/perview/pdf?fileId=${idNum}&resource=${fileType ? 0 : 1}`)
         window.open(`${process.env.VUE_APP_BASE_API}/system/fileStorage/preview?fileId=${idNum}&resource=${fileType ? 0 : 1}#toolbar=0&navpanes=0&scrollbar=0`)
       }
     },

+ 5 - 0
src/router/index.js

@@ -70,6 +70,11 @@ export const constantRoutes = [
     component: () => import('@/views/perview/index'),
     hidden: true
   },
+  {
+    path: '/perview/pdf',
+    component: () => import('@/views/perview/pdf'),
+    hidden: true
+  },
   {
     path: '/about',
     component: () => import('@/views/perview/about'),

+ 1 - 1
src/views/myBusiness/supplementaryInfo/components/AddInfo.vue

@@ -306,7 +306,7 @@ export default {
           prop: 'name',
           ruleRequired: true,
           render: (h, row) => {
-            return row.typeStr === '实控人' ? <el-input v-model={row.name} disabled={this.disabled} placeholder='请输入姓名'></el-input> : <span>{row.name}</span>
+            return row.typeStr === '实控人' || row.typeStr === '大股东' ? <el-input disabled={this.disabled} v-model={ row.name} placeholder='请输入姓名'></el-input> : <span>{row.name}</span>
           }
         },
         {

+ 68 - 0
src/views/perview/pdf.vue

@@ -0,0 +1,68 @@
+<template>
+  <div class="pdf-box">
+    <iframe id="pdfIframe" :src="url" frameborder="0" />
+    <!-- <div class="pdf-mark" @contextmenu="markClick" /> -->
+  </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() {
+    setTimeout(() => {
+      // const iframe = document.getElementById('pdfIframe')
+      // const iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindo
+      // console.log(iframeWin.document.getElementById('viewer'))
+      // console.log(iframe.height = iframeWin.document.getElementById('viewer').scrollHeight
+      // )
+      // iframeWin.document.getElementById('viewer').addEventListener('contextmenu', function(event) {
+      //   event.preventDefault()
+      //   return false
+      // })
+    }, 1000)
+
+    // const mask = document.querySelector('.pdf-mark')
+    // mask.addEventListener('scroll', function(params) {
+    //   iframe.scrollTop = mask.scrollTop
+    // })
+  },
+  methods: {
+    markClick() {
+      console.log(213123123)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.pdf-box {
+  width: 100%;
+  height: 100%;
+  overflow: auto;
+  position: relative;
+  iframe {
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    border: none;
+  }
+  .pdf-mark {
+    position: absolute;
+    top: 0px;
+    left: 0px;
+    width: 100%;
+    height: 100%;
+    background-color: rgba(0, 0, 0, 0.5); /* 半透明遮罩 */
+    overflow: auto;
+    // pointer-events: none; /* 防止遮罩阻止鼠标事件 */
+  }
+}
+</style>