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` - : ""} - ) + (전체 선택)