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

附件预览禁用右击

parent d4ef302e
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
: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%">
<pdf v-if="showType=='pdf'" :src="url" ></pdf> <pdf v-if="showType=='pdf'" :src="url" ></pdf>
<!-- <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" width="100%" height="100%" border="0" >
...@@ -177,6 +177,9 @@ ...@@ -177,6 +177,9 @@
}); });
this.url=URL.createObjectURL(blob) this.url=URL.createObjectURL(blob)
this.show=true this.show=true
this.$nextTick(()=>{
this.$refs.show.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );
})
}) })
}, },
creatFile(){ creatFile(){
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
: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%">
<pdf v-if="showType=='pdf'" :src="url" ></pdf> <pdf v-if="showType=='pdf'" :src="url" ></pdf>
<!-- <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" width="100%" height="100%" border="0" >
...@@ -175,6 +175,9 @@ ...@@ -175,6 +175,9 @@
}); });
this.url=URL.createObjectURL(blob) this.url=URL.createObjectURL(blob)
this.show=true this.show=true
this.$nextTick(()=>{
this.$refs.show.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );
})
}) })
}, },
creatFile(){ creatFile(){
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
> >
<div v-if="show" style="height: 85vh;width: 100%"> <div v-if="show" style="height: 85vh;width: 100%">
<!-- <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> -->
<pdf v-if="showType=='pdf'" :src="url" ></pdf> <pdf ref="show" v-if="showType=='pdf'" :src="url" ></pdf>
<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" width="100%" height="100%" border="0" >
</div> </div>
</el-dialog> </el-dialog>
...@@ -175,6 +175,9 @@ ...@@ -175,6 +175,9 @@
}); });
this.url=URL.createObjectURL(blob) this.url=URL.createObjectURL(blob)
this.show=true this.show=true
this.$nextTick(()=>{
this.$refs.show.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );
})
}) })
}, },
creatFile(){ creatFile(){
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
: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%">
<pdf v-if="showType=='pdf'" :src="url" ></pdf> <pdf v-if="showType=='pdf'" :src="url" ></pdf>
<!-- <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" width="100%" height="100%" border="0" >
...@@ -177,6 +177,9 @@ ...@@ -177,6 +177,9 @@
}); });
this.url=URL.createObjectURL(blob) this.url=URL.createObjectURL(blob)
this.show=true this.show=true
this.$nextTick(()=>{
this.$refs.show.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );
})
}) })
}, },
creatFile(){ creatFile(){
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
: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%">
<pdf v-if="showType=='pdf'" :src="url" ></pdf> <pdf v-if="showType=='pdf'" :src="url" ></pdf>
<!-- <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" width="100%" height="100%" border="0" >
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
</template> </template>
<script> <script>
import {pdf} from 'common' import {pdf} from 'common'
import { import {
doQuerytree doQuerytree
} from "@/api/outsourcingDirector/approve.js"; } from "@/api/outsourcingDirector/approve.js";
...@@ -176,6 +176,9 @@ ...@@ -176,6 +176,9 @@
}); });
this.url=URL.createObjectURL(blob) this.url=URL.createObjectURL(blob)
this.show=true this.show=true
this.$nextTick(()=>{
this.$refs.show.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );
})
}) })
}, },
creatFile(){ creatFile(){
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
:visible.sync="show" :visible.sync="show"
width="100%" width="100%"
> >
<div v-if="show" style="height: 85vh;width: 100%"> <div v-if="show" style="height: 85vh;width: 100%">
<!-- <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> -->
<pdf v-if="showType=='pdf'" :src="url" ></pdf> <pdf ref="show" v-if="showType=='pdf'" :src="url" ></pdf>
<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" width="100%" height="100%" border="0" >
</div> </div>
</el-dialog> </el-dialog>
...@@ -178,6 +178,9 @@ ...@@ -178,6 +178,9 @@
}); });
this.url=URL.createObjectURL(blob) this.url=URL.createObjectURL(blob)
this.show=true this.show=true
this.$nextTick(()=>{
this.$refs.show.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );
})
}) })
}, },
creatFile(){ creatFile(){
......
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