wenhongquan 11 months ago
parent
commit
53c751b410
2 changed files with 16 additions and 6 deletions
  1. 12 5
      src/components/pdfview/index.vue
  2. 4 1
      src/views/project/list/index.vue

+ 12 - 5
src/components/pdfview/index.vue

@@ -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">-->
       <!--        &lt;!&ndash; <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>

+ 4 - 1
src/views/project/list/index.vue

@@ -236,6 +236,9 @@
             <pdfview :src="currentfile.url" :ispic="(currentfile.fileSuffix+'').indexOf('pdf')==-1"  :isprint="hsp('filemanager.project.file.download')?1:0" :size="currentfile.size"></pdfview>
 
             <el-button v-hasPermi="['filemanager.project.file.download']" v-if="(currentfile.fileSuffix+'').indexOf('pdf')==-1" type="primary" style="position:absolute;right: 0;top: 0;z-index: 11" @click="printfile(currentfile)">打印</el-button>
+
+          <div  style="position:absolute;right: 0px;top: 0px;z-index: 11;width:120px;height: 50px;background: #323639"  v-hasPermi="['filemanager.project.file.download']" ></div>
+
         </div>
         <!-- <div><el-affix :offset="120" position="bottom"><el-button type="text" icon="DArrowRight"></el-button></el-affix></div>
       </div> -->
@@ -394,7 +397,7 @@
       :title="`上传文件`" :before-close="handleCloseupload"
       width="40vw">
 
-    <fileUpload :fileSize="100" v-model="uploadfilelist"  :suportdrag="true" :defaultbtn="false" @addfile="uploadbtnenable=false" @successupload="uploadbtnenable=true">
+    <fileUpload :fileSize="200" v-model="uploadfilelist"  :suportdrag="true" :defaultbtn="false" @addfile="uploadbtnenable=false" @successupload="uploadbtnenable=true">
        <template #default>
           <div>
              <el-icon class="el-icon--upload"><upload-filled /></el-icon>