Skip to content

Commit

Permalink
fix: 还原配置
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Nov 29, 2023
1 parent 6f361c8 commit 69bd47a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 137 deletions.
8 changes: 7 additions & 1 deletion packages/s2-core/src/cell/base-cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from 'lodash';
import {
CellTypes,
EMPTY_FIELD_VALUE,
InteractionStateName,
SHAPE_ATTRS_MAP,
SHAPE_STYLE_MAP,
Expand Down Expand Up @@ -135,7 +136,12 @@ export abstract class BaseCell<T extends SimpleBBox> extends Group {
}

public getFieldValue() {
return this.getFormattedFieldValue().formattedValue;
const { formattedValue } = this.getFormattedFieldValue();

if (formattedValue === EMPTY_FIELD_VALUE) {
return this.getActualText();
}
return formattedValue;
}

/**
Expand Down
134 changes: 0 additions & 134 deletions packages/s2-react/playground/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,140 +164,6 @@ export const sliderOptions: SliderSingleProps = {
},
};

export const testDataCfg = {
meta: [
{
field: '2d7feabd-76a2-4c11-8f24-79764af936b4',
name: '一级维度',
},
{
field: '30b4b32d-d69a-4772-b7f9-84cd54cf0cec',
name: '二级维度',
},
{
field: 'c5ce4e54-795a-42b3-9cc8-e8b685da44ee',
name: '数值',
},
],
fields: {
rows: [
'2d7feabd-76a2-4c11-8f24-79764af936b4',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec',
],
columns: [],
values: ['c5ce4e54-795a-42b3-9cc8-e8b685da44ee'],
valueInCols: true,
},
data: [
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '总计',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 1732771,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '维值-1',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '维值-2',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 172245,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '维值-1',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '维值-2',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 12222,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '维值-1',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '维值-3',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 11111,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '维值-1',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '维值-3',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 11111,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '维值-1',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 456,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-1',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '测试-2',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 12,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-1',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '测试-2',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 4444567,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-1',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '测试-3',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 111233,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-1',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '测试-3',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 785222,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-1',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '测试-4',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 6455644,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-1',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '测试-4',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 289898,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-1',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '测试-5',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 2222,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-1',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '测试-5',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 1111,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-1',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 125555,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-6',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '分享裂变',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 409090,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-6',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '分享裂变',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 111111,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-6',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '测试-7',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 5555,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-6',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '测试-7',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 67878,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-6',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '测试-8',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 53445.464,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-6',
'30b4b32d-d69a-4772-b7f9-84cd54cf0cec': '测试-8',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 456.464,
},
{
'2d7feabd-76a2-4c11-8f24-79764af936b4': '测试-6',
'c5ce4e54-795a-42b3-9cc8-e8b685da44ee': 123.416,
},
],
};

export const mockGridAnalysisOptions: SheetComponentOptions = {
width: 1600,
height: 600,
Expand Down
3 changes: 1 addition & 2 deletions packages/s2-react/playground/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ import {
tableSheetSingleColumns,
s2ThemeConfig,
pivotSheetDataCfgForCompactMode,
testDataCfg,
} from './config';
import './index.less';
import { ResizeConfig } from './resize';
Expand Down Expand Up @@ -1156,7 +1155,7 @@ function MainLayout() {
</Collapse>
{render && (
<SheetComponent
dataCfg={testDataCfg}
dataCfg={dataCfg}
options={mergedOptions}
sheetType={sheetType}
adaptive={adaptive}
Expand Down

0 comments on commit 69bd47a

Please sign in to comment.