|
|
|
|
@@ -4,12 +4,13 @@ import { type ReactNode, useMemo } from "react";
|
|
|
|
|
import type { ChartData } from "@/components/chart/types";
|
|
|
|
|
import TopChartTable from "@/components/combo/TopChartTable";
|
|
|
|
|
import type { TopChartTableRow } from "@/components/combo/types";
|
|
|
|
|
import { formatKoreanBaseDate } from "@/lib/utils";
|
|
|
|
|
import {cn, formatKoreanBaseDate} from "@/lib/utils";
|
|
|
|
|
import { useCsiDataQuery } from "@/query/statistics";
|
|
|
|
|
import type { CsiData, CsiDataMap } from "@/types/kfpa";
|
|
|
|
|
import VerticalBar from "@/components/chart/VerticalBar";
|
|
|
|
|
import {SignStyle} from "@/components/table/types";
|
|
|
|
|
import {GAP_WORDING} from "@/const/kfpa.const";
|
|
|
|
|
import {DIV_KEYS, REGION_KEY_MAP} from "@/config/kfpaConfig";
|
|
|
|
|
|
|
|
|
|
export const signStyleGapRow: SignStyle<TopChartTableRow> = {
|
|
|
|
|
rowSelector: (row) => row.label === GAP_WORDING,
|
|
|
|
|
@@ -18,15 +19,10 @@ export const signStyleGapRow: SignStyle<TopChartTableRow> = {
|
|
|
|
|
paint: "text",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const DIV_COLUMNS = [
|
|
|
|
|
{ key: "-1", label: "전체" },
|
|
|
|
|
{ key: "1", label: "서울" },
|
|
|
|
|
{ key: "2", label: "경기" },
|
|
|
|
|
{ key: "3", label: "부산" },
|
|
|
|
|
{ key: "4", label: "대구" },
|
|
|
|
|
{ key: "5", label: "대전" },
|
|
|
|
|
{ key: "6", label: "광주" },
|
|
|
|
|
] as const;
|
|
|
|
|
const DIV_COLUMNS = DIV_KEYS.map((key) => ({
|
|
|
|
|
key,
|
|
|
|
|
label: key === "-1" ? "전체" : REGION_KEY_MAP[key],
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
const METRICS: Array<{
|
|
|
|
|
key: keyof Omit<CsiData, "wave">;
|
|
|
|
|
@@ -180,12 +176,12 @@ const SafetyInspectionTotal = () => {
|
|
|
|
|
preAppendCells: getPreAppendCells(metric, metricIndex, rowIndex, selectedWaves.length + 1),
|
|
|
|
|
labelClassName:
|
|
|
|
|
metric.key === "csi"
|
|
|
|
|
? "bg-red-100 text-center font-bold"
|
|
|
|
|
: metric.group === "indirect"
|
|
|
|
|
? "bg-green-200 text-center font-bold"
|
|
|
|
|
: metric.group === "direct"
|
|
|
|
|
? "bg-red-50 text-center font-bold"
|
|
|
|
|
: "text-center font-bold",
|
|
|
|
|
? cn("bg-red-100 text-center", row.label !== GAP_WORDING && "font-bold")
|
|
|
|
|
: metric.group === "indirect"
|
|
|
|
|
? cn("bg-green-200 text-center", row.label !== GAP_WORDING && "font-bold")
|
|
|
|
|
: metric.group === "direct"
|
|
|
|
|
? cn("bg-red-50 text-center", row.label !== GAP_WORDING && "font-bold")
|
|
|
|
|
: cn("text-center", row.label !== GAP_WORDING && "font-bold"),
|
|
|
|
|
labelWidth: 90,
|
|
|
|
|
}))
|
|
|
|
|
);
|
|
|
|
|
@@ -224,6 +220,7 @@ const SafetyInspectionTotal = () => {
|
|
|
|
|
categories={categories}
|
|
|
|
|
rows={rows}
|
|
|
|
|
subLabelHeader={baseDateLabel}
|
|
|
|
|
signStyle={signStyleGapRow}
|
|
|
|
|
minWidth={1120}
|
|
|
|
|
chartHeight={260}
|
|
|
|
|
chart={
|
|
|
|
|
|