1
This commit is contained in:
parent
3a4e7d73bc
commit
f2b99c3e54
8
.reasonix/desktop-topic-auto-title-meta.json
Normal file
8
.reasonix/desktop-topic-auto-title-meta.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"topic_20260821-062201_c21eb2dbea49a53e": {
|
||||||
|
"stage": 1,
|
||||||
|
"userTurns": 1,
|
||||||
|
"basisHash": "10579074257f2c51",
|
||||||
|
"updatedAt": 1787293862779
|
||||||
|
}
|
||||||
|
}
|
||||||
3
.reasonix/desktop-topic-created-at.json
Normal file
3
.reasonix/desktop-topic-created-at.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"topic_20260821-062201_c21eb2dbea49a53e": 1787293321185
|
||||||
|
}
|
||||||
3
.reasonix/desktop-topic-title-sources.json
Normal file
3
.reasonix/desktop-topic-title-sources.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"topic_20260821-062201_c21eb2dbea49a53e": "auto"
|
||||||
|
}
|
||||||
3
.reasonix/desktop-topic-titles.json
Normal file
3
.reasonix/desktop-topic-titles.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"topic_20260821-062201_c21eb2dbea49a53e": "aggrid导出的时候数值不对,现在…"
|
||||||
|
}
|
||||||
32
src/App.tsx
32
src/App.tsx
@ -147,18 +147,6 @@ const defaultTemplateFilterNode = {
|
|||||||
label: '默认模板',
|
label: '默认模板',
|
||||||
} as const;
|
} as const;
|
||||||
const overallSummaryKey = 'summary';
|
const overallSummaryKey = 'summary';
|
||||||
const pivotGridWanValueFields = new Set([
|
|
||||||
'lowValue',
|
|
||||||
'centerValue',
|
|
||||||
'highValue',
|
|
||||||
'maxValue',
|
|
||||||
'minValue',
|
|
||||||
'avgValue',
|
|
||||||
'medianValue',
|
|
||||||
'standardDeviation',
|
|
||||||
'interquartileRange',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// const mockGeoLocationPayload = {
|
// const mockGeoLocationPayload = {
|
||||||
// checkStrictly: true,
|
// checkStrictly: true,
|
||||||
// type: 3,
|
// type: 3,
|
||||||
@ -279,9 +267,6 @@ function formatNumber(value: number, maximumFractionDigits: number) {
|
|||||||
|
|
||||||
function formatCostValue(value: number) {
|
function formatCostValue(value: number) {
|
||||||
const absValue = Math.abs(value);
|
const absValue = Math.abs(value);
|
||||||
if (absValue >= 10000) {
|
|
||||||
return `${formatNumber(value / 10000, 2)}万元`;
|
|
||||||
}
|
|
||||||
const fractionDigits = absValue > 0 && absValue < 1 ? 4 : 2;
|
const fractionDigits = absValue > 0 && absValue < 1 ? 4 : 2;
|
||||||
return `${formatNumber(value, fractionDigits)}元`;
|
return `${formatNumber(value, fractionDigits)}元`;
|
||||||
}
|
}
|
||||||
@ -302,16 +287,7 @@ function formatChartValue(value: number, metricKey: MetricKey) {
|
|||||||
return formatAreaMetricValue(value);
|
return formatAreaMetricValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatGridWanValue(value: number) {
|
|
||||||
const wanValue = value / 10000;
|
|
||||||
const fractionDigits = Math.abs(wanValue) > 0 && Math.abs(wanValue) < 1 ? 4 : 2;
|
|
||||||
return formatNumber(wanValue, fractionDigits);
|
|
||||||
}
|
|
||||||
|
|
||||||
function formatGridMetricValue(value: number, metricKey: MetricKey) {
|
function formatGridMetricValue(value: number, metricKey: MetricKey) {
|
||||||
if (metricKey === 'cost') {
|
|
||||||
return formatGridWanValue(value);
|
|
||||||
}
|
|
||||||
const absValue = Math.abs(value);
|
const absValue = Math.abs(value);
|
||||||
const fractionDigits = absValue > 0 && absValue < 1 ? 4 : 2;
|
const fractionDigits = absValue > 0 && absValue < 1 ? 4 : 2;
|
||||||
return formatNumber(value, fractionDigits);
|
return formatNumber(value, fractionDigits);
|
||||||
@ -1070,7 +1046,7 @@ function App() {
|
|||||||
);
|
);
|
||||||
const pivotGridColumnDefs = useMemo<(ColDef<PivotGridRow> | ColGroupDef<PivotGridRow>)[]>(
|
const pivotGridColumnDefs = useMemo<(ColDef<PivotGridRow> | ColGroupDef<PivotGridRow>)[]>(
|
||||||
() => {
|
() => {
|
||||||
const valueUnit = requestMetricKey === 'cost' ? '万元' : '元/m²';
|
const valueUnit = requestMetricKey === 'cost' ? '元' : '元/m²';
|
||||||
const valueColumnMinWidth = requestMetricKey === 'cost' ? 112 : 142;
|
const valueColumnMinWidth = requestMetricKey === 'cost' ? 112 : 142;
|
||||||
const valueFormatter = ({ value }: ValueFormatterParams<PivotGridRow, number | null>) => (
|
const valueFormatter = ({ value }: ValueFormatterParams<PivotGridRow, number | null>) => (
|
||||||
value == null ? '' : formatGridMetricValue(Number(value), requestMetricKey)
|
value == null ? '' : formatGridMetricValue(Number(value), requestMetricKey)
|
||||||
@ -1199,12 +1175,6 @@ function App() {
|
|||||||
const exportPivotGrid = useCallback(() => {
|
const exportPivotGrid = useCallback(() => {
|
||||||
pivotGridApiRef.current?.exportDataAsCsv({
|
pivotGridApiRef.current?.exportDataAsCsv({
|
||||||
fileName: '组团统计表.csv',
|
fileName: '组团统计表.csv',
|
||||||
processCellCallback: ({ column, value }) => {
|
|
||||||
if (value == null) return '';
|
|
||||||
return pivotGridWanValueFields.has(column.getColId())
|
|
||||||
? String(Number(value) / 10000)
|
|
||||||
: String(value);
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
setGridContextMenuPosition(null);
|
setGridContextMenuPosition(null);
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user