Merge pull request #7985 from dataease/pr@dev@refactor_tab

refactor(仪表板): 优化悬浮组件移入移除Tab样式,保持移入组件宽高
This commit is contained in:
王嘉豪 2024-02-04 14:11:04 +08:00 committed by GitHub
commit 65f35cacb3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1538,6 +1538,7 @@ export default {
// TabID tabid + '-' + tabActiveName
const targetCanvasId = this.tabMoveInActiveId + '-' + this.tabActiveTabNameMap[this.tabMoveInActiveId]
const targetCanvasScale = this.curCanvasScaleMap[targetCanvasId]
const targetMainCanvasScale = this.curCanvasScaleMap['canvas-main']
if (this.element.auxiliaryMatrix) {
this.element.x = 1
this.element.y = 108
@ -1548,8 +1549,12 @@ export default {
this.element.style.left = 0
this.element.style.top = (this.element.y - 1) * targetCanvasScale.matrixStyleOriginHeight
} else {
this.element.style.left = 0
this.element.style.top = 0
this.element.style.left = 10
this.element.style.top = 10
const newWidth = this.element.style.width * targetMainCanvasScale.scalePointWidth / targetCanvasScale.scalePointWidth
const checkWidth = this.canvasStyleData.width - 30
this.element.style.width = newWidth < checkWidth ? newWidth : checkWidth
this.element.style.height = this.element.style.height * targetMainCanvasScale.scalePointHeight / targetCanvasScale.scalePointHeight
}
this.element.canvasId = targetCanvasId
}