From 8d924c9507554a57f4fd831ad1837c2b6119a970 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Mon, 3 Jun 2024 19:03:43 +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=E5=AE=9A=E4=B9=89=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E4=B8=8B=E9=92=BB=E5=90=8E=E4=B8=8B=E9=92=BB=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=E6=94=B9=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/js/panel/common/common_table.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts index a6acb65fe1..205e7095a5 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts @@ -325,6 +325,18 @@ export function getStyle(chart: Chart): Style { p[n.fieldId] = n return p }, {}) || {} + // 下钻字段使用入口字段的宽度 + if (chart.drill) { + const { xAxis } = parseJson(chart) + const curDrillField = chart.drillFields[chart.drillFilters.length] + const drillEnterFieldIndex = xAxis.findIndex( + item => item.id === chart.drillFilters[0].fieldId + ) + const drillEnterField = xAxis[drillEnterFieldIndex] + fieldMap[curDrillField.dataeaseName] = { + width: fieldMap[drillEnterField.dataeaseName]?.width + } + } style.colCfg.width = node => { const width = node.spreadsheet.container.cfg.el.offsetWidth if (!basicStyle.tableFieldWidth?.length) {