From eec10e5196dadd7f8f103c66c482d4673b427ed0 Mon Sep 17 00:00:00 2001 From: wisonic Date: Mon, 4 Nov 2024 17:42:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E8=87=AA=E9=80=82=E5=BA=94=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=B8=8B=E9=9A=90=E8=97=8F=E7=BA=B5=E8=BE=B9=E6=A1=86=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E5=87=BA=E7=8E=B0=E9=80=8F=E6=98=8E=E7=BA=BF=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/js/panel/charts/table/table-info.ts | 7 ++++++- .../chart/components/js/panel/charts/table/table-normal.ts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts index 682f46f46b..302f15eaca 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts @@ -264,7 +264,12 @@ export class TableInfo extends S2ChartView { }, 0) const containerWidth = containerDom.getBoundingClientRect().width if (containerWidth <= totalWidthWithImg) { - // 图库计算的布局宽度已经大于等于容器宽度,不需要再扩大,不处理 + // 图库计算的布局宽度已经大于等于容器宽度,不需要再扩大,但是需要处理非整数宽度值,不然会出现透明细线 + ev.colLeafNodes.reduce((p, n) => { + n.width = Math.round(n.width) + n.x = p + return p + n.width + }, 0) return } // 图片字段固定 120, 剩余宽度按比例均摊到其他字段进行扩大 diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts index 5758f045d5..78cbb8e97e 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts @@ -265,7 +265,12 @@ export class TableNormal extends S2ChartView { const containerWidth = containerDom.getBoundingClientRect().width const scale = containerWidth / ev.colsHierarchy.width if (scale <= 1) { - // 图库计算的布局宽度已经大于等于容器宽度,不需要再扩大,不处理 + // 图库计算的布局宽度已经大于等于容器宽度,不需要再扩大,但是需要处理非整数宽度值,不然会出现透明细线 + ev.colLeafNodes.reduce((p, n) => { + n.width = Math.round(n.width) + n.x = p + return p + n.width + }, 0) return } const totalWidth = ev.colLeafNodes.reduce((p, n) => {