From a8a47fb673e4d1eddd18c73af9ae7a8814c84e72 Mon Sep 17 00:00:00 2001 From: lijinke666 Date: Thu, 2 Nov 2023 15:22:10 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=A7=BB=E5=8A=A8=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/s2-react/playground/config.ts | 32 ++++++++++++++++++++++++- packages/s2-react/playground/index.tsx | 33 ++------------------------ 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/packages/s2-react/playground/config.ts b/packages/s2-react/playground/config.ts index 27bc560e14..ccb83ab7ac 100644 --- a/packages/s2-react/playground/config.ts +++ b/packages/s2-react/playground/config.ts @@ -1,4 +1,4 @@ -import { isUpDataValue, type Columns } from '@antv/s2'; +import { isUpDataValue, type Columns, customMerge } from '@antv/s2'; import type { S2DataConfig, ThemeCfg } from '@antv/s2'; import { getBaseSheetComponentOptions } from '@antv/s2-shared'; import type { SliderSingleProps } from 'antd'; @@ -46,6 +46,36 @@ export const pivotSheetDataCfg: S2DataConfig = { fields, }; +export const pivotSheetDataCfgForCompactMode = customMerge(pivotSheetDataCfg, { + data: [ + ...pivotSheetDataCfg.data, + { + province: '浙江', + city: '杭州', + type: '笔', + price: '11111111', + }, + { + province: '浙江', + city: '杭州', + type: '纸张', + price: '2', + }, + { + province: '浙江', + city: '舟山', + type: '笔', + price: '2', + }, + { + province: '浙江', + city: '舟山', + type: '纸张', + price: '133.333', + }, + ], +}); + export const s2Options: SheetComponentOptions = { debug: true, width: 600, diff --git a/packages/s2-react/playground/index.tsx b/packages/s2-react/playground/index.tsx index 08461e21ed..e9829dd31e 100644 --- a/packages/s2-react/playground/index.tsx +++ b/packages/s2-react/playground/index.tsx @@ -68,6 +68,7 @@ import { tableSheetMultipleColumns, tableSheetSingleColumns, s2ThemeConfig, + pivotSheetDataCfgForCompactMode, } from './config'; import './index.less'; import { ResizeConfig } from './resize'; @@ -334,37 +335,7 @@ function MainLayout() { }, }, }); - setDataCfg( - customMerge(pivotSheetDataCfg, { - data: [ - ...pivotSheetDataCfg.data, - { - province: '浙江', - city: '杭州', - type: '笔', - price: '11111111', - }, - { - province: '浙江', - city: '杭州', - type: '纸张', - price: '2', - }, - { - province: '浙江', - city: '舟山', - type: '笔', - price: '2', - }, - { - province: '浙江', - city: '舟山', - type: '纸张', - price: '133.333', - }, - ], - }), - ); + setDataCfg(pivotSheetDataCfgForCompactMode); break; default: