Merge pull request #13281 from dataease/pr@dev-v2@fix_table_custom_field

fix(图表): 修复明细表自定义列宽铺满时宽度计算错误
This commit is contained in:
wisonic-s 2024-11-13 14:17:52 +08:00 committed by GitHub
commit b78b5436ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -489,7 +489,6 @@ export function getStyle(chart: Chart, dataConfig: S2DataConfig): Style {
: baseWidth * 10
const resultWidth = parseInt(tmpWidth.toFixed(0))
if (fullFilled) {
widthArr.push(resultWidth)
if (widthArr.length === dataConfig.meta.length - 1) {
const curTotalWidth = widthArr.reduce((p, n) => {
return p + n
@ -499,6 +498,7 @@ export function getStyle(chart: Chart, dataConfig: S2DataConfig): Style {
return restWidth
}
}
widthArr.push(resultWidth)
}
return resultWidth
}