From 40792ce994bc2b574a256433263e54af754f7dba Mon Sep 17 00:00:00 2001 From: Jinke Li Date: Sat, 11 May 2024 10:09:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E8=A1=A8=E5=90=AB=E6=9C=89=E7=A9=BA=E6=95=B0=E6=8D=AE=E5=8D=A0?= =?UTF-8?q?=E4=BD=8D=E7=AC=A6=E6=97=B6=E6=8E=92=E5=BA=8F=E9=94=99=E8=AF=AF?= =?UTF-8?q?=20close=20#2707=20(#2708)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复明细表含有空数据占位符时排序错误 close #2707 * test: 单测修复 --- .../__snapshots__/issue-2707-spec.ts.snap | 3316 +++++++++++++++++ .../s2-core/__tests__/bugs/issue-2707-spec.ts | 64 + .../__tests__/data/data-issue-2707.json | 1118 ++++++ .../s2-core/src/data-set/table-data-set.ts | 17 +- 4 files changed, 4513 insertions(+), 2 deletions(-) create mode 100644 packages/s2-core/__tests__/bugs/__snapshots__/issue-2707-spec.ts.snap create mode 100644 packages/s2-core/__tests__/bugs/issue-2707-spec.ts create mode 100644 packages/s2-core/__tests__/data/data-issue-2707.json diff --git a/packages/s2-core/__tests__/bugs/__snapshots__/issue-2707-spec.ts.snap b/packages/s2-core/__tests__/bugs/__snapshots__/issue-2707-spec.ts.snap new file mode 100644 index 0000000000..3ec2b83407 --- /dev/null +++ b/packages/s2-core/__tests__/bugs/__snapshots__/issue-2707-spec.ts.snap @@ -0,0 +1,3316 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PivotSheet Special Dimension Values Copy Tests should sort correctly data by ASC sort method 1`] = ` +Array [ + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 2000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 3000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 3000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 3000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 4000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 4000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 4000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 5000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 5000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 5000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 6000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 6000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 6000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 7000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 7000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 8000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 9000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 9000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 9000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 10000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 12000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 12000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 15000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 15000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 17000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 22000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 23000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 25000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 29000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 29000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 33000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 38000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 39000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 42000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 49000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 55000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 61000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 66000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 71000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 72000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 72000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 76000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 91000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 100000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 111000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 114000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 119000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 158000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 160000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 168000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 182000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 210000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 211000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 236000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 256000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 280000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 293000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 296000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 332000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 345000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 353000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 373000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 415000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 444000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 452000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 606000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 606000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 663000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 685000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 698000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 941000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 959000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1031000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1192000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1219000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1244000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1259000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1421000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1816000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1820000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1834000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1857000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 2200000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 3600000, + "key8": 1, + }, +] +`; + +exports[`PivotSheet Special Dimension Values Copy Tests should sort correctly data by DESC sort method 1`] = ` +Array [ + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 3600000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 2200000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1857000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1834000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1820000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1816000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1421000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1259000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1244000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1219000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1192000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1031000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 959000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 941000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 698000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 685000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 663000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 606000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 606000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 452000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 444000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 415000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 373000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 353000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 345000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 332000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 296000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 293000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 280000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 256000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 236000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 211000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 210000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 182000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 168000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 160000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 158000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 119000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 114000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 111000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 100000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 91000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 76000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 72000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 72000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 71000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 66000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 61000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 55000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 49000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 42000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 39000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 38000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 33000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 29000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 29000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 25000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 23000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 22000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 17000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 15000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 15000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 12000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 12000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 10000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 9000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 9000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 9000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 8000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 7000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 7000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 6000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 6000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 6000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 5000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 5000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 5000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 4000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 4000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 4000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 3000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 3000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 3000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 2000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, +] +`; + +exports[`PivotSheet Special Dimension Values Copy Tests should sort correctly data by DESC sort method and custom sortBy 1`] = ` +Array [ + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 2000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 3000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 3000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 3000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 4000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 4000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 4000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 5000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 5000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 5000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 6000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 6000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 6000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 7000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 7000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 8000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 9000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 9000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 9000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 10000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 12000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 12000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 15000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 15000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 17000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 22000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 23000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 25000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 29000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 29000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 33000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 38000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 39000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 42000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 49000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 55000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 61000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 66000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 71000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 72000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 72000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 76000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 91000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 100000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 111000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 114000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 119000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 158000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 160000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 168000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 182000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 210000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 211000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 236000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 256000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 280000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 293000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 296000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 332000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 345000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 353000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 373000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 415000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 444000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 452000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 606000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 606000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 663000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 685000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 698000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 941000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 959000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1031000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1192000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1219000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1244000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1259000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1421000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1800000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1816000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1820000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1834000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 1857000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 2200000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": 3600000, + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, + Object { + "key1": "mm", + "key2": "aa", + "key3": "用户", + "key4": "--", + "key5": "asd", + "key6": 1, + "key6__aqp_pe": 0, + "key7": "-", + "key8": 1, + }, +] +`; diff --git a/packages/s2-core/__tests__/bugs/issue-2707-spec.ts b/packages/s2-core/__tests__/bugs/issue-2707-spec.ts new file mode 100644 index 0000000000..45f61f9f6b --- /dev/null +++ b/packages/s2-core/__tests__/bugs/issue-2707-spec.ts @@ -0,0 +1,64 @@ +/** + * 明细表数据含有空值导致排序失效 + * @description spec for issue 2707 + * https://github.com/antvis/S2/issues/2707 + */ + +import { EMPTY_PLACEHOLDER } from '../../src'; +import * as mockDataConfig from '../data/data-issue-2707.json'; +import { createTableSheet } from '../util/helpers'; +import type { S2Options, SpreadSheet } from '@/index'; + +const s2Options: S2Options = { + width: 800, + height: 480, +}; + +describe('PivotSheet Special Dimension Values Copy Tests', () => { + let s2: SpreadSheet; + + beforeEach(() => { + s2 = createTableSheet(s2Options); + s2.setDataCfg(mockDataConfig); + s2.render(); + }); + + test('should sort correctly data by DESC sort method', () => { + s2.setDataCfg({ + sortParams: [{ sortFieldId: 'key7', sortMethod: 'DESC' }], + }); + s2.render(); + + expect(s2.dataSet.displayData).toMatchSnapshot(); + }); + + test('should sort correctly data by ASC sort method', () => { + s2.setDataCfg({ + sortParams: [{ sortFieldId: 'key7', sortMethod: 'ASC' }], + }); + s2.render(); + + expect(s2.dataSet.displayData).toMatchSnapshot(); + }); + + test('should sort correctly data by DESC sort method and custom sortBy', () => { + s2.setDataCfg({ + sortParams: [ + { + sortFieldId: 'key7', + sortMethod: 'ASC', + sortBy: (record) => { + if (record.key7 === EMPTY_PLACEHOLDER) { + return Number.MAX_VALUE; + } + + return record.key7; + }, + }, + ], + }); + s2.render(); + + expect(s2.dataSet.displayData).toMatchSnapshot(); + }); +}); diff --git a/packages/s2-core/__tests__/data/data-issue-2707.json b/packages/s2-core/__tests__/data/data-issue-2707.json new file mode 100644 index 0000000000..3bcf7eeeb1 --- /dev/null +++ b/packages/s2-core/__tests__/data/data-issue-2707.json @@ -0,0 +1,1118 @@ +{ + "fields": { + "rows": [], + "columns": ["key1", "key2", "key3", "key4", "key5", "key6", "key7", "key8"] + }, + "meta": [ + { "field": "key1", "name": "key1", "domainType": "dimension" }, + { "field": "key2", "name": "key2", "domainType": "dimension" }, + { "field": "key3", "name": "key3", "domainType": "dimension" }, + { "field": "key4", "name": "key4", "domainType": "dimension" }, + { "field": "key5", "name": "key5", "domainType": "date" }, + { "field": "key6", "name": "key6", "domainType": "measure" }, + { "field": "key7", "name": "排序这个", "domainType": "measure" }, + { "field": "key8", "name": "key8", "domainType": "measure" } + ], + "data": [ + { + "key4": "--", + "key7": 91000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 158000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": "-", + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 3000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 211000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 72000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 9000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1800000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 663000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 9000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 61000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 7000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 168000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 15000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 606000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 4000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 5000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 66000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1834000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1857000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 9000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 119000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 373000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 22000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 6000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 353000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 4000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 55000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": "-", + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 6000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1421000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1800000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 8000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 23000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 236000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 210000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 941000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 29000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 2000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1259000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 959000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 3000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 17000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 39000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": "-", + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 111000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1800000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": "-", + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 182000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 296000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 280000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 415000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 685000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 29000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 5000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1820000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 160000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 114000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 452000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 4000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 698000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 293000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 332000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 33000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 12000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 444000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 12000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": "-", + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 72000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 10000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": "-", + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1800000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": "-", + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 345000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 38000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 42000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1800000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 76000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 6000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 100000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 3000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 25000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1800000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 256000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 5000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 2200000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 49000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1800000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 71000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 15000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1192000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1244000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1219000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": "-", + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 3600000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1816000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": "-", + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 1031000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 7000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + }, + { + "key4": "--", + "key7": 606000, + "key6__aqp_pe": 0, + "key2": "aa", + "key8": 1, + "key6": 1, + "key3": "用户", + "key1": "mm", + "key5": "asd" + } + ] +} diff --git a/packages/s2-core/src/data-set/table-data-set.ts b/packages/s2-core/src/data-set/table-data-set.ts index 790693914d..2795deecad 100644 --- a/packages/s2-core/src/data-set/table-data-set.ts +++ b/packages/s2-core/src/data-set/table-data-set.ts @@ -7,6 +7,7 @@ import type { SimpleData, } from '../common/interface'; import { isAscSort, isDescSort } from '../utils/sort-action'; +import { getEmptyPlaceholder } from '../utils'; import { BaseDataSet } from './base-data-set'; import type { GetCellDataParams, GetCellMultiDataParams } from './interface'; @@ -135,11 +136,23 @@ export class TableDataSet extends BaseDataSet { return idxB - idxA; }); } else if (isAscSort(sortMethod!) || isDescSort(sortMethod!)) { - const func = isFunction(sortBy) ? sortBy : null; + const placeholder = getEmptyPlaceholder( + this.spreadsheet, + this.spreadsheet.options?.placeholder, + ); + const customSortBy = isFunction(sortBy) ? sortBy : null; + const customSort = (record: RawData) => { + // 空值占位符按最小值处理 https://github.com/antvis/S2/issues/2707 + if (record[sortFieldId] === placeholder) { + return Number.MIN_VALUE; + } + + return record[sortFieldId]; + }; sortedData = orderBy( data, - [func || sortFieldId], + [customSortBy || customSort], [sortMethod?.toLocaleLowerCase() as boolean | 'asc' | 'desc'], ) as RawData[]; }