refactor(仪表板): 优化悬浮组件移入移除Tab样式,保持移入组件宽高

This commit is contained in:
wangjiahao 2024-02-04 14:07:57 +08:00
parent 5e708e687f
commit bcbd1d3ce6

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
}