修复dragable的新窗口弹出被dragable父组件遮挡

This commit is contained in:
woolen 2020-11-22 20:57:38 +08:00
parent 997339aeaf
commit ba76a41e34
2 changed files with 17 additions and 3 deletions

View file

@ -40,7 +40,7 @@
import { on, off } from '../../utils/dom'; import { on, off } from '../../utils/dom';
import { findComponentsDownward } from '../../utils/assist'; import { findComponentsDownward } from '../../utils/assist';
import { transferIndex as modalIndex, transferIncrease as modalIncrease } from '../../utils/transfer-queue'; import { transferIndex as modalIndex, transferIncrease as modalIncrease, lastVisibleIndex, lastVisibleIncrease } from '../../utils/transfer-queue';
const prefixCls = 'ivu-modal'; const prefixCls = 'ivu-modal';
@ -343,6 +343,10 @@
}, },
handleClickModal () { handleClickModal () {
if (this.draggable) { if (this.draggable) {
if (lastVisibleIndex !== this.lastVisibleIndex){
this.lastVisibleIndex = lastVisibleIndex;
return;
}
this.modalIndex = this.handleGetModalIndex(); this.modalIndex = this.handleGetModalIndex();
} }
} }
@ -379,7 +383,10 @@
this.removeScrollEffect(); this.removeScrollEffect();
}, 300); }, 300);
} else { } else {
this.modalIndex = this.handleGetModalIndex(); if (this.lastVisible !== val) {
this.modalIndex = this.handleGetModalIndex();
lastVisibleIncrease();
}
if (this.timer) clearTimeout(this.timer); if (this.timer) clearTimeout(this.timer);
this.wrapShow = true; this.wrapShow = true;
@ -390,6 +397,8 @@
this.broadcast('Table', 'on-visible-change', val); this.broadcast('Table', 'on-visible-change', val);
this.broadcast('Slider', 'on-visible-change', val); // #2852 this.broadcast('Slider', 'on-visible-change', val); // #2852
this.$emit('on-visible-change', val); this.$emit('on-visible-change', val);
this.lastVisible = val;
this.lastVisibleIndex = lastVisibleIndex;
}, },
loading (val) { loading (val) {
if (!val) { if (!val) {

View file

@ -1,7 +1,12 @@
let transferIndex = 0; let transferIndex = 0;
let lastVisibleIndex = 0;
function transferIncrease() { function transferIncrease() {
transferIndex++; transferIndex++;
} }
export {transferIndex, transferIncrease}; function lastVisibleIncrease() {
lastVisibleIndex++;
}
export { transferIndex, transferIncrease, lastVisibleIndex, lastVisibleIncrease };