260330_01_ENH: 26일자 수정사항 반영(라이프스테이지 중분류 제외)
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user