From 1b090cdc58a2e80b1f4492c9872a4418e507b98e Mon Sep 17 00:00:00 2001 From: wisonic-s <51065359+wisonic-s@users.noreply.github.com> Date: Tue, 17 Jun 2025 21:40:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E9=80=8F=E8=A7=86?= =?UTF-8?q?=E8=A1=A8=E6=95=B0=E5=80=BC=E7=BB=B4=E5=BA=A6=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E9=94=99=E8=AF=AF=20#16321?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/js/panel/charts/table/table-pivot.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts index 05d20a9b26..8979613af8 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts @@ -309,6 +309,9 @@ export class TablePivot extends S2ChartView { // 根据配置动态决定排序顺序 uniqueValues.sort((a, b) => { + if ([2, 3, 4].includes(valueFieldMap[f]?.deType)) { + return sortMethod === 'ASC' ? a - b : b - a + } if (!a && !b) { return 0 } @@ -345,6 +348,9 @@ export class TablePivot extends S2ChartView { const uniqueValues = [...new Set(fieldValues)] // 根据配置动态决定排序顺序 uniqueValues.sort((a, b) => { + if ([2, 3, 4].includes(valueFieldMap[f]?.deType)) { + return sortMethod === 'ASC' ? a - b : b - a + } if (!a && !b) { return 0 }