feat(sn): CS 기준 UI 통일 및 지도 팝업 표준화
This commit is contained in:
@@ -4,13 +4,13 @@ export const windowPopupDefinitions = {
|
||||
cfmtnBgt: {
|
||||
key: "cfmtnBgt",
|
||||
title: "최종확정예산사업",
|
||||
width: 1500,
|
||||
height: 900,
|
||||
width: 1400,
|
||||
height: 720,
|
||||
requiredParams: ["bizSe"],
|
||||
},
|
||||
exmnBusinessRegister: {
|
||||
key: "exmnBusinessRegister",
|
||||
title: "사업정보 등록",
|
||||
title: "조사사업 등록",
|
||||
width: 1000,
|
||||
height: 620,
|
||||
},
|
||||
@@ -34,13 +34,6 @@ export const windowPopupDefinitions = {
|
||||
width: 1280,
|
||||
height: 900,
|
||||
},
|
||||
dredgingDetail: {
|
||||
key: "dredgingDetail",
|
||||
title: "준설결과 상세",
|
||||
width: 1280,
|
||||
height: 900,
|
||||
requiredParams: ["dredgingJobSn", "pipeFid", "longitude", "latitude"],
|
||||
},
|
||||
dredgingEdit: {
|
||||
key: "dredgingEdit",
|
||||
title: "준설결과 수정",
|
||||
@@ -70,13 +63,13 @@ export const windowPopupDefinitions = {
|
||||
},
|
||||
floodPreUpload: {
|
||||
key: "floodPreUpload",
|
||||
title: "도시침수 예방사업 등록",
|
||||
title: "도시침수예방사업 등록",
|
||||
width: 860,
|
||||
height: 360,
|
||||
},
|
||||
floodPreTable: {
|
||||
key: "floodPreTable",
|
||||
title: "도시침수 예방사업 상세",
|
||||
title: "도시침수예방사업 상세",
|
||||
width: 1400,
|
||||
height: 900,
|
||||
requiredParams: ["fileNm", "atflId"],
|
||||
@@ -96,21 +89,22 @@ export const windowPopupDefinitions = {
|
||||
},
|
||||
mapSearch: {
|
||||
key: "mapSearch",
|
||||
title: "관망도 검색",
|
||||
title: "정보검색",
|
||||
width: 1280,
|
||||
height: 980,
|
||||
maximize: true,
|
||||
},
|
||||
inftwtResultPopup: {
|
||||
key: "inftwtResultPopup",
|
||||
title: "침입수 분석결과",
|
||||
width: 1280,
|
||||
height: 900,
|
||||
height: 830,
|
||||
},
|
||||
rdiiResultPopup: {
|
||||
key: "rdiiResultPopup",
|
||||
title: "RDII 분석결과",
|
||||
width: 1280,
|
||||
height: 900,
|
||||
width: 1400,
|
||||
height: 830,
|
||||
},
|
||||
infilChart: {
|
||||
key: "infilChart",
|
||||
@@ -143,7 +137,7 @@ export const windowPopupDefinitions = {
|
||||
},
|
||||
agedPipePopup: {
|
||||
key: "agedPipePopup",
|
||||
title: "노후 하수관로 관리 ",
|
||||
title: "노후 하수관로 목록",
|
||||
width: 850,
|
||||
height: 600,
|
||||
placement: "browser-left",
|
||||
@@ -173,13 +167,13 @@ export const windowPopupDefinitions = {
|
||||
key: "pipeAnalysisPopup",
|
||||
title: "관로분석",
|
||||
width: 1180,
|
||||
height: 820,
|
||||
height: 950,
|
||||
},
|
||||
pipeAnalysisDetailPopup: {
|
||||
key: "pipeAnalysisDetailPopup",
|
||||
title: "관로현황",
|
||||
width: 1180,
|
||||
height: 760,
|
||||
height: 820,
|
||||
},
|
||||
repairHistoryPopup: {
|
||||
key: "repairHistoryPopup",
|
||||
@@ -198,7 +192,7 @@ export const windowPopupDefinitions = {
|
||||
key: "agedPipeStatusByCtpvPopup",
|
||||
title: "시도별 노후관로현황",
|
||||
width: 1160,
|
||||
height: 760,
|
||||
height: 790,
|
||||
},
|
||||
fldngHstryPopup: {
|
||||
key: "fldngHstryPopup",
|
||||
|
||||
@@ -1,42 +1,128 @@
|
||||
"use client";
|
||||
|
||||
import LoadingOverlay from "@/components/ui/LoadingBar";
|
||||
import dynamic from "next/dynamic";
|
||||
import type { ComponentType } from "react";
|
||||
|
||||
import {
|
||||
windowPopupDefinitions,
|
||||
type WindowPopupKey,
|
||||
} from "./model/popupDefinitions";
|
||||
import type { WindowPopupRegistryItem } from "./model/types";
|
||||
import AgedPipePopupContent from "./ui/AgedPipePopupContent";
|
||||
import AgedPipeStatusByCtpvPopupContent from "./ui/AgedPipeStatusByCtpvPopupContent";
|
||||
import DredgingRegisterPopupContent from "./ui/DredgingRegisterPopupContent";
|
||||
import DredgingDetailPopupContent from "./ui/DredgingDetailPopupContent";
|
||||
import DredgingEditPopupContent from "./ui/DredgingEditPopupContent";
|
||||
import ExmnBusinessRegisterPopupContent from "./ui/ExmnBusinessRegisterPopupContent";
|
||||
import ExmnPipeReportPopupContent from "./ui/ExmnPipeReportPopupContent";
|
||||
import ExmnResultRegisterPopupContent from "./ui/ExmnResultRegisterPopupContent";
|
||||
import ExmnSurveyDetailPopupContent from "./ui/ExmnSurveyDetailPopupContent";
|
||||
import FloodPreTablePopupContent from "./ui/FloodPreTablePopupContent";
|
||||
import FloodPreUploadPopupContent from "./ui/FloodPreUploadPopupContent";
|
||||
import InfilChartPopupContent from "./ui/InfilChartPopupContent";
|
||||
import InftwtResultPopupContent from "./ui/InftwtResultPopupContent";
|
||||
import OldPpUploadPopupContent from "./ui/OldPpUploadPopupContent";
|
||||
import OldPpTablePopupContent from "./ui/OldPpTablePopupContent";
|
||||
import RdiiChartPopupContent from "./ui/RdiiChartPopupContent";
|
||||
import RdiiResultPopupContent from "./ui/RdiiResultPopupContent";
|
||||
import ReportFilesPopupContent from "./ui/ReportFilesPopupContent";
|
||||
import ReportTabPopupContent from "./ui/ReportTabPopupContent";
|
||||
import SearchModalPopupContent from "./ui/SearchModalPopupContent";
|
||||
import SinkholePopupContent from "./ui/SinkholePopupContent";
|
||||
import SbmrgDngrMapPopupContent from "./ui/SbmrgDngrMapPopupContent";
|
||||
import FloodDngrMapPopupContent from "./ui/FloodDngrMapPopupContent";
|
||||
import SscDetailPopupContent from "./ui/SscDetailPopupContent";
|
||||
import type { WindowPopupContentProps } from "./model/types";
|
||||
import type {
|
||||
WindowPopupContentProps,
|
||||
WindowPopupRegistryItem,
|
||||
} from "./model/types";
|
||||
import FeaturePlaceholderPopupContent from "./ui/FeaturePlaceholderPopupContent";
|
||||
import FldngHstryPopupContent from "./ui/FldngHstryPopupContent";
|
||||
import GisEditSessionPopupContent from "./ui/GisEditSessionPopupContent";
|
||||
import GisManagementPopupContent from "./ui/GisManagementPopupContent";
|
||||
import PipeAnalysisPopupContent from "./ui/PipeAnalysisPopupContent";
|
||||
import PipeAnalysisDetailPopupContent from "./ui/PipeAnalysisDetailPopupContent";
|
||||
import RepairHistoryPopupContent from "./ui/RepairHistoryPopupContent";
|
||||
import WaterRiskPopupContent from "./ui/WaterRiskPopupContent";
|
||||
import CfmtnBgtPopupContent from "../cfmtnBgt/ui/CfmtnBgtPopupContent";
|
||||
|
||||
type WindowPopupModule = {
|
||||
default: ComponentType<WindowPopupContentProps>;
|
||||
};
|
||||
|
||||
const PopupChunkLoading = () => (
|
||||
<div className="relative min-h-dvh">
|
||||
<LoadingOverlay isLoading />
|
||||
</div>
|
||||
);
|
||||
|
||||
const loadPopupContent = (loader: () => Promise<WindowPopupModule>) =>
|
||||
dynamic(loader, {
|
||||
ssr: false,
|
||||
loading: PopupChunkLoading,
|
||||
});
|
||||
|
||||
const CfmtnBgtPopupContent = loadPopupContent(
|
||||
() => import("../cfmtnBgt/ui/CfmtnBgtPopupContent"),
|
||||
);
|
||||
const AgedPipePopupContent = loadPopupContent(
|
||||
() => import("./ui/AgedPipePopupContent"),
|
||||
);
|
||||
const AgedPipeStatusByCtpvPopupContent = loadPopupContent(
|
||||
() => import("./ui/AgedPipeStatusByCtpvPopupContent"),
|
||||
);
|
||||
const DredgingRegisterPopupContent = loadPopupContent(
|
||||
() => import("./ui/DredgingRegisterPopupContent"),
|
||||
);
|
||||
const DredgingEditPopupContent = loadPopupContent(
|
||||
() => import("./ui/DredgingEditPopupContent"),
|
||||
);
|
||||
const ExmnBusinessRegisterPopupContent = loadPopupContent(
|
||||
() => import("./ui/ExmnBusinessRegisterPopupContent"),
|
||||
);
|
||||
const ExmnPipeReportPopupContent = loadPopupContent(
|
||||
() => import("./ui/ExmnPipeReportPopupContent"),
|
||||
);
|
||||
const ExmnResultRegisterPopupContent = loadPopupContent(
|
||||
() => import("./ui/ExmnResultRegisterPopupContent"),
|
||||
);
|
||||
const ExmnSurveyDetailPopupContent = loadPopupContent(
|
||||
() => import("./ui/ExmnSurveyDetailPopupContent"),
|
||||
);
|
||||
const FloodPreTablePopupContent = loadPopupContent(
|
||||
() => import("./ui/FloodPreTablePopupContent"),
|
||||
);
|
||||
const FloodPreUploadPopupContent = loadPopupContent(
|
||||
() => import("./ui/FloodPreUploadPopupContent"),
|
||||
);
|
||||
const InfilChartPopupContent = loadPopupContent(
|
||||
() => import("./ui/InfilChartPopupContent"),
|
||||
);
|
||||
const InftwtResultPopupContent = loadPopupContent(
|
||||
() => import("./ui/InftwtResultPopupContent"),
|
||||
);
|
||||
const OldPpUploadPopupContent = loadPopupContent(
|
||||
() => import("./ui/OldPpUploadPopupContent"),
|
||||
);
|
||||
const OldPpTablePopupContent = loadPopupContent(
|
||||
() => import("./ui/OldPpTablePopupContent"),
|
||||
);
|
||||
const RdiiChartPopupContent = loadPopupContent(
|
||||
() => import("./ui/RdiiChartPopupContent"),
|
||||
);
|
||||
const RdiiResultPopupContent = loadPopupContent(
|
||||
() => import("./ui/RdiiResultPopupContent"),
|
||||
);
|
||||
const ReportFilesPopupContent = loadPopupContent(
|
||||
() => import("./ui/ReportFilesPopupContent"),
|
||||
);
|
||||
const ReportTabPopupContent = loadPopupContent(
|
||||
() => import("./ui/ReportTabPopupContent"),
|
||||
);
|
||||
const SearchModalPopupContent = loadPopupContent(
|
||||
() => import("./ui/SearchModalPopupContent"),
|
||||
);
|
||||
const SinkholePopupContent = loadPopupContent(
|
||||
() => import("./ui/SinkholePopupContent"),
|
||||
);
|
||||
const SbmrgDngrMapPopupContent = loadPopupContent(
|
||||
() => import("./ui/SbmrgDngrMapPopupContent"),
|
||||
);
|
||||
const FloodDngrMapPopupContent = loadPopupContent(
|
||||
() => import("./ui/FloodDngrMapPopupContent"),
|
||||
);
|
||||
const SscDetailPopupContent = loadPopupContent(
|
||||
() => import("./ui/SscDetailPopupContent"),
|
||||
);
|
||||
const FldngHstryPopupContent = loadPopupContent(
|
||||
() => import("./ui/FldngHstryPopupContent"),
|
||||
);
|
||||
const GisEditSessionPopupContent = loadPopupContent(
|
||||
() => import("./ui/GisEditSessionPopupContent"),
|
||||
);
|
||||
const GisManagementPopupContent = loadPopupContent(
|
||||
() => import("./ui/GisManagementPopupContent"),
|
||||
);
|
||||
const PipeAnalysisPopupContent = loadPopupContent(
|
||||
() => import("./ui/PipeAnalysisPopupContent"),
|
||||
);
|
||||
const PipeAnalysisDetailPopupContent = loadPopupContent(
|
||||
() => import("./ui/PipeAnalysisDetailPopupContent"),
|
||||
);
|
||||
const RepairHistoryPopupContent = loadPopupContent(
|
||||
() => import("./ui/RepairHistoryPopupContent"),
|
||||
);
|
||||
const WaterRiskPopupContent = loadPopupContent(
|
||||
() => import("./ui/WaterRiskPopupContent"),
|
||||
);
|
||||
|
||||
const FloodPredictionPlaceholderPopupContent = (
|
||||
_props: WindowPopupContentProps,
|
||||
@@ -73,10 +159,6 @@ export const windowPopupRegistry = {
|
||||
...windowPopupDefinitions.dredgingRegister,
|
||||
component: DredgingRegisterPopupContent,
|
||||
},
|
||||
dredgingDetail: {
|
||||
...windowPopupDefinitions.dredgingDetail,
|
||||
component: DredgingDetailPopupContent,
|
||||
},
|
||||
dredgingEdit: {
|
||||
...windowPopupDefinitions.dredgingEdit,
|
||||
component: DredgingEditPopupContent,
|
||||
|
||||
@@ -5,7 +5,7 @@ import DredgingDetailPopupPage from "@/app/(with-base-layout)/oper/dredging/comp
|
||||
import { postPopupMessage } from "../lib/popupMessage";
|
||||
import { WINDOW_POPUP_MESSAGE_TYPE } from "../model/types";
|
||||
import type { WindowPopupContentProps } from "../model/types";
|
||||
import { buildDredgingPopupRecord } from "./DredgingDetailPopupContent";
|
||||
import { buildDredgingPopupRecord } from "./dredgingPopupRecord";
|
||||
|
||||
/** 상세 화면과 같은 구조에서 선택 관로의 사진·위치·준설일자를 수정한다. */
|
||||
export default function DredgingEditPopupContent({
|
||||
|
||||
@@ -12,7 +12,7 @@ export default function DredgingRegisterPopupContent() {
|
||||
}, []);
|
||||
|
||||
if (!isMounted) {
|
||||
return <div className="min-h-dvh bg-[#f3f7fa]" suppressHydrationWarning />;
|
||||
return <div className="min-h-dvh bg-container" suppressHydrationWarning />;
|
||||
}
|
||||
|
||||
return <DredgingRegisterPopupPage />;
|
||||
|
||||
@@ -6,10 +6,12 @@ import type { WindowPopupContentProps } from "../model/types";
|
||||
|
||||
/** query parameter가 단일 문자열인지 안전하게 해석한다. */
|
||||
const getParam = (value: string | string[] | undefined) =>
|
||||
Array.isArray(value) ? value[0] ?? "" : value ?? "";
|
||||
Array.isArray(value) ? (value[0] ?? "") : (value ?? "");
|
||||
|
||||
/** 조사사업 등록 WindowPopup을 실제 업무 화면에 연결한다. */
|
||||
export default function ExmnBusinessRegisterPopupContent({ searchParams }: WindowPopupContentProps) {
|
||||
export default function ExmnBusinessRegisterPopupContent({
|
||||
searchParams,
|
||||
}: WindowPopupContentProps) {
|
||||
const [isMounted, setIsMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -17,7 +19,7 @@ export default function ExmnBusinessRegisterPopupContent({ searchParams }: Windo
|
||||
}, []);
|
||||
|
||||
if (!isMounted) {
|
||||
return <div className="min-h-dvh bg-[#f3f7fa]" suppressHydrationWarning />;
|
||||
return <div className="min-h-dvh bg-container" suppressHydrationWarning />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import { downloadExmnPipeReport } from "@/features/exmn/api/exmn-business-api";
|
||||
import { StandardPopupLayout } from "@common/business_components";
|
||||
import { Button } from "@common/components";
|
||||
|
||||
import type { WindowPopupContentProps } from "../model/types";
|
||||
|
||||
const getParam = (value: string | string[] | undefined) =>
|
||||
Array.isArray(value) ? value[0] ?? "" : value ?? "";
|
||||
Array.isArray(value) ? (value[0] ?? "") : (value ?? "");
|
||||
|
||||
/** 공통 Blob API 오류 문자열에서 백엔드의 사용자 안내 메시지만 추출한다. */
|
||||
const getReportErrorMessage = (error: unknown) => {
|
||||
@@ -15,7 +17,9 @@ const getReportErrorMessage = (error: unknown) => {
|
||||
return "관로 조사보고서를 불러오지 못했습니다.";
|
||||
}
|
||||
|
||||
const backendMessage = error.message.match(/"message":"((?:\\.|[^"\\])*)"/)?.[1];
|
||||
const backendMessage = error.message.match(
|
||||
/"message":"((?:\\.|[^"\\])*)"/,
|
||||
)?.[1];
|
||||
if (!backendMessage) return error.message;
|
||||
|
||||
try {
|
||||
@@ -66,16 +70,23 @@ export default function ExmnPipeReportPopupContent({
|
||||
}, [exmnBizId, pipeNumber]);
|
||||
|
||||
return (
|
||||
<main className="sn-popup-page">
|
||||
<header className="sn-popup-header">
|
||||
<h1 className="sn-popup-title">관로 조사보고서</h1>
|
||||
<span className="text-[1.05rem] text-white">
|
||||
관로번호 {pipeNumber}
|
||||
{reportNo ? ` · 보고서번호 ${reportNo}` : ""}
|
||||
</span>
|
||||
</header>
|
||||
|
||||
<section className="min-h-0 flex-1 bg-container p-3">
|
||||
<StandardPopupLayout
|
||||
title="관로 조사보고서"
|
||||
showDefaultCancelAction={false}
|
||||
actions={
|
||||
<>
|
||||
<span className="text-[1.05rem] text-label">
|
||||
관로번호 {pipeNumber}
|
||||
{reportNo ? ` · 보고서번호 ${reportNo}` : ""}
|
||||
</span>
|
||||
<Button type="button" color="white" onClick={() => window.close()}>
|
||||
취소
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
bodyClassName="flex min-h-0 flex-1 p-3"
|
||||
>
|
||||
<section className="min-h-0 flex-1">
|
||||
{errorMessage ? (
|
||||
<div className="flex h-full items-center justify-center rounded-sm border border-red-200 bg-red-50 p-6 text-center text-[1.1rem] text-red-700">
|
||||
{errorMessage}
|
||||
@@ -84,14 +95,14 @@ export default function ExmnPipeReportPopupContent({
|
||||
<iframe
|
||||
title={`${pipeNumber} 관로 조사보고서`}
|
||||
src={reportUrl}
|
||||
className="h-full w-full border border-border bg-white"
|
||||
className="h-full w-full border border-border bg-background"
|
||||
/>
|
||||
) : (
|
||||
<div className="flex h-full items-center justify-center rounded-sm border border-border bg-white text-[1.1rem] text-muted-foreground">
|
||||
<div className="flex h-full items-center justify-center rounded-sm border border-border bg-background text-[1.1rem] text-muted-foreground">
|
||||
조사보고서를 불러오는 중입니다.
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
</main>
|
||||
</StandardPopupLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,10 +7,12 @@ import type { WindowPopupContentProps } from "../model/types";
|
||||
|
||||
/** query parameter가 단일 문자열인지 안전하게 해석한다. */
|
||||
const getParam = (value: string | string[] | undefined) =>
|
||||
Array.isArray(value) ? value[0] ?? "" : value ?? "";
|
||||
Array.isArray(value) ? (value[0] ?? "") : (value ?? "");
|
||||
|
||||
/** 부모 목록이 전달한 선택 사업 요약을 팝업 표시 계약으로 복원한다. */
|
||||
const buildBusinessSummary = (searchParams: WindowPopupContentProps["searchParams"]): ExmnBusiness => ({
|
||||
const buildBusinessSummary = (
|
||||
searchParams: WindowPopupContentProps["searchParams"],
|
||||
): ExmnBusiness => ({
|
||||
exmnBizId: getParam(searchParams.exmnBizId),
|
||||
bizYr: getParam(searchParams.bizYr),
|
||||
bizNm: getParam(searchParams.bizNm),
|
||||
@@ -24,7 +26,9 @@ const buildBusinessSummary = (searchParams: WindowPopupContentProps["searchParam
|
||||
});
|
||||
|
||||
/** 선택 조사사업의 결과등록 WindowPopup을 실제 업로드 화면에 연결한다. */
|
||||
export default function ExmnResultRegisterPopupContent({ searchParams }: WindowPopupContentProps) {
|
||||
export default function ExmnResultRegisterPopupContent({
|
||||
searchParams,
|
||||
}: WindowPopupContentProps) {
|
||||
const [isMounted, setIsMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -32,7 +36,7 @@ export default function ExmnResultRegisterPopupContent({ searchParams }: WindowP
|
||||
}, []);
|
||||
|
||||
if (!isMounted) {
|
||||
return <div className="min-h-dvh bg-[#f3f7fa]" suppressHydrationWarning />;
|
||||
return <div className="min-h-dvh bg-container" suppressHydrationWarning />;
|
||||
}
|
||||
|
||||
const businessSummary = buildBusinessSummary(searchParams);
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import type { ExmnBusiness, ExmnJobType } from "@/features/exmn/model/exmn-business-types";
|
||||
import type {
|
||||
ExmnBusiness,
|
||||
ExmnJobType,
|
||||
} from "@/features/exmn/model/exmn-business-types";
|
||||
import type { ExmnDetailDefectType } from "@/features/exmn/model/exmn-detail-table";
|
||||
import { ExmnSurveyDetailPopupPage } from "@/features/exmn/ui/ExmnSurveyDetailPopupPage";
|
||||
import { useEffect, useState } from "react";
|
||||
@@ -8,7 +11,7 @@ import type { WindowPopupContentProps } from "../model/types";
|
||||
|
||||
/** query parameter가 단일 문자열인지 안전하게 해석한다. */
|
||||
const getParam = (value: string | string[] | undefined) =>
|
||||
Array.isArray(value) ? value[0] ?? "" : value ?? "";
|
||||
Array.isArray(value) ? (value[0] ?? "") : (value ?? "");
|
||||
|
||||
/** 상세보기 버튼이 전달한 조사유형을 PPL·MNHL 두 값으로 제한한다. */
|
||||
const getJobType = (value: string | string[] | undefined): ExmnJobType =>
|
||||
@@ -51,7 +54,7 @@ export default function ExmnSurveyDetailPopupContent({
|
||||
}, []);
|
||||
|
||||
if (!isMounted) {
|
||||
return <div className="min-h-dvh bg-[#f3f7fa]" suppressHydrationWarning />;
|
||||
return <div className="min-h-dvh bg-container" suppressHydrationWarning />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -4,22 +4,21 @@ type Props = {
|
||||
|
||||
export default function FeaturePlaceholderPopupContent({ title }: Props) {
|
||||
return (
|
||||
<main className="sn-popup-page">
|
||||
<header className="sn-popup-header">
|
||||
<h1 className="sn-popup-title">{title}</h1>
|
||||
</header>
|
||||
|
||||
<section className="flex flex-1 items-center justify-center bg-container p-8">
|
||||
<div className="w-full max-w-[520px] rounded-md border border-border bg-background p-8 text-center shadow-sm">
|
||||
<h2 className="text-[1.35rem] font-semibold text-foreground">{title}</h2>
|
||||
<p className="mt-4 text-[1.1rem] leading-7 text-label">
|
||||
현재는 팝업 창 구조만 우선 연결했습니다.
|
||||
<StandardPopupLayout title={title}>
|
||||
<section className="card card-border !m-0 flex flex-1 items-center justify-center p-8">
|
||||
<div className="w-full max-w-[560px] rounded-md border border-dashed border-border bg-container px-8 py-10 text-center">
|
||||
<h2 className="text-[1.4rem] font-semibold text-foreground">
|
||||
서비스 준비 중입니다.
|
||||
</h2>
|
||||
<p className="mt-4 text-[1.15rem] leading-7 text-label">
|
||||
{title} 기능은 현재 제공을 준비하고 있습니다.
|
||||
</p>
|
||||
<p className="mt-2 text-[1.05rem] leading-7 text-muted-foreground">
|
||||
상세 기능은 추후 단계에서 구현될 예정입니다.
|
||||
기능이 준비되면 이 화면에서 조회할 수 있습니다.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</StandardPopupLayout>
|
||||
);
|
||||
}
|
||||
import { StandardPopupLayout } from "@common/business_components";
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
import TableModal from "@/app/(with-base-layout)/oper/floodPre/tableModal";
|
||||
"use client";
|
||||
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
import { StandardPopupLayout } from "@common/business_components";
|
||||
import { windowPopupDefinitions } from "../model/popupDefinitions";
|
||||
import type { WindowPopupContentProps } from "../model/types";
|
||||
import PopupMissingParams from "./PopupMissingParams";
|
||||
import { getPopupParamValue } from "./popupContentUtils";
|
||||
|
||||
// 엑셀 파서는 브라우저 전용 의존성을 포함한다. 다른 WindowPopup까지 SSR 단계에서
|
||||
// 함께 실패하지 않도록 해당 상세 팝업을 실제로 열 때만 클라이언트에서 불러온다.
|
||||
const TableModal = dynamic(
|
||||
() => import("@/app/(with-base-layout)/oper/floodPre/tableModal"),
|
||||
{ ssr: false },
|
||||
);
|
||||
|
||||
export default function FloodPreTablePopupContent({
|
||||
searchParams,
|
||||
}: WindowPopupContentProps) {
|
||||
@@ -24,13 +35,11 @@ export default function FloodPreTablePopupContent({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex h-dvh flex-col overflow-hidden bg-white p-4">
|
||||
<h1 className="mb-3 shrink-0 text-2xl font-semibold">
|
||||
{windowPopupDefinitions.floodPreTable.title}
|
||||
</h1>
|
||||
<div className="min-h-0 flex-1 overflow-hidden">
|
||||
<TableModal fileNm={fileNm} atflId={atflId} />
|
||||
</div>
|
||||
</div>
|
||||
<StandardPopupLayout
|
||||
title={windowPopupDefinitions.floodPreTable.title}
|
||||
bodyClassName="overflow-hidden"
|
||||
>
|
||||
<TableModal fileNm={fileNm} atflId={atflId} />
|
||||
</StandardPopupLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,11 +4,15 @@ import { postData } from "@/components/lib/api";
|
||||
import OperFileUploadForm from "@/components/ui/operFileUploadForm";
|
||||
import { tokenManager } from "@/entities/auth/lib/token-manager";
|
||||
import { AUTH_USER_ID } from "@/shared/config";
|
||||
import { useAlertStore } from "@/shared/lib";
|
||||
import { StandardPopupLayout } from "@common/business_components";
|
||||
import { postPopupMessageAndClose } from "../lib/popupMessage";
|
||||
import { windowPopupDefinitions } from "../model/popupDefinitions";
|
||||
import { WINDOW_POPUP_MESSAGE_TYPE } from "../model/types";
|
||||
|
||||
export default function FloodPreUploadPopupContent() {
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
|
||||
const handleSubmit = async (
|
||||
fileNm: string,
|
||||
year: string,
|
||||
@@ -26,17 +30,20 @@ export default function FloodPreUploadPopupContent() {
|
||||
});
|
||||
|
||||
if (data) {
|
||||
alert("파일이 등록되었습니다.");
|
||||
postPopupMessageAndClose(WINDOW_POPUP_MESSAGE_TYPE.FLOOD_PRE_UPLOAD_COMPLETED);
|
||||
alert("파일이 등록되었습니다.", () =>
|
||||
postPopupMessageAndClose(
|
||||
WINDOW_POPUP_MESSAGE_TYPE.FLOOD_PRE_UPLOAD_COMPLETED,
|
||||
),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-dvh bg-white p-4">
|
||||
<OperFileUploadForm
|
||||
title={windowPopupDefinitions.floodPreUpload.title}
|
||||
onSubmit={handleSubmit}
|
||||
/>
|
||||
</div>
|
||||
<StandardPopupLayout
|
||||
title={windowPopupDefinitions.floodPreUpload.title}
|
||||
bodyClassName="[&>div>div.card]:!m-0 [&>div>div:first-child]:hidden"
|
||||
>
|
||||
<OperFileUploadForm title="" onSubmit={handleSubmit} />
|
||||
</StandardPopupLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { StandardPopupLayout } from "@common/business_components";
|
||||
import { Button } from "@common/components";
|
||||
|
||||
import GisEditSessionPanel from "@/app/(map-layout)/map/components/gisEdit/GisEditSessionPanel";
|
||||
import type { GisEditSessionSnapshot } from "@/app/(map-layout)/map/components/gisEdit/gisEditTypes";
|
||||
@@ -21,13 +23,19 @@ const EMPTY_SNAPSHOT: GisEditSessionSnapshot = {
|
||||
focusedChangeId: null,
|
||||
};
|
||||
|
||||
const postMessageToOpener = (type: string, payload?: Record<string, unknown>) => {
|
||||
const postMessageToOpener = (
|
||||
type: string,
|
||||
payload?: Record<string, unknown>,
|
||||
) => {
|
||||
if (typeof window === "undefined" || !window.opener) return;
|
||||
window.opener.postMessage({ type, payload }, window.location.origin);
|
||||
};
|
||||
|
||||
export default function GisEditSessionPopupContent(_props: WindowPopupContentProps) {
|
||||
const [snapshot, setSnapshot] = useState<GisEditSessionSnapshot>(EMPTY_SNAPSHOT);
|
||||
export default function GisEditSessionPopupContent(
|
||||
_props: WindowPopupContentProps,
|
||||
) {
|
||||
const [snapshot, setSnapshot] =
|
||||
useState<GisEditSessionSnapshot>(EMPTY_SNAPSHOT);
|
||||
|
||||
useEffect(() => {
|
||||
const handleMessage = (event: MessageEvent) => {
|
||||
@@ -46,43 +54,52 @@ export default function GisEditSessionPopupContent(_props: WindowPopupContentPro
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<main className="flex h-screen flex-col overflow-hidden bg-[#f6f8fb]">
|
||||
<header className="flex min-h-[48px] items-center justify-between gap-3 border-b border-[#dbe2e6] bg-primary px-5 py-3">
|
||||
<h1 className="text-[1.2rem] font-semibold text-white">
|
||||
{windowPopupDefinitions.gisEditSessionPopup.title}
|
||||
</h1>
|
||||
<button
|
||||
<StandardPopupLayout
|
||||
title={windowPopupDefinitions.gisEditSessionPopup.title}
|
||||
actions={
|
||||
<Button
|
||||
type="button"
|
||||
className="rounded border border-white/70 bg-white/10 px-3 py-1.5 text-[12px] font-semibold text-white transition hover:bg-white/20"
|
||||
color="white"
|
||||
onClick={() => {
|
||||
postMessageToOpener(WINDOW_POPUP_MESSAGE_TYPE.GIS_EDIT_SESSION_SHOW_INLINE);
|
||||
postMessageToOpener(
|
||||
WINDOW_POPUP_MESSAGE_TYPE.GIS_EDIT_SESSION_SHOW_INLINE,
|
||||
);
|
||||
}}
|
||||
>
|
||||
화면에서 보기
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<section className="flex-1 overflow-hidden p-3">
|
||||
</Button>
|
||||
}
|
||||
>
|
||||
<section className="card card-border !m-0 flex-1 overflow-hidden p-3">
|
||||
<GisEditSessionPanel
|
||||
{...snapshot}
|
||||
className="h-full shadow-none"
|
||||
variant="popup"
|
||||
onRemoveFocusedChange={() => {
|
||||
postMessageToOpener(WINDOW_POPUP_MESSAGE_TYPE.GIS_EDIT_SESSION_REMOVE_FOCUSED_CHANGE);
|
||||
postMessageToOpener(
|
||||
WINDOW_POPUP_MESSAGE_TYPE.GIS_EDIT_SESSION_REMOVE_FOCUSED_CHANGE,
|
||||
);
|
||||
}}
|
||||
onRemoveLastChange={() => {
|
||||
postMessageToOpener(WINDOW_POPUP_MESSAGE_TYPE.GIS_EDIT_SESSION_REMOVE_LAST_CHANGE);
|
||||
postMessageToOpener(
|
||||
WINDOW_POPUP_MESSAGE_TYPE.GIS_EDIT_SESSION_REMOVE_LAST_CHANGE,
|
||||
);
|
||||
}}
|
||||
onClearChanges={() => {
|
||||
postMessageToOpener(WINDOW_POPUP_MESSAGE_TYPE.GIS_EDIT_SESSION_CLEAR_CHANGES);
|
||||
postMessageToOpener(
|
||||
WINDOW_POPUP_MESSAGE_TYPE.GIS_EDIT_SESSION_CLEAR_CHANGES,
|
||||
);
|
||||
}}
|
||||
onFocusChange={(changeId) => {
|
||||
postMessageToOpener(WINDOW_POPUP_MESSAGE_TYPE.GIS_EDIT_SESSION_FOCUS_CHANGE, {
|
||||
changeId,
|
||||
});
|
||||
postMessageToOpener(
|
||||
WINDOW_POPUP_MESSAGE_TYPE.GIS_EDIT_SESSION_FOCUS_CHANGE,
|
||||
{
|
||||
changeId,
|
||||
},
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</section>
|
||||
</main>
|
||||
</StandardPopupLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ export default function InftwtResultPopupContent() {
|
||||
}, []);
|
||||
|
||||
if (!isMounted) {
|
||||
return <div className="h-dvh bg-white" suppressHydrationWarning />;
|
||||
return <div className="h-dvh bg-background" suppressHydrationWarning />;
|
||||
}
|
||||
|
||||
return <InftwtResultPopupPage />;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
"use client";
|
||||
|
||||
import { useMemo, type ReactNode } from "react";
|
||||
import {
|
||||
getCoreRowModel,
|
||||
useReactTable,
|
||||
type ColumnDef,
|
||||
type PaginationState,
|
||||
} from "@tanstack/react-table";
|
||||
|
||||
import {
|
||||
StandardDataTable,
|
||||
getStandardRowNumber,
|
||||
type ScrollMode,
|
||||
type UiHeadProps,
|
||||
} from "@common/business_components";
|
||||
|
||||
type MapPopupDataTableProps<T extends Record<string, unknown>> = {
|
||||
rows: T[];
|
||||
headlist: UiHeadProps[];
|
||||
title: ReactNode;
|
||||
total: number;
|
||||
page: number;
|
||||
pageSize: number;
|
||||
onPageChange: (page: number) => void;
|
||||
actions?: ReactNode;
|
||||
loading?: boolean;
|
||||
scrollMode?: ScrollMode;
|
||||
minTableWidth?: string;
|
||||
emptyMessage?: string;
|
||||
viewPagination?: boolean;
|
||||
fillAvailableHeight?: boolean;
|
||||
rowId?: (row: T, index: number) => string;
|
||||
selectedRowId?: string;
|
||||
onRowClick?: (row: T, index: number) => void;
|
||||
onCellClick?: (row: T, rowIndex: number, columnId: string) => void;
|
||||
clickableHeadIds?: string[];
|
||||
renderCell?: (
|
||||
row: T,
|
||||
headId: string,
|
||||
rowIndex: number,
|
||||
) => ReactNode | undefined;
|
||||
};
|
||||
|
||||
const ROW_NUMBER_IDS = new Set(["no", "rowNo", "rowNumber"]);
|
||||
|
||||
const formatCellValue = (value: unknown) => {
|
||||
if (value === null || value === undefined || value === "") return "-";
|
||||
if (typeof value === "number") return value.toLocaleString("ko-KR");
|
||||
return String(value);
|
||||
};
|
||||
|
||||
/** 지도 WindowPopup 목록을 CS 공통 표·순번·페이징 규칙으로 연결한다. */
|
||||
export default function MapPopupDataTable<T extends Record<string, unknown>>({
|
||||
rows,
|
||||
headlist,
|
||||
title,
|
||||
total,
|
||||
page,
|
||||
pageSize,
|
||||
onPageChange,
|
||||
actions,
|
||||
loading = false,
|
||||
scrollMode = "none",
|
||||
minTableWidth = "100%",
|
||||
emptyMessage,
|
||||
viewPagination = true,
|
||||
fillAvailableHeight = false,
|
||||
rowId,
|
||||
selectedRowId,
|
||||
onRowClick,
|
||||
onCellClick,
|
||||
clickableHeadIds,
|
||||
renderCell,
|
||||
}: MapPopupDataTableProps<T>) {
|
||||
const visibleHeads = useMemo(
|
||||
() =>
|
||||
headlist.filter(
|
||||
(head) => head.visible !== false && head.id && head.id.length > 1,
|
||||
),
|
||||
[headlist],
|
||||
);
|
||||
const columns = useMemo<ColumnDef<T>[]>(
|
||||
() =>
|
||||
visibleHeads.map((head) => ({
|
||||
id: head.id,
|
||||
accessorFn: (row) => row[head.id],
|
||||
header: ROW_NUMBER_IDS.has(head.id) ? "순번" : head.title,
|
||||
cell: ({ row, getValue }) => {
|
||||
const rowIndex = row.index;
|
||||
const rendered = renderCell?.(row.original, head.id, rowIndex);
|
||||
const value = ROW_NUMBER_IDS.has(head.id)
|
||||
? getStandardRowNumber({
|
||||
total,
|
||||
rowIndex,
|
||||
pageIndex: page - 1,
|
||||
pageSize,
|
||||
})
|
||||
: rendered === undefined
|
||||
? formatCellValue(getValue())
|
||||
: rendered;
|
||||
const isClickable =
|
||||
Boolean(onCellClick) &&
|
||||
(!clickableHeadIds || clickableHeadIds.includes(head.id));
|
||||
|
||||
return isClickable ? (
|
||||
<button
|
||||
type="button"
|
||||
className="w-full cursor-pointer text-inherit"
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
onCellClick?.(row.original, rowIndex, head.id);
|
||||
}}
|
||||
>
|
||||
{value}
|
||||
</button>
|
||||
) : (
|
||||
value
|
||||
);
|
||||
},
|
||||
meta: {
|
||||
align:
|
||||
head.align === "left" || head.align === "right"
|
||||
? head.align
|
||||
: "center",
|
||||
width: head.widthPercent,
|
||||
},
|
||||
})),
|
||||
[
|
||||
clickableHeadIds,
|
||||
onCellClick,
|
||||
page,
|
||||
pageSize,
|
||||
renderCell,
|
||||
total,
|
||||
visibleHeads,
|
||||
],
|
||||
);
|
||||
const pagination: PaginationState = {
|
||||
pageIndex: Math.max(page - 1, 0),
|
||||
pageSize,
|
||||
};
|
||||
const table = useReactTable({
|
||||
data: rows,
|
||||
columns,
|
||||
state: {
|
||||
pagination,
|
||||
rowSelection: selectedRowId ? { [selectedRowId]: true } : {},
|
||||
},
|
||||
rowCount: total,
|
||||
manualPagination: true,
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
getRowId: (row, index) => rowId?.(row, index) ?? String(index),
|
||||
onPaginationChange: (updater) => {
|
||||
const next =
|
||||
typeof updater === "function" ? updater(pagination) : updater;
|
||||
if (next.pageIndex === pagination.pageIndex) return;
|
||||
onPageChange(next.pageIndex + 1);
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<StandardDataTable
|
||||
table={table}
|
||||
title={title}
|
||||
actions={actions}
|
||||
loading={loading}
|
||||
emptyMessage={emptyMessage}
|
||||
flushOuterMargin
|
||||
className="!w-full !max-w-full"
|
||||
scrollMode={scrollMode}
|
||||
minTableWidth={minTableWidth}
|
||||
viewPagination={viewPagination}
|
||||
fillAvailableHeight={fillAvailableHeight}
|
||||
onRowClick={
|
||||
onRowClick ? (row) => onRowClick(row, rows.indexOf(row)) : undefined
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export type { MapPopupDataTableProps };
|
||||
@@ -1,9 +1,20 @@
|
||||
import TableModal from "@/app/(with-base-layout)/oper/oldPp/tableModal";
|
||||
"use client";
|
||||
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
import { StandardPopupLayout } from "@common/business_components";
|
||||
import { windowPopupDefinitions } from "../model/popupDefinitions";
|
||||
import type { WindowPopupContentProps } from "../model/types";
|
||||
import PopupMissingParams from "./PopupMissingParams";
|
||||
import { getPopupParamValue } from "./popupContentUtils";
|
||||
|
||||
// 엑셀 파서는 브라우저 전용 의존성을 포함한다. 다른 WindowPopup까지 SSR 단계에서
|
||||
// 함께 실패하지 않도록 해당 상세 팝업을 실제로 열 때만 클라이언트에서 불러온다.
|
||||
const TableModal = dynamic(
|
||||
() => import("@/app/(with-base-layout)/oper/oldPp/tableModal"),
|
||||
{ ssr: false },
|
||||
);
|
||||
|
||||
export default function OldPpTablePopupContent({
|
||||
searchParams,
|
||||
}: WindowPopupContentProps) {
|
||||
@@ -24,13 +35,11 @@ export default function OldPpTablePopupContent({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex h-dvh flex-col overflow-hidden bg-white p-4">
|
||||
<h1 className="mb-3 shrink-0 text-2xl font-semibold">
|
||||
{windowPopupDefinitions.oldPpTable.title}
|
||||
</h1>
|
||||
<div className="min-h-0 flex-1 overflow-hidden">
|
||||
<TableModal fileNm={fileNm} atflId={atflId} />
|
||||
</div>
|
||||
</div>
|
||||
<StandardPopupLayout
|
||||
title={windowPopupDefinitions.oldPpTable.title}
|
||||
bodyClassName="overflow-hidden"
|
||||
>
|
||||
<TableModal fileNm={fileNm} atflId={atflId} />
|
||||
</StandardPopupLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,11 +4,15 @@ import { postData } from "@/components/lib/api";
|
||||
import OperFileUploadForm from "@/components/ui/operFileUploadForm";
|
||||
import { tokenManager } from "@/entities/auth/lib/token-manager";
|
||||
import { AUTH_USER_ID } from "@/shared/config";
|
||||
import { useAlertStore } from "@/shared/lib";
|
||||
import { StandardPopupLayout } from "@common/business_components";
|
||||
import { postPopupMessageAndClose } from "../lib/popupMessage";
|
||||
import { windowPopupDefinitions } from "../model/popupDefinitions";
|
||||
import { WINDOW_POPUP_MESSAGE_TYPE } from "../model/types";
|
||||
|
||||
export default function OldPpUploadPopupContent() {
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
|
||||
const handleSubmit = async (
|
||||
fileNm: string,
|
||||
year: string,
|
||||
@@ -26,17 +30,20 @@ export default function OldPpUploadPopupContent() {
|
||||
});
|
||||
|
||||
if (data) {
|
||||
alert("파일이 등록되었습니다.");
|
||||
postPopupMessageAndClose(WINDOW_POPUP_MESSAGE_TYPE.OLD_PP_UPLOAD_COMPLETED);
|
||||
alert("파일이 등록되었습니다.", () =>
|
||||
postPopupMessageAndClose(
|
||||
WINDOW_POPUP_MESSAGE_TYPE.OLD_PP_UPLOAD_COMPLETED,
|
||||
),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-dvh bg-white p-4">
|
||||
<OperFileUploadForm
|
||||
title={windowPopupDefinitions.oldPpUpload.title}
|
||||
onSubmit={handleSubmit}
|
||||
/>
|
||||
</div>
|
||||
<StandardPopupLayout
|
||||
title={windowPopupDefinitions.oldPpUpload.title}
|
||||
bodyClassName="[&>div>div.card]:!m-0 [&>div>div:first-child]:hidden"
|
||||
>
|
||||
<OperFileUploadForm title="" onSubmit={handleSubmit} />
|
||||
</StandardPopupLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { StandardPopupLayout } from "@common/business_components";
|
||||
|
||||
export default function PopupMissingParams({
|
||||
title,
|
||||
missingParams,
|
||||
@@ -6,14 +8,17 @@ export default function PopupMissingParams({
|
||||
missingParams: string[];
|
||||
}) {
|
||||
return (
|
||||
<section className="flex min-h-dvh flex-col items-center justify-center gap-4 p-8 text-center">
|
||||
<h1 className="text-2xl font-semibold">{title}</h1>
|
||||
<p className="text-base text-gray-600">
|
||||
팝업을 여는 데 필요한 값이 누락되었습니다.
|
||||
</p>
|
||||
<p className="text-sm text-gray-500">
|
||||
누락된 값: {missingParams.join(", ")}
|
||||
</p>
|
||||
</section>
|
||||
<StandardPopupLayout title={title}>
|
||||
<section className="card card-border !m-0 flex flex-1 items-center justify-center p-8 text-center">
|
||||
<div>
|
||||
<p className="text-[1.3rem] text-label">
|
||||
팝업을 여는 데 필요한 값이 누락되었습니다.
|
||||
</p>
|
||||
<p className="mt-2 text-[1.15rem] text-muted-foreground">
|
||||
누락된 값: {missingParams.join(", ")}
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</StandardPopupLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
"use client";
|
||||
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import { cn } from "@common/components";
|
||||
|
||||
type PopupSearchPanelProps = {
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
contentClassName?: string;
|
||||
};
|
||||
|
||||
/** WindowPopup 조회조건의 외곽 카드, 패딩과 가로 스크롤 규칙을 한 곳에서 관리한다. */
|
||||
export default function PopupSearchPanel({
|
||||
children,
|
||||
className,
|
||||
contentClassName,
|
||||
}: PopupSearchPanelProps) {
|
||||
return (
|
||||
<section
|
||||
data-popup-search-panel
|
||||
className={cn(
|
||||
"card card-border !m-0 w-full min-w-0 shrink-0 !p-[1.2rem]",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
<div className={cn("min-w-0", contentClassName)}>{children}</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
export type { PopupSearchPanelProps };
|
||||
@@ -12,8 +12,8 @@ export default function RdiiResultPopupContent() {
|
||||
}, []);
|
||||
|
||||
if (!isMounted) {
|
||||
return <div className="h-dvh bg-white" suppressHydrationWarning />;
|
||||
return <div className="h-dvh bg-background" suppressHydrationWarning />;
|
||||
}
|
||||
|
||||
return <RdiiResultPopupPage />;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import LoadingOverlay from "@/components/ui/LoadingBar";
|
||||
import { getDcData } from "@/components/lib/api";
|
||||
import { UiTable } from "@common/business_components/ui";
|
||||
import { useAlertStore } from "@/shared/lib";
|
||||
import { StandardPopupLayout } from "@common/business_components";
|
||||
import { windowPopupDefinitions } from "../model/popupDefinitions";
|
||||
import type { WindowPopupContentProps } from "../model/types";
|
||||
import PopupMissingParams from "./PopupMissingParams";
|
||||
import { getPopupParamValue } from "./popupContentUtils";
|
||||
import MapPopupDataTable from "./MapPopupDataTable";
|
||||
|
||||
type ReportDataFile = {
|
||||
no?: number;
|
||||
@@ -18,7 +20,7 @@ type ReportDataFile = {
|
||||
};
|
||||
|
||||
const REPORT_FILES_HEADLIST = [
|
||||
{ id: "no", title: "NO" },
|
||||
{ id: "no", title: "순번" },
|
||||
{ id: "fileTitle", title: "파일명" },
|
||||
{ id: "regDt", title: "등록일자" },
|
||||
];
|
||||
@@ -26,6 +28,7 @@ const REPORT_FILES_HEADLIST = [
|
||||
export default function ReportFilesPopupContent({
|
||||
searchParams,
|
||||
}: WindowPopupContentProps) {
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
const clsfSystmSn = getPopupParamValue(searchParams.clsfSystmSn);
|
||||
const [files, setFiles] = useState<ReportDataFile[]>([]);
|
||||
const [allFiles, setAllFiles] = useState<ReportDataFile[]>([]);
|
||||
@@ -38,11 +41,10 @@ export default function ReportFilesPopupContent({
|
||||
const fetchFiles = async () => {
|
||||
setIsLoading(true);
|
||||
try {
|
||||
const result = await getDcData(`/api/v1/file?clsfSystmSn=${clsfSystmSn}`);
|
||||
const normalized = (result ?? []).map((item: ReportDataFile, index: number) => ({
|
||||
...item,
|
||||
no: index + 1,
|
||||
}));
|
||||
const result = await getDcData(
|
||||
`/api/v1/file?clsfSystmSn=${clsfSystmSn}`,
|
||||
);
|
||||
const normalized = (result ?? []).map((item: ReportDataFile) => item);
|
||||
setAllFiles(normalized);
|
||||
} catch (error) {
|
||||
console.error("보고서 파일 목록 조회 실패:", error);
|
||||
@@ -60,7 +62,11 @@ export default function ReportFilesPopupContent({
|
||||
setFiles(paged);
|
||||
}, [allFiles, curPage]);
|
||||
|
||||
const handleDownload = async (fileSn: string, fileTitle: string, filePath: string) => {
|
||||
const handleDownload = async (
|
||||
fileSn: string,
|
||||
fileTitle: string,
|
||||
filePath: string,
|
||||
) => {
|
||||
if (!filePath) {
|
||||
alert("filePath 정보가 없으므로 다운로드가 불가합니다.");
|
||||
return;
|
||||
@@ -96,26 +102,22 @@ export default function ReportFilesPopupContent({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex h-dvh flex-col overflow-hidden bg-white p-4">
|
||||
<h1 className="mb-3 shrink-0 text-2xl font-semibold">
|
||||
{windowPopupDefinitions.reportFiles.title}
|
||||
</h1>
|
||||
<div className="min-h-0 flex-1 overflow-auto">
|
||||
<LoadingOverlay isLoading={isLoading} />
|
||||
<UiTable
|
||||
headName={`조회 결과 (${allFiles.length.toLocaleString("ko-KR")})건`}
|
||||
tableData={files}
|
||||
headlist={REPORT_FILES_HEADLIST}
|
||||
pageSize={10}
|
||||
total={allFiles.length}
|
||||
onPageChange={setCurPage}
|
||||
cellClick={(index) => {
|
||||
if (typeof index !== "number" || !files[index]) return;
|
||||
const target = files[index];
|
||||
handleDownload(target.fileSn, target.fileTitle, target.filePath);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<StandardPopupLayout title={windowPopupDefinitions.reportFiles.title}>
|
||||
<LoadingOverlay isLoading={isLoading} />
|
||||
<MapPopupDataTable
|
||||
rows={files as Array<ReportDataFile & Record<string, unknown>>}
|
||||
headlist={REPORT_FILES_HEADLIST}
|
||||
title="보고서 파일 목록"
|
||||
total={allFiles.length}
|
||||
page={curPage}
|
||||
pageSize={10}
|
||||
onPageChange={setCurPage}
|
||||
clickableHeadIds={["fileTitle"]}
|
||||
onCellClick={(row) =>
|
||||
void handleDownload(row.fileSn, row.fileTitle, row.filePath)
|
||||
}
|
||||
rowId={(row, index) => row.fileSn || String(index)}
|
||||
/>
|
||||
</StandardPopupLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
"use client";
|
||||
|
||||
import ReportTab from "@/app/(map-layout)/map/searchModal/reportTab";
|
||||
import { StandardPopupLayout } from "@common/business_components";
|
||||
import { useEffect, useState } from "react";
|
||||
import { windowPopupDefinitions } from "../model/popupDefinitions";
|
||||
import type { WindowPopupContentProps } from "../model/types";
|
||||
@@ -18,15 +19,12 @@ export default function ReportTabPopupContent({
|
||||
}, []);
|
||||
|
||||
if (!isMounted) {
|
||||
return <div className="h-dvh bg-white" suppressHydrationWarning />;
|
||||
return <div className="h-dvh bg-background" suppressHydrationWarning />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex h-dvh flex-col overflow-hidden bg-white p-4">
|
||||
<h1 className="mb-3 shrink-0 text-2xl font-semibold">
|
||||
{windowPopupDefinitions.reportTab.title}
|
||||
</h1>
|
||||
<div className="min-h-0 flex-1 overflow-hidden">
|
||||
<StandardPopupLayout title={windowPopupDefinitions.reportTab.title}>
|
||||
<div className="card card-border !m-0 min-h-0 flex-1 overflow-hidden">
|
||||
<ReportTab
|
||||
open={true}
|
||||
isSearch={false}
|
||||
@@ -34,6 +32,6 @@ export default function ReportTabPopupContent({
|
||||
sggNm={sggNm || undefined}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</StandardPopupLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
"use client";
|
||||
|
||||
import type { WindowPopupKey } from "../model/popupDefinitions";
|
||||
import { windowPopupRegistry } from "../registry";
|
||||
|
||||
type WindowPopupRendererProps = {
|
||||
popupKey: WindowPopupKey;
|
||||
searchParams: Record<string, string | string[] | undefined>;
|
||||
};
|
||||
|
||||
/**
|
||||
* WindowPopup 구현들은 지도·엑셀처럼 브라우저 전용 모듈을 포함할 수 있다.
|
||||
* 레지스트리를 클라이언트 경계 안에서 해석해 다른 팝업의 의존성이 SSR을 막지 않게 한다.
|
||||
*/
|
||||
export default function WindowPopupRenderer({
|
||||
popupKey,
|
||||
searchParams,
|
||||
}: WindowPopupRendererProps) {
|
||||
const PopupComponent = windowPopupRegistry[popupKey].component;
|
||||
|
||||
return <PopupComponent searchParams={searchParams} />;
|
||||
}
|
||||
+4
-13
@@ -1,8 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import DredgingDetailPopupPage from "@/app/(with-base-layout)/oper/dredging/components/DredgingDetailPopupPage";
|
||||
|
||||
import type { DredgingRecord } from "@/app/(with-base-layout)/oper/dredging/lib/types";
|
||||
|
||||
import type { WindowPopupContentProps } from "../model/types";
|
||||
|
||||
const getParam = (value: string | string[] | undefined) =>
|
||||
@@ -20,7 +17,7 @@ const getNullableNumber = (value: string | string[] | undefined) => {
|
||||
return Number.isFinite(parsed) ? parsed : null;
|
||||
};
|
||||
|
||||
/** 목록 행의 직렬화된 값을 준설 상세 화면 모델로 복원한다. */
|
||||
/** 목록 행의 직렬화된 값을 준설 수정 화면 모델로 복원한다. */
|
||||
export const buildDredgingPopupRecord = (
|
||||
searchParams: WindowPopupContentProps["searchParams"],
|
||||
): DredgingRecord => ({
|
||||
@@ -43,16 +40,10 @@ export const buildDredgingPopupRecord = (
|
||||
latitude: getNumber(searchParams.latitude),
|
||||
snappedLongitude: getNumber(searchParams.snappedLongitude),
|
||||
snappedLatitude: getNumber(searchParams.snappedLatitude),
|
||||
registrationMode:
|
||||
getParam(searchParams.registrationMode) === "MANUAL" ? "MANUAL" : "PHOTO",
|
||||
registrationSource:
|
||||
getParam(searchParams.registrationSource) === "MANUAL" ? "MANUAL" : "EXIF",
|
||||
matchDistanceMeters: getNumber(searchParams.matchDistanceMeters),
|
||||
isMock: getParam(searchParams.isMock) === "true",
|
||||
});
|
||||
|
||||
export default function DredgingDetailPopupContent({
|
||||
searchParams,
|
||||
}: WindowPopupContentProps) {
|
||||
return (
|
||||
<DredgingDetailPopupPage record={buildDredgingPopupRecord(searchParams)} />
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user