master
parent
dfa7374765
commit
bb4e672eec
@ -1,100 +0,0 @@
|
|||||||
<template>
|
|
||||||
|
|
||||||
|
|
||||||
<el-dialog class="common-dialog" :fullscreen='isfullscreen' :title="title" :modal="false" top="10vh" :visible.sync="diaShow" @close="coloseDia"
|
|
||||||
:width="width">
|
|
||||||
<div slot="title">
|
|
||||||
<span class="el-dialog__title">{{title}}</span>
|
|
||||||
<slot name="searchtype"></slot>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="dialogConcent" style="max-height: 65vh !important;min-height: 300px;overflow: scroll;">
|
|
||||||
<div v-if="typeName=='file'">
|
|
||||||
<iframe id="iframeWin" :src="url" frameborder="0" scrolling="auto" align="center" class="iframeWeb">
|
|
||||||
</iframe>
|
|
||||||
</div>
|
|
||||||
<div v-if="typeName=='video'" style="text-align: center;">
|
|
||||||
<video :src="url" controls></video>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<div>
|
|
||||||
<el-button size="small" @click="coloseDia">关闭</el-button>
|
|
||||||
</div>
|
|
||||||
<slot name="footerbtn"></slot>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
default: "文件预览"
|
|
||||||
},
|
|
||||||
width: {
|
|
||||||
type: String,
|
|
||||||
default: "70%"
|
|
||||||
},
|
|
||||||
isShow: {
|
|
||||||
type: Boolean,
|
|
||||||
default: () => {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: "showinfo"
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
diaShow: this.isShow,
|
|
||||||
isfullscreen:false,
|
|
||||||
url:'',
|
|
||||||
typeName:'file',
|
|
||||||
baseUrl: `${process.env.VUE_APP_PREVIEW_API}?url=`,
|
|
||||||
wheight: "",
|
|
||||||
form:{
|
|
||||||
show:''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
isShow(val) {
|
|
||||||
this.diaShow = this.isShow;
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
coloseDia() {
|
|
||||||
// this.url = ""
|
|
||||||
this.diaShow = false
|
|
||||||
this.url = ''
|
|
||||||
this.typeName = 'file'
|
|
||||||
this.$emit('update:isShow', false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
/deep/ .show{
|
|
||||||
flex-basis: 100%;
|
|
||||||
}
|
|
||||||
.dialogConcent {
|
|
||||||
overflow-y: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.iframeWeb {
|
|
||||||
text-align: center;
|
|
||||||
border: none;
|
|
||||||
display: block;
|
|
||||||
height: 100vh;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Loading…
Reference in new issue