Commit 6f94f725 by luyt

feat:调整弹窗尺寸

1 parent bb3b5ccc
......@@ -17,9 +17,9 @@
"dependencies": {
"core-js": "^3.6.5",
"element-ui": "^2.15.6",
"glsx-common": "^1.3.2",
"vuedraggable": "^2.24.3",
"vue": "^2.6.11"
"glsx-common": "^1.4.9",
"vue": "^2.6.11",
"vuedraggable": "^2.24.3"
},
"devDependencies": {
"@vue/babel-helper-vue-jsx-merge-props": "^1.2.1",
......
......@@ -125,13 +125,15 @@
<!-- 测试业务组件GLBcTest -->
<GLBcTest></GLBcTest>
<hr />
<!-- 测试GLFull -->
<GLFull>SDK发就算冷冻机房乐山大佛</GLFull>
<hr />
<!-- 测试弹框组件 -->
<el-button plain @click="testDialog(1)">dialog(大)</el-button>
<el-button plain @click="testDialog2">dialog(中)</el-button>
<el-button plain @click="showDialog">dialog(小)</el-button>
<el-button plain @click="testDialog3">dialog(中)无按钮</el-button>
<el-button plain @click="testBeforeDialog">之前小弹窗</el-button>
<GLFull>SDK发就算冷冻机房乐山大佛</GLFull>
<!-- :content="'hello HelloWorld'" -->
<GLDialog :mode="mode" bigTitle="大标题" :hasFooter="hasFooter" :type="'error'" @onOk="handleOk" @onCancel="handleCancel" :visible.sync="dialogShow">
<div>
......@@ -203,7 +205,7 @@
</span> -->
</GLDialog>
<GLDialog :mode="mode" title="提示" :hasFooter="hasFooter" :type="'error'" :content="'hello HelloWorld'" @onOk="handleOk" @onCancel="handleCancel" :visible.sync="dialogShow2"></GLDialog>
<GLDialog title="提示123" :mode="mode" :hasFooter="hasFooter" :type="'error'" :content="'hello HelloWorld'" @onOk="handleOk" @onCancel="handleCancel" :visible.sync="dialogShow1"></GLDialog>
<GLDialog title="提示123" :mode="mode" :hasFooter="hasFooter" :type="'info'" :content="'hello HelloWorld'" @onOk="handleOk" @onCancel="handleCancel" :visible.sync="dialogShow1"></GLDialog>
<hr />
</div>
</template>
......
<template>
<div class="gl-dialog-wrap " :class="mode">
<div class="gl-dialog-wrap " :class="mode" @keyup.esc="escFn">
<el-dialog v-bind="$attrs" v-on="$listeners">
<template v-slot:title>
<!-- 标题插槽 -->
......@@ -96,7 +96,7 @@ export default {
}
},
mounted() {
console.log('slots',this.$slots)
// console.log('slots',this.$slots)
document.addEventListener('fullscreenchange', () => {
this.fullscreenchangeFn()
})
......@@ -154,12 +154,41 @@ export default {
// 这是取消事件
this.$emit('onCancel')
},
escFn(){
setTimeout(() => {
this.isFull = false
this.exitFullscreenHook()
},300)
},
fullScreenFn() {
if (document.fullscreenElement) {
this.exitFullscreen()
} else {
this.launchFullscreen(document.documentElement)
if(this.isFull){
this.exitFullscreenHook()
this.isFull = false
}else{
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')
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'
},
exitFullscreenHook(){
const dialog = document.querySelector('.el-dialog')
const dialogBody = document.querySelector('.el-dialog__body')
dialog.style.margin = '15vh auto 50px'
dialog.style.width = 1080 +'px'
dialog.style.height = 'auto'
dialogBody.style.maxHeight = '586px'
},
launchFullscreen(element) {
if (element.requestFullscreen) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!