fix(数据大屏): 修复调整视窗大小会导致tab组件内的图表大小发生变化问题

This commit is contained in:
wangjiahao
2025-05-06 11:39:40 +08:00
committed by 王嘉豪
parent 7e84201cc9
commit 34fc670bbb
2 changed files with 12 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ import { deepCopy } from './utils'
import { divide, multiply } from 'mathjs'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { storeToRefs } from 'pinia'
import { groupSizeStyleAdaptor } from '@/utils/style'
import { groupItemStyleAdaptor, groupSizeStyleAdaptor } from '@/utils/style'
import { nextTick } from 'vue'
const dvMainStore = dvMainStoreWithOut()
@@ -54,6 +54,16 @@ function changeComponentsSizeWithScaleCircle(componentDataCopy, scale) {
if (['Group'].includes(component.component)) {
groupSizeStyleAdaptor(component)
const parentStyle = component.style
component.propValue.forEach(componentInner => {
if (['DeTabs'].includes(componentInner.component)) {
componentInner.propValue.forEach(tabItem => {
changeComponentsSizeWithScaleCircle(tabItem.componentData, scale)
})
} else {
groupItemStyleAdaptor(componentInner, parentStyle)
}
})
} else if (['DeTabs'].includes(component.component)) {
component.propValue.forEach(tabItem => {
changeComponentsSizeWithScaleCircle(tabItem.componentData, scale)

View File

@@ -274,7 +274,7 @@ function dataVTabSizeStyleAdaptor(tabComponent) {
})
}
function groupItemStyleAdaptor(component, parentStyle) {
export function groupItemStyleAdaptor(component, parentStyle) {
// 分组还原逻辑
// 当发上分组缩放是,要将内部组件按照比例转换
const styleScale = component.groupStyle