From 3f2fe9aaca2d2074cfeb7cd9605f4985ec994ad4 Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 31 Oct 2022 11:30:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=80=8F=E8=A7=86=E8=A1=A8=E5=88=97=E8=A1=A8=E5=A4=B4=E5=8F=97?= =?UTF-8?q?=E5=BA=8F=E5=88=97=E5=8F=B7=E5=BD=B1=E5=93=8D=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chart/chart/common/common_table.js | 48 +++++++++++++------ 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/frontend/src/views/chart/chart/common/common_table.js b/frontend/src/views/chart/chart/common/common_table.js index 93cb2f0063..8afc816ea6 100644 --- a/frontend/src/views/chart/chart/common/common_table.js +++ b/frontend/src/views/chart/chart/common/common_table.js @@ -21,7 +21,7 @@ export function getCustomTheme(chart) { backgroundColor: headerColor, horizontalBorderColor: borderColor, verticalBorderColor: borderColor, - verticalBorderWidth: 0 + verticalBorderWidth: chart.type === 'table-pivot' ? 1 : 0 }, text: { fill: DEFAULT_COLOR_CASE.tableHeaderFontColor, @@ -49,7 +49,7 @@ export function getCustomTheme(chart) { fill: DEFAULT_COLOR_CASE.tableHeaderFontColor, fontSize: DEFAULT_SIZE.tableTitleFontSize, textAlign: headerAlign, - textBaseline: 'middle' // 行头字体绘制基线设置为中心,不然序号列的内容会靠上 + textBaseline: chart.type === 'table-pivot' ? 'top' : 'middle' // 行头字体绘制基线设置为中心,不然序号列的内容会靠上 }, bolderText: { fill: DEFAULT_COLOR_CASE.tableHeaderFontColor, @@ -127,12 +127,21 @@ export function getCustomTheme(chart) { theme.cornerCell.text.fill = c.tableHeaderFontColor ? c.tableHeaderFontColor : c.tableFontColor theme.cornerCell.measureText.fill = c.tableHeaderFontColor ? c.tableHeaderFontColor : c.tableFontColor - theme.rowCell.cell.backgroundColor = i_c // 这个参数其实只对开启序号列的行头生效 - theme.rowCell.cell.horizontalBorderColor = i_c - theme.rowCell.cell.verticalBorderColor = i_c - theme.rowCell.bolderText.fill = c.tableFontColor - theme.rowCell.text.fill = c.tableFontColor - theme.rowCell.measureText.fill = c.tableFontColor + if (chart.type === 'table-pivot') { + theme.rowCell.cell.backgroundColor = h_c + theme.rowCell.cell.horizontalBorderColor = b_c + theme.rowCell.cell.verticalBorderColor = b_c + theme.rowCell.bolderText.fill = c.tableHeaderFontColor ? c.tableHeaderFontColor : c.tableFontColor + theme.rowCell.text.fill = c.tableHeaderFontColor ? c.tableHeaderFontColor : c.tableFontColor + theme.rowCell.measureText.fill = c.tableHeaderFontColor ? c.tableHeaderFontColor : c.tableFontColor + } else { + theme.rowCell.cell.backgroundColor = i_c // 这个参数其实只对开启序号列的行头生效 + theme.rowCell.cell.horizontalBorderColor = i_c + theme.rowCell.cell.verticalBorderColor = i_c + theme.rowCell.bolderText.fill = c.tableFontColor + theme.rowCell.text.fill = c.tableFontColor + theme.rowCell.measureText.fill = c.tableFontColor + } theme.colCell.cell.backgroundColor = h_c theme.colCell.cell.horizontalBorderColor = b_c @@ -161,13 +170,22 @@ export function getCustomTheme(chart) { theme.cornerCell.measureText.fontSize = parseInt(s.tableTitleFontSize) theme.cornerCell.measureText.textAlign = h_a - // 序号列的数字单元格内容样式使用指标的内容样式而不是表头的内容样式 - theme.rowCell.bolderText.fontSize = parseInt(s.tableItemFontSize) - theme.rowCell.bolderText.textAlign = i_a - theme.rowCell.text.fontSize = parseInt(s.tableItemFontSize) - theme.rowCell.text.textAlign = i_a - theme.rowCell.measureText.fontSize = parseInt(s.tableItemFontSize) - theme.rowCell.measureText.textAlign = i_a + if (chart.type === 'table-pivot') { + theme.rowCell.bolderText.fontSize = parseInt(s.tableTitleFontSize) + theme.rowCell.bolderText.textAlign = h_a + theme.rowCell.text.fontSize = parseInt(s.tableTitleFontSize) + theme.rowCell.text.textAlign = h_a + theme.rowCell.measureText.fontSize = parseInt(s.tableTitleFontSize) + theme.rowCell.measureText.textAlign = h_a + } else { + // 序号列的数字单元格内容样式使用指标的内容样式而不是表头的内容样式 + theme.rowCell.bolderText.fontSize = parseInt(s.tableItemFontSize) + theme.rowCell.bolderText.textAlign = i_a + theme.rowCell.text.fontSize = parseInt(s.tableItemFontSize) + theme.rowCell.text.textAlign = i_a + theme.rowCell.measureText.fontSize = parseInt(s.tableItemFontSize) + theme.rowCell.measureText.textAlign = i_a + } theme.colCell.bolderText.fontSize = parseInt(s.tableTitleFontSize) theme.colCell.bolderText.textAlign = h_a