forked from github/dataease
fix(仪表板): 修复tab移出在仪表板可能出现组件重叠问题
This commit is contained in:
parent
af82c59967
commit
6e099a3442
@ -349,7 +349,7 @@ const coordinates = ref([]) //坐标点集合
|
||||
|
||||
let lastTask = undefined
|
||||
let isOverlay = false //是否正在交换位置
|
||||
let moveTime = 200 //移动动画时间
|
||||
let moveTime = 100 //移动动画时间
|
||||
|
||||
const itemMaxY = ref(0)
|
||||
let itemMaxX = 0
|
||||
@ -874,6 +874,11 @@ function removeItemById(componentId) {
|
||||
removeItem(index)
|
||||
}
|
||||
})
|
||||
if (!isMainCanvas(canvasId.value)) {
|
||||
nextTick(() => {
|
||||
canvasInit()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -335,8 +335,9 @@ const componentMoveIn = component => {
|
||||
component.style.left = 0
|
||||
component.style.top = 0
|
||||
tabItem.componentData.push(component)
|
||||
refInstance.addItemBox(component) //在适当的时候初始化布局组件
|
||||
nextTick(() => {
|
||||
refInstance.addItemBox(component) //在适当的时候初始化布局组件
|
||||
refInstance.canvasInitImmediately()
|
||||
})
|
||||
}
|
||||
} else {
|
||||
|
@ -133,6 +133,10 @@ const handleMouseDown = e => {
|
||||
}
|
||||
}
|
||||
|
||||
const canvasInitImmediately = () => {
|
||||
cyGridster.value.canvasInit()
|
||||
}
|
||||
|
||||
const canvasInit = (isFistLoad = true) => {
|
||||
if (canvasActive.value) {
|
||||
renderState.value = true
|
||||
@ -218,6 +222,7 @@ const moveOutFromTab = component => {
|
||||
componentData: componentData.value
|
||||
})
|
||||
addItemBox(component)
|
||||
canvasInit()
|
||||
}, 500)
|
||||
}
|
||||
|
||||
@ -272,6 +277,8 @@ watch(
|
||||
|
||||
defineExpose({
|
||||
addItemBox,
|
||||
canvasInit,
|
||||
canvasInitImmediately,
|
||||
getBaseMatrixSize
|
||||
})
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user