Skip to content

Commit 2d57c1e

Browse files
committed
feat(strategy-sheet): 占位符统一使用 options.placeholder
1 parent 3ad6461 commit 2d57c1e

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

packages/s2-core/src/utils/export/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ import { last, isEmpty, clone, trim, max, isObject, forEach } from 'lodash';
22
import { getCsvString } from './export-worker';
33
import { SpreadSheet } from '@/sheet-type';
44
import { CornerNodeType, ViewMeta } from '@/common/interface';
5-
import {
6-
ID_SEPARATOR,
7-
EMPTY_PLACEHOLDER,
8-
ROOT_BEGINNING_REGEX,
9-
} from '@/common/constant';
5+
import { ID_SEPARATOR, ROOT_BEGINNING_REGEX } from '@/common/constant';
106
import { MultiData } from '@/common/interface';
117

128
export const copyToClipboard = (str: string) => {
@@ -129,7 +125,7 @@ const processValueInRow = (
129125
}
130126
} else {
131127
// If the meta equals null then it will be replaced by '-'.
132-
tempCell.push(EMPTY_PLACEHOLDER);
128+
tempCell.push(sheetInstance.options.placeholder);
133129
}
134130
return tempCell.join(' ');
135131
};

packages/s2-core/src/utils/tooltip.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import { SpreadSheet } from '@/sheet-type';
4646
import { i18n } from '@/common/i18n';
4747
import {
4848
CellTypes,
49-
EMPTY_PLACEHOLDER,
5049
EXTRA_FIELD,
5150
PRECISION,
5251
VALUE_FIELD,
@@ -441,7 +440,7 @@ export const getSummaries = (params: SummaryParam): TooltipSummaryOptions[] => {
441440
value = '';
442441
} else if (every(selected, (item) => isNotNumber(get(item, VALUE_FIELD)))) {
443442
// 如果选中的单元格都无数据,则显示"-"
444-
value = EMPTY_PLACEHOLDER;
443+
value = spreadsheet.options.placeholder;
445444
} else {
446445
const dataSum = getDataSumByField(selected, VALUE_FIELD);
447446
value = parseFloat(dataSum.toPrecision(PRECISION)); // solve accuracy problems

0 commit comments

Comments
 (0)