coys 2 jaren geleden
bovenliggende
commit
79fa7f3aea

+ 51 - 0
src/components/pdfCom/index.vue

@@ -0,0 +1,51 @@
+<template>
+  <div>
+    <VuePdf @click="lookPdf"   :src="src"></VuePdf>
+    <!-- <VuePdf @click="lookPdf" v-else  :src="this_window.origin+item.url"></VuePdf> -->
+    <van-overlay :show="show" @click="onClickHide">
+      <div class="imgsty">
+
+        <VuePdf    :src="src"></VuePdf>
+        </div>
+      
+    </van-overlay>
+  </div>
+</template>
+<script>
+import VuePdf from 'vue-pdf'
+
+export default {
+  name: 'SocAppIndex',
+  props:{
+    src:{
+     type:String,
+     default:''
+    }
+  },
+  components: {
+    VuePdf
+  },
+  data() {
+    return {}
+  },
+
+  mounted() {},
+
+  methods: {
+    //查看pdf
+    lookPdf(){
+        this.show = true
+    },
+    
+    onClickHide() {
+      this.show = false
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.imgsty{
+    position:absolute;
+    top: 28%;
+}
+</style>

+ 5 - 2
src/views/menu/training/components/addTraining.vue

@@ -71,7 +71,7 @@
 
           <imgCom :width="'100'" v-if="this_window.origin+item.url&&item.type==0"  :height="'100'" :src="this_window.origin+item.url"></imgCom>
           <!-- <VuePdf v-else :src="this_window.origin+item.url"></VuePdf> -->
-          <VuePdf v-else  :src="this_window.origin+item.url"></VuePdf>
+          <VuePdf  v-else  :src="this_window.origin+item.url"></VuePdf>
         </div>
       </template>
     </div>
@@ -142,7 +142,8 @@ import imgCom from '@/components/imgCom/index.vue'
 import { gettrainingInfo, edittrainingInfo } from '@/api/training.js'
 import { newDateTime } from '@/utils/date.js'
 import { Dialog, Toast } from 'vant'
-import VuePdf from "vue-pdf"
+import VuePdf from "@/components/pdfCom/index.vue"
+
 export default {
   name: 'SocAppAddTraining',
   components: {
@@ -242,6 +243,8 @@ export default {
   mounted() {},
 
   methods: {
+    // 查看pdf
+    
     onSubmit(values) {
       console.log('submit', values)
       Dialog.confirm({

+ 1 - 1
src/views/menu/training/components/personnelSignature.vue

@@ -93,7 +93,7 @@ import { upload } from '@/api/public'
 import imgCom from '@/components/imgCom/index.vue'
 import { base64ToBlob } from '@/utils/base64TurnImg.js'
 import config from '@/config/index'
-import VuePdf from "vue-pdf"
+import VuePdf from "@/components/pdfCom/index.vue"
 export default {
   name: 'SocAppAddTraining',
   components: {