fix(数据大屏): 修复数据大屏将图表和查询组件组合(加查询条件),大屏无法缩放问题。 #17278 (#17437)

This commit is contained in:
王嘉豪
2025-11-17 17:20:08 +08:00
committed by GitHub
parent 73a5de7715
commit 8508cf2ef4

View File

@@ -35,26 +35,27 @@ function changeComponentsSizeWithScaleCircle(componentDataCopy, scale) {
return
}
componentDataCopy?.forEach(component => {
Object.keys(component.style).forEach(key => {
if (needToChangeDirectionAttrs.width.includes(key)) {
// 根据原来的比例获取样式原来的尺寸
// 再用原来的尺寸 * 现在的比例得出新的尺寸
if (!!component.style[key]) {
if (component.style) {
Object.keys(component.style)?.forEach(key => {
if (needToChangeDirectionAttrs.width.includes(key)) {
// 根据原来的比例获取样式原来的尺寸
// 再用原来的尺寸 * 现在的比例得出新的尺寸
if (!!component.style[key]) {
component.style[key] = format(
getOriginStyle(component.style[key], canvasStyleData.value.scale),
scale
)
}
} else if (needToChangeDirectionAttrs.height.includes(key)) {
// 根据原来的比例获取样式原来的尺寸
// 再用原来的尺寸 * 现在的比例得出新的尺寸
component.style[key] = format(
getOriginStyle(component.style[key], canvasStyleData.value.scale),
getOriginStyle(component.style[key], canvasStyleData.value.scaleHeight),
scale
)
}
} else if (needToChangeDirectionAttrs.height.includes(key)) {
// 根据原来的比例获取样式原来的尺寸
// 再用原来的尺寸 * 现在的比例得出新的尺寸
component.style[key] = format(
getOriginStyle(component.style[key], canvasStyleData.value.scaleHeight),
scale
)
}
})
})
}
if (['Group'].includes(component.component)) {
groupSizeStyleAdaptor(component)
const parentStyle = component.style
@@ -129,7 +130,7 @@ export function changeRefComponentsSizeWithScalePointCircle(
outScale
) {
componentDataRef.forEach(component => {
Object.keys(component.style).forEach(key => {
Object.keys(component.style)?.forEach(key => {
if (needToChangeDirectionAttrs.width.includes(key)) {
// 根据原来的比例获取样式原来的尺寸
// 再用原来的尺寸 * 现在的比例得出新的尺寸