From 9b8cd839ee1e05a8905f75cb08dc8dea2970004b Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 9 Nov 2023 17:49:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A1=A8=E6=A0=BC=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E8=A1=A8=E5=A4=B4#5873?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/lang/en.js | 1 + core/frontend/src/lang/tw.js | 1 + core/frontend/src/lang/zh.js | 1 + core/frontend/src/views/chart/chart/chart.js | 3 +- .../src/views/chart/chart/table/table-info.js | 18 ++ core/frontend/src/views/chart/chart/util.js | 12 +- .../components/shapeAttr/SizeSelector.vue | 198 +++++++------ .../components/shapeAttr/SizeSelectorAntV.vue | 275 ++++++++++-------- .../chart/components/table/TableNormal.vue | 9 +- 9 files changed, 295 insertions(+), 223 deletions(-) diff --git a/core/frontend/src/lang/en.js b/core/frontend/src/lang/en.js index 609f7da0ab..fcbad70544 100644 --- a/core/frontend/src/lang/en.js +++ b/core/frontend/src/lang/en.js @@ -1147,6 +1147,7 @@ export default { table_header_font_color: 'Header Font', table_item_font_color: 'Table Font', table_show_index: 'Show Index', + table_show_table_header: 'Show Table Header', stripe: 'Zebra pattern', start_angle: 'Start Angle', end_angle: 'End Angle', diff --git a/core/frontend/src/lang/tw.js b/core/frontend/src/lang/tw.js index 454ab31525..fb6656ba65 100644 --- a/core/frontend/src/lang/tw.js +++ b/core/frontend/src/lang/tw.js @@ -1146,6 +1146,7 @@ export default { table_header_font_color: '表頭字體', table_item_font_color: '表格字體', table_show_index: '顯示序號', + table_show_table_header: '顯示表頭', stripe: '斑馬紋', start_angle: '起始角度', end_angle: '結束角度', diff --git a/core/frontend/src/lang/zh.js b/core/frontend/src/lang/zh.js index f27c6fa2a4..3175cc9525 100644 --- a/core/frontend/src/lang/zh.js +++ b/core/frontend/src/lang/zh.js @@ -1145,6 +1145,7 @@ export default { table_header_font_color: '表头字体', table_item_font_color: '表格字体', table_show_index: '显示序号', + table_show_table_header: '显示表头', stripe: '斑马纹', start_angle: '起始角度', end_angle: '结束角度', diff --git a/core/frontend/src/views/chart/chart/chart.js b/core/frontend/src/views/chart/chart/chart.js index a687a7aafe..2058b8a829 100644 --- a/core/frontend/src/views/chart/chart/chart.js +++ b/core/frontend/src/views/chart/chart/chart.js @@ -156,7 +156,8 @@ export const DEFAULT_SIZE = { mapLineAnimateInterval: 1, mapLineAnimateTrailLength: 1, wordSizeRange: [8, 32], - wordSpacing: 6 + wordSpacing: 6, + showTableHeader: true } 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 8f7179089f..2c9b8edd21 100644 --- a/core/frontend/src/views/chart/chart/table/table-info.js +++ b/core/frontend/src/views/chart/chart/table/table-info.js @@ -111,6 +111,15 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo) return new DataCell(viewMeta, viewMeta?.spreadsheet) } } + // 隐藏表头,保留顶部的分割线, 禁用表头横向 resize + if (customAttr.size.showTableHeader === false) { + s2Options.style.colCfg.height = 1 + s2Options.interaction = { + resize: { + colCellVertical: false + } + } + } // 开始渲染 if (s2) { @@ -284,6 +293,15 @@ export function baseTableNormal(s2, container, chart, action, tableData) { } } } + // 隐藏表头,保留顶部的分割线, 禁用表头横向 resize + if (customAttr.size.showTableHeader === false) { + s2Options.style.colCfg.height = 1 + s2Options.interaction = { + resize: { + colCellVertical: false + } + } + } // 开始渲染 if (s2) { diff --git a/core/frontend/src/views/chart/chart/util.js b/core/frontend/src/views/chart/chart/util.js index 92a9757112..347dbd41c2 100644 --- a/core/frontend/src/views/chart/chart/util.js +++ b/core/frontend/src/views/chart/chart/util.js @@ -63,7 +63,8 @@ export const TYPE_CONFIGS = [ 'tableColumnMode', 'showIndex', 'indexLabel', - 'tableColTooltip' + 'tableColTooltip', + 'showTableHeader' ], 'title-selector-ant-v': [ 'show', @@ -113,7 +114,8 @@ export const TYPE_CONFIGS = [ 'tableColumnMode', 'showIndex', 'indexLabel', - 'tableColTooltip' + 'tableColTooltip', + 'showTableHeader' ], 'title-selector-ant-v': [ 'show', @@ -1987,7 +1989,8 @@ export const TYPE_CONFIGS = [ 'tableColumnWidth', 'showIndex', 'indexLabel', - 'tableAutoBreakLine' + 'tableAutoBreakLine', + 'showTableHeader' ], 'title-selector': [ 'show', @@ -2031,7 +2034,8 @@ export const TYPE_CONFIGS = [ 'tableColumnWidth', 'showIndex', 'indexLabel', - 'tableAutoBreakLine' + 'tableAutoBreakLine', + 'showTableHeader' ], 'title-selector': [ 'show', diff --git a/core/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue b/core/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue index bfaa06d0ec..ca4a384770 100644 --- a/core/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue +++ b/core/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue @@ -242,7 +242,42 @@ - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + {{ $t('commons.yes') }} + {{ $t('commons.no') }} + + +
+ + + + + + + + + +
@@ -1055,6 +1072,7 @@