Merge pull request #7985 from dataease/pr@dev@refactor_tab
refactor(仪表板): 优化悬浮组件移入移除Tab样式,保持移入组件宽高
This commit is contained in:
commit
65f35cacb3
@ -1538,6 +1538,7 @@ export default {
|
||||
// Tab内部的画布ID 为 tab组件id + '-' + 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
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user