From c87557947fbd3c5919048d1c0b30fe3553dbded0 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Tue, 23 Jun 2026 16:19:38 +0900 Subject: [PATCH] =?UTF-8?q?260623=5F07=5FENH:=20=ED=95=84=ED=84=B0=20?= =?UTF-8?q?=EC=98=B5=EC=85=98=EC=97=90=20=EB=B6=88=ED=95=84=EC=9A=94=20?= =?UTF-8?q?=EB=82=B4=EC=9A=A9=20=EC=A0=9C=EA=B1=B0,=20=EB=AA=A8=EB=8B=88?= =?UTF-8?q?=ED=84=B0=EB=A7=81=EC=97=90=EC=84=9C=20=EB=A6=AC=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=ED=81=B4=EB=A6=AD=EC=8B=9C=20select=20box=EC=97=90?= =?UTF-8?q?=20=EC=84=A0=ED=83=9D=20=EB=82=B4=EC=9A=A9=20=EC=A0=81=EC=9A=A9?= =?UTF-8?q?=20=EC=A0=9C=EA=B1=B0,=20=EB=AA=A8=EB=8B=88=ED=84=B0=EB=A7=81?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EB=8F=84=EC=B0=A9=EC=9D=B4=20=EC=95=84?= =?UTF-8?q?=EB=8B=8C=20=EA=B2=BD=EC=9A=B0=20=EC=97=85=EB=A1=9C=EB=93=9C=20?= =?UTF-8?q?=EB=AA=BB=ED=95=98=EA=B2=8C=20=EC=A1=B0=EC=B9=98,=20=EC=A7=80?= =?UTF-8?q?=EC=9E=90=EC=B2=B4=20=ED=8C=8C=EC=9D=BC=20=EC=97=85=EB=A1=9C?= =?UTF-8?q?=EB=93=9C=20=ED=95=AD=EC=8B=9C=20=EA=B0=80=EB=8A=A5=ED=95=98?= =?UTF-8?q?=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(pages)/(main)/monitoring/page.tsx | 13 +++++++--- src/components/common/LoadingOverlay.tsx | 2 +- .../MonitoringPerformanceDetailDialog.tsx | 5 +++- .../dialog/PerformanceDetailDialog.tsx | 25 ++++++++++++++++--- src/components/ui/multi-select.tsx | 6 +---- 5 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/app/(pages)/(main)/monitoring/page.tsx b/src/app/(pages)/(main)/monitoring/page.tsx index a81a7e1..4f00699 100644 --- a/src/app/(pages)/(main)/monitoring/page.tsx +++ b/src/app/(pages)/(main)/monitoring/page.tsx @@ -75,6 +75,7 @@ const MonitoringPage = () => { const userId = auth.user?.userId; const [selectedId, setSelectedId] = useState(null); + const [detailId, setDetailId] = useState(null); const [visitMode, setVisitMode] = useState<"departure" | "arrival">("departure"); const refreshMonitoringList = () => { @@ -96,6 +97,11 @@ const MonitoringPage = () => { return sortedItems.find((item) => item.id === selectedId) ?? sortedItems[0] ?? null; }, [selectedId, sortedItems]); + const detailSelected = useMemo(() => { + if (!detailId) return null; + return sortedItems.find((item) => item.id === detailId) ?? null; + }, [detailId, sortedItems]); + const selectedMonitoringRow = useMemo(() => { if (!selected || !userId) return undefined; return ([0, 1] as const) @@ -129,7 +135,7 @@ const MonitoringPage = () => { const visitOpen = isDialogOpen("monitoringVisitDialog"); const detailOpen = isDialogOpen("monitoringDetailDialog"); - const {data: detailData} = usePerformanceDetailQuery(selected?.id ?? 0, Boolean(selected?.id && detailOpen)); + const {data: detailData} = usePerformanceDetailQuery(detailId ?? 0, Boolean(detailId && detailOpen)); const openVisit = (mode: "departure" | "arrival") => { setVisitMode(mode); @@ -264,7 +270,7 @@ const MonitoringPage = () => { getRowId={(row) => String(row.id)} selectMode="click-event" onRowClick={(item) => { - setSelectedId(item.id); + setDetailId(item.id); showDialog("monitoringDetailDialog"); }} highlightRowIds={selected ? [String(selected.id)] : []} @@ -301,9 +307,10 @@ const MonitoringPage = () => { } hideDialog("monitoringDetailDialog"); + setDetailId(null); refreshMonitoringList(); }} - performance={detailData ?? selected} + performance={detailData ?? detailSelected} codes={codes} userId={userId} /> diff --git a/src/components/common/LoadingOverlay.tsx b/src/components/common/LoadingOverlay.tsx index c62ba0f..dd2e141 100644 --- a/src/components/common/LoadingOverlay.tsx +++ b/src/components/common/LoadingOverlay.tsx @@ -11,7 +11,7 @@ export function LoadingOverlay({ force = false }: { force?: boolean }) { return (
{/* 심플 로딩 인디케이터 */} -
+
); } \ No newline at end of file diff --git a/src/components/dialog/MonitoringPerformanceDetailDialog.tsx b/src/components/dialog/MonitoringPerformanceDetailDialog.tsx index ccee065..f2564b8 100644 --- a/src/components/dialog/MonitoringPerformanceDetailDialog.tsx +++ b/src/components/dialog/MonitoringPerformanceDetailDialog.tsx @@ -64,12 +64,14 @@ function ActionButton({ } function MonitoringReviewActions({ + canUpload, performanceId, reviewType, userId, uploadFileName, pdfFileName, }: Readonly<{ + canUpload: boolean; performanceId: number; reviewType: number; userId?: string; @@ -112,7 +114,7 @@ function MonitoringReviewActions({ return (
void upload(event.target.files?.[0])} /> - fileInputRef.current?.click()}>파일 업로드 + fileInputRef.current?.click()}>파일 업로드 원본 PDF 미리보기 @@ -230,6 +232,7 @@ export function MonitoringPerformanceDetailDialog({
{row ? ( ) { const fileInputRef = useRef(null); @@ -127,7 +129,6 @@ function ReviewFileActions({ const originalMutation = useDownloadReviewOriginalMutation(); const pdfMutation = useDownloadReviewPdfMutation(); const {withLoadingAsync} = useLoading(); - const complete = Boolean(pdfFileName); const upload = async (file?: File) => { try { @@ -168,7 +169,7 @@ function ReviewFileActions({ {canEdit && ( <> void upload(event.target.files?.[0])} /> - fileInputRef.current?.click()}>파일 업로드 + fileInputRef.current?.click()}>파일 업로드 )} 원본 @@ -232,7 +233,15 @@ function LocalGovernmentReviewRow({
지자체
{display.label} - +
); @@ -267,7 +276,15 @@ function MonitoringStatusRow({
{display.label} - +
{row.slot.visit?.length ? ( <> diff --git a/src/components/ui/multi-select.tsx b/src/components/ui/multi-select.tsx index ef3d8f4..229e97c 100644 --- a/src/components/ui/multi-select.tsx +++ b/src/components/ui/multi-select.tsx @@ -1385,11 +1385,7 @@ function MultiSelectInner(
} - (전체 선택 - {getAllOptions().length > 20 - ? ` - ${getAllOptions().length} options` - : ""} - ) + (전체 선택)