Commit 679a513f by luyt

fix:修复大弹窗无法放大问题

1 parent 7a86137a
This diff could not be displayed because it is too large.
<template>
<div class="gl-dialog-wrap " :class="mode" @keyup.esc="escFn">
<div class="gl-dialog-wrap " :class="mode" :id="idDom" @keyup.esc="escFn">
<el-dialog v-bind="$attrs" v-on="$listeners">
<template v-slot:title>
<!-- 标题插槽 -->
......@@ -34,13 +34,13 @@
</template>
</template>
<template v-slot:footer v-if="hasFooter">
<!-- footer插槽 -->
<template v-if="!$slots.footer">
<span class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="cancel">{{ cancelName }}</el-button>
<el-button type="primary" size="small" @click="ok">{{ okName }}</el-button>
</span>
</template>
<!-- footer插槽 -->
<slot name="footer" v-else></slot>
</template>
</el-dialog>
......@@ -92,15 +92,10 @@ export default {
},
data() {
return {
isFull: false
isFull: false,
idDom:Math.random().toString(36).slice(-8)
}
},
mounted() {
// // console.log('slots',this.$slots)
// document.addEventListener('fullscreenchange', () => {
// this.fullscreenchangeFn()
// })
},
computed: {
okName: function() {
let resName
......@@ -168,27 +163,26 @@ export default {
this.fullScreenHook()
this.isFull = true
}
// if (document.fullscreenElement) {
// this.exitFullscreen()
// } else {
// this.launchFullscreen(document.documentElement)
// }
},
fullScreenHook(){
const dialog = document.querySelector('.el-dialog')
const dialogBody = document.querySelector('.el-dialog__body')
const rootdom = document.getElementById(this.idDom)
const dialog = rootdom.getElementsByClassName('el-dialog')[0]
const dialogBody = rootdom.getElementsByClassName('el-dialog__body')[0]
dialog.style.margin = 0
dialog.style.width = window.innerWidth +'px'
dialog.style.height = window.innerHeight +'px'
dialogBody.style.maxHeight = window.innerHeight -60 -40 -64 + 'px'
// dialogBody.style.maxHeight = window.innerHeight -60 -40 -64 + 'px'
dialogBody.style.minHeight = window.innerHeight -60 -40 -64 + 'px'
},
exitFullscreenHook(){
const dialog = document.querySelector('.el-dialog')
const dialogBody = document.querySelector('.el-dialog__body')
const rootdom = document.getElementById(this.idDom)
const dialog = rootdom.getElementsByClassName('el-dialog')[0]
const dialogBody = rootdom.getElementsByClassName('el-dialog__body')[0]
dialog.style.margin = '15vh auto 50px'
dialog.style.width = 1080 +'px'
dialog.style.height = 'auto'
dialogBody.style.maxHeight = '586px'
// dialogBody.style.maxHeight = '586px'
dialogBody.style.minHeight = '156px'
},
launchFullscreen(element) {
if (element.requestFullscreen) {
......@@ -220,11 +214,6 @@ export default {
}
}
},
// beforeDestroy() {
// document.removeEventListener('fullscreenchange', () => {
// this.fullscreenchangeFn()
// })
// }
}
</script>
......@@ -325,11 +314,4 @@ export default {
height: 40px;
}
}
// .gl-dialog-scrm{
// .el-dialog__header {
// .el-dialog__headerbtn {
// top: 15px;
// }
// }
// }
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!