Merge pull request #9295 from dataease/pr@dev-v2@fix_table_pivot_col_row_swap

fix(图表): 修复透视表行列定义,和 V1 保持一致 #9238
This commit is contained in:
wisonic-s 2024-04-24 12:26:04 +08:00 committed by GitHub
commit 42e65c563a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 2 deletions

View File

@ -8,3 +8,10 @@ update data_visualization_info set version = 2;
ALTER TABLE `visualization_template`
ADD COLUMN `version` int NULL DEFAULT 3 COMMENT '使用资源的版本';
update visualization_template set version = 2;
update
core_chart_view as a,
core_chart_view as b
set
a.x_axis = b.x_axis_ext,
a.x_axis_ext = b.x_axis
where a.id = b.id and a.type = 'table-pivot';

View File

@ -18,4 +18,12 @@ where `id` = '156330103';
UPDATE `area`
set `id` = '156330114',
`name` = '钱塘区'
where `id` = '156330104';
where `id` = '156330104';
update
core_chart_view as a,
core_chart_view as b
set
a.x_axis = b.x_axis_ext,
a.x_axis_ext = b.x_axis
where a.id = b.id and a.type = 'table-pivot';

View File

@ -59,7 +59,7 @@ export class TablePivot extends S2ChartView<PivotSheet> {
const { container, chart, chartObj, action } = drawOption
const containerDom = document.getElementById(container)
const { xAxis: columnFields, xAxisExt: rowFields, yAxis: valueFields } = chart
const { xAxisExt: columnFields, xAxis: rowFields, yAxis: valueFields } = chart
const [c, r, v] = [columnFields, rowFields, valueFields].map(arr =>
arr.map(i => i.dataeaseName)
)