|
@@ -1,10 +1,12 @@
|
|
|
<template>
|
|
|
<div style="width: 100%;height:100%;position:absolute;text-align: center">
|
|
|
<el-watermark :font="font" :content="watertext" style="width: 100%;height:100%;position:absolute">
|
|
|
- <PicShow :src="props.src" v-if="props.ispic" />
|
|
|
|
|
|
+ <el-image :src="props.src" v-if="ismobile && ispic"></el-image>
|
|
|
+ <PicShow :src="props.src" v-if="ispic && !ismobile" />
|
|
|
|
|
|
- <iframe v-loading style="width:100%;height:100%;border:none" v-if="!props.ispic" :src="`${currentPdf}`" />
|
|
|
+
|
|
|
+ <iframe v-loading style="width:100%;height:100%;border:none" v-if="!ispic " :src="`${currentPdf}`" />
|
|
|
<!-- <div style="height: 100%;overflow-y: auto" v-if="!usepdf">-->
|
|
|
<!-- <!– <div v-for="page in pages" :key="page" style="width: 100%;">-->
|
|
|
<!-- <VuePDF :pdf="pdf" fit-parent :watermark-text="watermarkText" :watermark-options="watermarkOptions" :page="page">-->
|
|
@@ -24,7 +26,7 @@ import moment from 'moment';
|
|
|
import useUserStore from '@/store/modules/user';
|
|
|
import PicShow from "./picShow.vue"
|
|
|
|
|
|
-
|
|
|
+const route = useRoute()
|
|
|
const userStore = useUserStore();
|
|
|
|
|
|
document.oncontextmenu = function(){
|
|
@@ -48,11 +50,15 @@ const font = ref({
|
|
|
})
|
|
|
|
|
|
const watertext = ref();
|
|
|
+const ispic = ref(false);
|
|
|
+const ismobile = ref(false);
|
|
|
|
|
|
|
|
|
const currentPdf = ref(props.src)
|
|
|
watchEffect(() => {
|
|
|
- if(props.size>1024*1024*38){
|
|
|
+ ispic.value = props.ispic;
|
|
|
+ ismobile.value = route.fullPath.indexOf("h5")!=-1;
|
|
|
+ if(props.size>1024*1024*3){
|
|
|
usepdf.value = false;
|
|
|
}else{
|
|
|
usepdf.value = true;
|
|
@@ -88,4 +94,5 @@ onMounted(()=>{
|
|
|
// const { pdf, pages } = usePDF(currentPdf)
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped></style>
|
|
|
+<style lang="scss" >
|
|
|
+</style>
|