diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 2df096f6f1..fad8602543 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -971,6 +971,9 @@ export default { table_header_show_vertical_border: '表头纵边框线', table_cell_show_horizon_border: '单元格横边框线', table_cell_show_vertical_border: '单元格纵边框线', + table_col_freeze_tip: '第一列到', + tbale_row_freeze_tip: '第一行到', + table_freeze: '冻结', stripe: '斑马纹', start_angle: '起始角度', end_angle: '结束角度', diff --git a/core/core-frontend/src/models/chart/chart-attr.d.ts b/core/core-frontend/src/models/chart/chart-attr.d.ts index 42483f0e3c..649cc0429e 100644 --- a/core/core-frontend/src/models/chart/chart-attr.d.ts +++ b/core/core-frontend/src/models/chart/chart-attr.d.ts @@ -410,6 +410,18 @@ declare interface ChartTableCellAttr { * 加粗 */ isBolder: boolean + /** + * 冻结 + */ + tableFreeze: boolean + /** + * 冻结列 + */ + tableColumnFreezeHead: number + /** + * 冻结行 + */ + tableRowFreezeHead: number } /** diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableCellSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableCellSelector.vue index 393750b916..a26b4e3148 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableCellSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableCellSelector.vue @@ -308,6 +308,58 @@ onMounted(() => { + + + {{ t('chart.table_freeze') }} + + + + + + + + + + + + + + { 'tableScrollBarColor', 'alpha', 'tablePageMode' + ], + 'table-cell-selector': [ + ...TABLE_EDITOR_PROPERTY_INNER['table-cell-selector'], + 'tableFreeze', + 'tableColumnFreezeHead', + 'tableRowFreezeHead' ] } axis: AxisType[] = ['xAxis', 'filter', 'drill'] @@ -151,7 +157,9 @@ export class TableInfo extends S2ChartView { tooltip: { getContainer: () => containerDom, renderTooltip: sheet => new SortTooltip(sheet) - } + }, + frozenColCount: customAttr.tableCell.tableColumnFreezeHead ?? 0, + frozenRowCount: customAttr.tableCell.tableRowFreezeHead ?? 0 } // 开启序号之后,第一列就是序号列,修改 label 即可 if (s2Options.showSeriesNumber) { diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts index 1ac9e543af..986eb555ca 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts @@ -34,6 +34,12 @@ export class TableNormal extends S2ChartView { ...TABLE_EDITOR_PROPERTY_INNER['basic-style-selector'], 'showSummary', 'summaryLabel' + ], + 'table-cell-selector': [ + ...TABLE_EDITOR_PROPERTY_INNER['table-cell-selector'], + 'tableFreeze', + 'tableColumnFreezeHead', + 'tableRowFreezeHead' ] } axis: AxisType[] = ['xAxis', 'yAxis', 'drill', 'filter'] @@ -132,7 +138,9 @@ export class TableNormal extends S2ChartView { tooltip: { getContainer: () => containerDom, renderTooltip: sheet => new SortTooltip(sheet) - } + }, + frozenColCount: customAttr.tableCell.tableColumnFreezeHead ?? 0, + frozenRowCount: customAttr.tableCell.tableRowFreezeHead ?? 0 } // 开启序号之后,第一列就是序号列,修改 label 即可 if (s2Options.showSeriesNumber) {