260330_01_ENH: 26일자 수정사항 반영(라이프스테이지 중분류 제외)

This commit is contained in:
2026-03-30 13:18:08 +09:00
parent ee8bb13209
commit 7f9465e96f
19 changed files with 203 additions and 94 deletions

View File

@@ -21,7 +21,13 @@ import {
VerticalBar,
} from "@/components/lge-dashboard";
import { useLayoutFilter } from "@/components/layout/LayoutFilterContext";
import {calcGapProductRow, formatRowLabel, normalizeFilterCondition, withGapRow} from "@/lib/lg-dashboard";
import {
calcGapProductRow,
formatRowLabel,
normalizeFilterCondition,
withGapRow,
wrapSampleRow
} from "@/lib/lg-dashboard";
import {buildHeader_ProductKeyMap, exportDashboardExcel} from "@/lib/lg-export-excel";
import {useDebouncedValue} from "@/hooks/useDebouncedValue";
import {SelectedMap} from "@/types/common";
@@ -49,16 +55,17 @@ const PurchasePage = () => {
const purchaseRows =
data?.statisticsDataMap?.purchase
.filter((r) => r.rowLabel == `구매`)
.filter((r) => r.rowLabel == `구매` || r.rowLabel == `사례수`)
.map((row) => {
const rowLabel = row.rowLabel == `사례수`? `${formatRowLabel(row.year)} ${row.rowLabel}` : row.year;
return {
...row,
rowLabel: row.year,
rowLabel: rowLabel,
}
}) ?? [];
const purchaseRowsWithGap = useMemo(() => {
return withGapRow(purchaseRows, calcGapProductRow);
return withGapRow(wrapSampleRow(purchaseRows, false), calcGapProductRow, -1, -3);
}, [purchaseRows]);
const purchaseTableRows = useMemo<TopChartTableRow[]>(() => {
@@ -72,7 +79,7 @@ const PurchasePage = () => {
const purchaseChartData = useMemo<ChartData>(() => {
return {
categories: [...PRODUCTS],
series: purchaseRows
series: purchaseRows.filter((r) => !r.rowLabel.includes("사례수"))
.map((r) => ({
name: r.rowLabel,
data: PRODUCT_KEYS.map((k) => (r as any)[k] ?? null),