Commit 6f94f725 by luyt

feat:调整弹窗尺寸

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