Commit 679a513f by luyt

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

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