통수능/준설관리
This commit is contained in:
@@ -3,11 +3,9 @@
|
||||
import type { UIEvent } from "react";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
|
||||
import {
|
||||
downloadExcelWithKoreanHeaders,
|
||||
type UiTableSort,
|
||||
} from "@common/business_components/ui";
|
||||
import type { UiTableSort } from "@common/business_components/ui/table";
|
||||
import { Button, Input } from "@common/components/ui";
|
||||
import { downloadExcelWithKoreanHeaders } from "@/shared/lib/download-excel";
|
||||
|
||||
import {
|
||||
getExmnFacilityDetails,
|
||||
|
||||
@@ -3,7 +3,11 @@ import {
|
||||
windowPopupDefinitions,
|
||||
type WindowPopupKey,
|
||||
} from "../model/popupDefinitions";
|
||||
import type { OpenWindowPopupParams, WindowPopupDefinition } from "../model/types";
|
||||
import type {
|
||||
OpenWindowPopupOptions,
|
||||
OpenWindowPopupParams,
|
||||
WindowPopupDefinition,
|
||||
} from "../model/types";
|
||||
|
||||
const buildQueryString = (params: OpenWindowPopupParams = {}) => {
|
||||
const searchParams = new URLSearchParams();
|
||||
@@ -84,13 +88,18 @@ const buildPopupFeatures = ({
|
||||
export const openWindowPopup = (
|
||||
popupKey: WindowPopupKey,
|
||||
params?: OpenWindowPopupParams,
|
||||
options?: OpenWindowPopupOptions,
|
||||
) => {
|
||||
if (typeof window === "undefined") return null;
|
||||
if (!isWindowPopupKey(popupKey)) return null;
|
||||
|
||||
const definition = windowPopupDefinitions[popupKey];
|
||||
const popupUrl = `/popup/${popupKey}${buildQueryString(params)}`;
|
||||
const popupFeatures = buildPopupFeatures(definition);
|
||||
const popupFeatures = buildPopupFeatures({
|
||||
...definition,
|
||||
width: options?.width ?? definition.width,
|
||||
height: options?.height ?? definition.height,
|
||||
});
|
||||
const popupWindow = window.open(
|
||||
popupUrl,
|
||||
`sn-popup-${popupKey}`,
|
||||
|
||||
@@ -21,6 +21,12 @@ export const windowPopupDefinitions = {
|
||||
height: 720,
|
||||
requiredParams: ["exmnBizId", "trtdstId", "trtdstNm", "jobType"],
|
||||
},
|
||||
dredgingRegister: {
|
||||
key: "dredgingRegister",
|
||||
title: "준설결과 등록",
|
||||
width: 1280,
|
||||
height: 900,
|
||||
},
|
||||
oldPpUpload: {
|
||||
key: "oldPpUpload",
|
||||
title: "노후 하수관로 정비사업 등록",
|
||||
@@ -175,8 +181,8 @@ export const windowPopupDefinitions = {
|
||||
flowRiskPopup: {
|
||||
key: "flowRiskPopup",
|
||||
title: "통수 위험",
|
||||
width: 920,
|
||||
height: 760,
|
||||
width: 1180,
|
||||
height: 820,
|
||||
},
|
||||
} as const satisfies Record<string, WindowPopupDefinition>;
|
||||
|
||||
|
||||
@@ -30,10 +30,16 @@ export type OpenWindowPopupParams = Record<
|
||||
string | number | boolean | null | undefined
|
||||
>;
|
||||
|
||||
/** 팝업별 기본 정의를 유지하면서 호출 화면에서 필요한 크기만 재정의한다. */
|
||||
export type OpenWindowPopupOptions = Partial<
|
||||
Pick<WindowPopupDefinition, "width" | "height">
|
||||
>;
|
||||
|
||||
export const WINDOW_POPUP_MESSAGE_TYPE = {
|
||||
EXMN_BUSINESS_CREATED: "sn:popup:exmnBusinessCreated",
|
||||
EXMN_BUSINESS_UPDATED: "sn:popup:exmnBusinessUpdated",
|
||||
EXMN_RESULT_COMMITTED: "sn:popup:exmnResultCommitted",
|
||||
DREDGING_REGISTERED: "sn:popup:dredgingRegistered",
|
||||
OLD_PP_UPLOAD_COMPLETED: "sn:popup:oldPpUploadCompleted",
|
||||
FLOOD_PRE_UPLOAD_COMPLETED: "sn:popup:floodPreUploadCompleted",
|
||||
MAP_SEARCH_SELECT_FEATURE: "sn:popup:mapSearchSelectFeature",
|
||||
@@ -49,11 +55,6 @@ export const WINDOW_POPUP_MESSAGE_TYPE = {
|
||||
WATER_RISK_READY: "sn:popup:waterRiskReady",
|
||||
WATER_RISK_SYNC: "sn:popup:waterRiskSync",
|
||||
WATER_RISK_SELECT_RESULT: "sn:popup:waterRiskSelectResult",
|
||||
WATER_RISK_START_SETTING_EDIT: "sn:popup:waterRiskStartSettingEdit",
|
||||
WATER_RISK_STOP_SETTING_EDIT: "sn:popup:waterRiskStopSettingEdit",
|
||||
WATER_RISK_REMOVE_STAGED_PIPE: "sn:popup:waterRiskRemoveStagedPipe",
|
||||
WATER_RISK_REORDER_STAGED_PIPE: "sn:popup:waterRiskReorderStagedPipe",
|
||||
WATER_RISK_CLEAR_STAGED_PIPES: "sn:popup:waterRiskClearStagedPipes",
|
||||
} as const;
|
||||
|
||||
export type WindowPopupMessageType =
|
||||
|
||||
@@ -2,6 +2,7 @@ import { windowPopupDefinitions, type WindowPopupKey } from "./model/popupDefini
|
||||
import type { WindowPopupRegistryItem } from "./model/types";
|
||||
import AgedPipePopupContent from "./ui/AgedPipePopupContent";
|
||||
import AgedPipeStatusByCtpvPopupContent from "./ui/AgedPipeStatusByCtpvPopupContent";
|
||||
import DredgingRegisterPopupContent from "./ui/DredgingRegisterPopupContent";
|
||||
import ExmnBusinessRegisterPopupContent from "./ui/ExmnBusinessRegisterPopupContent";
|
||||
import ExmnResultRegisterPopupContent from "./ui/ExmnResultRegisterPopupContent";
|
||||
import ExmnSurveyDetailPopupContent from "./ui/ExmnSurveyDetailPopupContent";
|
||||
@@ -50,6 +51,10 @@ export const windowPopupRegistry = {
|
||||
...windowPopupDefinitions.exmnSurveyDetail,
|
||||
component: ExmnSurveyDetailPopupContent,
|
||||
},
|
||||
dredgingRegister: {
|
||||
...windowPopupDefinitions.dredgingRegister,
|
||||
component: DredgingRegisterPopupContent,
|
||||
},
|
||||
oldPpUpload: {
|
||||
...windowPopupDefinitions.oldPpUpload,
|
||||
component: OldPpUploadPopupContent,
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
"use client";
|
||||
|
||||
import DredgingRegisterPopupPage from "@/app/(with-base-layout)/oper/dredging/_components/DredgingRegisterPopupPage";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
/** 준설결과 등록 화면을 공통 WindowPopup 레이아웃에 연결한다. */
|
||||
export default function DredgingRegisterPopupContent() {
|
||||
const [isMounted, setIsMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setIsMounted(true);
|
||||
}, []);
|
||||
|
||||
if (!isMounted) {
|
||||
return <div className="min-h-dvh bg-[#f3f7fa]" suppressHydrationWarning />;
|
||||
}
|
||||
|
||||
return <DredgingRegisterPopupPage />;
|
||||
}
|
||||
Reference in New Issue
Block a user