From acf215c1bf4aaf7bb86461fe34b1ed2d26d1f62e Mon Sep 17 00:00:00 2001 From: jcchoi Date: Tue, 20 Oct 2026 10:45:29 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8C=80=EC=8B=9C=EB=B3=B4=EB=93=9C=20?= =?UTF-8?q?=EC=9D=B4=EC=83=81=EC=B9=98=EC=84=A0=EB=B3=84=EB=B3=B4=EA=B3=A0?= =?UTF-8?q?=EC=84=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/dashboard/dashboard-interface.ts | 200 ++++++------- .../ui/panels/vrfc-report-panel.tsx | 266 +++++++++--------- 2 files changed, 233 insertions(+), 233 deletions(-) diff --git a/apps/st/src/entities/statistics/model/dashboard/dashboard-interface.ts b/apps/st/src/entities/statistics/model/dashboard/dashboard-interface.ts index 19a1be4d5..c2df2922e 100644 --- a/apps/st/src/entities/statistics/model/dashboard/dashboard-interface.ts +++ b/apps/st/src/entities/statistics/model/dashboard/dashboard-interface.ts @@ -1,100 +1,100 @@ -export interface DashboardSearchParams { - statsYr: string; - dtlInstCd: string; - enoCd?: string; - laeSeCd?: string; - sewerBzmnCd?: string; - sido?: string; - sggNm?: string; - unSubmitOnly?: boolean; -} - -export interface DashboardApiResponse { - status: string; - message: string; - data: T; - code: string; - httpStatus: number; -} - -export interface VrfcReportResponse { - typeCounts: Record; - list: VrfcReportSelect[]; -} - -export interface VrfcReportSelect { - vrfcCd: string; - statsNm: string; - rsnExpln: string; - admdstNm: string; - nowVlCn: string; - compVlCn: string; -} - -export interface VrfcErrCountResponse { - statsYr: string; - vrfcErrCount: number; -} - -export interface UnSubmitCountResponse { - statsYr: string; - statusList: UnSubmitStatsResponse[]; - submittedCount: number; - totalCount: number; - unSubmittedCount: number; -} - -export interface UnSubmitStatsResponse { - sbmsnYn: string; - sidoSggNm: string; - statsCd: string; - statsNm: string; - statusCd: string; - statusNm: string; -} - -export interface StatsSubmissionResponse { - totalCount: number; - submittedCount: number; - submissionRate: number; - statusLevel: string; -} - -export interface EcptReqCountResponse { - statsYr: string; - ecptReqCount: number; -} - -export interface ThreeStageStatusResponse { - statsYr: string; - lclgvSbmsnSttsCd: string; - lclgvSbmsnSttsNm: string; - lclgvRejected: boolean; - mctpvPicSbmsnSttsCd: string; - mctpvPicSbmsnSttsNm: string; - mctpvRejected: boolean; - pbcpSbmsnSttsCd: string; - pbcpSbmsnSttsNm: string; - pbcpRejected: boolean; -} - -export interface DashboardService { - getVrfcReport( - params: DashboardSearchParams, - ): Promise>; - getVrfcErrCount( - params: DashboardSearchParams, - ): Promise>; - getUnSubmitCount( - params: DashboardSearchParams, - ): Promise>; - getStatsSubmissionRate( - params: DashboardSearchParams, - ): Promise>; - getEcptReqCount( - params: DashboardSearchParams, - ): Promise>; - getThreeStageStatus( - params: DashboardSearchParams, - ): Promise>; -} +export interface DashboardSearchParams { + statsYr: string; + dtlInstCd: string; + enoCd?: string; + laeSeCd?: string; + sewerBzmnCd?: string; + sido?: string; + sggNm?: string; + unSubmitOnly?: boolean; +} + +export interface DashboardApiResponse { + status: string; + message: string; + data: T; + code: string; + httpStatus: number; +} + +export interface VrfcReportResponse { + typeCounts: Record; + list: VrfcReportSelect[]; +} + +export interface VrfcReportSelect { + vrfcCd: string; + statsNm: string; + rsnExpln: string; + admdstNm: string; + nowCN: string; + cmprCn: string | null; +} + +export interface VrfcErrCountResponse { + statsYr: string; + vrfcErrCount: number; +} + +export interface UnSubmitCountResponse { + statsYr: string; + statusList: UnSubmitStatsResponse[]; + submittedCount: number; + totalCount: number; + unSubmittedCount: number; +} + +export interface UnSubmitStatsResponse { + sbmsnYn: string; + sidoSggNm: string; + statsCd: string; + statsNm: string; + statusCd: string; + statusNm: string; +} + +export interface StatsSubmissionResponse { + totalCount: number; + submittedCount: number; + submissionRate: number; + statusLevel: string; +} + +export interface EcptReqCountResponse { + statsYr: string; + ecptReqCount: number; +} + +export interface ThreeStageStatusResponse { + statsYr: string; + lclgvSbmsnSttsCd: string; + lclgvSbmsnSttsNm: string; + lclgvRejected: boolean; + mctpvPicSbmsnSttsCd: string; + mctpvPicSbmsnSttsNm: string; + mctpvRejected: boolean; + pbcpSbmsnSttsCd: string; + pbcpSbmsnSttsNm: string; + pbcpRejected: boolean; +} + +export interface DashboardService { + getVrfcReport( + params: DashboardSearchParams, + ): Promise>; + getVrfcErrCount( + params: DashboardSearchParams, + ): Promise>; + getUnSubmitCount( + params: DashboardSearchParams, + ): Promise>; + getStatsSubmissionRate( + params: DashboardSearchParams, + ): Promise>; + getEcptReqCount( + params: DashboardSearchParams, + ): Promise>; + getThreeStageStatus( + params: DashboardSearchParams, + ): Promise>; +} diff --git a/apps/st/src/pages/statistics/ui/panels/vrfc-report-panel.tsx b/apps/st/src/pages/statistics/ui/panels/vrfc-report-panel.tsx index 1463cc035..7fdb26b74 100644 --- a/apps/st/src/pages/statistics/ui/panels/vrfc-report-panel.tsx +++ b/apps/st/src/pages/statistics/ui/panels/vrfc-report-panel.tsx @@ -1,133 +1,133 @@ -"use client"; - -import { useDashboardVrfcReport } from "@/entities/statistics"; -import type { DashboardSearchParams } from "@/entities/statistics/model/dashboard/dashboard-interface"; -import { - Badge, - type BadgeProps, - LoadingWithAnimation, -} from "@common/components"; - -import { useDragHandle } from "../sortable-panel"; - -interface VrfcReportPanelProps { - params: DashboardSearchParams | null; -} - -const TYPE_CODE_NAME_MAP: Record = { - NV: "일반", - IMR: "I-MR", - HB: "HB", -}; - -const TYPE_CODE_COLOR_MAP: Record = { - NV: "gray", - IMR: "red", - HB: "blue", -}; - -export function VrfcReportPanel({ params }: VrfcReportPanelProps) { - const { dragHandleProps, isDragging } = useDragHandle(); - const { data, isLoading, error } = useDashboardVrfcReport(params); - - return ( -
-
-

이상치 선별보고서

-
-
- {isLoading && ( -
-
- -
-
- )} - {error && ( -
- 데이터를 불러올 수 없습니다. -
- )} - {data && ( -
- {/* TBD: typeCounts 표시 방법 (탭? 필터?) */} - {data.typeCounts && - Object.keys(data.typeCounts).length > 0 && ( -
- {Object.entries(data.typeCounts).map( - ([type, count]) => ( - - {TYPE_CODE_NAME_MAP[type]}:{" "} - {count} - - ), - )} -
- )} - - {/* TBD: 테이블 컬럼 정의, 증감 표시 방법 */} -
- {data.list.length === 0 ? ( -
- 이상치 항목이 없습니다. -
- ) : ( -
- {data.list.map((item, index) => ( -
-
- - {item.statsNm} - - - { - TYPE_CODE_NAME_MAP[ - item.vrfcCd - ] - } - -
-

- {item.rsnExpln} -

-
- {item.admdstNm} - - {/* TBD: 증감 표시 방법 (nowVlCn - compVlCn 계산?) */} - 현재: {item.nowVlCn ?? "-"}{" "} - / 비교:{" "} - {item.compVlCn ?? "-"} - -
- {/* TBD: 등급/점수/단계/업데이트 시각 필드 미제공 */} -
- ))} -
- )} -
-
- )} -
-
- ); -} +"use client"; + +import { useDashboardVrfcReport } from "@/entities/statistics"; +import type { DashboardSearchParams } from "@/entities/statistics/model/dashboard/dashboard-interface"; +import { + Badge, + type BadgeProps, + LoadingWithAnimation, +} from "@common/components"; + +import { useDragHandle } from "../sortable-panel"; + +interface VrfcReportPanelProps { + params: DashboardSearchParams | null; +} + +const TYPE_CODE_NAME_MAP: Record = { + NV: "일반", + IMR: "I-MR", + HB: "HB", +}; + +const TYPE_CODE_COLOR_MAP: Record = { + NV: "gray", + IMR: "red", + HB: "blue", +}; + +export function VrfcReportPanel({ params }: VrfcReportPanelProps) { + const { dragHandleProps, isDragging } = useDragHandle(); + const { data, isLoading, error } = useDashboardVrfcReport(params); + + return ( +
+
+

이상치 선별보고서

+
+
+ {isLoading && ( +
+
+ +
+
+ )} + {error && ( +
+ 데이터를 불러올 수 없습니다. +
+ )} + {data && ( +
+ {/* TBD: typeCounts 표시 방법 (탭? 필터?) */} + {data.typeCounts && + Object.keys(data.typeCounts).length > 0 && ( +
+ {Object.entries(data.typeCounts).map( + ([type, count]) => ( + + {TYPE_CODE_NAME_MAP[type]}:{" "} + {count} + + ), + )} +
+ )} + + {/* TBD: 테이블 컬럼 정의, 증감 표시 방법 */} +
+ {data.list.length === 0 ? ( +
+ 이상치 항목이 없습니다. +
+ ) : ( +
+ {data.list.map((item, index) => ( +
+
+ + {item.statsNm} + + + { + TYPE_CODE_NAME_MAP[ + item.vrfcCd + ] + } + +
+

+ {item.rsnExpln} +

+
+ {item.admdstNm} + + {/* TBD: 증감 표시 방법 (nowCN - cmprCn 계산?) */} + 현재: {item.nowCN ?? "-"}{" "} + / 비교:{" "} + {item.cmprCn ?? "-"} + +
+ {/* TBD: 등급/점수/단계/업데이트 시각 필드 미제공 */} +
+ ))} +
+ )} +
+
+ )} +
+
+ ); +}