From 8b6afd41a6a1e2e9ab27d0af6e63f79b03791817 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 21 Dec 2023 15:31:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE-=E8=A1=A8=E6=A0=BC):=20?= =?UTF-8?q?AntV=20=E6=98=8E=E7=BB=86=E8=A1=A8/=E6=B1=87=E6=80=BB=E8=A1=A8?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=86=BB=E7=BB=93=E8=A1=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/lang/en.js | 2 +- core/frontend/src/lang/tw.js | 2 +- core/frontend/src/lang/zh.js | 2 +- core/frontend/src/views/chart/chart/chart.js | 3 ++- .../src/views/chart/chart/table/table-info.js | 16 +++++++++++----- core/frontend/src/views/chart/chart/util.js | 8 ++++---- .../chart/components/shapeAttr/SizeSelector.vue | 4 ++-- .../components/shapeAttr/SizeSelectorAntV.vue | 15 +++++++++++++-- 8 files changed, 35 insertions(+), 17 deletions(-) diff --git a/core/frontend/src/lang/en.js b/core/frontend/src/lang/en.js index aad6c1a058..e39f519e66 100644 --- a/core/frontend/src/lang/en.js +++ b/core/frontend/src/lang/en.js @@ -1386,9 +1386,9 @@ export default { filter_value_can_not_str: 'Value type can not input string', enum_value_can_not_null: 'Enum Value can not empty.', column: 'Column', + table_freeze: 'Table Freeze', table_config: 'Table Config', table_column_width_config: 'Column Width', - table_column_freeze: 'Column Freeze', table_column_adapt: 'Adapt', table_column_custom: 'Custom', chart_table_pivot: 'Pivot Table', diff --git a/core/frontend/src/lang/tw.js b/core/frontend/src/lang/tw.js index 9d8b378867..912b49e6c5 100644 --- a/core/frontend/src/lang/tw.js +++ b/core/frontend/src/lang/tw.js @@ -1386,7 +1386,7 @@ export default { column: '列', table_config: '表格配置', table_column_width_config: '列寬調整', - table_column_freeze: '列凍結', + table_freeze: '表格凍結', table_column_adapt: '自適應', table_column_custom: '自定義', chart_table_pivot: '透視表', diff --git a/core/frontend/src/lang/zh.js b/core/frontend/src/lang/zh.js index ec19a423dd..aae63a6d5e 100644 --- a/core/frontend/src/lang/zh.js +++ b/core/frontend/src/lang/zh.js @@ -1384,9 +1384,9 @@ export default { filter_value_can_not_str: '数值类型字段过滤值不能包含文本', enum_value_can_not_null: '字段枚举值不能为空', column: '列', + table_freeze: '表格冻结', table_config: '表格配置', table_column_width_config: '列宽调整', - table_column_freeze: '列冻结', table_column_adapt: '自适应', table_column_custom: '自定义', chart_table_pivot: '透视表', diff --git a/core/frontend/src/views/chart/chart/chart.js b/core/frontend/src/views/chart/chart/chart.js index c24042c61c..9879226866 100644 --- a/core/frontend/src/views/chart/chart/chart.js +++ b/core/frontend/src/views/chart/chart/chart.js @@ -172,7 +172,8 @@ export const DEFAULT_SIZE = { quotaSuffixLetterSpace: '0', quotaSuffixFontShadow: false, tableColumnFreezeHead: 0, - tableColumnFreezeTail: 0 + tableColumnFreezeTail: 0, + tableRowFreezeHead: 0 } export const DEFAULT_SUSPENSION = { show: true diff --git a/core/frontend/src/views/chart/chart/table/table-info.js b/core/frontend/src/views/chart/chart/table/table-info.js index 61013bfbbd..960e8c9aff 100644 --- a/core/frontend/src/views/chart/chart/table/table-info.js +++ b/core/frontend/src/views/chart/chart/table/table-info.js @@ -92,7 +92,8 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo) showSeriesNumber: customAttr.size.showIndex, style: getSize(chart), conditions: getConditions(chart), - frozenColCount: customAttr.size.tableColumnFreezeHead ?? 0 + frozenColCount: customAttr.size.tableColumnFreezeHead ?? 0, + frozenRowCount: customAttr.size.tableRowFreezeHead ?? 0 } // 开启序号之后,第一列就是序号列,修改 label 即可 if (s2Options.showSeriesNumber) { @@ -285,16 +286,16 @@ export function baseTableNormal(s2, container, chart, action, tableData) { showSeriesNumber: customAttr.size.showIndex, style: getSize(chart), conditions: getConditions(chart), - frozenColCount: customAttr.size.tableColumnFreezeHead ?? 0 + frozenColCount: customAttr.size.tableColumnFreezeHead ?? 0, + frozenRowCount: customAttr.size.tableRowFreezeHead ?? 0 } // 开启序号之后,第一列就是序号列,修改 label 即可 if (s2Options.showSeriesNumber) { s2Options.colCell = (node) => { if (node.colIndex === 0) { - if (!customAttr.size.indexLabel) { + node.label = customAttr.size.indexLabel + if (!customAttr.size.indexLabel || customAttr.size.showTableHeader === false) { node.label = ' ' - } else { - node.label = customAttr.size.indexLabel } } } @@ -310,6 +311,11 @@ export function baseTableNormal(s2, container, chart, action, tableData) { colCellVertical: false } } + s2Options.colCell = (node) => { + if (node.colIndex === 0) { + node.label = ' ' + } + } } // 开始渲染 diff --git a/core/frontend/src/views/chart/chart/util.js b/core/frontend/src/views/chart/chart/util.js index 141fd9f8e0..7f3192abe8 100644 --- a/core/frontend/src/views/chart/chart/util.js +++ b/core/frontend/src/views/chart/chart/util.js @@ -63,7 +63,7 @@ export const TYPE_CONFIGS = [ 'tableTitleHeight', 'tableItemHeight', 'tableColumnMode', - 'tableColumnFreeze', + 'tableFreeze', 'showIndex', 'indexLabel', 'tableColTooltip', @@ -121,7 +121,7 @@ export const TYPE_CONFIGS = [ 'indexLabel', 'tableColTooltip', 'showTableHeader', - 'tableColumnFreeze' + 'tableFreeze' ], 'title-selector-ant-v': [ 'show', @@ -2083,7 +2083,7 @@ export const TYPE_CONFIGS = [ 'tableTitleHeight', 'tableItemHeight', 'tableColumnWidth', - 'tableColumnFreeze', + 'tableFreeze', 'showIndex', 'indexLabel', 'tableAutoBreakLine', @@ -2133,7 +2133,7 @@ export const TYPE_CONFIGS = [ 'tableColumnWidth', 'showIndex', 'indexLabel', - 'tableColumnFreeze', + 'tableFreeze', 'tableAutoBreakLine', 'showTableHeader' ], diff --git a/core/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue b/core/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue index 7103c7e35b..d5e3742bda 100644 --- a/core/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue +++ b/core/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue @@ -330,8 +330,8 @@ /> {{ $t('dynamic_time.before') }} diff --git a/core/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue b/core/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue index 2d3a7bf20e..80a69c8ae9 100644 --- a/core/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue +++ b/core/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue @@ -296,8 +296,8 @@ /> {{ $t('dynamic_time.before') }} @@ -309,6 +309,16 @@ @change="changeBarSizeCase('tableColumnFreezeHead')" /> {{ $t('chart.column') }} +
+ {{ $t('dynamic_time.before') }} + + {{ $t('deDataset.row') }}