Commit ceb6441a authored by 李苏's avatar 李苏 💬

img自适应宽高比,pdf缩放

parent fb03287d
...@@ -6,10 +6,17 @@ ...@@ -6,10 +6,17 @@
:visible.sync="show" :visible.sync="show"
width="100%" width="100%"
> >
<div ref='show' v-if="show" style="height: 85vh;width: 100%"> <div ref='show' v-if="show" style="height: 85vh;width: 100%;position: relative;">
<div style='transform:scale(0.36);height: 85vh;width: 100%;'>
<pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i" ></pdf> <pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i" ></pdf>
</div>
<!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> --> <!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> -->
<img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" width="100%" height="100%" border="0" > <img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" style="max-height: 100%;position: absolute;
left: 50%;
top: 50%;;
transform: translate(-50%,-50%);
" border="0" >
</div> </div>
</el-dialog> </el-dialog>
<div id='bzzywdfileAdd' style="display: none;" > <div id='bzzywdfileAdd' style="display: none;" >
......
...@@ -6,10 +6,17 @@ ...@@ -6,10 +6,17 @@
:visible.sync="show" :visible.sync="show"
width="100%" width="100%"
> >
<div ref='show' v-if="show" style="height: 85vh;width: 100%"> <div ref='show' v-if="show" style="height: 85vh;width: 100%;position: relative;">
<div style='transform:scale(0.36);height: 85vh;width: 100%;'>
<pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i" ></pdf> <pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i" ></pdf>
</div>
<!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> --> <!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> -->
<img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" width="100%" height="100%" border="0" > <img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" style="max-height: 100%;position: absolute;
left: 50%;
top: 50%;;
transform: translate(-50%,-50%);
" border="0" >
</div> </div>
</el-dialog> </el-dialog>
<div id='aqwdfileAdd' style="display: none;" > <div id='aqwdfileAdd' style="display: none;" >
......
...@@ -6,10 +6,17 @@ ...@@ -6,10 +6,17 @@
:visible.sync="show" :visible.sync="show"
width="100%" width="100%"
> >
<div v-if="show" style="height: 85vh;width: 100%"> <div ref='show' v-if="show" style="height: 85vh;width: 100%;position: relative;">
<!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> --> <div style='transform:scale(0.36);height: 85vh;width: 100%;'>
<pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i" ></pdf> <pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i" ></pdf>
<img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" width="100%" height="100%" border="0" > </div>
<!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> -->
<img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" style="max-height: 100%;position: absolute;
left: 50%;
top: 50%;;
transform: translate(-50%,-50%);
" border="0" >
</div> </div>
</el-dialog> </el-dialog>
<div id='approvefileAdd' style="display: none;" > <div id='approvefileAdd' style="display: none;" >
......
...@@ -6,10 +6,17 @@ ...@@ -6,10 +6,17 @@
:visible.sync="show" :visible.sync="show"
width="100%" width="100%"
> >
<div ref="show" v-if="show" style="height: 85vh;width: 100%"> <div ref='show' v-if="show" style="height: 85vh;width: 100%;position: relative;">
<div style='transform:scale(0.36);height: 85vh;width: 100%;'>
<pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i" ></pdf> <pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i" ></pdf>
</div>
<!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> --> <!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> -->
<img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" width="100%" height="100%" border="0" > <img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" style="max-height: 100%;position: absolute;
left: 50%;
top: 50%;;
transform: translate(-50%,-50%);
" border="0" >
</div> </div>
</el-dialog> </el-dialog>
<div id='approvefileAdd' style="display: none;" > <div id='approvefileAdd' style="display: none;" >
......
...@@ -6,10 +6,17 @@ ...@@ -6,10 +6,17 @@
:visible.sync="show" :visible.sync="show"
width="100%" width="100%"
> >
<div ref='show' v-if="show" style="height: 85vh;width: 100%"> <div ref='show' v-if="show" style="height: 85vh;width: 100%;position: relative;">
<div style='transform:scale(0.36);height: 85vh;width: 100%;'>
<pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i" ></pdf> <pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i" ></pdf>
</div>
<!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> --> <!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> -->
<img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" width="100%" height="100%" border="0" > <img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" style="max-height: 100%;position: absolute;
left: 50%;
top: 50%;;
transform: translate(-50%,-50%);
" border="0" >
</div> </div>
</el-dialog> </el-dialog>
<div id='approvefileAdd' style="display: none;" > <div id='approvefileAdd' style="display: none;" >
......
...@@ -7,10 +7,17 @@ ...@@ -7,10 +7,17 @@
width="100%" width="100%"
> >
<div v-if="show" style="height: 85vh;width: 100%"> <div ref='show' v-if="show" style="height: 85vh;width: 100%;position: relative;">
<!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> --> <div style='transform:scale(0.36);height: 85vh;width: 100%;'>
<pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i" ></pdf> <pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i" ></pdf>
<img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" width="100%" height="100%" border="0" > </div>
<!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> -->
<img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" style="max-height: 100%;position: absolute;
left: 50%;
top: 50%;;
transform: translate(-50%,-50%);
" border="0" >
</div> </div>
</el-dialog> </el-dialog>
<div id='approvefileAdd' style="display: none;" > <div id='approvefileAdd' style="display: none;" >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment