Browse Source

优化dialog最大化逻辑

master
Poised_flw 4 years ago
parent
commit
3db9b7f56e
  1. 30
      src/tis_app_template_kt/src/components/Dialog/Pc.vue

30
src/tis_app_template_kt/src/components/Dialog/Pc.vue

@ -53,10 +53,10 @@ import VueDragResize from 'vue-drag-resize'
return window.outerHeight;
},
isDraggable() {
return true;
return this.isMax ? false : true;
},
isResizable() {
return true;
return this.isMax ? false : true;
},
isTitle() {
return true;
@ -71,6 +71,7 @@ import VueDragResize from 'vue-drag-resize'
data() {
return {
//
isMax:false,
isDestory:false,
showSizeChoice: false,
@ -80,6 +81,7 @@ import VueDragResize from 'vue-drag-resize'
height: Math.round(window.innerHeight * .6),
top: Math.round(window.innerHeight * .2),
left: Math.round(window.innerWidth * .2),
_style: {}, //
};
},
methods: {
@ -93,11 +95,29 @@ import VueDragResize from 'vue-drag-resize'
this.curHeight = newRect.height;
},
onMaxSize(){
this.$refs.dragEl.$el.style.left = 0
this.$refs.dragEl.$el.style.top = 0
const $contentEl = this.$refs.dragEl.$el.firstChild
this.isMax = !this.isMax
const $dragEl = this.$refs.dragEl.$el
const $contentEl = $dragEl.firstChild
//
if (this.isMax) {
this._style = {
width: this.width,
height: this.height,
left: this.left,
top: this.top
}
$dragEl.style.left = 0
$dragEl.style.top = 0
$contentEl.style.width = window.innerWidth + 'px'
$contentEl.style.height = window.innerHeight + 'px'
}
else {
$dragEl.style.left = this._style.left
$dragEl.style.top = this._style.top
$contentEl.style.width = this._style.width + 'px'
$contentEl.style.height = this._style.height + 'px'
}
return;
this.isMax = !this.isMax;
this.left = 0

Loading…
Cancel
Save