260518_02_ENH: 전체현황, 안전점검에 지역본부 평균 대비 row 추가
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
import { useLayoutFilter } from "@/components/layout/LayoutCategoryContext";
|
import { useLayoutFilter } from "@/components/layout/LayoutCategoryContext";
|
||||||
import CustomerSatisfactionTotal from "@/components/kfpa/CustomerSatisfactionTotal";
|
import CustomerSatisfactionTotal from "@/components/kfpa/CustomerSatisfactionTotal";
|
||||||
import CustomerSatisfactionDetail from "@/components/kfpa/CustomerSatisfactionDetail";
|
import CustomerSatisfactionDetail from "@/components/kfpa/CustomerSatisfactionDetail";
|
||||||
import { COMMENT_TABLE_TITLE } from "@/config/kfpaConfig";
|
import { COMMENT_TABLE_TITLE } from "@/config/kfpa.config";
|
||||||
|
|
||||||
const BridgePlatformPage = () => {
|
const BridgePlatformPage = () => {
|
||||||
const { selectedDiv } = useLayoutFilter();
|
const { selectedDiv } = useLayoutFilter();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import { useLayoutFilter } from "@/components/layout/LayoutCategoryContext";
|
import { useLayoutFilter } from "@/components/layout/LayoutCategoryContext";
|
||||||
import CustomerSatisfactionTotal from "@/components/kfpa/CustomerSatisfactionTotal";
|
import CustomerSatisfactionTotal from "@/components/kfpa/CustomerSatisfactionTotal";
|
||||||
import CustomerSatisfactionDetail from "@/components/kfpa/CustomerSatisfactionDetail";
|
import CustomerSatisfactionDetail from "@/components/kfpa/CustomerSatisfactionDetail";
|
||||||
import { COMMENT_TABLE_TITLE } from "@/config/kfpaConfig";
|
import { COMMENT_TABLE_TITLE } from "@/config/kfpa.config";
|
||||||
|
|
||||||
const UcisPage = () => {
|
const UcisPage = () => {
|
||||||
const { selectedDiv } = useLayoutFilter();
|
const { selectedDiv } = useLayoutFilter();
|
||||||
|
|||||||
@@ -530,7 +530,7 @@
|
|||||||
|
|
||||||
.kfpa-table tbody th,
|
.kfpa-table tbody th,
|
||||||
.kfpa-table tbody td {
|
.kfpa-table tbody td {
|
||||||
padding: 7px 12px;
|
padding: 6px 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.kfpa-table thead tr.kfpa-table__chart-row > th,
|
.kfpa-table thead tr.kfpa-table__chart-row > th,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ TopChartTableSectionRow
|
|||||||
import {ChartData} from "../chart/types";
|
import {ChartData} from "../chart/types";
|
||||||
import {CHART_HEIGHTS, TABLE_DIMENSIONS} from "../chart/chart.config";
|
import {CHART_HEIGHTS, TABLE_DIMENSIONS} from "../chart/chart.config";
|
||||||
import type {DataColumn, SignStyle} from "@/components/table/types";
|
import type {DataColumn, SignStyle} from "@/components/table/types";
|
||||||
import { CUSTOMER_SATISFACTION_DECIMAL_PLACES } from "@/config/kfpaConfig";
|
import { CUSTOMER_SATISFACTION_DECIMAL_PLACES } from "@/config/kfpa.config";
|
||||||
|
|
||||||
export type TopChartTableProps = {
|
export type TopChartTableProps = {
|
||||||
title?: string;
|
title?: string;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
getDashboardRankRows,
|
getDashboardRankRows,
|
||||||
getSideMenuLabel,
|
getSideMenuLabel,
|
||||||
RANK_TABLE_TITLE,
|
RANK_TABLE_TITLE,
|
||||||
} from "@/config/kfpaConfig";
|
} from "@/config/kfpa.config";
|
||||||
import CustomerSatisfactionRankTable from "./CustomerSatisfactionRankTable";
|
import CustomerSatisfactionRankTable from "./CustomerSatisfactionRankTable";
|
||||||
import CustomerSatisfactionCommentTable from "./CustomerSatisfactionCommentTable";
|
import CustomerSatisfactionCommentTable from "./CustomerSatisfactionCommentTable";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import TopChartTable from "@/components/combo/TopChartTable";
|
|||||||
import type { TopChartTableRow } from "@/components/combo/types";
|
import type { TopChartTableRow } from "@/components/combo/types";
|
||||||
import VerticalBar from "@/components/chart/VerticalBar";
|
import VerticalBar from "@/components/chart/VerticalBar";
|
||||||
import type { DataColumn } from "@/components/table/types";
|
import type { DataColumn } from "@/components/table/types";
|
||||||
import { GAP_WORDING } from "@/const/kfpa.const";
|
|
||||||
import {
|
import {
|
||||||
CUSTOMER_SATISFACTION_DECIMAL_PLACES,
|
CUSTOMER_SATISFACTION_DECIMAL_PLACES,
|
||||||
CUSTOMER_SATISFACTION_GAP_SIGN_STYLE,
|
CUSTOMER_SATISFACTION_GAP_SIGN_STYLE,
|
||||||
@@ -14,11 +14,12 @@ import {
|
|||||||
DASHBOARD_TOTAL_TITLE_BY_CATEGORY,
|
DASHBOARD_TOTAL_TITLE_BY_CATEGORY,
|
||||||
DIV_KEYS,
|
DIV_KEYS,
|
||||||
SUMMARY_CATEGORY_KEYS,
|
SUMMARY_CATEGORY_KEYS,
|
||||||
getDashboardTotalTableLayout,
|
getDashboardTotalTableLayout, GAP_WORDING, SUMMARY_AVERAGE_GAP_WORDING,
|
||||||
} from "@/config/kfpaConfig";
|
} from "@/config/kfpa.config";
|
||||||
import { useLayoutFilter } from "@/components/layout/LayoutCategoryContext";
|
import { useLayoutFilter } from "@/components/layout/LayoutCategoryContext";
|
||||||
import { useCsiSummaryQuery } from "@/query/statistics";
|
import { useCsiSummaryQuery } from "@/query/statistics";
|
||||||
import {
|
import {
|
||||||
|
getAverageGapValue,
|
||||||
getSummaryColumnLabel,
|
getSummaryColumnLabel,
|
||||||
getSummaryCsiValue,
|
getSummaryCsiValue,
|
||||||
getSummaryDataKey,
|
getSummaryDataKey,
|
||||||
@@ -46,8 +47,6 @@ const CustomerSatisfactionSummary = () => {
|
|||||||
|
|
||||||
const latestWave = waves.at(-1);
|
const latestWave = waves.at(-1);
|
||||||
const selectedWaves = latestWave == null ? [] : [latestWave - 1, latestWave];
|
const selectedWaves = latestWave == null ? [] : [latestWave - 1, latestWave];
|
||||||
const currentWave = selectedWaves.at(-1);
|
|
||||||
|
|
||||||
const columns: DataColumn<Record<string, unknown>>[] = summaryColumns.map((key) => ({
|
const columns: DataColumn<Record<string, unknown>>[] = summaryColumns.map((key) => ({
|
||||||
key,
|
key,
|
||||||
header: getSummaryColumnLabel(key),
|
header: getSummaryColumnLabel(key),
|
||||||
@@ -59,12 +58,12 @@ const CustomerSatisfactionSummary = () => {
|
|||||||
const categories = summaryColumns.map(getSummaryColumnLabel);
|
const categories = summaryColumns.map(getSummaryColumnLabel);
|
||||||
|
|
||||||
const rows: TopChartTableRow[] =
|
const rows: TopChartTableRow[] =
|
||||||
selectedWaves.length === 0 || currentWave == null
|
selectedWaves.length === 0 || latestWave == undefined
|
||||||
? []
|
? []
|
||||||
: [
|
: [
|
||||||
{
|
{
|
||||||
label: "응답건수",
|
label: "응답건수",
|
||||||
values: summaryColumns.map((key) => getSummarySampleCount(data, getSummaryDataKey(key), currentWave)),
|
values: summaryColumns.map((key) => getSummarySampleCount(data, getSummaryDataKey(key), latestWave)),
|
||||||
preAppendCells: [
|
preAppendCells: [
|
||||||
{
|
{
|
||||||
content: "",
|
content: "",
|
||||||
@@ -74,38 +73,40 @@ const CustomerSatisfactionSummary = () => {
|
|||||||
],
|
],
|
||||||
labelClassName: "bg-gray-300 text-center font-bold",
|
labelClassName: "bg-gray-300 text-center font-bold",
|
||||||
cellClassName: "bg-gray-300",
|
cellClassName: "bg-gray-300",
|
||||||
labelWidth: 90,
|
|
||||||
decimalPlaces: 0,
|
decimalPlaces: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: GAP_WORDING,
|
label: GAP_WORDING,
|
||||||
values: summaryColumns.map((key) =>
|
values: summaryColumns.map((key) =>
|
||||||
getSummaryGapValue(data, getSummaryDataKey(key), selectedWaves[0], currentWave)
|
getSummaryGapValue(data, getSummaryDataKey(key), selectedWaves[0], latestWave)
|
||||||
),
|
),
|
||||||
preAppendCells: [
|
preAppendCells: [
|
||||||
{
|
{
|
||||||
content: DASHBOARD_METRIC_GROUP_LABEL_MAP.csi,
|
content: DASHBOARD_METRIC_GROUP_LABEL_MAP.csi,
|
||||||
rowSpan: selectedWaves.length + 1,
|
rowSpan: selectedWaves.length + 2,
|
||||||
width: 140,
|
width: 140,
|
||||||
className: "bg-csi text-center align-middle font-bold content-text-base",
|
className: "bg-csi text-center align-middle font-bold content-text-base",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
labelClassName: "bg-csi text-center font-bold",
|
labelClassName: "bg-csi text-center font-bold",
|
||||||
labelWidth: 80,
|
|
||||||
},
|
},
|
||||||
...selectedWaves.map((wave) => ({
|
...selectedWaves.map((wave) => ({
|
||||||
label: getWaveLabel(wave),
|
label: getWaveLabel(wave),
|
||||||
values: summaryColumns.map((key) => getSummaryCsiValue(data, getSummaryDataKey(key), wave)),
|
values: summaryColumns.map((key) => getSummaryCsiValue(data, getSummaryDataKey(key), wave)),
|
||||||
labelClassName: "bg-csi text-center font-bold",
|
labelClassName: "bg-csi text-center font-bold",
|
||||||
labelWidth: 80,
|
|
||||||
})),
|
})),
|
||||||
|
{
|
||||||
|
label: SUMMARY_AVERAGE_GAP_WORDING,
|
||||||
|
values: summaryColumns.map((key) => getAverageGapValue(data, getSummaryDataKey(DIV_KEYS[0]), getSummaryDataKey(key), latestWave)),
|
||||||
|
labelClassName: "bg-csi text-center font-bold",
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const chartData: ChartData = {
|
const chartData: ChartData = {
|
||||||
categories,
|
categories,
|
||||||
series: selectedWaves.map((wave) => ({
|
series: selectedWaves.map((wave) => ({
|
||||||
name: getWaveLabel(wave),
|
name: getWaveLabel(wave),
|
||||||
data: summaryColumns.map((key) => getSummaryCsiValue(data, getSummaryDataKey(key), wave) ?? null),
|
data: summaryColumns.map((key) => getSummaryCsiValue(data, getSummaryDataKey(key), wave) ?? 0),
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -148,7 +149,7 @@ const CustomerSatisfactionSummary = () => {
|
|||||||
barMaxWidth={30}
|
barMaxWidth={30}
|
||||||
showFocusLabel="all"
|
showFocusLabel="all"
|
||||||
labelOptions={{ position: "top", distance: 4 }}
|
labelOptions={{ position: "top", distance: 4 }}
|
||||||
grid={{ left: 0, right: 0, top: 40, bottom: 5 }}
|
grid={{ left: 0, right: 0, top: 20, bottom: 5 }}
|
||||||
xAxis={{
|
xAxis={{
|
||||||
type: "category",
|
type: "category",
|
||||||
data: categories,
|
data: categories,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { useCsiDataQuery } from "@/query/statistics";
|
|||||||
import type { DashboardMetricConfig, DashboardMetricGroup } from "@/types/kfpa";
|
import type { DashboardMetricConfig, DashboardMetricGroup } from "@/types/kfpa";
|
||||||
import VerticalBar from "@/components/chart/VerticalBar";
|
import VerticalBar from "@/components/chart/VerticalBar";
|
||||||
import type { DataColumn } from "@/components/table/types";
|
import type { DataColumn } from "@/components/table/types";
|
||||||
import { GAP_WORDING } from "@/const/kfpa.const";
|
|
||||||
import {
|
import {
|
||||||
CUSTOMER_SATISFACTION_GAP_SIGN_STYLE,
|
CUSTOMER_SATISFACTION_GAP_SIGN_STYLE,
|
||||||
DASHBOARD_METRIC_GROUP_LABEL_MAP,
|
DASHBOARD_METRIC_GROUP_LABEL_MAP,
|
||||||
@@ -17,14 +17,15 @@ import {
|
|||||||
REGION_KEY_MAP,
|
REGION_KEY_MAP,
|
||||||
getDashboardMetricConfigs,
|
getDashboardMetricConfigs,
|
||||||
getDashboardTotalColumnEntries,
|
getDashboardTotalColumnEntries,
|
||||||
getDashboardTotalTableLayout,
|
getDashboardTotalTableLayout, GAP_WORDING, AVERAGE_GAP_WORDING, DIV_KEYS,
|
||||||
} from "@/config/kfpaConfig";
|
} from "@/config/kfpa.config";
|
||||||
import type { DashboardTotalTableLayout } from "@/config/kfpaConfig";
|
import type { DashboardTotalTableLayout } from "@/config/kfpa.config";
|
||||||
import { useLayoutFilter } from "@/components/layout/LayoutCategoryContext";
|
import { useLayoutFilter } from "@/components/layout/LayoutCategoryContext";
|
||||||
import {
|
import {
|
||||||
|
getAverageGapValue,
|
||||||
getCsiDataByWave,
|
getCsiDataByWave,
|
||||||
getCsiMetricGapValue,
|
getCsiMetricGapValue,
|
||||||
getCsiMetricValue,
|
getCsiMetricValue, getSummaryDataKey,
|
||||||
getWaveLabel,
|
getWaveLabel,
|
||||||
} from "@/lib/kfpa-util";
|
} from "@/lib/kfpa-util";
|
||||||
|
|
||||||
@@ -95,7 +96,9 @@ const CustomerSatisfactionTotal = () => {
|
|||||||
[categoryKey]
|
[categoryKey]
|
||||||
);
|
);
|
||||||
|
|
||||||
const { categoryColumns, categories, rows, verticalChartData } = useMemo(() => {
|
const addAverageGapRow = useMemo(() => categoryKey === "2601009_A", [categoryKey]);
|
||||||
|
|
||||||
|
const { categoryColumns, categories, rows, chartData } = useMemo(() => {
|
||||||
const waves = Array.from(
|
const waves = Array.from(
|
||||||
new Set(
|
new Set(
|
||||||
Object.values(data ?? {})
|
Object.values(data ?? {})
|
||||||
@@ -116,7 +119,7 @@ const CustomerSatisfactionTotal = () => {
|
|||||||
const categories = divisionColumns.map((div) => div.label);
|
const categories = divisionColumns.map((div) => div.label);
|
||||||
|
|
||||||
const rows: TopChartTableRow[] =
|
const rows: TopChartTableRow[] =
|
||||||
selectedWaves.length === 0
|
selectedWaves.length === 0 || latestWave == undefined
|
||||||
? []
|
? []
|
||||||
: metrics.flatMap((metric, metricIndex) =>
|
: metrics.flatMap((metric, metricIndex) =>
|
||||||
[
|
[
|
||||||
@@ -130,6 +133,13 @@ const CustomerSatisfactionTotal = () => {
|
|||||||
label: getWaveLabel(wave),
|
label: getWaveLabel(wave),
|
||||||
values: divisionColumns.map((div) => getCsiMetricValue(data, div.key, wave, metric.key)),
|
values: divisionColumns.map((div) => getCsiMetricValue(data, div.key, wave, metric.key)),
|
||||||
})),
|
})),
|
||||||
|
...(addAverageGapRow && metric.group === "csi"
|
||||||
|
? [{
|
||||||
|
label: AVERAGE_GAP_WORDING,
|
||||||
|
values: divisionColumns.map((div) => getAverageGapValue(data, DIV_KEYS[0], div.key, latestWave)),
|
||||||
|
}]
|
||||||
|
: []
|
||||||
|
),
|
||||||
].map((row, rowIndex) => ({
|
].map((row, rowIndex) => ({
|
||||||
...row,
|
...row,
|
||||||
preAppendCells: getPreAppendCells(
|
preAppendCells: getPreAppendCells(
|
||||||
@@ -137,7 +147,7 @@ const CustomerSatisfactionTotal = () => {
|
|||||||
metric,
|
metric,
|
||||||
metricIndex,
|
metricIndex,
|
||||||
rowIndex,
|
rowIndex,
|
||||||
selectedWaves.length + 1,
|
selectedWaves.length + (addAverageGapRow && metric.group === "csi"? 2 : 1),
|
||||||
tableLayout
|
tableLayout
|
||||||
),
|
),
|
||||||
labelClassName: cn(`bg-${metric.group}`, "text-center", row.label !== GAP_WORDING && "font-bold"),
|
labelClassName: cn(`bg-${metric.group}`, "text-center", row.label !== GAP_WORDING && "font-bold"),
|
||||||
@@ -145,7 +155,7 @@ const CustomerSatisfactionTotal = () => {
|
|||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
|
|
||||||
const verticalChartData: ChartData = {
|
const chartData: ChartData = {
|
||||||
categories,
|
categories,
|
||||||
series: selectedWaves.map((wave) => ({
|
series: selectedWaves.map((wave) => ({
|
||||||
name: getWaveLabel(wave),
|
name: getWaveLabel(wave),
|
||||||
@@ -157,7 +167,7 @@ const CustomerSatisfactionTotal = () => {
|
|||||||
categoryColumns,
|
categoryColumns,
|
||||||
categories,
|
categories,
|
||||||
rows,
|
rows,
|
||||||
verticalChartData,
|
chartData,
|
||||||
};
|
};
|
||||||
}, [data, divisionColumns, metrics, tableLayout]);
|
}, [data, divisionColumns, metrics, tableLayout]);
|
||||||
|
|
||||||
@@ -197,7 +207,7 @@ const CustomerSatisfactionTotal = () => {
|
|||||||
rows={rows}
|
rows={rows}
|
||||||
sectionRows={[
|
sectionRows={[
|
||||||
{
|
{
|
||||||
afterRowIndex: 2,
|
afterRowIndex: addAverageGapRow? 3 : 2,
|
||||||
content: "고객만족지수 세부 항목",
|
content: "고객만족지수 세부 항목",
|
||||||
className: "bg-gray-400 text-center font-bold",
|
className: "bg-gray-400 text-center font-bold",
|
||||||
bodyClassName: "bg-gray-400 text-center",
|
bodyClassName: "bg-gray-400 text-center",
|
||||||
@@ -209,14 +219,14 @@ const CustomerSatisfactionTotal = () => {
|
|||||||
chartHeight={200}
|
chartHeight={200}
|
||||||
chart={
|
chart={
|
||||||
<VerticalBar
|
<VerticalBar
|
||||||
data={verticalChartData}
|
data={chartData}
|
||||||
height="100%"
|
height="100%"
|
||||||
paletteVarNames={["--chart-5", "--chart-7"]}
|
paletteVarNames={["--chart-5", "--chart-7"]}
|
||||||
valueFormatter={(value) => value.toFixed(2)}
|
valueFormatter={(value) => value.toFixed(2)}
|
||||||
barMaxWidth={30}
|
barMaxWidth={30}
|
||||||
showFocusLabel="all"
|
showFocusLabel="all"
|
||||||
labelOptions={{ position: "top", distance: 4 }}
|
labelOptions={{ position: "top", distance: 4 }}
|
||||||
grid={{ left: 0, right: 0, top: 40, bottom: 5 }}
|
grid={{ left: 0, right: 0, top: 20, bottom: 5 }}
|
||||||
xAxis={{
|
xAxis={{
|
||||||
type: "category",
|
type: "category",
|
||||||
data: categories,
|
data: categories,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Image from "next/image";
|
|||||||
import {Button} from "@/components/ui/button";
|
import {Button} from "@/components/ui/button";
|
||||||
import {LogIn, LogOut} from "lucide-react";
|
import {LogIn, LogOut} from "lucide-react";
|
||||||
import {cn} from "@/lib/utils";
|
import {cn} from "@/lib/utils";
|
||||||
import {SITE_TITLE} from "@/config/kfpaConfig";
|
import {SITE_TITLE} from "@/config/kfpa.config";
|
||||||
import {TopMenuItem} from "@/config/menu.type";
|
import {TopMenuItem} from "@/config/menu.type";
|
||||||
import {usePathname} from "next/navigation";
|
import {usePathname} from "next/navigation";
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,25 @@
|
|||||||
import type { TopChartTableRow } from "@/components/combo/types";
|
import type { TopChartTableRow } from "@/components/combo/types";
|
||||||
import type { SignStyle } from "@/components/table/types";
|
import type { SignStyle } from "@/components/table/types";
|
||||||
import { GAP_WORDING } from "@/const/kfpa.const";
|
|
||||||
|
|
||||||
export const SITE_TITLE = "고객 관계 성과측정 실시간 대시보드";
|
export const SITE_TITLE = "고객 관계 성과측정 실시간 대시보드";
|
||||||
|
|
||||||
export const CUSTOMER_SATISFACTION_DECIMAL_PLACES = 2;
|
|
||||||
|
|
||||||
export const RANK_TABLE_TITLE = "물건 유형별 고객만족지수";
|
export const RANK_TABLE_TITLE = "물건 유형별 고객만족지수";
|
||||||
|
|
||||||
export const COMMENT_TABLE_TITLE = "고객 관점의 성과분류";
|
export const COMMENT_TABLE_TITLE = "고객 관점 성과 분류";
|
||||||
|
|
||||||
|
export const CUSTOMER_SATISFACTION_DECIMAL_PLACES = 2;
|
||||||
|
|
||||||
|
export const VIEW_DECIMAL_POINT = 0;
|
||||||
|
|
||||||
|
export const GAP_WORDING = "전년 대비";
|
||||||
|
|
||||||
|
export const SUMMARY_AVERAGE_GAP_WORDING = "지역본부 평균 대비";
|
||||||
|
|
||||||
|
export const AVERAGE_GAP_WORDING = "평균 대비";
|
||||||
|
|
||||||
export const CUSTOMER_SATISFACTION_GAP_SIGN_STYLE: SignStyle<TopChartTableRow> = {
|
export const CUSTOMER_SATISFACTION_GAP_SIGN_STYLE: SignStyle<TopChartTableRow> = {
|
||||||
rowSelector: (row) => row.label === GAP_WORDING,
|
rowSelector: (row) =>
|
||||||
|
[GAP_WORDING, AVERAGE_GAP_WORDING, SUMMARY_AVERAGE_GAP_WORDING].includes(row.label),
|
||||||
display: "arrow",
|
display: "arrow",
|
||||||
arrowWithNumber: true,
|
arrowWithNumber: true,
|
||||||
paint: "text",
|
paint: "text",
|
||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
CATEGORY_PATH_MAP,
|
CATEGORY_PATH_MAP,
|
||||||
SIDE_MENU_KEY_MAP_BY_CATEGORY,
|
SIDE_MENU_KEY_MAP_BY_CATEGORY,
|
||||||
SIDE_MENU_KEYS_BY_CATEGORY
|
SIDE_MENU_KEYS_BY_CATEGORY
|
||||||
} from "./kfpaConfig";
|
} from "./kfpa.config";
|
||||||
import { Building } from 'lucide-react';
|
import { Building } from 'lucide-react';
|
||||||
|
|
||||||
export const TOP_MENUS: TopMenuItem[] = Object.entries(CATEGORY_KEY_MAP).map(
|
export const TOP_MENUS: TopMenuItem[] = Object.entries(CATEGORY_KEY_MAP).map(
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
export const VIEW_DECIMAL_POINT = 0;
|
|
||||||
export const GAP_WORDING = "전년 대비";
|
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
DASHBOARD_COMMENT_COLUMNS,
|
DASHBOARD_COMMENT_COLUMNS,
|
||||||
DIV_KEY_MAP,
|
DIV_KEY_MAP,
|
||||||
REGION_KEY_MAP,
|
REGION_KEY_MAP,
|
||||||
} from "@/config/kfpaConfig";
|
} from "@/config/kfpa.config";
|
||||||
import type {
|
import type {
|
||||||
CommentColumn,
|
CommentColumn,
|
||||||
CommentValue,
|
CommentValue,
|
||||||
@@ -72,6 +72,21 @@ export const getSummaryGapValue = (
|
|||||||
return currentValue - previousValue;
|
return currentValue - previousValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getAverageGapValue = (
|
||||||
|
dataMap: CsiSummaryMap | undefined,
|
||||||
|
averageKey: string,
|
||||||
|
key: string,
|
||||||
|
wave: number,
|
||||||
|
) => {
|
||||||
|
if(averageKey === key) return null;
|
||||||
|
|
||||||
|
const averageValue = getSummaryCsiValue(dataMap, averageKey, wave);
|
||||||
|
const currentValue = getSummaryCsiValue(dataMap, key, wave);
|
||||||
|
|
||||||
|
if (averageValue == null || currentValue == null) return null;
|
||||||
|
return currentValue - averageValue;
|
||||||
|
};
|
||||||
|
|
||||||
export const getSelectedDetail = (data: Record<string, DivDetailData> | undefined, selectedDiv: string) => {
|
export const getSelectedDetail = (data: Record<string, DivDetailData> | undefined, selectedDiv: string) => {
|
||||||
if (!data) return undefined;
|
if (!data) return undefined;
|
||||||
return data[selectedDiv] ?? Object.values(data)[0];
|
return data[selectedDiv] ?? Object.values(data)[0];
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { clsx, type ClassValue } from "clsx"
|
import { clsx, type ClassValue } from "clsx"
|
||||||
import { twMerge } from "tailwind-merge"
|
import { twMerge } from "tailwind-merge"
|
||||||
import {VIEW_DECIMAL_POINT} from "@/const/kfpa.const";
|
import {VIEW_DECIMAL_POINT} from "@/config/kfpa.config";
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs))
|
return twMerge(clsx(inputs))
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import type {
|
|||||||
CATEGORY_KEY_MAP,
|
CATEGORY_KEY_MAP,
|
||||||
DASHBOARD_COMMENT_ROWS_BY_CATEGORY,
|
DASHBOARD_COMMENT_ROWS_BY_CATEGORY,
|
||||||
DASHBOARD_METRICS_BY_CATEGORY,
|
DASHBOARD_METRICS_BY_CATEGORY,
|
||||||
} from "@/config/kfpaConfig";
|
} from "@/config/kfpa.config";
|
||||||
|
|
||||||
export type CategoryKey = keyof typeof CATEGORY_KEY_MAP;
|
export type CategoryKey = keyof typeof CATEGORY_KEY_MAP;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user