From 14d118ba3e0ce9209e38f5a57532aba8d732f848 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 21 Dec 2023 15:24:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE-=E8=A1=A8=E6=A0=BC):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=20Echarts=20=E8=A1=A8=E6=A0=BC=E5=86=BB?= =?UTF-8?q?=E7=BB=93=E5=88=97=E5=90=8E=E6=A0=B7=E5=BC=8F=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/table/TableNormal.vue | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/core/frontend/src/views/chart/components/table/TableNormal.vue b/core/frontend/src/views/chart/components/table/TableNormal.vue index 5e08ec6a6a..7b3859a247 100644 --- a/core/frontend/src/views/chart/components/table/TableNormal.vue +++ b/core/frontend/src/views/chart/components/table/TableNormal.vue @@ -239,7 +239,11 @@ export default { tableStyle() { return { width: '100%', - '--scroll-bar-color': this.scrollBarColor + '--scroll-bar-color': this.scrollBarColor, + '--footer-font-color': this.table_header_class.color, + '--footer-bg-color': this.table_header_class.background, + '--footer-font-size': this.table_header_class.fontSize, + '--footer-height': this.table_header_class.height } }, ...mapState([ @@ -441,16 +445,14 @@ export default { this.table_item_class.fontSize = customAttr.size.tableItemFontSize + 'px' this.table_header_class.height = customAttr.size.tableTitleHeight + 'px' this.table_item_class.height = customAttr.size.tableItemHeight + 'px' - const visibleColumn = this.$refs.plxTable.getTableColumn().fullColumn for (let i = 0, column = visibleColumn[i]; i < visibleColumn.length; i++) { - // 有变更才刷新 if (column.type === 'index' && column.visible !== customAttr.size.showIndex) { column.visible = customAttr.size.showIndex - this.$refs.plxTable.refreshColumn() break } } + this.$refs.plxTable.refreshColumn() if (!customAttr.size.indexLabel) { this.indexLabel = ' ' } else { @@ -506,20 +508,6 @@ export default { this.bg_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha) } } - // 修改footer合计样式 - const table = document.getElementsByClassName(this.chart.id) - this.$refs.plxTable.updateFooter().then(() => { - for (let i = 0; i < table.length; i++) { - const s_table = table[i].getElementsByClassName('elx-table--footer') - let s = '' - for (const i in this.table_header_class) { - s += (i === 'fontSize' ? 'font-size' : i) + ':' + this.table_header_class[i] + ';' - } - for (let i = 0; i < s_table.length; i++) { - s_table[i].setAttribute('style', s) - } - } - }) }, getRowStyle({ row, rowIndex }) { if (rowIndex % 2 !== 0) { @@ -828,6 +816,12 @@ export default { text-overflow: var(--text-overflow, 'ellipsis'); white-space: var(--white-space, 'nowrap'); } + ::v-deep .elx-table--footer { + color: var(--footer-font-color); + background: var(--footer-bg-color); + font-size: var(--footer-font-size); + height: var(--footer-height); + } } From 8b6afd41a6a1e2e9ab27d0af6e63f79b03791817 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 21 Dec 2023 15:31:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE-=E8=A1=A8=E6=A0=BC)?= =?UTF-8?q?:=20AntV=20=E6=98=8E=E7=BB=86=E8=A1=A8/=E6=B1=87=E6=80=BB?= =?UTF-8?q?=E8=A1=A8=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') }}