Merge pull request #13102 from dataease/pr@dev-v2@fix_table_adapt_transparent_line

fix(图表): 修复表格自适应模式下隐藏纵边框可能出现透明线条
This commit is contained in:
wisonic-s 2024-11-04 17:44:32 +08:00 committed by GitHub
commit f08b3dccc8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View File

@ -264,7 +264,12 @@ export class TableInfo extends S2ChartView<TableSheet> {
}, 0) }, 0)
const containerWidth = containerDom.getBoundingClientRect().width const containerWidth = containerDom.getBoundingClientRect().width
if (containerWidth <= totalWidthWithImg) { if (containerWidth <= totalWidthWithImg) {
// 图库计算的布局宽度已经大于等于容器宽度不需要再扩大不处理 // 图库计算的布局宽度已经大于等于容器宽度不需要再扩大但是需要处理非整数宽度值不然会出现透明细线
ev.colLeafNodes.reduce((p, n) => {
n.width = Math.round(n.width)
n.x = p
return p + n.width
}, 0)
return return
} }
// 图片字段固定 120, 剩余宽度按比例均摊到其他字段进行扩大 // 图片字段固定 120, 剩余宽度按比例均摊到其他字段进行扩大

View File

@ -265,7 +265,12 @@ export class TableNormal extends S2ChartView<TableSheet> {
const containerWidth = containerDom.getBoundingClientRect().width const containerWidth = containerDom.getBoundingClientRect().width
const scale = containerWidth / ev.colsHierarchy.width const scale = containerWidth / ev.colsHierarchy.width
if (scale <= 1) { if (scale <= 1) {
// 图库计算的布局宽度已经大于等于容器宽度不需要再扩大不处理 // 图库计算的布局宽度已经大于等于容器宽度不需要再扩大但是需要处理非整数宽度值不然会出现透明细线
ev.colLeafNodes.reduce((p, n) => {
n.width = Math.round(n.width)
n.x = p
return p + n.width
}, 0)
return return
} }
const totalWidth = ev.colLeafNodes.reduce((p, n) => { const totalWidth = ev.colLeafNodes.reduce((p, n) => {