Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60ee194cc9 | ||
|
|
3d027ed374 | ||
|
|
d70eb17a72 | ||
|
|
ddd619babc | ||
|
|
5d27ee830e | ||
|
|
212b9a43a9 | ||
|
|
f092a23ee4 | ||
|
|
25c357a423 | ||
|
|
a77246a1db | ||
|
|
f00ce31648 | ||
|
|
dc57a491dd | ||
|
|
c9b7266959 | ||
|
|
0dd2111cb9 | ||
|
|
87fbf15e2b |
@@ -2,35 +2,35 @@ import { z } from "zod";
|
|||||||
|
|
||||||
/** 백엔드 DcRagFileInfoDto */
|
/** 백엔드 DcRagFileInfoDto */
|
||||||
export const dcRagFileInfoSchema = z.object({
|
export const dcRagFileInfoSchema = z.object({
|
||||||
fileId: z.string().optional(),
|
fileId: z.string().nullish(),
|
||||||
fileGroupId: z.string().optional(),
|
fileGroupId: z.string().nullish(),
|
||||||
fileName: z.string().optional(),
|
fileName: z.string().nullish(),
|
||||||
physicalPath: z.string().optional(),
|
physicalPath: z.string().nullish(),
|
||||||
downloadUrl: z.string().optional(),
|
downloadUrl: z.string().nullish(),
|
||||||
fileSize: z.number().optional(),
|
fileSize: z.number().nullish(),
|
||||||
esntlAtchFileId: z.string().optional(),
|
esntlAtchFileId: z.string().nullish(),
|
||||||
esntlAtchFileNm: z.string().optional(),
|
esntlAtchFileNm: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 DcRagDocumentTransferRequestDto */
|
/** 백엔드 DcRagDocumentTransferRequestDto */
|
||||||
export const dcRagDocumentTransferRequestSchema = z.object({
|
export const dcRagDocumentTransferRequestSchema = z.object({
|
||||||
fnrsCnsltnDocNo: z.string(),
|
fnrsCnsltnDocNo: z.string(),
|
||||||
taskSeComCd: z.string().optional(),
|
taskSeComCd: z.string().nullish(),
|
||||||
taskSeCdNm: z.string().optional(),
|
taskSeCdNm: z.string().nullish(),
|
||||||
essentialFiles: z.array(dcRagFileInfoSchema).optional(),
|
essentialFiles: z.array(dcRagFileInfoSchema).nullish(),
|
||||||
etcFiles: z.array(dcRagFileInfoSchema).optional(),
|
etcFiles: z.array(dcRagFileInfoSchema).nullish(),
|
||||||
callbackUrl: z.string().optional(),
|
callbackUrl: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 DcRagDraftGenerateRequestDto */
|
/** 백엔드 DcRagDraftGenerateRequestDto */
|
||||||
export const dcRagDraftGenerateRequestSchema = z.object({
|
export const dcRagDraftGenerateRequestSchema = z.object({
|
||||||
fnrsCnsltnDocNo: z.string(),
|
fnrsCnsltnDocNo: z.string(),
|
||||||
pwrkCnsltnDocNo: z.string(),
|
pwrkCnsltnDocNo: z.string(),
|
||||||
crtDmndUuid: z.string().optional(),
|
crtDmndUuid: z.string().nullish(),
|
||||||
essentialFiles: z.array(dcRagFileInfoSchema).optional(),
|
essentialFiles: z.array(dcRagFileInfoSchema).nullish(),
|
||||||
etcFiles: z.array(dcRagFileInfoSchema).optional(),
|
etcFiles: z.array(dcRagFileInfoSchema).nullish(),
|
||||||
rqstrUuid: z.string().optional(),
|
rqstrUuid: z.string().nullish(),
|
||||||
callbackUrl: z.string().optional(),
|
callbackUrl: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 DcRagCostVerifyRequestDto */
|
/** 백엔드 DcRagCostVerifyRequestDto */
|
||||||
|
|||||||
@@ -2,68 +2,68 @@ import { z } from "zod";
|
|||||||
|
|
||||||
/** 백엔드 DesignCnstnMngSaveRequestDto */
|
/** 백엔드 DesignCnstnMngSaveRequestDto */
|
||||||
export const designCnstnMngSaveSchema = z.object({
|
export const designCnstnMngSaveSchema = z.object({
|
||||||
designCnstnDocNo: z.string().optional(),
|
designCnstnDocNo: z.string().nullish(),
|
||||||
admdstCd: z.string().optional(),
|
admdstCd: z.string().nullish(),
|
||||||
envoSeComCd: z.string().optional(),
|
envoSeComCd: z.string().nullish(),
|
||||||
taskSeComCd: z.string().optional(),
|
taskSeComCd: z.string().nullish(),
|
||||||
bizNm: z.string().optional(),
|
bizNm: z.string().nullish(),
|
||||||
bizBgngYr: z.string().optional(),
|
bizBgngYr: z.string().nullish(),
|
||||||
bizEndYr: z.string().optional(),
|
bizEndYr: z.string().nullish(),
|
||||||
bizCn: z.string().optional(),
|
bizCn: z.string().nullish(),
|
||||||
aplcntNm: z.string().optional(),
|
aplcntNm: z.string().nullish(),
|
||||||
aplcntMblTelno: z.string().optional(),
|
aplcntMblTelno: z.string().nullish(),
|
||||||
aplcntOgdpNm: z.string().optional(),
|
aplcntOgdpNm: z.string().nullish(),
|
||||||
aplcntEmlAddr: z.string().optional(),
|
aplcntEmlAddr: z.string().nullish(),
|
||||||
dsgnrNm: z.string().optional(),
|
dsgnrNm: z.string().nullish(),
|
||||||
dsgnrTelno: z.string().optional(),
|
dsgnrTelno: z.string().nullish(),
|
||||||
dsgnrOgdpNm: z.string().optional(),
|
dsgnrOgdpNm: z.string().nullish(),
|
||||||
dsgnrEmlAddr: z.string().optional(),
|
dsgnrEmlAddr: z.string().nullish(),
|
||||||
atchFileGroupId: z.string().optional(),
|
atchFileGroupId: z.string().nullish(),
|
||||||
prgrsSttsComCd: z.string().optional(),
|
prgrsSttsComCd: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 DesignCnstnApplySaveRequestDto.BzScaleItem */
|
/** 백엔드 DesignCnstnApplySaveRequestDto.BzScaleItem */
|
||||||
export const designCnstnBzScaleItemSchema = z.object({
|
export const designCnstnBzScaleItemSchema = z.object({
|
||||||
cnstpSeCd: z.string().optional(),
|
cnstpSeCd: z.string().nullish(),
|
||||||
bscPl: z.number().optional(),
|
bscPl: z.number().nullish(),
|
||||||
budgetReflct: z.number().optional(),
|
budgetReflct: z.number().nullish(),
|
||||||
thtiDsgn: z.number().optional(),
|
thtiDsgn: z.number().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 DesignCnstnApplySaveRequestDto.BizCstItem */
|
/** 백엔드 DesignCnstnApplySaveRequestDto.BizCstItem */
|
||||||
export const designCnstnBizCstItemSchema = z.object({
|
export const designCnstnBizCstItemSchema = z.object({
|
||||||
acntgSeCd: z.string().optional(),
|
acntgSeCd: z.string().nullish(),
|
||||||
bscPlanAmt: z.number().optional(),
|
bscPlanAmt: z.number().nullish(),
|
||||||
bgtRfltAmt: z.number().optional(),
|
bgtRfltAmt: z.number().nullish(),
|
||||||
tstmDesignAmt: z.number().optional(),
|
tstmDesignAmt: z.number().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 DesignCnstnApplySaveRequestDto.EsntlAtchFileItem */
|
/** 백엔드 DesignCnstnApplySaveRequestDto.EsntlAtchFileItem */
|
||||||
export const designCnstnEsntlAtchFileItemSchema = z.object({
|
export const designCnstnEsntlAtchFileItemSchema = z.object({
|
||||||
esntlAtchFileId: z.string().optional(),
|
esntlAtchFileId: z.string().nullish(),
|
||||||
atchFileGroupId: z.string().optional(),
|
atchFileGroupId: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 DesignCnstnRvwOpnnSaveRequestDto */
|
/** 백엔드 DesignCnstnRvwOpnnSaveRequestDto */
|
||||||
export const designCnstnRvwOpnnSaveSchema = z.object({
|
export const designCnstnRvwOpnnSaveSchema = z.object({
|
||||||
designCnstnDocNo: z.string(),
|
designCnstnDocNo: z.string(),
|
||||||
rvwOpnnSn: z.number().optional(),
|
rvwOpnnSn: z.number().nullish(),
|
||||||
opnrSeComCd: z.string().optional(),
|
opnrSeComCd: z.string().nullish(),
|
||||||
opnrNm: z.string().optional(),
|
opnrNm: z.string().nullish(),
|
||||||
rvwRsltCn: z.string().optional(),
|
rvwRsltCn: z.string().nullish(),
|
||||||
rvwRsltAnmlyYn: z.string().optional(),
|
rvwRsltAnmlyYn: z.string().nullish(),
|
||||||
atchFileGroupId: z.string().optional(),
|
atchFileGroupId: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 DesignCnstnApplySaveRequestDto */
|
/** 백엔드 DesignCnstnApplySaveRequestDto */
|
||||||
export const designCnstnApplySaveSchema = z.object({
|
export const designCnstnApplySaveSchema = z.object({
|
||||||
techReViewSaveCd: z.string().optional(),
|
techReViewSaveCd: z.string().nullish(),
|
||||||
rvwStpCd: z.string().optional(),
|
rvwStpCd: z.string().nullish(),
|
||||||
designCnstnMng: designCnstnMngSaveSchema,
|
designCnstnMng: designCnstnMngSaveSchema,
|
||||||
bzScaleList: z.array(designCnstnBzScaleItemSchema).optional(),
|
bzScaleList: z.array(designCnstnBzScaleItemSchema).nullish(),
|
||||||
bizCstList: z.array(designCnstnBizCstItemSchema).optional(),
|
bizCstList: z.array(designCnstnBizCstItemSchema).nullish(),
|
||||||
esntlAtchFileList: z.array(designCnstnEsntlAtchFileItemSchema).optional(),
|
esntlAtchFileList: z.array(designCnstnEsntlAtchFileItemSchema).nullish(),
|
||||||
rvwOpnnList: z.array(designCnstnRvwOpnnSaveSchema).optional(),
|
rvwOpnnList: z.array(designCnstnRvwOpnnSaveSchema).nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type DesignCnstnMngSaveRequestDto = z.infer<typeof designCnstnMngSaveSchema>;
|
export type DesignCnstnMngSaveRequestDto = z.infer<typeof designCnstnMngSaveSchema>;
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ export {
|
|||||||
validateAllRowsForSave,
|
validateAllRowsForSave,
|
||||||
validateAplnRow,
|
validateAplnRow,
|
||||||
validateAtrzOrder,
|
validateAtrzOrder,
|
||||||
|
validateUniqueAtrzAprvr,
|
||||||
validateUniqueSeqNo,
|
validateUniqueSeqNo,
|
||||||
} from "./lib/apln-validators";
|
} from "./lib/apln-validators";
|
||||||
export {
|
export {
|
||||||
|
|||||||
@@ -76,3 +76,16 @@ export function validateUniqueSeqNo(rows: ElaprAplnRow[]): string | null {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function validateUniqueAtrzAprvr(rows: ElaprAplnRow[]): string | null {
|
||||||
|
const pairSet = new Set<string>();
|
||||||
|
for (const row of getVisibleRows(rows)) {
|
||||||
|
const atrz = row.atrzSeComCd?.trim();
|
||||||
|
const aprvr = row.aprvrUuid?.trim();
|
||||||
|
if (!atrz || !aprvr) continue;
|
||||||
|
const key = `${atrz}::${aprvr}`;
|
||||||
|
if (pairSet.has(key)) return "동일한 결재구분과 결재자가 중복됩니다.";
|
||||||
|
pairSet.add(key);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ export interface ElaprDmndSaveRequestDto {
|
|||||||
elaprDocNo: string;
|
elaprDocNo: string;
|
||||||
dmndTtl: string;
|
dmndTtl: string;
|
||||||
dmndCn: string;
|
dmndCn: string;
|
||||||
elaprCycl?: number;
|
elaprCycl?: number | null;
|
||||||
docPrgrsSttsComCd?: string;
|
docPrgrsSttsComCd?: string | null;
|
||||||
elaprPrgrsSttsList?: ElaprPrgrsSttsSaveRequestDto[];
|
elaprPrgrsSttsList?: ElaprPrgrsSttsSaveRequestDto[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {
|
|||||||
} from "@common/components";
|
} from "@common/components";
|
||||||
|
|
||||||
import { useElaprAplnPage } from "../api/queries";
|
import { useElaprAplnPage } from "../api/queries";
|
||||||
import { validateAplnRow } from "../lib/apln-validators";
|
import { validateAplnRow, validateUniqueAtrzAprvr } from "../lib/apln-validators";
|
||||||
import { useAplnRows } from "../lib/use-apln-rows";
|
import { useAplnRows } from "../lib/use-apln-rows";
|
||||||
import { useDndSensors } from "../lib/use-dnd-sensors";
|
import { useDndSensors } from "../lib/use-dnd-sensors";
|
||||||
import type { ElaprApln } from "../model/elapr-apln-interface";
|
import type { ElaprApln } from "../model/elapr-apln-interface";
|
||||||
@@ -110,6 +110,12 @@ function ElaprAplnPickerGrid({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const duplicateError = validateUniqueAtrzAprvr(rows);
|
||||||
|
if (duplicateError) {
|
||||||
|
alert(duplicateError);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
commitEdit(row.rowKey);
|
commitEdit(row.rowKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import {
|
|||||||
getVisibleRows,
|
getVisibleRows,
|
||||||
validateAllRowsForSave,
|
validateAllRowsForSave,
|
||||||
validateAtrzOrder,
|
validateAtrzOrder,
|
||||||
|
validateUniqueAtrzAprvr,
|
||||||
validateUniqueSeqNo,
|
validateUniqueSeqNo,
|
||||||
} from "../lib/apln-validators";
|
} from "../lib/apln-validators";
|
||||||
import { mapDocPrgrsToAplnRows } from "../lib/doc-prgrs-to-apln-rows";
|
import { mapDocPrgrsToAplnRows } from "../lib/doc-prgrs-to-apln-rows";
|
||||||
@@ -90,6 +91,12 @@ function ElaprDocPrgrsPickerDialog({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const atrzAprvrError = validateUniqueAtrzAprvr(aplnRows);
|
||||||
|
if (atrzAprvrError) {
|
||||||
|
alert(atrzAprvrError);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const visibleRows = getVisibleRows(aplnRows);
|
const visibleRows = getVisibleRows(aplnRows);
|
||||||
onConfirm?.({ aplnRows: visibleRows });
|
onConfirm?.({ aplnRows: visibleRows });
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import {
|
|||||||
getVisibleRows,
|
getVisibleRows,
|
||||||
validateAllRowsForSave,
|
validateAllRowsForSave,
|
||||||
validateAtrzOrder,
|
validateAtrzOrder,
|
||||||
|
validateUniqueAtrzAprvr,
|
||||||
validateUniqueSeqNo,
|
validateUniqueSeqNo,
|
||||||
} from "../lib/apln-validators";
|
} from "../lib/apln-validators";
|
||||||
import type { ElaprAplnRow } from "../model/elapr-apln-row-types";
|
import type { ElaprAplnRow } from "../model/elapr-apln-row-types";
|
||||||
@@ -106,6 +107,12 @@ function ElaprTmpltPickerDialog({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const atrzAprvrError = validateUniqueAtrzAprvr(aplnRows);
|
||||||
|
if (atrzAprvrError) {
|
||||||
|
alert(atrzAprvrError);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const visibleRows = getVisibleRows(aplnRows);
|
const visibleRows = getVisibleRows(aplnRows);
|
||||||
|
|
||||||
const payload: ElaprTmpltPickerConfirmPayload = {
|
const payload: ElaprTmpltPickerConfirmPayload = {
|
||||||
|
|||||||
@@ -2,52 +2,52 @@ import { z } from "zod";
|
|||||||
|
|
||||||
/** 백엔드 FnrsCnsltnMngSaveRequestDto */
|
/** 백엔드 FnrsCnsltnMngSaveRequestDto */
|
||||||
export const fnrsCnsltnMngSaveSchema = z.object({
|
export const fnrsCnsltnMngSaveSchema = z.object({
|
||||||
fnrsCnsltnDocNo: z.string().optional(),
|
fnrsCnsltnDocNo: z.string().nullish(),
|
||||||
admdstCd: z.string().optional(),
|
admdstCd: z.string().nullish(),
|
||||||
envoSeComCd: z.string().optional(),
|
envoSeComCd: z.string().nullish(),
|
||||||
taskSeComCd: z.string().optional(),
|
taskSeComCd: z.string().nullish(),
|
||||||
cfmtnBgtBizNo: z.string().optional(),
|
cfmtnBgtBizNo: z.string().nullish(),
|
||||||
bgtAplyYr: z.string().optional(),
|
bgtAplyYr: z.string().nullish(),
|
||||||
bizNm: z.string().optional(),
|
bizNm: z.string().nullish(),
|
||||||
bizBgngYr: z.string().optional(),
|
bizBgngYr: z.string().nullish(),
|
||||||
bizEndYr: z.string().optional(),
|
bizEndYr: z.string().nullish(),
|
||||||
bizCn: z.string().optional(),
|
bizCn: z.string().nullish(),
|
||||||
aplcntNm: z.string().optional(),
|
aplcntNm: z.string().nullish(),
|
||||||
aplcntMblTelno: z.string().optional(),
|
aplcntMblTelno: z.string().nullish(),
|
||||||
aplcntOgdpNm: z.string().optional(),
|
aplcntOgdpNm: z.string().nullish(),
|
||||||
aplcntEmlAddr: z.string().optional(),
|
aplcntEmlAddr: z.string().nullish(),
|
||||||
dsgnrNm: z.string().optional(),
|
dsgnrNm: z.string().nullish(),
|
||||||
dsgnrTelno: z.string().optional(),
|
dsgnrTelno: z.string().nullish(),
|
||||||
dsgnrOgdpNm: z.string().optional(),
|
dsgnrOgdpNm: z.string().nullish(),
|
||||||
dsgnrEmlAddr: z.string().optional(),
|
dsgnrEmlAddr: z.string().nullish(),
|
||||||
atchFileGroupId: z.string().optional(),
|
atchFileGroupId: z.string().nullish(),
|
||||||
sharAtchFileGroupId: z.string().optional(),
|
sharAtchFileGroupId: z.string().nullish(),
|
||||||
prgrsSttsComCd: z.string().optional(),
|
prgrsSttsComCd: z.string().nullish(),
|
||||||
rtlztnFcltSeComCd: z.string().optional(),
|
rtlztnFcltSeComCd: z.string().nullish(),
|
||||||
rtlztnUsgSeComCd: z.string().optional(),
|
rtlztnUsgSeComCd: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 FnrsCnsltnApplySaveRequestDto.BzScaleItem */
|
/** 백엔드 FnrsCnsltnApplySaveRequestDto.BzScaleItem */
|
||||||
export const fnrsCnsltnBzScaleItemSchema = z.object({
|
export const fnrsCnsltnBzScaleItemSchema = z.object({
|
||||||
cnstpSeCd: z.string().optional(),
|
cnstpSeCd: z.string().nullish(),
|
||||||
bscPl: z.number().optional(),
|
bscPl: z.number().nullish(),
|
||||||
budgetReflct: z.number().optional(),
|
budgetReflct: z.number().nullish(),
|
||||||
thtiDsgn: z.number().optional(),
|
thtiDsgn: z.number().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 FnrsCnsltnApplySaveRequestDto.BizCstItem */
|
/** 백엔드 FnrsCnsltnApplySaveRequestDto.BizCstItem */
|
||||||
export const fnrsCnsltnBizCstItemSchema = z.object({
|
export const fnrsCnsltnBizCstItemSchema = z.object({
|
||||||
acntgSeCd: z.string().optional(),
|
acntgSeCd: z.string().nullish(),
|
||||||
bscPlanAmt: z.number().optional(),
|
bscPlanAmt: z.number().nullish(),
|
||||||
bgtRfltAmt: z.number().optional(),
|
bgtRfltAmt: z.number().nullish(),
|
||||||
tstmDesignAmt: z.number().optional(),
|
tstmDesignAmt: z.number().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 FnrsCnsltnApplySaveRequestDto.CklstResultItem */
|
/** 백엔드 FnrsCnsltnApplySaveRequestDto.CklstResultItem */
|
||||||
export const fnrsCnsltnCklstResultItemSchema = z.object({
|
export const fnrsCnsltnCklstResultItemSchema = z.object({
|
||||||
cklstRvwSn: z.number().optional(),
|
cklstRvwSn: z.number().nullish(),
|
||||||
cklstArtclSn: z.number().optional(),
|
cklstArtclSn: z.number().nullish(),
|
||||||
cklstSn: z.number().optional(),
|
cklstSn: z.number().nullish(),
|
||||||
rvwStpComCd: z.string().nullish(),
|
rvwStpComCd: z.string().nullish(),
|
||||||
selected: z.enum(["Y", "N"]).nullish(),
|
selected: z.enum(["Y", "N"]).nullish(),
|
||||||
picRvwCn: z.string().nullish(),
|
picRvwCn: z.string().nullish(),
|
||||||
@@ -55,58 +55,58 @@ export const fnrsCnsltnCklstResultItemSchema = z.object({
|
|||||||
|
|
||||||
/** 백엔드 FnrsCnsltnApplySaveRequestDto.EsntlAtchFileItem */
|
/** 백엔드 FnrsCnsltnApplySaveRequestDto.EsntlAtchFileItem */
|
||||||
export const fnrsCnsltnEsntlAtchFileItemSchema = z.object({
|
export const fnrsCnsltnEsntlAtchFileItemSchema = z.object({
|
||||||
esntlAtchFileId: z.string().optional(),
|
esntlAtchFileId: z.string().nullish(),
|
||||||
atchFileGroupId: z.string().optional(),
|
atchFileGroupId: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 FnrsCnsltnApplySaveRequestDto.FnrsCnsltnSplmntDmndItem */
|
/** 백엔드 FnrsCnsltnApplySaveRequestDto.FnrsCnsltnSplmntDmndItem */
|
||||||
export const fnrsCnsltnSplmntDmndItemSchema = z.object({
|
export const fnrsCnsltnSplmntDmndItemSchema = z.object({
|
||||||
splmntDmndSn: z.number().nullish(),
|
splmntDmndSn: z.number().nullish(),
|
||||||
splmntArtclComCd: z.string().nullish(),
|
splmntArtclComCd: z.string().nullish(),
|
||||||
splmntDmndCn: z.string().optional(),
|
splmntDmndCn: z.string().nullish(),
|
||||||
splmntDmndDt: z.string().optional(),
|
splmntDmndDt: z.string().nullish(),
|
||||||
splmntDmndAtchFileGroupId: z.string().optional(),
|
splmntDmndAtchFileGroupId: z.string().nullish(),
|
||||||
splmntCn: z.string().optional(),
|
splmntCn: z.string().nullish(),
|
||||||
splmntPicNm: z.string().optional(),
|
splmntPicNm: z.string().nullish(),
|
||||||
splmntCmptnDt: z.string().optional(),
|
splmntCmptnDt: z.string().nullish(),
|
||||||
splmntAtchFileGroupId: z.string().optional(),
|
splmntAtchFileGroupId: z.string().nullish(),
|
||||||
cmptnYn: z.string().optional(),
|
cmptnYn: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 FnrsCnsltnRvwOpnnSaveRequestDto */
|
/** 백엔드 FnrsCnsltnRvwOpnnSaveRequestDto */
|
||||||
export const fnrsCnsltnRvwOpnnSaveSchema = z.object({
|
export const fnrsCnsltnRvwOpnnSaveSchema = z.object({
|
||||||
fnrsCnsltnDocNo: z.string(),
|
fnrsCnsltnDocNo: z.string(),
|
||||||
rvwOpnnSn: z.number().optional(),
|
rvwOpnnSn: z.number().nullish(),
|
||||||
opnrSeComCd: z.string().optional(),
|
opnrSeComCd: z.string().nullish(),
|
||||||
opnrNm: z.string().optional(),
|
opnrNm: z.string().nullish(),
|
||||||
rvwRsltCn: z.string().optional(),
|
rvwRsltCn: z.string().nullish(),
|
||||||
rvwRsltAnmlyYn: z.string().optional(),
|
rvwRsltAnmlyYn: z.string().nullish(),
|
||||||
atchFileGroupId: z.string().optional(),
|
atchFileGroupId: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 FnrsCnsltnApplySaveRequestDto.FnrsSharItem */
|
/** 백엔드 FnrsCnsltnApplySaveRequestDto.FnrsSharItem */
|
||||||
export const fnrsSharItemSchema = z.object({
|
export const fnrsSharItemSchema = z.object({
|
||||||
fnrsSharSeCd: z.string().optional(),
|
fnrsSharSeCd: z.string().nullish(),
|
||||||
exstnAmt: z.number().optional(),
|
exstnAmt: z.number().nullish(),
|
||||||
chgRqtAmt: z.number().optional(),
|
chgRqtAmt: z.number().nullish(),
|
||||||
ajmtAmt: z.number().optional(),
|
ajmtAmt: z.number().nullish(),
|
||||||
rmrkCn: z.string().optional(),
|
rmrkCn: z.string().nullish(),
|
||||||
envoRmrkCn: z.string().optional(),
|
envoRmrkCn: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 FnrsCnsltnApplySaveRequestDto */
|
/** 백엔드 FnrsCnsltnApplySaveRequestDto */
|
||||||
export const fnrsCnsltnApplySaveSchema = z.object({
|
export const fnrsCnsltnApplySaveSchema = z.object({
|
||||||
techReViewSaveCd: z.string().optional(),
|
techReViewSaveCd: z.string().nullish(),
|
||||||
rvwStpCd: z.string().optional(),
|
rvwStpCd: z.string().nullish(),
|
||||||
fnrsCnsltnMng: fnrsCnsltnMngSaveSchema,
|
fnrsCnsltnMng: fnrsCnsltnMngSaveSchema,
|
||||||
bzScaleList: z.array(fnrsCnsltnBzScaleItemSchema).optional(),
|
bzScaleList: z.array(fnrsCnsltnBzScaleItemSchema).nullish(),
|
||||||
bizCstList: z.array(fnrsCnsltnBizCstItemSchema).optional(),
|
bizCstList: z.array(fnrsCnsltnBizCstItemSchema).nullish(),
|
||||||
cklstResultList: z.array(fnrsCnsltnCklstResultItemSchema).optional(),
|
cklstResultList: z.array(fnrsCnsltnCklstResultItemSchema).nullish(),
|
||||||
cklstResultMap: z.record(z.array(fnrsCnsltnCklstResultItemSchema)).optional(),
|
cklstResultMap: z.record(z.array(fnrsCnsltnCklstResultItemSchema)).nullish(),
|
||||||
esntlAtchFileList: z.array(fnrsCnsltnEsntlAtchFileItemSchema).optional(),
|
esntlAtchFileList: z.array(fnrsCnsltnEsntlAtchFileItemSchema).nullish(),
|
||||||
rvwOpnnList: z.array(fnrsCnsltnRvwOpnnSaveSchema).optional(),
|
rvwOpnnList: z.array(fnrsCnsltnRvwOpnnSaveSchema).nullish(),
|
||||||
splmntDmndList: z.array(fnrsCnsltnSplmntDmndItemSchema).optional(),
|
splmntDmndList: z.array(fnrsCnsltnSplmntDmndItemSchema).nullish(),
|
||||||
fnrsSharList: z.array(fnrsSharItemSchema).optional(),
|
fnrsSharList: z.array(fnrsSharItemSchema).nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type FnrsCnsltnMngSaveRequestDto = z.infer<typeof fnrsCnsltnMngSaveSchema>;
|
export type FnrsCnsltnMngSaveRequestDto = z.infer<typeof fnrsCnsltnMngSaveSchema>;
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import { z } from "zod";
|
|||||||
|
|
||||||
/** 백엔드 FnrsExamineRequestDto */
|
/** 백엔드 FnrsExamineRequestDto */
|
||||||
export const fnrsExamineRequestSchema = z.object({
|
export const fnrsExamineRequestSchema = z.object({
|
||||||
prgrsSttsComCd: z.string().optional(),
|
prgrsSttsComCd: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 EnvoActnReviewReqDto */
|
/** 백엔드 EnvoActnReviewReqDto */
|
||||||
export const envoActnReviewReqSchema = z.object({
|
export const envoActnReviewReqSchema = z.object({
|
||||||
specialRqstCn: z.string().optional(),
|
specialRqstCn: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type FnrsExamineRequestDto = z.infer<typeof fnrsExamineRequestSchema>;
|
export type FnrsExamineRequestDto = z.infer<typeof fnrsExamineRequestSchema>;
|
||||||
|
|||||||
@@ -2,52 +2,52 @@ import { z } from "zod";
|
|||||||
|
|
||||||
/** 백엔드 InstlSncnMngSaveRequestDto */
|
/** 백엔드 InstlSncnMngSaveRequestDto */
|
||||||
export const instlSncnMngSaveSchema = z.object({
|
export const instlSncnMngSaveSchema = z.object({
|
||||||
instlSncnDocNo: z.string().optional(),
|
instlSncnDocNo: z.string().nullish(),
|
||||||
admdstCd: z.string().optional(),
|
admdstCd: z.string().nullish(),
|
||||||
envoSeComCd: z.string().optional(),
|
envoSeComCd: z.string().nullish(),
|
||||||
sncnSeComCd: z.string().optional(),
|
sncnSeComCd: z.string().nullish(),
|
||||||
taskSeComCd: z.string().optional(),
|
taskSeComCd: z.string().nullish(),
|
||||||
bgtBizCd: z.string().optional(),
|
bgtBizCd: z.string().nullish(),
|
||||||
bgtAplyYr: z.string().optional(),
|
bgtAplyYr: z.string().nullish(),
|
||||||
bizNm: z.string().optional(),
|
bizNm: z.string().nullish(),
|
||||||
bizBgngYr: z.string().optional(),
|
bizBgngYr: z.string().nullish(),
|
||||||
bizEndYr: z.string().optional(),
|
bizEndYr: z.string().nullish(),
|
||||||
bizCn: z.string().optional(),
|
bizCn: z.string().nullish(),
|
||||||
aplcntNm: z.string().optional(),
|
aplcntNm: z.string().nullish(),
|
||||||
aplcntMblTelno: z.string().optional(),
|
aplcntMblTelno: z.string().nullish(),
|
||||||
aplcntOgdpNm: z.string().optional(),
|
aplcntOgdpNm: z.string().nullish(),
|
||||||
aplcntEmlAddr: z.string().optional(),
|
aplcntEmlAddr: z.string().nullish(),
|
||||||
dsgnrNm: z.string().optional(),
|
dsgnrNm: z.string().nullish(),
|
||||||
dsgnrTelno: z.string().optional(),
|
dsgnrTelno: z.string().nullish(),
|
||||||
dsgnrOgdpNm: z.string().optional(),
|
dsgnrOgdpNm: z.string().nullish(),
|
||||||
dsgnrEmlAddr: z.string().optional(),
|
dsgnrEmlAddr: z.string().nullish(),
|
||||||
atchFileGroupId: z.string().optional(),
|
atchFileGroupId: z.string().nullish(),
|
||||||
prgrsSttsComCd: z.string().optional(),
|
prgrsSttsComCd: z.string().nullish(),
|
||||||
rtlztnFcltSeComCd: z.string().optional(),
|
rtlztnFcltSeComCd: z.string().nullish(),
|
||||||
rtlztnUsgSeComCd: z.string().optional(),
|
rtlztnUsgSeComCd: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 InstlSncnApplySaveRequestDto.BzScaleItem (diff는 API 미전송) */
|
/** 백엔드 InstlSncnApplySaveRequestDto.BzScaleItem (diff는 API 미전송) */
|
||||||
export const instlSncnBzScaleItemSchema = z.object({
|
export const instlSncnBzScaleItemSchema = z.object({
|
||||||
cnstpSeCd: z.string().optional(),
|
cnstpSeCd: z.string().nullish(),
|
||||||
bscPl: z.number().optional(),
|
bscPl: z.number().nullish(),
|
||||||
budgetReflct: z.number().optional(),
|
budgetReflct: z.number().nullish(),
|
||||||
thtiDsgn: z.number().optional(),
|
thtiDsgn: z.number().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 InstlSncnApplySaveRequestDto.BizCstItem */
|
/** 백엔드 InstlSncnApplySaveRequestDto.BizCstItem */
|
||||||
export const instlSncnBizCstItemSchema = z.object({
|
export const instlSncnBizCstItemSchema = z.object({
|
||||||
acntgSeCd: z.string().optional(),
|
acntgSeCd: z.string().nullish(),
|
||||||
bscPlanAmt: z.number().optional(),
|
bscPlanAmt: z.number().nullish(),
|
||||||
bgtRfltAmt: z.number().optional(),
|
bgtRfltAmt: z.number().nullish(),
|
||||||
tstmDesignAmt: z.number().optional(),
|
tstmDesignAmt: z.number().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 InstlSncnApplySaveRequestDto.CklstResultItem */
|
/** 백엔드 InstlSncnApplySaveRequestDto.CklstResultItem */
|
||||||
export const instlSncnCklstResultItemSchema = z.object({
|
export const instlSncnCklstResultItemSchema = z.object({
|
||||||
cklstRvwSn: z.number().optional(),
|
cklstRvwSn: z.number().nullish(),
|
||||||
cklstArtclSn: z.number().optional(),
|
cklstArtclSn: z.number().nullish(),
|
||||||
cklstSn: z.number().optional(),
|
cklstSn: z.number().nullish(),
|
||||||
rvwStpComCd: z.string().nullish(),
|
rvwStpComCd: z.string().nullish(),
|
||||||
selected: z.enum(["Y", "N"]).nullish(),
|
selected: z.enum(["Y", "N"]).nullish(),
|
||||||
picRvwCn: z.string().nullish(),
|
picRvwCn: z.string().nullish(),
|
||||||
@@ -55,47 +55,47 @@ export const instlSncnCklstResultItemSchema = z.object({
|
|||||||
|
|
||||||
/** 백엔드 InstlSncnApplySaveRequestDto.EsntlAtchFileItem */
|
/** 백엔드 InstlSncnApplySaveRequestDto.EsntlAtchFileItem */
|
||||||
export const instlSncnEsntlAtchFileItemSchema = z.object({
|
export const instlSncnEsntlAtchFileItemSchema = z.object({
|
||||||
esntlAtchFileId: z.string().optional(),
|
esntlAtchFileId: z.string().nullish(),
|
||||||
atchFileGroupId: z.string().optional(),
|
atchFileGroupId: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 InstlSncnRvwOpnnSaveRequestDto */
|
/** 백엔드 InstlSncnRvwOpnnSaveRequestDto */
|
||||||
export const instlSncnRvwOpnnSaveSchema = z.object({
|
export const instlSncnRvwOpnnSaveSchema = z.object({
|
||||||
instlSncnDocNo: z.string(),
|
instlSncnDocNo: z.string(),
|
||||||
rvwOpnnSn: z.number().optional(),
|
rvwOpnnSn: z.number().nullish(),
|
||||||
opnrSeComCd: z.string().optional(),
|
opnrSeComCd: z.string().nullish(),
|
||||||
opnrNm: z.string().optional(),
|
opnrNm: z.string().nullish(),
|
||||||
rvwRsltCn: z.string().optional(),
|
rvwRsltCn: z.string().nullish(),
|
||||||
rvwRsltAnmlyYn: z.string().optional(),
|
rvwRsltAnmlyYn: z.string().nullish(),
|
||||||
atchFileGroupId: z.string().optional(),
|
atchFileGroupId: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 InstlSncnApplySaveRequestDto.InstlSncnSplmntDmndItem */
|
/** 백엔드 InstlSncnApplySaveRequestDto.InstlSncnSplmntDmndItem */
|
||||||
export const instlSncnSplmntDmndItemSchema = z.object({
|
export const instlSncnSplmntDmndItemSchema = z.object({
|
||||||
splmntDmndSn: z.number().nullish(),
|
splmntDmndSn: z.number().nullish(),
|
||||||
splmntArtclComCd: z.string().nullish(),
|
splmntArtclComCd: z.string().nullish(),
|
||||||
splmntDmndCn: z.string().optional(),
|
splmntDmndCn: z.string().nullish(),
|
||||||
splmntDmndDt: z.string().optional(),
|
splmntDmndDt: z.string().nullish(),
|
||||||
splmntDmndAtchFileGroupId: z.string().optional(),
|
splmntDmndAtchFileGroupId: z.string().nullish(),
|
||||||
splmntCn: z.string().optional(),
|
splmntCn: z.string().nullish(),
|
||||||
splmntPicNm: z.string().optional(),
|
splmntPicNm: z.string().nullish(),
|
||||||
splmntCmptnDt: z.string().optional(),
|
splmntCmptnDt: z.string().nullish(),
|
||||||
splmntAtchFileGroupId: z.string().optional(),
|
splmntAtchFileGroupId: z.string().nullish(),
|
||||||
cmptnYn: z.string().optional(),
|
cmptnYn: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 InstlSncnApplySaveRequestDto */
|
/** 백엔드 InstlSncnApplySaveRequestDto */
|
||||||
export const instlSncnApplySaveSchema = z.object({
|
export const instlSncnApplySaveSchema = z.object({
|
||||||
techReViewSaveCd: z.string().optional(),
|
techReViewSaveCd: z.string().nullish(),
|
||||||
rvwStpCd: z.string().optional(),
|
rvwStpCd: z.string().nullish(),
|
||||||
instlSncnMng: instlSncnMngSaveSchema,
|
instlSncnMng: instlSncnMngSaveSchema,
|
||||||
bzScaleList: z.array(instlSncnBzScaleItemSchema).optional(),
|
bzScaleList: z.array(instlSncnBzScaleItemSchema).nullish(),
|
||||||
bizCstList: z.array(instlSncnBizCstItemSchema).optional(),
|
bizCstList: z.array(instlSncnBizCstItemSchema).nullish(),
|
||||||
cklstResultList: z.array(instlSncnCklstResultItemSchema).optional(),
|
cklstResultList: z.array(instlSncnCklstResultItemSchema).nullish(),
|
||||||
cklstResultMap: z.record(z.array(instlSncnCklstResultItemSchema)).optional(),
|
cklstResultMap: z.record(z.array(instlSncnCklstResultItemSchema)).nullish(),
|
||||||
esntlAtchFileList: z.array(instlSncnEsntlAtchFileItemSchema).optional(),
|
esntlAtchFileList: z.array(instlSncnEsntlAtchFileItemSchema).nullish(),
|
||||||
rvwOpnnList: z.array(instlSncnRvwOpnnSaveSchema).optional(),
|
rvwOpnnList: z.array(instlSncnRvwOpnnSaveSchema).nullish(),
|
||||||
splmntDmndList: z.array(instlSncnSplmntDmndItemSchema).optional(),
|
splmntDmndList: z.array(instlSncnSplmntDmndItemSchema).nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type InstlSncnMngSaveRequestDto = z.infer<typeof instlSncnMngSaveSchema>;
|
export type InstlSncnMngSaveRequestDto = z.infer<typeof instlSncnMngSaveSchema>;
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ import { z } from "zod";
|
|||||||
export const pwrkCnsltnDocCrtRsltSaveRequestSchema = z.object({
|
export const pwrkCnsltnDocCrtRsltSaveRequestSchema = z.object({
|
||||||
crtDmndUuid: z.string().uuid(),
|
crtDmndUuid: z.string().uuid(),
|
||||||
pwrkCnsltnDocNo: z.string().min(1).max(100),
|
pwrkCnsltnDocNo: z.string().min(1).max(100),
|
||||||
atchFileGroupId: z.string().max(30).optional(),
|
atchFileGroupId: z.string().max(30).nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type PwrkCnsltnDocCrtRsltSaveRequestDto = z.infer<
|
export type PwrkCnsltnDocCrtRsltSaveRequestDto = z.infer<
|
||||||
|
|||||||
+4
-4
@@ -3,10 +3,10 @@ import { z } from "zod";
|
|||||||
/** 백엔드 PwrkCnsltnDocEvlSaveRequestDto */
|
/** 백엔드 PwrkCnsltnDocEvlSaveRequestDto */
|
||||||
export const pwrkCnsltnDocEvlSaveRequestSchema = z.object({
|
export const pwrkCnsltnDocEvlSaveRequestSchema = z.object({
|
||||||
pwrkCnsltnDocNo: z.string().min(1),
|
pwrkCnsltnDocNo: z.string().min(1),
|
||||||
pwrkCnsltnDocEvlUuid: z.string().uuid().optional(),
|
pwrkCnsltnDocEvlUuid: z.string().uuid().nullish(),
|
||||||
pwrkCnsltnDocEvlCn: z.string().max(2000).optional(),
|
pwrkCnsltnDocEvlCn: z.string().max(2000).nullish(),
|
||||||
pwrkCnsltnDocEvlScr: z.number().optional(),
|
pwrkCnsltnDocEvlScr: z.number().nullish(),
|
||||||
pwrkCnsltnDocEvlDt: z.string().optional(),
|
pwrkCnsltnDocEvlDt: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type PwrkCnsltnDocEvlSaveRequestDto = z.infer<typeof pwrkCnsltnDocEvlSaveRequestSchema>;
|
export type PwrkCnsltnDocEvlSaveRequestDto = z.infer<typeof pwrkCnsltnDocEvlSaveRequestSchema>;
|
||||||
|
|||||||
@@ -3,18 +3,18 @@ import { z } from "zod";
|
|||||||
/** 백엔드 PwrkActnResultSubmitDto.ActnItemDto */
|
/** 백엔드 PwrkActnResultSubmitDto.ActnItemDto */
|
||||||
export const pwrkActnResultActnItemSchema = z.object({
|
export const pwrkActnResultActnItemSchema = z.object({
|
||||||
rvwOpnnSn: z.number(),
|
rvwOpnnSn: z.number(),
|
||||||
actnRsltCn: z.string().optional(),
|
actnRsltCn: z.string().nullish(),
|
||||||
rfltYn: z.string().optional(),
|
rfltYn: z.string().nullish(),
|
||||||
atchFileGroupId: z.string().optional(),
|
atchFileGroupId: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 PwrkActnResultSubmitDto */
|
/** 백엔드 PwrkActnResultSubmitDto */
|
||||||
export const pwrkActnResultSubmitSchema = z.object({
|
export const pwrkActnResultSubmitSchema = z.object({
|
||||||
isSubmit: z.boolean(),
|
isSubmit: z.boolean(),
|
||||||
actnList: z.array(pwrkActnResultActnItemSchema).optional(),
|
actnList: z.array(pwrkActnResultActnItemSchema).nullish(),
|
||||||
totActnSummary: z.string().optional(),
|
totActnSummary: z.string().nullish(),
|
||||||
muniDocNo: z.string().optional(),
|
muniDocNo: z.string().nullish(),
|
||||||
pwrkAtchFileGroupId: z.string().optional(),
|
pwrkAtchFileGroupId: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type PwrkActnResultSubmitDto = z.infer<typeof pwrkActnResultSubmitSchema>;
|
export type PwrkActnResultSubmitDto = z.infer<typeof pwrkActnResultSubmitSchema>;
|
||||||
|
|||||||
@@ -2,50 +2,50 @@ import { z } from "zod";
|
|||||||
|
|
||||||
/** 백엔드 SewerBscPlanSaveRequestDto */
|
/** 백엔드 SewerBscPlanSaveRequestDto */
|
||||||
export const sewerBscPlanSaveSchema = z.object({
|
export const sewerBscPlanSaveSchema = z.object({
|
||||||
sewerBscPlanDocNo: z.string().optional(),
|
sewerBscPlanDocNo: z.string().nullish(),
|
||||||
admdstCd: z.string().optional(),
|
admdstCd: z.string().nullish(),
|
||||||
envoSeComCd: z.string().optional(),
|
envoSeComCd: z.string().nullish(),
|
||||||
sewerBscPlanSeComCd: z.string().optional(),
|
sewerBscPlanSeComCd: z.string().nullish(),
|
||||||
sewerBscPlanNm: z.string().optional(),
|
sewerBscPlanNm: z.string().nullish(),
|
||||||
taskSeComCd: z.string().optional(),
|
taskSeComCd: z.string().nullish(),
|
||||||
prgrsSttsComCd: z.string().optional(),
|
prgrsSttsComCd: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 SewerBscPlanDtlSaveRequestDto */
|
/** 백엔드 SewerBscPlanDtlSaveRequestDto */
|
||||||
export const sewerBscPlanDtlSaveSchema = z.object({
|
export const sewerBscPlanDtlSaveSchema = z.object({
|
||||||
sewerBscPlanDocNo: z.string().optional(),
|
sewerBscPlanDocNo: z.string().nullish(),
|
||||||
chgCycl: z.number().optional(),
|
chgCycl: z.number().nullish(),
|
||||||
aplcntNm: z.string().optional(),
|
aplcntNm: z.string().nullish(),
|
||||||
aplcntMblTelno: z.string().optional(),
|
aplcntMblTelno: z.string().nullish(),
|
||||||
aplcntOgdpNm: z.string().optional(),
|
aplcntOgdpNm: z.string().nullish(),
|
||||||
aplcntEmlAddr: z.string().optional(),
|
aplcntEmlAddr: z.string().nullish(),
|
||||||
dsgnrNm: z.string().optional(),
|
dsgnrNm: z.string().nullish(),
|
||||||
dsgnrTelno: z.string().optional(),
|
dsgnrTelno: z.string().nullish(),
|
||||||
dsgnrOgdpNm: z.string().optional(),
|
dsgnrOgdpNm: z.string().nullish(),
|
||||||
dsgnrEmlAddr: z.string().optional(),
|
dsgnrEmlAddr: z.string().nullish(),
|
||||||
planYr: z.string().optional(),
|
planYr: z.string().nullish(),
|
||||||
crtrYr: z.string().optional(),
|
crtrYr: z.string().nullish(),
|
||||||
bizOtlnCn: z.string().optional(),
|
bizOtlnCn: z.string().nullish(),
|
||||||
frlvlGoalYr: z.string().optional(),
|
frlvlGoalYr: z.string().nullish(),
|
||||||
sclvlGoalYr: z.string().optional(),
|
sclvlGoalYr: z.string().nullish(),
|
||||||
thlvlGoalYr: z.string().optional(),
|
thlvlGoalYr: z.string().nullish(),
|
||||||
folvlGoalYr: z.string().optional(),
|
folvlGoalYr: z.string().nullish(),
|
||||||
atchFileGroupId: z.string().optional(),
|
atchFileGroupId: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanOtlnItem */
|
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanOtlnItem */
|
||||||
export const sewerBscPlanOtlnItemSchema = z.object({
|
export const sewerBscPlanOtlnItemSchema = z.object({
|
||||||
planStpNo: z.number().optional(),
|
planStpNo: z.number().nullish(),
|
||||||
sewerPlanPpltnCnt: z.number().optional(),
|
sewerPlanPpltnCnt: z.number().nullish(),
|
||||||
sewerPrcsPpltnCnt: z.number().optional(),
|
sewerPrcsPpltnCnt: z.number().nullish(),
|
||||||
sewerPsplyRt: z.number().optional(),
|
sewerPsplyRt: z.number().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 SewerBscPlanApplySaveRequestDto.CklstResultItem */
|
/** 백엔드 SewerBscPlanApplySaveRequestDto.CklstResultItem */
|
||||||
export const sewerBscPlanCklstResultItemSchema = z.object({
|
export const sewerBscPlanCklstResultItemSchema = z.object({
|
||||||
cklstRvwSn: z.number().optional(),
|
cklstRvwSn: z.number().nullish(),
|
||||||
cklstArtclSn: z.number().optional(),
|
cklstArtclSn: z.number().nullish(),
|
||||||
cklstSn: z.number().optional(),
|
cklstSn: z.number().nullish(),
|
||||||
rvwStpComCd: z.string(),
|
rvwStpComCd: z.string(),
|
||||||
selected: z.enum(["Y", "N"]).nullish(),
|
selected: z.enum(["Y", "N"]).nullish(),
|
||||||
picRvwCn: z.string().nullish(),
|
picRvwCn: z.string().nullish(),
|
||||||
@@ -53,109 +53,109 @@ export const sewerBscPlanCklstResultItemSchema = z.object({
|
|||||||
|
|
||||||
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanFnrsCstItem */
|
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanFnrsCstItem */
|
||||||
export const sewerBscPlanFnrsCstItemSchema = z.object({
|
export const sewerBscPlanFnrsCstItemSchema = z.object({
|
||||||
planStpNo: z.number().optional(),
|
planStpNo: z.number().nullish(),
|
||||||
gvexpAmt: z.number().optional(),
|
gvexpAmt: z.number().nullish(),
|
||||||
lcexpAmt: z.number().optional(),
|
lcexpAmt: z.number().nullish(),
|
||||||
orgprBdchgAmt: z.number().optional(),
|
orgprBdchgAmt: z.number().nullish(),
|
||||||
etcAmt: z.number().optional(),
|
etcAmt: z.number().nullish(),
|
||||||
sumAmt: z.number().optional(),
|
sumAmt: z.number().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanSplmntDmndItem */
|
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanSplmntDmndItem */
|
||||||
export const sewerBscPlanSplmntDmndItemSchema = z.object({
|
export const sewerBscPlanSplmntDmndItemSchema = z.object({
|
||||||
splmntDmndSn: z.number().nullish(),
|
splmntDmndSn: z.number().nullish(),
|
||||||
splmntArtclComCd: z.string().nullish(),
|
splmntArtclComCd: z.string().nullish(),
|
||||||
splmntDmndCn: z.string().optional(),
|
splmntDmndCn: z.string().nullish(),
|
||||||
splmntDmndDt: z.string().optional(),
|
splmntDmndDt: z.string().nullish(),
|
||||||
splmntDmndAtchFileGroupId: z.string().optional(),
|
splmntDmndAtchFileGroupId: z.string().nullish(),
|
||||||
splmntCn: z.string().optional(),
|
splmntCn: z.string().nullish(),
|
||||||
splmntPicNm: z.string().optional(),
|
splmntPicNm: z.string().nullish(),
|
||||||
splmntCmptnDt: z.string().optional(),
|
splmntCmptnDt: z.string().nullish(),
|
||||||
splmntAtchFileGroupId: z.string().optional(),
|
splmntAtchFileGroupId: z.string().nullish(),
|
||||||
cmptnYn: z.string().optional(),
|
cmptnYn: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanRvwOpnnItem */
|
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanRvwOpnnItem */
|
||||||
export const sewerBscPlanRvwOpnnItemSchema = z.object({
|
export const sewerBscPlanRvwOpnnItemSchema = z.object({
|
||||||
rvwOpnnSn: z.number().optional(),
|
rvwOpnnSn: z.number().nullish(),
|
||||||
opnrSeComCd: z.string().optional(),
|
opnrSeComCd: z.string().nullish(),
|
||||||
opnrNm: z.string().optional(),
|
opnrNm: z.string().nullish(),
|
||||||
rvwRsltCn: z.string().optional(),
|
rvwRsltCn: z.string().nullish(),
|
||||||
rvwRsltAnmlyYn: z.string().optional(),
|
rvwRsltAnmlyYn: z.string().nullish(),
|
||||||
atchFileGroupId: z.string().optional(),
|
atchFileGroupId: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 SewerBscPlanApplySaveRequestDto.EsntlAtchFileItem */
|
/** 백엔드 SewerBscPlanApplySaveRequestDto.EsntlAtchFileItem */
|
||||||
export const sewerBscPlanEsntlAtchFileItemSchema = z.object({
|
export const sewerBscPlanEsntlAtchFileItemSchema = z.object({
|
||||||
esntlAtchFileId: z.string().optional(),
|
esntlAtchFileId: z.string().nullish(),
|
||||||
atchFileGroupId: z.string().optional(),
|
atchFileGroupId: z.string().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanBizCstItem */
|
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanBizCstItem */
|
||||||
export const sewerBscPlanBizCstItemSchema = z.object({
|
export const sewerBscPlanBizCstItemSchema = z.object({
|
||||||
planStpNo: z.number().optional(),
|
planStpNo: z.number().nullish(),
|
||||||
acntgSeCd: z.string().optional(),
|
acntgSeCd: z.string().nullish(),
|
||||||
cstrnAmt: z.number().optional(),
|
cstrnAmt: z.number().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanTmplntDtlItem */
|
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanTmplntDtlItem */
|
||||||
export const sewerBscPlanTmplntDtlItemSchema = z.object({
|
export const sewerBscPlanTmplntDtlItemSchema = z.object({
|
||||||
planStpNo: z.number().optional(),
|
planStpNo: z.number().nullish(),
|
||||||
swtrmtFcltCd: z.string().optional(),
|
swtrmtFcltCd: z.string().nullish(),
|
||||||
prcsZoneArea: z.number().optional(),
|
prcsZoneArea: z.number().nullish(),
|
||||||
swtrmtPpltnCnt: z.number().optional(),
|
swtrmtPpltnCnt: z.number().nullish(),
|
||||||
planSwqty: z.number().optional(),
|
planSwqty: z.number().nullish(),
|
||||||
fcltCpct: z.number().optional(),
|
fcltCpct: z.number().nullish(),
|
||||||
sprsysDrtwPplLen: z.number().optional(),
|
sprsysDrtwPplLen: z.number().nullish(),
|
||||||
sprsysExlnPplLen: z.number().optional(),
|
sprsysExlnPplLen: z.number().nullish(),
|
||||||
cbsysPplLen: z.number().optional(),
|
cbsysPplLen: z.number().nullish(),
|
||||||
icptgPplLen: z.number().optional(),
|
icptgPplLen: z.number().nullish(),
|
||||||
drgCnt: z.number().optional(),
|
drgCnt: z.number().nullish(),
|
||||||
drtwRlyPumpCnt: z.number().optional(),
|
drtwRlyPumpCnt: z.number().nullish(),
|
||||||
drtwPumpCnt: z.number().optional(),
|
drtwPumpCnt: z.number().nullish(),
|
||||||
exlnPumpCnt: z.number().optional(),
|
exlnPumpCnt: z.number().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanTmplntItem */
|
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanTmplntItem */
|
||||||
export const sewerBscPlanTmplntItemSchema = z.object({
|
export const sewerBscPlanTmplntItemSchema = z.object({
|
||||||
swtrmtFcltCd: z.string().optional(),
|
swtrmtFcltCd: z.string().nullish(),
|
||||||
atchFileGroupId: z.string().optional(),
|
atchFileGroupId: z.string().nullish(),
|
||||||
sewerBscPlanTmplntDtlList: z.array(sewerBscPlanTmplntDtlItemSchema).optional(),
|
sewerBscPlanTmplntDtlList: z.array(sewerBscPlanTmplntDtlItemSchema).nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanTmplntTmprStrgItem */
|
/** 백엔드 SewerBscPlanApplySaveRequestDto.SewerBscPlanTmplntTmprStrgItem */
|
||||||
export const sewerBscPlanTmplntTmprStrgItemSchema = z.object({
|
export const sewerBscPlanTmplntTmprStrgItemSchema = z.object({
|
||||||
dtStrgDt: z.string().optional(),
|
dtStrgDt: z.string().nullish(),
|
||||||
swtrmtFcltCd: z.string().optional(),
|
swtrmtFcltCd: z.string().nullish(),
|
||||||
prcsZoneArea: z.number().optional(),
|
prcsZoneArea: z.number().nullish(),
|
||||||
swtrmtPpltnCnt: z.number().optional(),
|
swtrmtPpltnCnt: z.number().nullish(),
|
||||||
planSwqty: z.number().optional(),
|
planSwqty: z.number().nullish(),
|
||||||
fcltCpct: z.number().optional(),
|
fcltCpct: z.number().nullish(),
|
||||||
sprsysDrtwPplLen: z.number().optional(),
|
sprsysDrtwPplLen: z.number().nullish(),
|
||||||
sprsysExlnPplLen: z.number().optional(),
|
sprsysExlnPplLen: z.number().nullish(),
|
||||||
cbsysPplLen: z.number().optional(),
|
cbsysPplLen: z.number().nullish(),
|
||||||
icptgPplLen: z.number().optional(),
|
icptgPplLen: z.number().nullish(),
|
||||||
drgCnt: z.number().optional(),
|
drgCnt: z.number().nullish(),
|
||||||
drtwRlyPumpCnt: z.number().optional(),
|
drtwRlyPumpCnt: z.number().nullish(),
|
||||||
drtwPumpCnt: z.number().optional(),
|
drtwPumpCnt: z.number().nullish(),
|
||||||
exlnPumpCnt: z.number().optional(),
|
exlnPumpCnt: z.number().nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 백엔드 SewerBscPlanApplySaveRequestDto */
|
/** 백엔드 SewerBscPlanApplySaveRequestDto */
|
||||||
export const sewerBscPlanApplySaveSchema = z.object({
|
export const sewerBscPlanApplySaveSchema = z.object({
|
||||||
techReViewSaveCd: z.string().optional(),
|
techReViewSaveCd: z.string().nullish(),
|
||||||
rvwStpCd: z.string().optional(),
|
rvwStpCd: z.string().nullish(),
|
||||||
sewerBscPlan: sewerBscPlanSaveSchema,
|
sewerBscPlan: sewerBscPlanSaveSchema,
|
||||||
sewerBscPlanDtl: sewerBscPlanDtlSaveSchema,
|
sewerBscPlanDtl: sewerBscPlanDtlSaveSchema,
|
||||||
sewerBscPlanOtlnList: z.array(sewerBscPlanOtlnItemSchema).optional(),
|
sewerBscPlanOtlnList: z.array(sewerBscPlanOtlnItemSchema).nullish(),
|
||||||
cklstResultList: z.array(sewerBscPlanCklstResultItemSchema).optional(),
|
cklstResultList: z.array(sewerBscPlanCklstResultItemSchema).nullish(),
|
||||||
fnrsCstList: z.array(sewerBscPlanFnrsCstItemSchema).optional(),
|
fnrsCstList: z.array(sewerBscPlanFnrsCstItemSchema).nullish(),
|
||||||
splmntDmndList: z.array(sewerBscPlanSplmntDmndItemSchema).optional(),
|
splmntDmndList: z.array(sewerBscPlanSplmntDmndItemSchema).nullish(),
|
||||||
rvwOpnnList: z.array(sewerBscPlanRvwOpnnItemSchema).optional(),
|
rvwOpnnList: z.array(sewerBscPlanRvwOpnnItemSchema).nullish(),
|
||||||
esntlAtchFileList: z.array(sewerBscPlanEsntlAtchFileItemSchema).optional(),
|
esntlAtchFileList: z.array(sewerBscPlanEsntlAtchFileItemSchema).nullish(),
|
||||||
bizCstList: z.array(sewerBscPlanBizCstItemSchema).optional(),
|
bizCstList: z.array(sewerBscPlanBizCstItemSchema).nullish(),
|
||||||
sewerBscPlanTmplntList: z.array(sewerBscPlanTmplntItemSchema).optional(),
|
sewerBscPlanTmplntList: z.array(sewerBscPlanTmplntItemSchema).nullish(),
|
||||||
tmplntTmprStrgList: z.array(sewerBscPlanTmplntTmprStrgItemSchema).optional(),
|
tmplntTmprStrgList: z.array(sewerBscPlanTmplntTmprStrgItemSchema).nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type SewerBscPlanSaveRequestDto = z.infer<typeof sewerBscPlanSaveSchema>;
|
export type SewerBscPlanSaveRequestDto = z.infer<typeof sewerBscPlanSaveSchema>;
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ export const designCnstnRegistSchema = z.object({
|
|||||||
.string()
|
.string()
|
||||||
.min(1, "설계자 이메일은 필수입니다")
|
.min(1, "설계자 이메일은 필수입니다")
|
||||||
.email("올바른 이메일 형식이 아닙니다"),
|
.email("올바른 이메일 형식이 아닙니다"),
|
||||||
sido: z.string().optional(),
|
sido: z.string().nullish(),
|
||||||
gugun: z.string().optional(),
|
gugun: z.string().nullish(),
|
||||||
}),
|
}),
|
||||||
bzScaleList: z.array(
|
bzScaleList: z.array(
|
||||||
designCnstnBzScaleItemSchema.extend({
|
designCnstnBzScaleItemSchema.extend({
|
||||||
@@ -32,7 +32,7 @@ export const designCnstnRegistSchema = z.object({
|
|||||||
bscPl: z.number(),
|
bscPl: z.number(),
|
||||||
budgetReflct: z.number(),
|
budgetReflct: z.number(),
|
||||||
thtiDsgn: z.number(),
|
thtiDsgn: z.number(),
|
||||||
diff: z.number().optional(),
|
diff: z.number().nullish(),
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
esntlAtchFileList: z.array(
|
esntlAtchFileList: z.array(
|
||||||
@@ -52,7 +52,7 @@ export function formatTaskSeComCdForApi(taskSeComCd: string[]): string {
|
|||||||
return taskSeComCd.join(",");
|
return taskSeComCd.join(",");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parseTaskSeComCdFromApi(taskSeComCd?: string): string[] {
|
export function parseTaskSeComCdFromApi(taskSeComCd?: string | null): string[] {
|
||||||
if (!taskSeComCd) return [];
|
if (!taskSeComCd) return [];
|
||||||
return taskSeComCd.split(",").filter(Boolean);
|
return taskSeComCd.split(",").filter(Boolean);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ function getBadgeColor(state: BadgeState) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatOptional(value: string | undefined) {
|
function formatOptional(value: string | null | undefined) {
|
||||||
return value?.trim() ? value : "-";
|
return value?.trim() ? value : "-";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,14 +51,19 @@ const ROLE_STATUS_BUTTON_ACTIONS: Record<string, Record<string, FnrsCnsltnViewBu
|
|||||||
LE: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRply, FNRS_CNSLTN_VIEW_BUTTON_ACTION.rqstTechRvw],
|
LE: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRply, FNRS_CNSLTN_VIEW_BUTTON_ACTION.rqstTechRvw],
|
||||||
TP: [
|
TP: [
|
||||||
FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng,
|
FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng,
|
||||||
FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRply,
|
|
||||||
FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwOpnnRply,
|
FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwOpnnRply,
|
||||||
],
|
],
|
||||||
|
RB: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
|
||||||
RA: [
|
RA: [
|
||||||
FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng,
|
FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng,
|
||||||
FNRS_CNSLTN_VIEW_BUTTON_ACTION.rqstActnRvw,
|
FNRS_CNSLTN_VIEW_BUTTON_ACTION.rqstActnRvw,
|
||||||
],
|
],
|
||||||
|
AV: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
|
||||||
|
EV: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
|
||||||
|
RK: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
|
||||||
RR: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng, FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRply],
|
RR: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng, FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRply],
|
||||||
|
EP: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
|
||||||
|
TA: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import {
|
|||||||
type ChecklistFormState,
|
type ChecklistFormState,
|
||||||
type ChecklistProgress,
|
type ChecklistProgress,
|
||||||
type ChecklistRowKey,
|
type ChecklistRowKey,
|
||||||
type ChecklistStepMap,
|
|
||||||
REVIEW_STEP_CODES,
|
REVIEW_STEP_CODES,
|
||||||
type ReviewStepCode,
|
type ReviewStepCode,
|
||||||
} from "../model/view-types";
|
} from "../model/view-types";
|
||||||
@@ -17,15 +16,6 @@ export function buildChecklistRowKey(
|
|||||||
return `${row.taskSeComCd}_${row.cklstSn}_${row.cklstArtclSn}_${row.cklstRvwSn}_${step}`;
|
return `${row.taskSeComCd}_${row.cklstSn}_${row.cklstArtclSn}_${row.cklstRvwSn}_${step}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function groupByReviewStep(rows: CklstRvwRsltTreeDto[]): ChecklistStepMap {
|
|
||||||
const base: ChecklistStepMap = { LOCAL: [], ENV: [], KECO: [] };
|
|
||||||
rows.forEach((row) => {
|
|
||||||
const step = (row.rvwStpComCd ?? "LOCAL") as ReviewStepCode;
|
|
||||||
if (REVIEW_STEP_CODES.includes(step)) base[step].push(row);
|
|
||||||
});
|
|
||||||
return base;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function extractTaskCodes(rows: CklstRvwRsltTreeDto[]): string[] {
|
export function extractTaskCodes(rows: CklstRvwRsltTreeDto[]): string[] {
|
||||||
return Array.from(new Set(rows.map((row) => row.taskSeComCd).filter(Boolean)));
|
return Array.from(new Set(rows.map((row) => row.taskSeComCd).filter(Boolean)));
|
||||||
}
|
}
|
||||||
@@ -70,13 +60,6 @@ export function computeChecklistProgress(
|
|||||||
return { total, completed, percent };
|
return { total, completed, percent };
|
||||||
}
|
}
|
||||||
|
|
||||||
export function filterChecklistRowsByReviewStep(
|
|
||||||
rows: CklstRvwRsltTreeDto[],
|
|
||||||
reviewStep: ReviewStepCode,
|
|
||||||
): CklstRvwRsltTreeDto[] {
|
|
||||||
return rows.filter((row) => row.rvwStpComCd === reviewStep);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function computeReviewStepChecklistProgress(
|
export function computeReviewStepChecklistProgress(
|
||||||
rows: CklstRvwRsltTreeDto[],
|
rows: CklstRvwRsltTreeDto[],
|
||||||
results: ChecklistFormState["results"],
|
results: ChecklistFormState["results"],
|
||||||
@@ -93,23 +76,6 @@ export function computeReviewStepChecklistProgress(
|
|||||||
return { total, completed, percent };
|
return { total, completed, percent };
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildChecklistFormState(rows: CklstRvwRsltTreeDto[]): ChecklistFormState {
|
|
||||||
const results: ChecklistFormState["results"] = {};
|
|
||||||
const comments: ChecklistFormState["comments"] = {};
|
|
||||||
rows.forEach((row) => {
|
|
||||||
const key = buildChecklistRowKey(row);
|
|
||||||
if (row.rvwRsltAnmlyYn === "Y" || row.rvwRsltAnmlyYn === "N") {
|
|
||||||
results[key] = row.rvwRsltAnmlyYn;
|
|
||||||
}
|
|
||||||
if (row.picRvwCn) comments[key] = row.picRvwCn;
|
|
||||||
});
|
|
||||||
return {
|
|
||||||
results,
|
|
||||||
comments,
|
|
||||||
progress: computeChecklistProgress(rows, results),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function mergeChecklistFormStateFromServer(
|
export function mergeChecklistFormStateFromServer(
|
||||||
prev: ChecklistFormState,
|
prev: ChecklistFormState,
|
||||||
allRows: CklstRvwRsltTreeDto[],
|
allRows: CklstRvwRsltTreeDto[],
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ export const fnrsCnsltnRegistSchema = z.object({
|
|||||||
.string()
|
.string()
|
||||||
.min(1, "설계자 이메일은 필수입니다")
|
.min(1, "설계자 이메일은 필수입니다")
|
||||||
.email("올바른 이메일 형식이 아닙니다"),
|
.email("올바른 이메일 형식이 아닙니다"),
|
||||||
sido: z.string().optional(),
|
sido: z.string().nullish(),
|
||||||
gugun: z.string().optional(),
|
gugun: z.string().nullish(),
|
||||||
}),
|
}),
|
||||||
bzScaleList: z.array(
|
bzScaleList: z.array(
|
||||||
fnrsCnsltnBzScaleItemSchema.extend({
|
fnrsCnsltnBzScaleItemSchema.extend({
|
||||||
@@ -36,7 +36,7 @@ export const fnrsCnsltnRegistSchema = z.object({
|
|||||||
bscPl: z.number(),
|
bscPl: z.number(),
|
||||||
budgetReflct: z.number(),
|
budgetReflct: z.number(),
|
||||||
thtiDsgn: z.number(),
|
thtiDsgn: z.number(),
|
||||||
diff: z.number().optional(),
|
diff: z.number().nullish(),
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
bizCstList: z.array(
|
bizCstList: z.array(
|
||||||
@@ -52,8 +52,8 @@ export const fnrsCnsltnRegistSchema = z.object({
|
|||||||
fnrsSharSeCd: z.string(),
|
fnrsSharSeCd: z.string(),
|
||||||
exstnAmt: z.number(),
|
exstnAmt: z.number(),
|
||||||
chgRqtAmt: z.number(),
|
chgRqtAmt: z.number(),
|
||||||
ajmtAmt: z.number().optional(),
|
ajmtAmt: z.number().nullish(),
|
||||||
rmrkCn: z.string().optional(),
|
rmrkCn: z.string().nullish(),
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
cklstResultList: z.array(
|
cklstResultList: z.array(
|
||||||
@@ -74,7 +74,7 @@ export const fnrsCnsltnRegistSchema = z.object({
|
|||||||
splmntDmndList: z.array(
|
splmntDmndList: z.array(
|
||||||
fnrsCnsltnSplmntDmndItemSchema.extend({
|
fnrsCnsltnSplmntDmndItemSchema.extend({
|
||||||
splmntArtclCdNm: z.string().nullish(),
|
splmntArtclCdNm: z.string().nullish(),
|
||||||
splmntDmndAtchFileNm: z.string().optional(),
|
splmntDmndAtchFileNm: z.string().nullish(),
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
privacyConsent: z.enum(["Y", "N"], {
|
privacyConsent: z.enum(["Y", "N"], {
|
||||||
@@ -88,7 +88,7 @@ export function formatTaskSeComCdForApi(taskSeComCd: string[]): string {
|
|||||||
return taskSeComCd.join(",");
|
return taskSeComCd.join(",");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parseTaskSeComCdFromApi(taskSeComCd?: string): string[] {
|
export function parseTaskSeComCdFromApi(taskSeComCd?: string | null): string[] {
|
||||||
if (!taskSeComCd) return [];
|
if (!taskSeComCd) return [];
|
||||||
return taskSeComCd.split(",").filter(Boolean);
|
return taskSeComCd.split(",").filter(Boolean);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const pwrkCnsltnDocEvlFormSchema = z.object({
|
|||||||
required_error: "만족도를 선택해 주세요.",
|
required_error: "만족도를 선택해 주세요.",
|
||||||
invalid_type_error: "만족도를 선택해 주세요.",
|
invalid_type_error: "만족도를 선택해 주세요.",
|
||||||
}),
|
}),
|
||||||
pwrkCnsltnDocEvlCn: z.string().max(2000).optional(),
|
pwrkCnsltnDocEvlCn: z.string().max(2000).nullish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type PwrkCnsltnDocEvlFormValues = z.infer<typeof pwrkCnsltnDocEvlFormSchema>;
|
export type PwrkCnsltnDocEvlFormValues = z.infer<typeof pwrkCnsltnDocEvlFormSchema>;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import type { CklstRvwRsltTreeDto } from "@/entities/fnrs-cnsltn";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
PBADMS_PROGRESS_ORDER,
|
PBADMS_PROGRESS_ORDER,
|
||||||
REVIEW_STEP_CODES,
|
REVIEW_STEP_CODES,
|
||||||
@@ -28,6 +30,25 @@ export function getVisibleReviewSteps(
|
|||||||
return REVIEW_STEP_CODES.slice(0, count);
|
return REVIEW_STEP_CODES.slice(0, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function resolveVisibleReviewSteps(
|
||||||
|
prgrsSttsComCd: string,
|
||||||
|
userRoleCode: string | undefined,
|
||||||
|
cklstResultList: CklstRvwRsltTreeDto[],
|
||||||
|
): ReviewStepCode[] {
|
||||||
|
const byProgressAndRole = getVisibleReviewSteps(prgrsSttsComCd, userRoleCode);
|
||||||
|
const currentStep = byProgressAndRole.at(-1);
|
||||||
|
const stepsWithData = new Set<ReviewStepCode>();
|
||||||
|
|
||||||
|
for (const row of cklstResultList) {
|
||||||
|
const step = row.rvwStpComCd as ReviewStepCode | undefined;
|
||||||
|
if (step && REVIEW_STEP_CODES.includes(step)) stepsWithData.add(step);
|
||||||
|
}
|
||||||
|
|
||||||
|
return REVIEW_STEP_CODES.filter(
|
||||||
|
(step) => stepsWithData.has(step) || step === currentStep,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export function getEditableReviewStep(
|
export function getEditableReviewStep(
|
||||||
dtlInstCd?: string,
|
dtlInstCd?: string,
|
||||||
prgrsSttsComCd?: string,
|
prgrsSttsComCd?: string,
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ function getBadgeColor(state: BadgeState) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatOptional(value: string | undefined) {
|
function formatOptional(value: string | null | undefined) {
|
||||||
return value?.trim() ? value : "-";
|
return value?.trim() ? value : "-";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,10 +44,14 @@ export interface ChecklistFormState {
|
|||||||
progress: ChecklistProgress;
|
progress: ChecklistProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ChecklistStepMap = Record<ReviewStepCode, CklstRvwRsltTreeDto[]>;
|
|
||||||
|
|
||||||
export const REVIEW_STEP_CODES: ReviewStepCode[] = ["LOCAL", "ENV", "KECO"];
|
export const REVIEW_STEP_CODES: ReviewStepCode[] = ["LOCAL", "ENV", "KECO"];
|
||||||
|
|
||||||
|
export const CHECKLIST_TAB_LABELS: Record<ReviewStepCode, string> = {
|
||||||
|
LOCAL: "자가체크",
|
||||||
|
ENV: "기술검토",
|
||||||
|
KECO: "환경청검토",
|
||||||
|
};
|
||||||
|
|
||||||
export const REVIEW_STEP_LABELS: Record<ReviewStepCode, string> = {
|
export const REVIEW_STEP_LABELS: Record<ReviewStepCode, string> = {
|
||||||
LOCAL: "지자체",
|
LOCAL: "지자체",
|
||||||
ENV: "환경청",
|
ENV: "환경청",
|
||||||
|
|||||||
@@ -180,7 +180,9 @@ function FloatingActionButtons({
|
|||||||
userInfo?.userUnqId,
|
userInfo?.userUnqId,
|
||||||
);
|
);
|
||||||
const viewOnlyPwrkCnsltnDoc =
|
const viewOnlyPwrkCnsltnDoc =
|
||||||
prgrsSttsComCd === "SL" || (prgrsSttsComCd === "RB" && dtlInstCd !== "ROLE_USER05");
|
prgrsSttsComCd === "SL" ||
|
||||||
|
(prgrsSttsComCd === "RB" && dtlInstCd !== "ROLE_USER05") ||
|
||||||
|
(prgrsSttsComCd === "RK" && dtlInstCd === "ROLE_USER03");
|
||||||
|
|
||||||
const actionButtons = useMemo(() => {
|
const actionButtons = useMemo(() => {
|
||||||
if (needsAtrzResolve && isRvwLoginUserLoading) return [];
|
if (needsAtrzResolve && isRvwLoginUserLoading) return [];
|
||||||
|
|||||||
@@ -113,7 +113,8 @@ function PwrkCnsltnDocEvlDialog({ open, pwrkCnsltnDocNo, onClose }: PwrkCnsltnDo
|
|||||||
<Textarea
|
<Textarea
|
||||||
id="pwrkCnsltnDocEvlCn"
|
id="pwrkCnsltnDocEvlCn"
|
||||||
rows={4}
|
rows={4}
|
||||||
placeholder="의견을 입력해 주세요 (선택)"
|
placeholder="의견을 입력해 주세요"
|
||||||
|
className="!text-xl"
|
||||||
{...register("pwrkCnsltnDocEvlCn")}
|
{...register("pwrkCnsltnDocEvlCn")}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import {
|
|||||||
fnrsCnsltnMngService,
|
fnrsCnsltnMngService,
|
||||||
} from "@/entities/fnrs-cnsltn";
|
} from "@/entities/fnrs-cnsltn";
|
||||||
import { useFnrsSharSeMngTree } from "@/entities/fnrs-shar-se";
|
import { useFnrsSharSeMngTree } from "@/entities/fnrs-shar-se";
|
||||||
|
import { findCompletedPwrkDraft, usePwrkCnsltnMngByUpDocNo } from "@/entities/pwrk-cnsltn-mng";
|
||||||
import {
|
import {
|
||||||
AttachmentsFormSection,
|
AttachmentsFormSection,
|
||||||
buildAcntgCostItems,
|
buildAcntgCostItems,
|
||||||
@@ -35,7 +36,10 @@ import {
|
|||||||
} from "@/widgets/pbadms-sprt";
|
} from "@/widgets/pbadms-sprt";
|
||||||
import { Button } from "@common/components";
|
import { Button } from "@common/components";
|
||||||
|
|
||||||
import { type FnrsCnsltnRegistFormData, fnrsCnsltnRegistSchema } from "../lib/fnrs-cnsltn-regist-schema";
|
import {
|
||||||
|
type FnrsCnsltnRegistFormData,
|
||||||
|
fnrsCnsltnRegistSchema,
|
||||||
|
} from "../lib/fnrs-cnsltn-regist-schema";
|
||||||
import {
|
import {
|
||||||
buildFormPayload,
|
buildFormPayload,
|
||||||
getCreateDefaultValues,
|
getCreateDefaultValues,
|
||||||
@@ -68,6 +72,12 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
|
|||||||
const isSplmntPrgrsStts = initialData?.detDto?.prgrsSttsComCd === "SL";
|
const isSplmntPrgrsStts = initialData?.detDto?.prgrsSttsComCd === "SL";
|
||||||
const fnrsCnsltnDocNo = initialData?.detDto?.fnrsCnsltnDocNo;
|
const fnrsCnsltnDocNo = initialData?.detDto?.fnrsCnsltnDocNo;
|
||||||
|
|
||||||
|
const { data: pwrkCnsltnData } = usePwrkCnsltnMngByUpDocNo(
|
||||||
|
fnrsCnsltnDocNo,
|
||||||
|
isSplmntPrgrsStts && Boolean(fnrsCnsltnDocNo),
|
||||||
|
);
|
||||||
|
const hasCompletedDraft = Boolean(findCompletedPwrkDraft(pwrkCnsltnData));
|
||||||
|
|
||||||
const { data: masterSharTree = [] } = useFnrsSharSeMngTree();
|
const { data: masterSharTree = [] } = useFnrsSharSeMngTree();
|
||||||
const { data: acntgTree = [] } = useAcntgSeMngTree();
|
const { data: acntgTree = [] } = useAcntgSeMngTree();
|
||||||
const { data: essentialFiles = [] } = useEsntlAtchFileMngTree({ docSeComCd: "FNRS" });
|
const { data: essentialFiles = [] } = useEsntlAtchFileMngTree({ docSeComCd: "FNRS" });
|
||||||
@@ -126,7 +136,7 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
|
|||||||
(item) => !item.splmntCn || !item.splmntCn.trim(),
|
(item) => !item.splmntCn || !item.splmntCn.trim(),
|
||||||
);
|
);
|
||||||
if (hasEmptySplmntCn) {
|
if (hasEmptySplmntCn) {
|
||||||
alert("보완요청내용이 있습니다. 보완 완료내용을 입력해 주세요.");
|
alert("보완 요청 내용이 있습니다.\n보완 완료 내용을 입력해 주세요.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,6 +184,11 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
|
|||||||
async function onApply(data: FnrsCnsltnRegistFormData) {
|
async function onApply(data: FnrsCnsltnRegistFormData) {
|
||||||
if (isSubmitting) return;
|
if (isSubmitting) return;
|
||||||
|
|
||||||
|
if (data.privacyConsent !== "Y") {
|
||||||
|
alert("개인정보 수집/이용에 동의해야 신청이 가능합니다.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isFormChecklistComplete(data.cklstResultList)) {
|
if (!isFormChecklistComplete(data.cklstResultList)) {
|
||||||
alert("모든 체크리스트 항목을 체크해야 신청이 가능합니다.");
|
alert("모든 체크리스트 항목을 체크해야 신청이 가능합니다.");
|
||||||
return;
|
return;
|
||||||
@@ -260,7 +275,10 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
|
|||||||
initialEsntlFiles={isEditMode ? initialData?.esntlFileList : undefined}
|
initialEsntlFiles={isEditMode ? initialData?.esntlFileList : undefined}
|
||||||
initialEtcFiles={isEditMode ? initialData?.etcFileList : undefined}
|
initialEtcFiles={isEditMode ? initialData?.etcFileList : undefined}
|
||||||
/>
|
/>
|
||||||
<SplmntDmndFormSection readOnly={!isSplmntPrgrsStts} />
|
<SplmntDmndFormSection
|
||||||
|
initialData={initialData?.splmntDmndList}
|
||||||
|
readOnly={!isSplmntPrgrsStts}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="sticky bottom-0 z-40 !-mb-2 border-t bg-white pb-8 pt-6 shadow-[0_-4px_12px_rgba(0,0,0,0.06)]">
|
<div className="sticky bottom-0 z-40 !-mb-2 border-t bg-white pb-8 pt-6 shadow-[0_-4px_12px_rgba(0,0,0,0.06)]">
|
||||||
<div className="mx-4 flex flex-wrap justify-center gap-3 sm:gap-4">
|
<div className="mx-4 flex flex-wrap justify-center gap-3 sm:gap-4">
|
||||||
@@ -300,7 +318,7 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
|
|||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
{fnrsCnsltnDocNo ? (
|
{hasCompletedDraft ? (
|
||||||
<Button
|
<Button
|
||||||
color="orange"
|
color="orange"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -324,7 +342,7 @@ function FnrsFormPage({ mode, initialData, createDefaults }: FnrsFormPageProps)
|
|||||||
</div>
|
</div>
|
||||||
</SectionCollapsibleGroup>
|
</SectionCollapsibleGroup>
|
||||||
</form>
|
</form>
|
||||||
{fnrsCnsltnDocNo ? (
|
{hasCompletedDraft && fnrsCnsltnDocNo ? (
|
||||||
<PwrkCnsltnDocMngDialog
|
<PwrkCnsltnDocMngDialog
|
||||||
open={isPwrkCnsltnDocMngOpen}
|
open={isPwrkCnsltnDocMngOpen}
|
||||||
fnrsCnsltnDocNo={fnrsCnsltnDocNo}
|
fnrsCnsltnDocNo={fnrsCnsltnDocNo}
|
||||||
|
|||||||
@@ -14,7 +14,11 @@ import {
|
|||||||
} from "@/widgets/pbadms-sprt";
|
} from "@/widgets/pbadms-sprt";
|
||||||
import { Skeleton } from "@common/components";
|
import { Skeleton } from "@common/components";
|
||||||
|
|
||||||
import { getAiPendingMessage, isAiPendingStatus, isRagIndexingInProgress } from "../lib/ai-pending-utils";
|
import {
|
||||||
|
getAiPendingMessage,
|
||||||
|
isAiPendingStatus,
|
||||||
|
isRagIndexingInProgress,
|
||||||
|
} from "../lib/ai-pending-utils";
|
||||||
import { needsRoleUser01AtrzResolve } from "../lib/button-config";
|
import { needsRoleUser01AtrzResolve } from "../lib/button-config";
|
||||||
import { getEditableReviewStep } from "../lib/review-step-utils";
|
import { getEditableReviewStep } from "../lib/review-step-utils";
|
||||||
import { EMPTY_CKLST_RESULT_LIST, useChecklistFormState } from "../lib/use-checklist-form-state";
|
import { EMPTY_CKLST_RESULT_LIST, useChecklistFormState } from "../lib/use-checklist-form-state";
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import {
|
|||||||
extractTaskCodes,
|
extractTaskCodes,
|
||||||
getChecklistDisplayRows,
|
getChecklistDisplayRows,
|
||||||
} from "../../lib/checklist-utils";
|
} from "../../lib/checklist-utils";
|
||||||
import { getVisibleReviewSteps } from "../../lib/review-step-utils";
|
import { resolveVisibleReviewSteps } from "../../lib/review-step-utils";
|
||||||
import type { ReviewStepCode } from "../../model/view-types";
|
import type { ReviewStepCode } from "../../model/view-types";
|
||||||
import {
|
import {
|
||||||
|
CHECKLIST_TAB_LABELS,
|
||||||
type ChecklistFormState,
|
type ChecklistFormState,
|
||||||
REVIEW_STEP_LABELS,
|
|
||||||
ROLE_TO_REVIEW_STEP,
|
ROLE_TO_REVIEW_STEP,
|
||||||
TASK_CODE_LABELS,
|
TASK_CODE_LABELS,
|
||||||
} from "../../model/view-types";
|
} from "../../model/view-types";
|
||||||
@@ -37,8 +37,8 @@ function ChecklistSection({
|
|||||||
setFormState,
|
setFormState,
|
||||||
}: ChecklistSectionProps) {
|
}: ChecklistSectionProps) {
|
||||||
const visibleReviewSteps = useMemo(
|
const visibleReviewSteps = useMemo(
|
||||||
() => getVisibleReviewSteps(prgrsSttsComCd, userRoleCode),
|
() => resolveVisibleReviewSteps(prgrsSttsComCd, userRoleCode, cklstResultList),
|
||||||
[prgrsSttsComCd, userRoleCode],
|
[prgrsSttsComCd, userRoleCode, cklstResultList],
|
||||||
);
|
);
|
||||||
const taskCodes = useMemo(() => extractTaskCodes(cklstResultList), [cklstResultList]);
|
const taskCodes = useMemo(() => extractTaskCodes(cklstResultList), [cklstResultList]);
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ function ChecklistSection({
|
|||||||
<TabsList>
|
<TabsList>
|
||||||
{visibleReviewSteps.map((stepCode) => (
|
{visibleReviewSteps.map((stepCode) => (
|
||||||
<TabsTrigger key={stepCode} value={stepCode} className="!px-6 !py-3 text-xl">
|
<TabsTrigger key={stepCode} value={stepCode} className="!px-6 !py-3 text-xl">
|
||||||
{REVIEW_STEP_LABELS[stepCode]}
|
{CHECKLIST_TAB_LABELS[stepCode]}
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
))}
|
))}
|
||||||
</TabsList>
|
</TabsList>
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export const instlSncnRegistSchema = z.object({
|
|||||||
splmntDmndList: z.array(
|
splmntDmndList: z.array(
|
||||||
instlSncnSplmntDmndItemSchema.extend({
|
instlSncnSplmntDmndItemSchema.extend({
|
||||||
splmntArtclCdNm: z.string().nullish(),
|
splmntArtclCdNm: z.string().nullish(),
|
||||||
splmntDmndAtchFileNm: z.string().optional(),
|
splmntDmndAtchFileNm: z.string().nullish(),
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
privacyConsent: z.enum(["Y", "N"], {
|
privacyConsent: z.enum(["Y", "N"], {
|
||||||
@@ -82,7 +82,7 @@ export function formatTaskSeComCdForApi(taskSeComCd: string[]): string {
|
|||||||
return taskSeComCd.join(",");
|
return taskSeComCd.join(",");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parseTaskSeComCdFromApi(taskSeComCd?: string): string[] {
|
export function parseTaskSeComCdFromApi(taskSeComCd?: string | null): string[] {
|
||||||
if (!taskSeComCd) return [];
|
if (!taskSeComCd) return [];
|
||||||
return taskSeComCd.split(",").filter(Boolean);
|
return taskSeComCd.split(",").filter(Boolean);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { ReviewStepCode } from "@/entities/instl-sncn";
|
import type { CklstRvwRsltTreeDto, ReviewStepCode } from "@/entities/instl-sncn";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
INSTL_PROGRESS_ORDER,
|
INSTL_PROGRESS_ORDER,
|
||||||
@@ -27,6 +27,25 @@ export function getVisibleReviewSteps(
|
|||||||
return REVIEW_STEP_CODES.slice(0, count);
|
return REVIEW_STEP_CODES.slice(0, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function resolveVisibleReviewSteps(
|
||||||
|
prgrsSttsComCd: string,
|
||||||
|
userRoleCode: string | undefined,
|
||||||
|
cklstResultList: CklstRvwRsltTreeDto[],
|
||||||
|
): ReviewStepCode[] {
|
||||||
|
const byProgressAndRole = getVisibleReviewSteps(prgrsSttsComCd, userRoleCode);
|
||||||
|
const currentStep = byProgressAndRole.at(-1);
|
||||||
|
const stepsWithData = new Set<ReviewStepCode>();
|
||||||
|
|
||||||
|
for (const row of cklstResultList) {
|
||||||
|
const step = row.rvwStpComCd as ReviewStepCode | undefined;
|
||||||
|
if (step && REVIEW_STEP_CODES.includes(step)) stepsWithData.add(step);
|
||||||
|
}
|
||||||
|
|
||||||
|
return REVIEW_STEP_CODES.filter(
|
||||||
|
(step) => stepsWithData.has(step) || step === currentStep,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export function getEditableReviewStep(
|
export function getEditableReviewStep(
|
||||||
dtlInstCd?: string,
|
dtlInstCd?: string,
|
||||||
prgrsSttsComCd?: string,
|
prgrsSttsComCd?: string,
|
||||||
|
|||||||
@@ -9,7 +9,10 @@ import type {
|
|||||||
ReviewStepCode,
|
ReviewStepCode,
|
||||||
} from "@/entities/instl-sncn";
|
} from "@/entities/instl-sncn";
|
||||||
import { instlSncnApplySaveSchema } from "@/entities/instl-sncn";
|
import { instlSncnApplySaveSchema } from "@/entities/instl-sncn";
|
||||||
import { type SplmntDmndDialogConfirmPayload, toEsntlAtchFileSaveList } from "@/widgets/pbadms-sprt";
|
import {
|
||||||
|
type SplmntDmndDialogConfirmPayload,
|
||||||
|
toEsntlAtchFileSaveList,
|
||||||
|
} from "@/widgets/pbadms-sprt";
|
||||||
|
|
||||||
import type { ChecklistFormState } from "../model/view-types";
|
import type { ChecklistFormState } from "../model/view-types";
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ function getBadgeColor(state: BadgeState) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatOptional(value: string | undefined) {
|
function formatOptional(value: string | null | undefined) {
|
||||||
return value?.trim() ? value : "-";
|
return value?.trim() ? value : "-";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,12 @@ export type ChecklistStepMap = Record<ReviewStepCode, CklstRvwRsltTreeDto[]>;
|
|||||||
|
|
||||||
export const REVIEW_STEP_CODES: ReviewStepCode[] = ["LOCAL", "ENV", "KECO"];
|
export const REVIEW_STEP_CODES: ReviewStepCode[] = ["LOCAL", "ENV", "KECO"];
|
||||||
|
|
||||||
|
export const CHECKLIST_TAB_LABELS: Record<ReviewStepCode, string> = {
|
||||||
|
LOCAL: "자가체크",
|
||||||
|
ENV: "기술검토",
|
||||||
|
KECO: "환경청검토",
|
||||||
|
};
|
||||||
|
|
||||||
export const REVIEW_STEP_LABELS: Record<ReviewStepCode, string> = {
|
export const REVIEW_STEP_LABELS: Record<ReviewStepCode, string> = {
|
||||||
LOCAL: "지자체",
|
LOCAL: "지자체",
|
||||||
ENV: "환경청",
|
ENV: "환경청",
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import {
|
|||||||
extractTaskCodes,
|
extractTaskCodes,
|
||||||
getChecklistDisplayRows,
|
getChecklistDisplayRows,
|
||||||
} from "../../lib/checklist-utils";
|
} from "../../lib/checklist-utils";
|
||||||
import { getVisibleReviewSteps } from "../../lib/review-step-utils";
|
import { resolveVisibleReviewSteps } from "../../lib/review-step-utils";
|
||||||
import {
|
import {
|
||||||
|
CHECKLIST_TAB_LABELS,
|
||||||
type ChecklistFormState,
|
type ChecklistFormState,
|
||||||
REVIEW_STEP_LABELS,
|
|
||||||
ROLE_TO_REVIEW_STEP,
|
ROLE_TO_REVIEW_STEP,
|
||||||
TASK_CODE_LABELS,
|
TASK_CODE_LABELS,
|
||||||
} from "../../model/view-types";
|
} from "../../model/view-types";
|
||||||
@@ -36,8 +36,8 @@ function ChecklistSection({
|
|||||||
setFormState,
|
setFormState,
|
||||||
}: ChecklistSectionProps) {
|
}: ChecklistSectionProps) {
|
||||||
const visibleReviewSteps = useMemo(
|
const visibleReviewSteps = useMemo(
|
||||||
() => getVisibleReviewSteps(prgrsSttsComCd, userRoleCode),
|
() => resolveVisibleReviewSteps(prgrsSttsComCd, userRoleCode, cklstResultList),
|
||||||
[prgrsSttsComCd, userRoleCode],
|
[prgrsSttsComCd, userRoleCode, cklstResultList],
|
||||||
);
|
);
|
||||||
const taskCodes = useMemo(() => extractTaskCodes(cklstResultList), [cklstResultList]);
|
const taskCodes = useMemo(() => extractTaskCodes(cklstResultList), [cklstResultList]);
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ function ChecklistSection({
|
|||||||
<TabsList>
|
<TabsList>
|
||||||
{visibleReviewSteps.map((stepCode) => (
|
{visibleReviewSteps.map((stepCode) => (
|
||||||
<TabsTrigger key={stepCode} value={stepCode} className="!px-6 !py-3 text-xl">
|
<TabsTrigger key={stepCode} value={stepCode} className="!px-6 !py-3 text-xl">
|
||||||
{REVIEW_STEP_LABELS[stepCode]}
|
{CHECKLIST_TAB_LABELS[stepCode]}
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
))}
|
))}
|
||||||
</TabsList>
|
</TabsList>
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { type CostItemDef, roundAmount } from "@/widgets/pbadms-sprt";
|
import { type CostItemDef, roundAmount } from "@/widgets/pbadms-sprt";
|
||||||
|
|
||||||
import { type BizCstMatrixItem,getAmt, PLAN_STEPS } from "./biz-cst-matrix-utils";
|
import { type BizCstMatrixItem, getAmt, PLAN_STEPS } from "./biz-cst-matrix-utils";
|
||||||
|
|
||||||
export interface FnrsCstItem {
|
export interface FnrsCstItem {
|
||||||
planStpNo: number;
|
planStpNo: number;
|
||||||
gvexpAmt?: number;
|
gvexpAmt?: number | null;
|
||||||
lcexpAmt?: number;
|
lcexpAmt?: number | null;
|
||||||
orgprBdchgAmt?: number;
|
orgprBdchgAmt?: number | null;
|
||||||
etcAmt?: number;
|
etcAmt?: number | null;
|
||||||
sumAmt?: number;
|
sumAmt?: number | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FnrsCstStepRemaining {
|
export interface FnrsCstStepRemaining {
|
||||||
@@ -32,10 +32,7 @@ function getBizCstStepTotal(
|
|||||||
|
|
||||||
function sumFnrsCstLeaf(item: FnrsCstItem): number {
|
function sumFnrsCstLeaf(item: FnrsCstItem): number {
|
||||||
return roundAmount(
|
return roundAmount(
|
||||||
(item.gvexpAmt ?? 0) +
|
(item.gvexpAmt ?? 0) + (item.lcexpAmt ?? 0) + (item.orgprBdchgAmt ?? 0) + (item.etcAmt ?? 0),
|
||||||
(item.lcexpAmt ?? 0) +
|
|
||||||
(item.orgprBdchgAmt ?? 0) +
|
|
||||||
(item.etcAmt ?? 0),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import type { CklstRvwRsltTreeDto } from "@/entities/sewer-bsc-plan";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
PBADMS_PROGRESS_ORDER,
|
PBADMS_PROGRESS_ORDER,
|
||||||
REVIEW_STEP_CODES,
|
REVIEW_STEP_CODES,
|
||||||
@@ -28,6 +30,25 @@ export function getVisibleReviewSteps(
|
|||||||
return REVIEW_STEP_CODES.slice(0, count);
|
return REVIEW_STEP_CODES.slice(0, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function resolveVisibleReviewSteps(
|
||||||
|
prgrsSttsComCd: string,
|
||||||
|
userRoleCode: string | undefined,
|
||||||
|
cklstResultList: CklstRvwRsltTreeDto[],
|
||||||
|
): ReviewStepCode[] {
|
||||||
|
const byProgressAndRole = getVisibleReviewSteps(prgrsSttsComCd, userRoleCode);
|
||||||
|
const currentStep = byProgressAndRole.at(-1);
|
||||||
|
const stepsWithData = new Set<ReviewStepCode>();
|
||||||
|
|
||||||
|
for (const row of cklstResultList) {
|
||||||
|
const step = row.rvwStpComCd as ReviewStepCode | undefined;
|
||||||
|
if (step && REVIEW_STEP_CODES.includes(step)) stepsWithData.add(step);
|
||||||
|
}
|
||||||
|
|
||||||
|
return REVIEW_STEP_CODES.filter(
|
||||||
|
(step) => stepsWithData.has(step) || step === currentStep,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export function getEditableReviewStep(
|
export function getEditableReviewStep(
|
||||||
dtlInstCd?: string,
|
dtlInstCd?: string,
|
||||||
prgrsSttsComCd?: string,
|
prgrsSttsComCd?: string,
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ import {
|
|||||||
export const sewerBscPlanRegistSchema = z.object({
|
export const sewerBscPlanRegistSchema = z.object({
|
||||||
sewerBscPlan: sewerBscPlanSaveSchema.extend({
|
sewerBscPlan: sewerBscPlanSaveSchema.extend({
|
||||||
sewerBscPlanNm: z.string().min(1, "기본계획명은 필수입니다"),
|
sewerBscPlanNm: z.string().min(1, "기본계획명은 필수입니다"),
|
||||||
sewerBscPlanSeCdNm: z.string().optional(),
|
sewerBscPlanSeCdNm: z.string().nullish(),
|
||||||
taskSeCdNm: z.string().optional(),
|
taskSeCdNm: z.string().nullish(),
|
||||||
sido: z.string().optional(),
|
sido: z.string().nullish(),
|
||||||
gugun: z.string().nullish(),
|
gugun: z.string().nullish(),
|
||||||
}),
|
}),
|
||||||
sewerBscPlanDtl: sewerBscPlanDtlSaveSchema.extend({
|
sewerBscPlanDtl: sewerBscPlanDtlSaveSchema.extend({
|
||||||
@@ -61,7 +61,7 @@ export const sewerBscPlanRegistSchema = z.object({
|
|||||||
sewerBscPlanTmplntItemSchema.extend({
|
sewerBscPlanTmplntItemSchema.extend({
|
||||||
swtrmtFcltCd: z.string(),
|
swtrmtFcltCd: z.string(),
|
||||||
swtrmtFcltNm: z.string().nullish(),
|
swtrmtFcltNm: z.string().nullish(),
|
||||||
atchFileNm: z.string().optional(),
|
atchFileNm: z.string().nullish(),
|
||||||
sewerBscPlanTmplntDtlList: z
|
sewerBscPlanTmplntDtlList: z
|
||||||
.array(
|
.array(
|
||||||
sewerBscPlanTmplntDtlItemSchema.extend({
|
sewerBscPlanTmplntDtlItemSchema.extend({
|
||||||
@@ -69,7 +69,7 @@ export const sewerBscPlanRegistSchema = z.object({
|
|||||||
swtrmtFcltCd: z.string(),
|
swtrmtFcltCd: z.string(),
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.optional(),
|
.nullish(),
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
cklstResultList: z.array(
|
cklstResultList: z.array(
|
||||||
@@ -78,7 +78,7 @@ export const sewerBscPlanRegistSchema = z.object({
|
|||||||
cklstArtclSn: z.number(),
|
cklstArtclSn: z.number(),
|
||||||
cklstRvwSn: z.number(),
|
cklstRvwSn: z.number(),
|
||||||
selected: z.enum(["Y", "N"]).nullish(),
|
selected: z.enum(["Y", "N"]).nullish(),
|
||||||
picRvwCn: z.string().nullable().optional(),
|
picRvwCn: z.string().nullish(),
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
esntlAtchFileList: z.array(
|
esntlAtchFileList: z.array(
|
||||||
@@ -90,9 +90,9 @@ export const sewerBscPlanRegistSchema = z.object({
|
|||||||
splmntDmndList: z.array(
|
splmntDmndList: z.array(
|
||||||
sewerBscPlanSplmntDmndItemSchema.extend({
|
sewerBscPlanSplmntDmndItemSchema.extend({
|
||||||
splmntArtclCdNm: z.string().nullish(),
|
splmntArtclCdNm: z.string().nullish(),
|
||||||
splmntDmndAtchFileNm: z.string().optional(),
|
splmntDmndAtchFileNm: z.string().nullish(),
|
||||||
splmntAtchFileNm: z.string().optional(),
|
splmntAtchFileNm: z.string().nullish(),
|
||||||
splmntAtchFileAtflId: z.string().optional(),
|
splmntAtchFileAtflId: z.string().nullish(),
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
privacyConsent: z.enum(["Y", "N"], {
|
privacyConsent: z.enum(["Y", "N"], {
|
||||||
|
|||||||
@@ -42,6 +42,12 @@ export type ChecklistStepMap = Record<ReviewStepCode, CklstRvwRsltTreeDto[]>;
|
|||||||
|
|
||||||
export const REVIEW_STEP_CODES: ReviewStepCode[] = ["LOCAL", "ENV", "KECO"];
|
export const REVIEW_STEP_CODES: ReviewStepCode[] = ["LOCAL", "ENV", "KECO"];
|
||||||
|
|
||||||
|
export const CHECKLIST_TAB_LABELS: Record<ReviewStepCode, string> = {
|
||||||
|
LOCAL: "자가체크",
|
||||||
|
ENV: "기술검토",
|
||||||
|
KECO: "환경청검토",
|
||||||
|
};
|
||||||
|
|
||||||
export const REVIEW_STEP_LABELS: Record<ReviewStepCode, string> = {
|
export const REVIEW_STEP_LABELS: Record<ReviewStepCode, string> = {
|
||||||
LOCAL: "지자체",
|
LOCAL: "지자체",
|
||||||
ENV: "환경청",
|
ENV: "환경청",
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ interface PreviousPlanLookupDialogProps {
|
|||||||
open: boolean;
|
open: boolean;
|
||||||
onOpenChange: (open: boolean) => void;
|
onOpenChange: (open: boolean) => void;
|
||||||
/** 부모 폼 `sewerBscPlan.sido` 표시명 */
|
/** 부모 폼 `sewerBscPlan.sido` 표시명 */
|
||||||
initialSidoNm?: string;
|
initialSidoNm?: string | null;
|
||||||
/** 부모 폼 `sewerBscPlan.gugun` 표시명 */
|
/** 부모 폼 `sewerBscPlan.gugun` 표시명 */
|
||||||
initialGugunNm?: string | null;
|
initialGugunNm?: string | null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import {
|
|||||||
extractTaskCodes,
|
extractTaskCodes,
|
||||||
getChecklistDisplayRows,
|
getChecklistDisplayRows,
|
||||||
} from "../../lib/checklist-utils";
|
} from "../../lib/checklist-utils";
|
||||||
import { getVisibleReviewSteps } from "../../lib/review-step-utils";
|
import { resolveVisibleReviewSteps } from "../../lib/review-step-utils";
|
||||||
import type { ReviewStepCode } from "../../model/view-types";
|
import type { ReviewStepCode } from "../../model/view-types";
|
||||||
import {
|
import {
|
||||||
|
CHECKLIST_TAB_LABELS,
|
||||||
type ChecklistFormState,
|
type ChecklistFormState,
|
||||||
REVIEW_STEP_LABELS,
|
|
||||||
ROLE_TO_REVIEW_STEP,
|
ROLE_TO_REVIEW_STEP,
|
||||||
TASK_CODE_LABELS,
|
TASK_CODE_LABELS,
|
||||||
} from "../../model/view-types";
|
} from "../../model/view-types";
|
||||||
@@ -37,8 +37,8 @@ function ChecklistSection({
|
|||||||
setFormState,
|
setFormState,
|
||||||
}: ChecklistSectionProps) {
|
}: ChecklistSectionProps) {
|
||||||
const visibleReviewSteps = useMemo(
|
const visibleReviewSteps = useMemo(
|
||||||
() => getVisibleReviewSteps(prgrsSttsComCd, userRoleCode),
|
() => resolveVisibleReviewSteps(prgrsSttsComCd, userRoleCode, cklstResultList),
|
||||||
[prgrsSttsComCd, userRoleCode],
|
[prgrsSttsComCd, userRoleCode, cklstResultList],
|
||||||
);
|
);
|
||||||
const taskCodes = useMemo(() => extractTaskCodes(cklstResultList), [cklstResultList]);
|
const taskCodes = useMemo(() => extractTaskCodes(cklstResultList), [cklstResultList]);
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ function ChecklistSection({
|
|||||||
<TabsList>
|
<TabsList>
|
||||||
{visibleReviewSteps.map((stepCode) => (
|
{visibleReviewSteps.map((stepCode) => (
|
||||||
<TabsTrigger key={stepCode} value={stepCode} className="!px-6 !py-3 text-xl">
|
<TabsTrigger key={stepCode} value={stepCode} className="!px-6 !py-3 text-xl">
|
||||||
{REVIEW_STEP_LABELS[stepCode]}
|
{CHECKLIST_TAB_LABELS[stepCode]}
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
))}
|
))}
|
||||||
</TabsList>
|
</TabsList>
|
||||||
|
|||||||
@@ -214,8 +214,8 @@ function TmplntFacilityMatrix({
|
|||||||
interface TmplntFacilityAttachmentsProps {
|
interface TmplntFacilityAttachmentsProps {
|
||||||
facilityIndex: number;
|
facilityIndex: number;
|
||||||
facilityName?: string;
|
facilityName?: string;
|
||||||
atchFileGroupId?: string;
|
atchFileGroupId?: string | null;
|
||||||
atchFileNm?: string;
|
atchFileNm?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function TmplntFacilityAttachments({
|
function TmplntFacilityAttachments({
|
||||||
|
|||||||
@@ -205,14 +205,14 @@ export interface EsntlAtchFileSaveBase {
|
|||||||
export interface SplmntDmndSaveBase {
|
export interface SplmntDmndSaveBase {
|
||||||
splmntDmndSn?: number | null;
|
splmntDmndSn?: number | null;
|
||||||
splmntArtclComCd?: string | null;
|
splmntArtclComCd?: string | null;
|
||||||
splmntDmndCn?: string;
|
splmntDmndCn?: string | null;
|
||||||
splmntDmndDt?: string;
|
splmntDmndDt?: string | null;
|
||||||
splmntDmndAtchFileGroupId?: string;
|
splmntDmndAtchFileGroupId?: string | null;
|
||||||
splmntCn?: string;
|
splmntCn?: string | null;
|
||||||
splmntPicNm?: string;
|
splmntPicNm?: string | null;
|
||||||
splmntCmptnDt?: string;
|
splmntCmptnDt?: string | null;
|
||||||
splmntAtchFileGroupId?: string;
|
splmntAtchFileGroupId?: string | null;
|
||||||
cmptnYn?: string;
|
cmptnYn?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 검토의견 저장 공통 필드 (문서번호 제외) */
|
/** 검토의견 저장 공통 필드 (문서번호 제외) */
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
interface CanEditPbadmsDocParams {
|
interface CanEditPbadmsDocParams {
|
||||||
docSeComCd: string;
|
docSeComCd: string;
|
||||||
prgrsSttsComCd: string | undefined;
|
prgrsSttsComCd?: string | null;
|
||||||
rgtr: string | undefined;
|
rgtr?: string | null;
|
||||||
loggedInUserUnqId: string | undefined;
|
loggedInUserUnqId?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function canEditPbadmsDoc({
|
function canEditPbadmsDoc({
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ export interface FnrsSharListItem {
|
|||||||
fnrsSharSeCd: string;
|
fnrsSharSeCd: string;
|
||||||
exstnAmt: number;
|
exstnAmt: number;
|
||||||
chgRqtAmt: number;
|
chgRqtAmt: number;
|
||||||
ajmtAmt?: number;
|
ajmtAmt?: number | null;
|
||||||
rmrkCn?: string;
|
rmrkCn?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type FnrsSharTreeNode = FnrsSharSeMngTreeDto | FnrsSharBizCstTreeDto;
|
export type FnrsSharTreeNode = FnrsSharSeMngTreeDto | FnrsSharBizCstTreeDto;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { Controller, useFormContext } from "react-hook-form";
|
import { useFormContext } from "react-hook-form";
|
||||||
|
|
||||||
import { useQueryClient } from "@tanstack/react-query";
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
import { Download } from "lucide-react";
|
import { Download } from "lucide-react";
|
||||||
@@ -78,7 +78,7 @@ function AttachmentsFormSection({
|
|||||||
initialEsntlFiles,
|
initialEsntlFiles,
|
||||||
initialEtcFiles,
|
initialEtcFiles,
|
||||||
}: AttachmentsFormSectionProps) {
|
}: AttachmentsFormSectionProps) {
|
||||||
const { control, getValues, setValue } = useFormContext<AttachmentsFormData>();
|
const { getValues, setValue } = useFormContext<AttachmentsFormData>();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const [uploadedFiles, setUploadedFiles] = useState<Record<string, UploadedFileItem[]>>({});
|
const [uploadedFiles, setUploadedFiles] = useState<Record<string, UploadedFileItem[]>>({});
|
||||||
const [etcFiles, setEtcFiles] = useState<EtcFileItem[]>([]);
|
const [etcFiles, setEtcFiles] = useState<EtcFileItem[]>([]);
|
||||||
@@ -373,89 +373,83 @@ function AttachmentsFormSection({
|
|||||||
return (
|
return (
|
||||||
<SectionCollapsible title="첨부파일">
|
<SectionCollapsible title="첨부파일">
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
<Controller
|
<div className="px-2">
|
||||||
name="esntlAtchFileList"
|
<h3 className="mb-4 text-xl font-semibold">필수 첨부파일</h3>
|
||||||
control={control}
|
<Table variant="secondary" className="table-fixed">
|
||||||
render={() => (
|
<colgroup>
|
||||||
<div className="px-2">
|
<col width="44%" />
|
||||||
<h3 className="mb-4 text-xl font-semibold">필수 첨부파일</h3>
|
<col width="12%" />
|
||||||
<Table variant="secondary" className="table-fixed">
|
<col width="44%" />
|
||||||
<colgroup>
|
</colgroup>
|
||||||
<col width="44%" />
|
<TableHeader>
|
||||||
<col width="12%" />
|
<TableRow>
|
||||||
<col width="44%" />
|
<TableHead className="w-[30rem]" align="left">
|
||||||
</colgroup>
|
파일명
|
||||||
<TableHeader>
|
</TableHead>
|
||||||
<TableRow>
|
<TableHead>파일 확장자</TableHead>
|
||||||
<TableHead className="w-[30rem]" align="left">
|
<TableHead>파일첨부</TableHead>
|
||||||
파일명
|
</TableRow>
|
||||||
</TableHead>
|
</TableHeader>
|
||||||
<TableHead>파일 확장자</TableHead>
|
<TableBody>
|
||||||
<TableHead>파일첨부</TableHead>
|
{essentialFiles.length === 0 ? (
|
||||||
</TableRow>
|
<TableRow>
|
||||||
</TableHeader>
|
<TableCell colSpan={4} className="py-12 text-center text-muted-foreground">
|
||||||
<TableBody>
|
조회된 필수 첨부파일 항목이 없습니다.
|
||||||
{essentialFiles.length === 0 ? (
|
</TableCell>
|
||||||
<TableRow>
|
</TableRow>
|
||||||
<TableCell colSpan={4} className="py-12 text-center text-muted-foreground">
|
) : (
|
||||||
조회된 필수 첨부파일 항목이 없습니다.
|
essentialFiles.map((file) => {
|
||||||
|
const atflCd = file.atchFileGroupId ?? "";
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TableRow key={file.esntlAtchFileId}>
|
||||||
|
<TableHead
|
||||||
|
className="group break-keep font-medium"
|
||||||
|
data-required={file.esntlAtchYn === "Y"}
|
||||||
|
align="left"
|
||||||
|
>
|
||||||
|
<div className="inline-flex w-[calc(100%-1rem)] items-center justify-between gap-10">
|
||||||
|
{file.esntlAtchFileNm}
|
||||||
|
{atflCd ? (
|
||||||
|
<Button
|
||||||
|
size="sm"
|
||||||
|
color="white"
|
||||||
|
onClick={() => downloadTemplate(atflCd)}
|
||||||
|
>
|
||||||
|
<Download className="!size-5 shrink-0" />
|
||||||
|
양식내려받기
|
||||||
|
</Button>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
<TableCell align="center">{file.esntlAtchFileRmrk}</TableCell>
|
||||||
|
<TableCell className="space-y-2">
|
||||||
|
<AttachmentFileField
|
||||||
|
files={(uploadedFiles[file.esntlAtchFileId] ?? []).map((item) => ({
|
||||||
|
fileKey: item.fileKey,
|
||||||
|
fileName: item.file?.name ?? item.fileName,
|
||||||
|
onDownload: item.atflId
|
||||||
|
? () => downloadByAtflId(item.atflId!)
|
||||||
|
: undefined,
|
||||||
|
}))}
|
||||||
|
inputId={`${file.esntlAtchFileId}-file-input`}
|
||||||
|
isUploadingByKey={isUploading}
|
||||||
|
accept={toFileAccept(file.esntlAtchFileRmrk) || undefined}
|
||||||
|
onAdd={(fileList) =>
|
||||||
|
void handleEssentialFileUpload(file.esntlAtchFileId, fileList)
|
||||||
|
}
|
||||||
|
onRemove={(index) =>
|
||||||
|
void removeEssentialFile(file.esntlAtchFileId, index)
|
||||||
|
}
|
||||||
|
/>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
) : (
|
);
|
||||||
essentialFiles.map((file) => {
|
})
|
||||||
const atflCd = file.atchFileGroupId ?? "";
|
)}
|
||||||
|
</TableBody>
|
||||||
return (
|
</Table>
|
||||||
<TableRow key={file.esntlAtchFileId}>
|
</div>
|
||||||
<TableHead
|
|
||||||
className="group break-keep font-medium"
|
|
||||||
data-required={file.esntlAtchYn === "Y"}
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
<div className="inline-flex w-[calc(100%-1rem)] items-center justify-between gap-10">
|
|
||||||
{file.esntlAtchFileNm}
|
|
||||||
{atflCd ? (
|
|
||||||
<Button
|
|
||||||
size="sm"
|
|
||||||
color="white"
|
|
||||||
onClick={() => downloadTemplate(atflCd)}
|
|
||||||
>
|
|
||||||
<Download className="!size-5 shrink-0" />
|
|
||||||
양식내려받기
|
|
||||||
</Button>
|
|
||||||
) : null}
|
|
||||||
</div>
|
|
||||||
</TableHead>
|
|
||||||
<TableCell align="center">{file.esntlAtchFileRmrk}</TableCell>
|
|
||||||
<TableCell className="space-y-2">
|
|
||||||
<AttachmentFileField
|
|
||||||
files={(uploadedFiles[file.esntlAtchFileId] ?? []).map((item) => ({
|
|
||||||
fileKey: item.fileKey,
|
|
||||||
fileName: item.file?.name ?? item.fileName,
|
|
||||||
onDownload: item.atflId
|
|
||||||
? () => downloadByAtflId(item.atflId!)
|
|
||||||
: undefined,
|
|
||||||
}))}
|
|
||||||
inputId={`${file.esntlAtchFileId}-file-input`}
|
|
||||||
isUploadingByKey={isUploading}
|
|
||||||
accept={toFileAccept(file.esntlAtchFileRmrk) || undefined}
|
|
||||||
onAdd={(fileList) =>
|
|
||||||
void handleEssentialFileUpload(file.esntlAtchFileId, fileList)
|
|
||||||
}
|
|
||||||
onRemove={(index) =>
|
|
||||||
void removeEssentialFile(file.esntlAtchFileId, index)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
);
|
|
||||||
})
|
|
||||||
)}
|
|
||||||
</TableBody>
|
|
||||||
</Table>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="px-2">
|
<div className="px-2">
|
||||||
<div className="mb-4 flex items-center justify-between">
|
<div className="mb-4 flex items-center justify-between">
|
||||||
|
|||||||
@@ -43,12 +43,13 @@ function AttachmentsViewSection({ esntlFileList, etcFileList }: AttachmentsViewS
|
|||||||
) : (
|
) : (
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
{files.map((file) => (
|
{files.map((file) => (
|
||||||
<AttachmentDownloadLink
|
<div key={file.atflId}>
|
||||||
key={file.atflId}
|
<AttachmentDownloadLink
|
||||||
atflId={file.atflId}
|
atflId={file.atflId}
|
||||||
fileName={file.orgnlFileNm || "다운로드"}
|
fileName={file.orgnlFileNm || "다운로드"}
|
||||||
className="items-center"
|
className="items-center"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect, useMemo } from "react";
|
import { useEffect, useMemo } from "react";
|
||||||
import { Controller, useFormContext, useWatch } from "react-hook-form";
|
import { useFormContext, useWatch } from "react-hook-form";
|
||||||
|
|
||||||
import { SectionCollapsible } from "@/shared/ui";
|
import { SectionCollapsible } from "@/shared/ui";
|
||||||
import { Field } from "@/shared/ui/field";
|
import { Field } from "@/shared/ui/field";
|
||||||
@@ -31,6 +31,16 @@ interface BusinessCostFormData {
|
|||||||
|
|
||||||
type CostFieldKey = "bscPlanAmt" | "bgtRfltAmt" | "tstmDesignAmt";
|
type CostFieldKey = "bscPlanAmt" | "bgtRfltAmt" | "tstmDesignAmt";
|
||||||
|
|
||||||
|
function isSameBizCstCodes(
|
||||||
|
current: BusinessCostFormData["bizCstList"],
|
||||||
|
next: BusinessCostFormData["bizCstList"],
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
current.length === next.length &&
|
||||||
|
current.every((item, index) => item.acntgSeCd === next[index]?.acntgSeCd)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function BusinessCostFormSection() {
|
function BusinessCostFormSection() {
|
||||||
const { control, setValue, getValues } = useFormContext<BusinessCostFormData>();
|
const { control, setValue, getValues } = useFormContext<BusinessCostFormData>();
|
||||||
const bizCstList = useWatch({ control, name: "bizCstList" }) ?? [];
|
const bizCstList = useWatch({ control, name: "bizCstList" }) ?? [];
|
||||||
@@ -42,22 +52,22 @@ function BusinessCostFormSection() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (costItems.length === 0) return;
|
if (costItems.length === 0) return;
|
||||||
|
|
||||||
const existingMap = new Map(getValues("bizCstList").map((item) => [item.acntgSeCd, item]));
|
const current = getValues("bizCstList") ?? [];
|
||||||
|
const existingMap = new Map(current.map((item) => [item.acntgSeCd, item]));
|
||||||
|
const next = costItems.map((item) => {
|
||||||
|
const existing = existingMap.get(item.code);
|
||||||
|
if (existing) return existing;
|
||||||
|
|
||||||
setValue(
|
return {
|
||||||
"bizCstList",
|
acntgSeCd: item.code,
|
||||||
costItems.map((item) => {
|
bscPlanAmt: 0,
|
||||||
const existing = existingMap.get(item.code);
|
bgtRfltAmt: 0,
|
||||||
if (existing) return existing;
|
tstmDesignAmt: 0,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
if (isSameBizCstCodes(current, next)) return;
|
||||||
acntgSeCd: item.code,
|
setValue("bizCstList", next);
|
||||||
bscPlanAmt: 0,
|
|
||||||
bgtRfltAmt: 0,
|
|
||||||
tstmDesignAmt: 0,
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}, [costItems, getValues, setValue]);
|
}, [costItems, getValues, setValue]);
|
||||||
|
|
||||||
function handleCostChange(index: number, fieldKey: CostFieldKey, value: string) {
|
function handleCostChange(index: number, fieldKey: CostFieldKey, value: string) {
|
||||||
@@ -119,58 +129,37 @@ function BusinessCostFormSection() {
|
|||||||
</div>
|
</div>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Controller
|
<Field>
|
||||||
name={`bizCstList.${idx}.bgtRfltAmt`}
|
<Input
|
||||||
control={control}
|
type="number"
|
||||||
render={({ field, fieldState }) => (
|
value={data.bgtRfltAmt ?? ""}
|
||||||
<Field data-invalid={fieldState.invalid}>
|
onChange={(e) => handleCostChange(idx, "bgtRfltAmt", e.target.value)}
|
||||||
<Input
|
readOnly={item.readonly}
|
||||||
type="number"
|
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
|
||||||
value={field.value || ""}
|
/>
|
||||||
onChange={(e) => handleCostChange(idx, "bgtRfltAmt", e.target.value)}
|
</Field>
|
||||||
readOnly={item.readonly}
|
|
||||||
aria-invalid={fieldState.invalid}
|
|
||||||
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
|
|
||||||
/>
|
|
||||||
</Field>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Controller
|
<Field>
|
||||||
name={`bizCstList.${idx}.bscPlanAmt`}
|
<Input
|
||||||
control={control}
|
type="number"
|
||||||
render={({ field, fieldState }) => (
|
value={data.bscPlanAmt ?? ""}
|
||||||
<Field data-invalid={fieldState.invalid}>
|
onChange={(e) => handleCostChange(idx, "bscPlanAmt", e.target.value)}
|
||||||
<Input
|
readOnly={item.readonly}
|
||||||
type="number"
|
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
|
||||||
value={field.value || ""}
|
/>
|
||||||
onChange={(e) => handleCostChange(idx, "bscPlanAmt", e.target.value)}
|
</Field>
|
||||||
readOnly={item.readonly}
|
|
||||||
aria-invalid={fieldState.invalid}
|
|
||||||
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
|
|
||||||
/>
|
|
||||||
</Field>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Controller
|
<Field>
|
||||||
name={`bizCstList.${idx}.tstmDesignAmt`}
|
<Input
|
||||||
control={control}
|
type="number"
|
||||||
render={({ field, fieldState }) => (
|
value={data.tstmDesignAmt ?? ""}
|
||||||
<Field data-invalid={fieldState.invalid}>
|
onChange={(e) => handleCostChange(idx, "tstmDesignAmt", e.target.value)}
|
||||||
<Input
|
readOnly={item.readonly}
|
||||||
type="number"
|
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
|
||||||
value={field.value || ""}
|
/>
|
||||||
onChange={(e) => handleCostChange(idx, "tstmDesignAmt", e.target.value)}
|
</Field>
|
||||||
readOnly={item.readonly}
|
|
||||||
aria-invalid={fieldState.invalid}
|
|
||||||
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
|
|
||||||
/>
|
|
||||||
</Field>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<div className="text-right">
|
<div className="text-right">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect, useMemo } from "react";
|
import { useEffect, useMemo } from "react";
|
||||||
import { Controller, useFormContext, useWatch } from "react-hook-form";
|
import { useFormContext, useWatch } from "react-hook-form";
|
||||||
|
|
||||||
import { SectionCollapsible } from "@/shared/ui";
|
import { SectionCollapsible } from "@/shared/ui";
|
||||||
import { Field } from "@/shared/ui/field";
|
import { Field } from "@/shared/ui/field";
|
||||||
@@ -31,6 +31,16 @@ interface BusinessScaleFormData {
|
|||||||
|
|
||||||
type ScaleFieldKey = "bscPl" | "budgetReflct" | "thtiDsgn";
|
type ScaleFieldKey = "bscPl" | "budgetReflct" | "thtiDsgn";
|
||||||
|
|
||||||
|
function isSameBzScaleCodes(
|
||||||
|
current: BusinessScaleFormData["bzScaleList"],
|
||||||
|
next: BusinessScaleFormData["bzScaleList"],
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
current.length === next.length &&
|
||||||
|
current.every((item, index) => item.cnstpSeCd === next[index]?.cnstpSeCd)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function BusinessScaleFormSection() {
|
function BusinessScaleFormSection() {
|
||||||
const { control, setValue, getValues } = useFormContext<BusinessScaleFormData>();
|
const { control, setValue, getValues } = useFormContext<BusinessScaleFormData>();
|
||||||
const bzScaleList = useWatch({ control, name: "bzScaleList" }) ?? [];
|
const bzScaleList = useWatch({ control, name: "bzScaleList" }) ?? [];
|
||||||
@@ -42,7 +52,8 @@ function BusinessScaleFormSection() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (scaleItems.length === 0) return;
|
if (scaleItems.length === 0) return;
|
||||||
|
|
||||||
const existingMap = new Map(getValues("bzScaleList").map((item) => [item.cnstpSeCd, item]));
|
const current = getValues("bzScaleList") ?? [];
|
||||||
|
const existingMap = new Map(current.map((item) => [item.cnstpSeCd, item]));
|
||||||
|
|
||||||
const next = scaleItems.map((item) => {
|
const next = scaleItems.map((item) => {
|
||||||
const existing = existingMap.get(item.code);
|
const existing = existingMap.get(item.code);
|
||||||
@@ -57,6 +68,7 @@ function BusinessScaleFormSection() {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (isSameBzScaleCodes(current, next)) return;
|
||||||
setValue("bzScaleList", recalculateBzScaleTotals(next, scaleItems));
|
setValue("bzScaleList", recalculateBzScaleTotals(next, scaleItems));
|
||||||
}, [scaleItems, getValues, setValue]);
|
}, [scaleItems, getValues, setValue]);
|
||||||
|
|
||||||
@@ -112,58 +124,37 @@ function BusinessScaleFormSection() {
|
|||||||
</div>
|
</div>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Controller
|
<Field>
|
||||||
name={`bzScaleList.${idx}.bscPl`}
|
<Input
|
||||||
control={control}
|
type="number"
|
||||||
render={({ field, fieldState }) => (
|
value={data.bscPl ?? ""}
|
||||||
<Field data-invalid={fieldState.invalid}>
|
onChange={(e) => handleScaleChange(idx, "bscPl", e.target.value)}
|
||||||
<Input
|
readOnly={item.readonly}
|
||||||
type="number"
|
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
|
||||||
value={field.value || ""}
|
/>
|
||||||
onChange={(e) => handleScaleChange(idx, "bscPl", e.target.value)}
|
</Field>
|
||||||
readOnly={item.readonly}
|
|
||||||
aria-invalid={fieldState.invalid}
|
|
||||||
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
|
|
||||||
/>
|
|
||||||
</Field>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Controller
|
<Field>
|
||||||
name={`bzScaleList.${idx}.budgetReflct`}
|
<Input
|
||||||
control={control}
|
type="number"
|
||||||
render={({ field, fieldState }) => (
|
value={data.budgetReflct ?? ""}
|
||||||
<Field data-invalid={fieldState.invalid}>
|
onChange={(e) => handleScaleChange(idx, "budgetReflct", e.target.value)}
|
||||||
<Input
|
readOnly={item.readonly}
|
||||||
type="number"
|
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
|
||||||
value={field.value || ""}
|
/>
|
||||||
onChange={(e) => handleScaleChange(idx, "budgetReflct", e.target.value)}
|
</Field>
|
||||||
readOnly={item.readonly}
|
|
||||||
aria-invalid={fieldState.invalid}
|
|
||||||
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
|
|
||||||
/>
|
|
||||||
</Field>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Controller
|
<Field>
|
||||||
name={`bzScaleList.${idx}.thtiDsgn`}
|
<Input
|
||||||
control={control}
|
type="number"
|
||||||
render={({ field, fieldState }) => (
|
value={data.thtiDsgn ?? ""}
|
||||||
<Field data-invalid={fieldState.invalid}>
|
onChange={(e) => handleScaleChange(idx, "thtiDsgn", e.target.value)}
|
||||||
<Input
|
readOnly={item.readonly}
|
||||||
type="number"
|
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
|
||||||
value={field.value || ""}
|
/>
|
||||||
onChange={(e) => handleScaleChange(idx, "thtiDsgn", e.target.value)}
|
</Field>
|
||||||
readOnly={item.readonly}
|
|
||||||
aria-invalid={fieldState.invalid}
|
|
||||||
className={`text-right ${item.readonly ? "bg-muted" : ""}`}
|
|
||||||
/>
|
|
||||||
</Field>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<div className="text-right">
|
<div className="text-right">
|
||||||
|
|||||||
@@ -1,18 +1,15 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect, useMemo, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { Controller, useFormContext, useWatch } from "react-hook-form";
|
import { useFormContext, useWatch } from "react-hook-form";
|
||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
import { SectionCollapsible } from "@/shared/ui";
|
import { SectionCollapsible } from "@/shared/ui";
|
||||||
import { Field, FieldLabel } from "@/shared/ui/field";
|
|
||||||
import { cklstMngService, type CklstTreeNode } from "@/entities/cklst";
|
import { cklstMngService, type CklstTreeNode } from "@/entities/cklst";
|
||||||
import { useCodeList } from "@/entities/code";
|
import { useCodeList } from "@/entities/code";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
RadioGroup,
|
|
||||||
RadioGroupItem,
|
|
||||||
Skeleton,
|
Skeleton,
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
@@ -125,11 +122,21 @@ function ChecklistFormSection({ docSeComCd, fieldPrefix }: ChecklistFormSectionP
|
|||||||
}
|
}
|
||||||
}, [checklistTabs, activeTab]);
|
}, [checklistTabs, activeTab]);
|
||||||
|
|
||||||
|
function handleSelectChange(resultIdx: number, value: "Y" | "N") {
|
||||||
|
const currentList = getValues("cklstResultList") as CklstResultListItem[];
|
||||||
|
const row = currentList[resultIdx];
|
||||||
|
if (!row) return;
|
||||||
|
|
||||||
|
const newList = [...currentList];
|
||||||
|
newList[resultIdx] = { ...row, selected: value };
|
||||||
|
setValue("cklstResultList", newList, { shouldDirty: true });
|
||||||
|
}
|
||||||
|
|
||||||
function handleSelectAll(tabCode: string, value: "Y" | "N") {
|
function handleSelectAll(tabCode: string, value: "Y" | "N") {
|
||||||
const tab = checklistTabs.find((t) => t.code === tabCode);
|
const tab = checklistTabs.find((t) => t.code === tabCode);
|
||||||
if (!tab) return;
|
if (!tab) return;
|
||||||
|
|
||||||
const currentList = getValues("cklstResultList");
|
const currentList = getValues("cklstResultList") as CklstResultListItem[];
|
||||||
const newList = [...currentList];
|
const newList = [...currentList];
|
||||||
|
|
||||||
tab.items
|
tab.items
|
||||||
@@ -141,7 +148,7 @@ function ChecklistFormSection({ docSeComCd, fieldPrefix }: ChecklistFormSectionP
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setValue("cklstResultList", newList);
|
setValue("cklstResultList", newList, { shouldDirty: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasSelectedTaskCodes = Boolean(taskSeComCdArray?.length);
|
const hasSelectedTaskCodes = Boolean(taskSeComCdArray?.length);
|
||||||
@@ -234,6 +241,8 @@ function ChecklistFormSection({ docSeComCd, fieldPrefix }: ChecklistFormSectionP
|
|||||||
{tab.items.map((item) => {
|
{tab.items.map((item) => {
|
||||||
const resultIdx = cklstRvwSnIndexMap.get(item.cklstRvwSn) ?? -1;
|
const resultIdx = cklstRvwSnIndexMap.get(item.cklstRvwSn) ?? -1;
|
||||||
const showRadios = item.bchckUseYn === "Y";
|
const showRadios = item.bchckUseYn === "Y";
|
||||||
|
const selected = cklstResultList[resultIdx]?.selected;
|
||||||
|
const radioName = `check-${item.cklstRvwSn}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableRow key={item.cklstRvwSn}>
|
<TableRow key={item.cklstRvwSn}>
|
||||||
@@ -248,66 +257,30 @@ function ChecklistFormSection({ docSeComCd, fieldPrefix }: ChecklistFormSectionP
|
|||||||
{item.content}
|
{item.content}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
{showRadios && resultIdx >= 0 ? (
|
{showRadios && resultIdx >= 0 ? (
|
||||||
<Controller
|
<>
|
||||||
name={`cklstResultList.${resultIdx}.selected`}
|
<TableCell className="text-center">
|
||||||
control={control}
|
<input
|
||||||
render={({ field, fieldState }) => (
|
type="radio"
|
||||||
<>
|
name={radioName}
|
||||||
<TableCell className="text-center">
|
value="Y"
|
||||||
<RadioGroup
|
checked={selected === "Y"}
|
||||||
name={field.name}
|
onChange={() => handleSelectChange(resultIdx, "Y")}
|
||||||
value={field.value === "Y" ? "Y" : undefined}
|
aria-label="예"
|
||||||
onValueChange={field.onChange}
|
className="cursor-pointer"
|
||||||
className="flex justify-center"
|
/>
|
||||||
>
|
</TableCell>
|
||||||
<FieldLabel
|
<TableCell className="text-center">
|
||||||
htmlFor={`check-${item.cklstRvwSn}-Y`}
|
<input
|
||||||
className="!w-auto justify-center border-none"
|
type="radio"
|
||||||
>
|
name={radioName}
|
||||||
<Field
|
value="N"
|
||||||
orientation="horizontal"
|
checked={selected === "N"}
|
||||||
data-invalid={fieldState.invalid}
|
onChange={() => handleSelectChange(resultIdx, "N")}
|
||||||
className="w-auto"
|
aria-label="아니오"
|
||||||
>
|
className="cursor-pointer"
|
||||||
<RadioGroupItem
|
/>
|
||||||
value="Y"
|
</TableCell>
|
||||||
id={`check-${item.cklstRvwSn}-Y`}
|
</>
|
||||||
aria-invalid={fieldState.invalid}
|
|
||||||
aria-label="예"
|
|
||||||
/>
|
|
||||||
</Field>
|
|
||||||
</FieldLabel>
|
|
||||||
</RadioGroup>
|
|
||||||
</TableCell>
|
|
||||||
<TableCell className="text-center">
|
|
||||||
<RadioGroup
|
|
||||||
name={field.name}
|
|
||||||
value={field.value === "N" ? "N" : undefined}
|
|
||||||
onValueChange={field.onChange}
|
|
||||||
className="flex justify-center"
|
|
||||||
>
|
|
||||||
<FieldLabel
|
|
||||||
htmlFor={`check-${item.cklstRvwSn}-N`}
|
|
||||||
className="!w-auto justify-center border-none"
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
orientation="horizontal"
|
|
||||||
data-invalid={fieldState.invalid}
|
|
||||||
className="w-auto"
|
|
||||||
>
|
|
||||||
<RadioGroupItem
|
|
||||||
value="N"
|
|
||||||
id={`check-${item.cklstRvwSn}-N`}
|
|
||||||
aria-invalid={fieldState.invalid}
|
|
||||||
aria-label="아니오"
|
|
||||||
/>
|
|
||||||
</Field>
|
|
||||||
</FieldLabel>
|
|
||||||
</RadioGroup>
|
|
||||||
</TableCell>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
) : null}
|
) : null}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect, useMemo, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { Controller, useFormContext, useWatch } from "react-hook-form";
|
import { useFormContext, useWatch } from "react-hook-form";
|
||||||
|
|
||||||
import { getDefaultFileKey, useTus } from "@/shared/lib";
|
import { getDefaultFileKey, useTus } from "@/shared/lib";
|
||||||
import { TextShimmer } from "@/shared/ui";
|
import { AttachmentFileField, SectionCollapsible } from "@/shared/ui";
|
||||||
import { SectionCollapsible } from "@/shared/ui";
|
|
||||||
import { Field } from "@/shared/ui/field";
|
import { Field } from "@/shared/ui/field";
|
||||||
import { useAcntgSeMngTree } from "@/entities/acntg";
|
import { useAcntgSeMngTree } from "@/entities/acntg";
|
||||||
|
import { useDownloadAttachmentByAtflId } from "@/entities/attach";
|
||||||
import type { AtflMngClientResponseDto } from "@/entities/fnrs-cnsltn";
|
import type { AtflMngClientResponseDto } from "@/entities/fnrs-cnsltn";
|
||||||
import type { FnrsSharBizCstTreeDto } from "@/entities/fnrs-shar-se";
|
import type { FnrsSharBizCstTreeDto } from "@/entities/fnrs-shar-se";
|
||||||
import { useFnrsSharSeMngTree } from "@/entities/fnrs-shar-se";
|
import { useFnrsSharSeMngTree } from "@/entities/fnrs-shar-se";
|
||||||
import {
|
import {
|
||||||
Button,
|
|
||||||
cn,
|
cn,
|
||||||
Input,
|
Input,
|
||||||
Skeleton,
|
Skeleton,
|
||||||
@@ -37,6 +36,7 @@ import { calcDiffPercent } from "../lib/format-utils";
|
|||||||
import { BizCstTotalDisplayTable } from "./biz-cst-total-display-table";
|
import { BizCstTotalDisplayTable } from "./biz-cst-total-display-table";
|
||||||
|
|
||||||
const SHAR_FILE_KEY_PREFIX = "fnrs-shar::";
|
const SHAR_FILE_KEY_PREFIX = "fnrs-shar::";
|
||||||
|
const SHAR_FILE_ACCEPT = ".hwp,.hwpx";
|
||||||
|
|
||||||
interface FnrsSharFormData {
|
interface FnrsSharFormData {
|
||||||
fnrsSharList: FnrsSharListItem[];
|
fnrsSharList: FnrsSharListItem[];
|
||||||
@@ -53,6 +53,12 @@ interface FnrsSharFormData {
|
|||||||
|
|
||||||
type SharFieldKey = "exstnAmt" | "chgRqtAmt" | "rmrkCn";
|
type SharFieldKey = "exstnAmt" | "chgRqtAmt" | "rmrkCn";
|
||||||
|
|
||||||
|
interface SharUploadedFile {
|
||||||
|
fileKey: string;
|
||||||
|
fileName: string;
|
||||||
|
atflId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
interface FnrsSharFormSectionProps {
|
interface FnrsSharFormSectionProps {
|
||||||
initialSharTree?: FnrsSharBizCstTreeDto[];
|
initialSharTree?: FnrsSharBizCstTreeDto[];
|
||||||
initialSharAtchFiles?: AtflMngClientResponseDto[];
|
initialSharAtchFiles?: AtflMngClientResponseDto[];
|
||||||
@@ -62,12 +68,30 @@ function createSharUploadKey(file: File) {
|
|||||||
return `${SHAR_FILE_KEY_PREFIX}${getDefaultFileKey(file)}`;
|
return `${SHAR_FILE_KEY_PREFIX}${getDefaultFileKey(file)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toInitialSharFile(file?: AtflMngClientResponseDto): SharUploadedFile | null {
|
||||||
|
if (!file?.orgnlFileNm) return null;
|
||||||
|
|
||||||
|
return {
|
||||||
|
fileKey: file.atflId ? `server::${file.atflId}` : `${SHAR_FILE_KEY_PREFIX}${file.atflCd}`,
|
||||||
|
fileName: file.orgnlFileNm,
|
||||||
|
atflId: file.atflId,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function isSameFnrsSharCodes(current: FnrsSharListItem[], next: FnrsSharListItem[]) {
|
||||||
|
return (
|
||||||
|
current.length === next.length &&
|
||||||
|
current.every((item, index) => item.fnrsSharSeCd === next[index]?.fnrsSharSeCd)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsSharFormSectionProps) {
|
function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsSharFormSectionProps) {
|
||||||
const { control, setValue, getValues } = useFormContext<FnrsSharFormData>();
|
const { control, setValue, getValues } = useFormContext<FnrsSharFormData>();
|
||||||
const fnrsSharList = useWatch({ control, name: "fnrsSharList" }) ?? [];
|
const fnrsSharList = useWatch({ control, name: "fnrsSharList" }) ?? [];
|
||||||
const [uploadedFileName, setUploadedFileName] = useState(
|
const [uploadedFile, setUploadedFile] = useState<SharUploadedFile | null>(() =>
|
||||||
() => initialSharAtchFiles?.[0]?.orgnlFileNm ?? "",
|
toInitialSharFile(initialSharAtchFiles?.[0]),
|
||||||
);
|
);
|
||||||
|
const { mutate: downloadByAtflId } = useDownloadAttachmentByAtflId();
|
||||||
|
|
||||||
const { data: masterTree = [], isLoading: isMasterLoading } = useFnrsSharSeMngTree();
|
const { data: masterTree = [], isLoading: isMasterLoading } = useFnrsSharSeMngTree();
|
||||||
const { data: acntgTree = [] } = useAcntgSeMngTree();
|
const { data: acntgTree = [] } = useAcntgSeMngTree();
|
||||||
@@ -78,9 +102,13 @@ function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsShar
|
|||||||
const isLoading = initialSharTree?.length ? false : isMasterLoading;
|
const isLoading = initialSharTree?.length ? false : isMasterLoading;
|
||||||
|
|
||||||
const { uploadFileAsync, isUploading } = useTus({
|
const { uploadFileAsync, isUploading } = useTus({
|
||||||
onSuccess: (atflCd) => {
|
onSuccess: (atflCd, atflId, _file, fileKey) => {
|
||||||
if (!atflCd) return;
|
if (!atflCd) return;
|
||||||
setValue("fnrsCnsltnMng.sharAtchFileGroupId", atflCd, { shouldDirty: true });
|
setValue("fnrsCnsltnMng.sharAtchFileGroupId", atflCd, { shouldDirty: true });
|
||||||
|
setUploadedFile((prev) => (prev?.fileKey === fileKey ? { ...prev, atflId } : prev));
|
||||||
|
},
|
||||||
|
onError: (_error, _file, fileKey) => {
|
||||||
|
setUploadedFile((prev) => (prev?.fileKey === fileKey ? null : prev));
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const isSharUploading = Object.values(isUploading).some(Boolean);
|
const isSharUploading = Object.values(isUploading).some(Boolean);
|
||||||
@@ -96,6 +124,7 @@ function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsShar
|
|||||||
: mergeFnrsSharTreeWithForm(sharTree, []);
|
: mergeFnrsSharTreeWithForm(sharTree, []);
|
||||||
|
|
||||||
const withTotals = recalculateFnrsSharTotals(merged, sharItems);
|
const withTotals = recalculateFnrsSharTotals(merged, sharItems);
|
||||||
|
if (isSameFnrsSharCodes(existing, withTotals)) return;
|
||||||
setValue("fnrsSharList", withTotals);
|
setValue("fnrsSharList", withTotals);
|
||||||
}, [sharItems, sharTree, initialSharTree, getValues, setValue]);
|
}, [sharItems, sharTree, initialSharTree, getValues, setValue]);
|
||||||
|
|
||||||
@@ -120,16 +149,32 @@ function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsShar
|
|||||||
applySharList(draft);
|
applySharList(draft);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleSharFileChange(event: React.ChangeEvent<HTMLInputElement>) {
|
async function handleSharFileAdd(files: FileList | null) {
|
||||||
const file = event.target.files?.[0];
|
const file = files?.[0];
|
||||||
if (!file) return;
|
if (!file) return;
|
||||||
|
|
||||||
const fileKey = createSharUploadKey(file);
|
const fileKey = createSharUploadKey(file);
|
||||||
setUploadedFileName(file.name);
|
setUploadedFile({ fileName: file.name, fileKey });
|
||||||
await uploadFileAsync(file, { fileKey });
|
|
||||||
event.target.value = "";
|
try {
|
||||||
|
await uploadFileAsync(file, { fileKey });
|
||||||
|
} catch {
|
||||||
|
// onError callback handles cleanup
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const sharAtchFiles = uploadedFile
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
fileKey: uploadedFile.fileKey,
|
||||||
|
fileName: uploadedFile.fileName,
|
||||||
|
onDownload: uploadedFile.atflId
|
||||||
|
? () => downloadByAtflId(uploadedFile.atflId!)
|
||||||
|
: undefined,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: [];
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
<SectionCollapsible title="재원분담">
|
<SectionCollapsible title="재원분담">
|
||||||
@@ -189,40 +234,26 @@ function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsShar
|
|||||||
{item.label}
|
{item.label}
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Controller
|
<Field>
|
||||||
name={`fnrsSharList.${idx}.exstnAmt`}
|
<Input
|
||||||
control={control}
|
type="number"
|
||||||
render={({ field, fieldState }) => (
|
value={data.exstnAmt ?? ""}
|
||||||
<Field data-invalid={fieldState.invalid}>
|
onChange={(e) => handleSharChange(idx, "exstnAmt", e.target.value)}
|
||||||
<Input
|
readOnly={item.readonly}
|
||||||
type="number"
|
className={cn("text-right", item.readonly && "bg-muted")}
|
||||||
value={field.value ?? ""}
|
/>
|
||||||
onChange={(e) => handleSharChange(idx, "exstnAmt", e.target.value)}
|
</Field>
|
||||||
readOnly={item.readonly}
|
|
||||||
aria-invalid={fieldState.invalid}
|
|
||||||
className={cn("text-right", item.readonly && "bg-muted")}
|
|
||||||
/>
|
|
||||||
</Field>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Controller
|
<Field>
|
||||||
name={`fnrsSharList.${idx}.chgRqtAmt`}
|
<Input
|
||||||
control={control}
|
type="number"
|
||||||
render={({ field, fieldState }) => (
|
value={data.chgRqtAmt ?? ""}
|
||||||
<Field data-invalid={fieldState.invalid}>
|
onChange={(e) => handleSharChange(idx, "chgRqtAmt", e.target.value)}
|
||||||
<Input
|
readOnly={item.readonly}
|
||||||
type="number"
|
className={cn("text-right", item.readonly && "bg-muted")}
|
||||||
value={field.value ?? ""}
|
/>
|
||||||
onChange={(e) => handleSharChange(idx, "chgRqtAmt", e.target.value)}
|
</Field>
|
||||||
readOnly={item.readonly}
|
|
||||||
aria-invalid={fieldState.invalid}
|
|
||||||
className={cn("text-right", item.readonly && "bg-muted")}
|
|
||||||
/>
|
|
||||||
</Field>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<div className="text-right">
|
<div className="text-right">
|
||||||
@@ -233,19 +264,12 @@ function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsShar
|
|||||||
<div className="text-right">{calcDiffPercent(diff, data.exstnAmt || 0)}</div>
|
<div className="text-right">{calcDiffPercent(diff, data.exstnAmt || 0)}</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Controller
|
<Field>
|
||||||
name={`fnrsSharList.${idx}.rmrkCn`}
|
<Input
|
||||||
control={control}
|
value={data.rmrkCn ?? ""}
|
||||||
render={({ field, fieldState }) => (
|
onChange={(e) => handleSharChange(idx, "rmrkCn", e.target.value)}
|
||||||
<Field data-invalid={fieldState.invalid}>
|
/>
|
||||||
<Input
|
</Field>
|
||||||
value={field.value ?? ""}
|
|
||||||
onChange={(e) => handleSharChange(idx, "rmrkCn", e.target.value)}
|
|
||||||
aria-invalid={fieldState.invalid}
|
|
||||||
/>
|
|
||||||
</Field>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
@@ -257,31 +281,20 @@ function FnrsSharFormSection({ initialSharTree, initialSharAtchFiles }: FnrsShar
|
|||||||
|
|
||||||
<div className="mt-6 px-2 pb-2">
|
<div className="mt-6 px-2 pb-2">
|
||||||
<h3 className="mb-2 text-xl font-semibold">첨부파일</h3>
|
<h3 className="mb-2 text-xl font-semibold">첨부파일</h3>
|
||||||
<div className="flex flex-wrap items-center gap-2">
|
{!uploadedFile ? (
|
||||||
{isSharUploading && uploadedFileName ? (
|
<p className="mb-2 px-1 text-xl text-muted-foreground">
|
||||||
<TextShimmer className="max-w-lg text-xl" active>
|
총사업비 신청서(.hwp) 파일을 등록해주세요.
|
||||||
{uploadedFileName}
|
</p>
|
||||||
</TextShimmer>
|
) : null}
|
||||||
) : (
|
<AttachmentFileField
|
||||||
<Input
|
files={sharAtchFiles}
|
||||||
value={uploadedFileName}
|
inputId="fnrs-shar-atch-file-input"
|
||||||
readOnly
|
isUploadingByKey={isUploading}
|
||||||
placeholder="총사업비 신청서(.hwp) 파일을 등록해주세요."
|
accept={SHAR_FILE_ACCEPT}
|
||||||
className="max-w-lg rounded-sm"
|
multiple={false}
|
||||||
/>
|
addDisabled={isSharUploading}
|
||||||
)}
|
onAdd={(fileList) => void handleSharFileAdd(fileList)}
|
||||||
<Button type="button" color="white" disabled={isSharUploading} asChild>
|
/>
|
||||||
<label className="cursor-pointer">
|
|
||||||
첨부파일
|
|
||||||
<input
|
|
||||||
type="file"
|
|
||||||
accept=".hwp,.hwpx"
|
|
||||||
className="hidden"
|
|
||||||
onChange={handleSharFileChange}
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</SectionCollapsible>
|
</SectionCollapsible>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,7 +5,12 @@ import { Controller, useFormContext, useWatch } from "react-hook-form";
|
|||||||
|
|
||||||
import { dayjs, getDefaultFileKey, useTus } from "@/shared/lib";
|
import { dayjs, getDefaultFileKey, useTus } from "@/shared/lib";
|
||||||
import { AttachmentFileField, SectionCollapsible } from "@/shared/ui";
|
import { AttachmentFileField, SectionCollapsible } from "@/shared/ui";
|
||||||
import { AttachmentDownloadLink, attachService, useDownloadAttachmentByAtflId } from "@/entities/attach";
|
import {
|
||||||
|
AttachmentDownloadLink,
|
||||||
|
attachService,
|
||||||
|
useDownloadAttachmentByAtflId,
|
||||||
|
} from "@/entities/attach";
|
||||||
|
import { FnrsCnsltnSplmntDmndResponseDto } from "@/entities/fnrs-cnsltn";
|
||||||
import {
|
import {
|
||||||
Badge,
|
Badge,
|
||||||
Table,
|
Table,
|
||||||
@@ -46,6 +51,7 @@ interface SplmntDmndFormData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface SplmntDmndFormSectionProps {
|
interface SplmntDmndFormSectionProps {
|
||||||
|
initialData?: FnrsCnsltnSplmntDmndResponseDto[];
|
||||||
readOnly?: boolean;
|
readOnly?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +71,7 @@ function getRowKey(item: SplmntDmndFormItem, index: number) {
|
|||||||
return item.splmntDmndSn != null ? String(item.splmntDmndSn) : `idx-${index}`;
|
return item.splmntDmndSn != null ? String(item.splmntDmndSn) : `idx-${index}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function SplmntDmndFormSection({ readOnly = false }: SplmntDmndFormSectionProps) {
|
function SplmntDmndFormSection({ initialData, readOnly = false }: SplmntDmndFormSectionProps) {
|
||||||
const formId = useId();
|
const formId = useId();
|
||||||
const { control, setValue, getValues } = useFormContext<SplmntDmndFormData>();
|
const { control, setValue, getValues } = useFormContext<SplmntDmndFormData>();
|
||||||
const splmntDmndList = useWatch({ control, name: "splmntDmndList" }) ?? [];
|
const splmntDmndList = useWatch({ control, name: "splmntDmndList" }) ?? [];
|
||||||
@@ -260,6 +266,7 @@ function SplmntDmndFormSection({ readOnly = false }: SplmntDmndFormSectionProps)
|
|||||||
const isRowUploading = rowFiles.some((file) => isUploading[file.fileKey] ?? false);
|
const isRowUploading = rowFiles.some((file) => isUploading[file.fileKey] ?? false);
|
||||||
const fileInputId = `${formId}-${rowKey}-file`;
|
const fileInputId = `${formId}-${rowKey}-file`;
|
||||||
const isRowReadOnly = readOnly || item.cmptnYn === "Y";
|
const isRowReadOnly = readOnly || item.cmptnYn === "Y";
|
||||||
|
const splmntAtchFileInfo = initialData?.[index]?.splmntAtchFileInfo;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableRow key={rowKey}>
|
<TableRow key={rowKey}>
|
||||||
@@ -282,7 +289,15 @@ function SplmntDmndFormSection({ readOnly = false }: SplmntDmndFormSectionProps)
|
|||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className="align-top">
|
<TableCell className="align-top">
|
||||||
{isRowReadOnly ? (
|
{isRowReadOnly ? (
|
||||||
<span className="whitespace-pre-wrap">{item.splmntCn || "-"}</span>
|
<div className="space-y-2">
|
||||||
|
<div className="whitespace-pre-wrap">{item.splmntCn || "-"}</div>
|
||||||
|
{splmntAtchFileInfo?.atflCd ? (
|
||||||
|
<AttachmentDownloadLink
|
||||||
|
atflCd={splmntAtchFileInfo?.atflCd}
|
||||||
|
fileName={splmntAtchFileInfo?.orgnlFileNm}
|
||||||
|
/>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
@@ -292,7 +307,7 @@ function SplmntDmndFormSection({ readOnly = false }: SplmntDmndFormSectionProps)
|
|||||||
value={field.value ?? ""}
|
value={field.value ?? ""}
|
||||||
onChange={field.onChange}
|
onChange={field.onChange}
|
||||||
onBlur={field.onBlur}
|
onBlur={field.onBlur}
|
||||||
placeholder="보완완료 내용을 입력하세요."
|
placeholder="보완 완료 내용을 입력하세요."
|
||||||
className="min-h-[6rem] !text-xl"
|
className="min-h-[6rem] !text-xl"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { client } from "@/shared/api";
|
import { client } from "@/shared/api";
|
||||||
import { create } from "zustand";
|
import { create } from "zustand";
|
||||||
import { ENDPOINT } from "@/shared/config";
|
import { ENDPOINT } from "@/shared/config";
|
||||||
import type { BasinStofcbrCountContent, PplLengthContent, SewerageService } from "../model/sn-interface";
|
import type { PplLengthContent, SewerageService } from "../model/sn-interface";
|
||||||
import type { OldPplChartData, mapPplOldType, mapPplOldItem } from "../model/sn-interface";
|
import type { OldPplChartData, mapPplOldType, mapPplOldItem } from "../model/sn-interface";
|
||||||
|
|
||||||
export type SnState = {
|
export type SnState = {
|
||||||
@@ -35,7 +35,26 @@ const initialUsePplChartData: OldPplChartData = {
|
|||||||
};
|
};
|
||||||
const initialOldPplChartData: OldPplChartData = {
|
const initialOldPplChartData: OldPplChartData = {
|
||||||
labels: ["금강", "한강", "낙동강", "영산강"],
|
labels: ["금강", "한강", "낙동강", "영산강"],
|
||||||
datasets: []
|
datasets: [
|
||||||
|
{
|
||||||
|
label: "20-25년",
|
||||||
|
data: [1140, 3181, 3100, 1662],
|
||||||
|
backgroundColor: "#3B82F6",
|
||||||
|
borderRadius: 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "25-30년",
|
||||||
|
data: [1391, 3615, 1814, 1411],
|
||||||
|
backgroundColor: "#EF4444",
|
||||||
|
borderRadius: 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "30년이상",
|
||||||
|
data: [2014, 10303, 9831, 2000],
|
||||||
|
backgroundColor: "#F87171",
|
||||||
|
borderRadius: 4
|
||||||
|
}
|
||||||
|
]
|
||||||
};
|
};
|
||||||
type OldPplStoreState = {
|
type OldPplStoreState = {
|
||||||
chartData: OldPplChartData;
|
chartData: OldPplChartData;
|
||||||
@@ -51,122 +70,23 @@ export const useUsePplStore = create<OldPplStoreState>((set) => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
export const initailMapOldPplData: mapPplOldType = {
|
export const initailMapOldPplData: mapPplOldType = {
|
||||||
colTitle: { stofcbrCount: "우수토실개소수", totalLen: "하수관로총연장" },
|
colTitle: { totalLen: "총길이", pplLen2025: "20~25년", pplLen2530: "25~30년", pplLen30: "30년 이상" }, //헤더 영역
|
||||||
data: [
|
data: [
|
||||||
{ name: "금강", totalLen: 0, stofcbrCount: 0 },
|
{ name: "금강", totalLen: 4545, pplLen2025: 1140, pplLen2530: 1391, pplLen30: 2014 },
|
||||||
{ name: "한강", totalLen: 0, stofcbrCount: 0 },
|
{ name: "한강", totalLen: 17099, pplLen2025: 3181, pplLen2530: 3615, pplLen30: 10303 },
|
||||||
{ name: "낙동강", totalLen: 0, stofcbrCount: 0 },
|
{ name: "낙동강", totalLen: 14745, pplLen2025: 3100, pplLen2530: 1814, pplLen30: 9831 },
|
||||||
{ name: "영산강", totalLen: 0, stofcbrCount: 0 },
|
{ name: "영산강", totalLen: 5073, pplLen2025: 1662, pplLen2530: 1411, pplLen30: 2000 },
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
type mapPplOldState = {
|
type mapPplOldState = {
|
||||||
mapData: mapPplOldItem[];
|
mapData: mapPplOldItem[];
|
||||||
setMapData: (mapData: mapPplOldItem[]) => void;
|
setMapData: (mapData: mapPplOldItem[]) => void;
|
||||||
setStofcbrCounts: (counts: BasinStofcbrCountContent[]) => void;
|
|
||||||
};
|
};
|
||||||
export const useMapOldPplStore = create<mapPplOldState>((set) => ({
|
export const useMapOldPplStore = create<mapPplOldState>((set) => ({
|
||||||
mapData: initailMapOldPplData.data,
|
mapData: initailMapOldPplData.data,
|
||||||
setMapData: (newMapData) => set((state) => ({
|
setMapData: (newMapData) => set({ mapData: newMapData }),
|
||||||
mapData: newMapData.map((item) => ({
|
|
||||||
...item,
|
|
||||||
stofcbrCount: state.mapData.find((current) => current.name === item.name)?.stofcbrCount ?? item.stofcbrCount,
|
|
||||||
})),
|
|
||||||
})),
|
|
||||||
setStofcbrCounts: (counts) => set((state) => ({
|
|
||||||
mapData: state.mapData.map((item) => ({
|
|
||||||
...item,
|
|
||||||
stofcbrCount: counts.find((count) => count.zoneNm === item.name)?.stofcbrCount ?? item.stofcbrCount,
|
|
||||||
})),
|
|
||||||
})),
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const DEFAULT_BASIN_ORDER = ["금강", "한강", "낙동강", "영산강"];
|
|
||||||
const YEAR_GROUP_START_COLOR = "#FACC15";
|
|
||||||
const YEAR_GROUP_END_COLOR = "#F87171";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 시작색과 종료색 사이를 RGB 기준으로 보간해 구간 수만큼 색상을 생성합니다.
|
|
||||||
* 구간이 하나면 시작색을, 둘 이상이면 첫 구간은 파란색·마지막 구간은 빨간색으로 고정합니다.
|
|
||||||
*/
|
|
||||||
function buildYearGroupColors(count: number): string[] {
|
|
||||||
if (count <= 0) return [];
|
|
||||||
if (count === 1) return [YEAR_GROUP_START_COLOR];
|
|
||||||
|
|
||||||
const parseHex = (color: string) => [
|
|
||||||
Number.parseInt(color.slice(1, 3), 16),
|
|
||||||
Number.parseInt(color.slice(3, 5), 16),
|
|
||||||
Number.parseInt(color.slice(5, 7), 16),
|
|
||||||
];
|
|
||||||
const toHex = (value: number) => Math.round(value).toString(16).padStart(2, "0");
|
|
||||||
const start = parseHex(YEAR_GROUP_START_COLOR);
|
|
||||||
const end = parseHex(YEAR_GROUP_END_COLOR);
|
|
||||||
|
|
||||||
return Array.from({ length: count }, (_, index) => {
|
|
||||||
const ratio = index / (count - 1);
|
|
||||||
return `#${start.map((channel, channelIndex) => {
|
|
||||||
const endChannel = end[channelIndex] ?? channel;
|
|
||||||
return toHex(channel + (endChannel - channel) * ratio);
|
|
||||||
}).join("")}`;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 별도 정렬순서가 없는 MV 계약에서 구간명의 첫 숫자를 기준으로 표시순서를 결정합니다.
|
|
||||||
* 숫자가 없는 비정형 구간은 숫자 구간 뒤에 한글 오름차순으로 배치합니다.
|
|
||||||
*/
|
|
||||||
function compareYearGroups(left: string, right: string): number {
|
|
||||||
const leftNumber = left.match(/\d+/)?.[0];
|
|
||||||
const rightNumber = right.match(/\d+/)?.[0];
|
|
||||||
|
|
||||||
if (leftNumber !== undefined && rightNumber !== undefined) {
|
|
||||||
const numberDifference = Number(leftNumber) - Number(rightNumber);
|
|
||||||
if (numberDifference !== 0) return numberDifference;
|
|
||||||
} else if (leftNumber !== undefined) {
|
|
||||||
return -1;
|
|
||||||
} else if (rightNumber !== undefined) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return left.localeCompare(right, "ko");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MV 응답의 yearGroup 목록으로 노후관로 차트 데이터를 동적으로 생성합니다.
|
|
||||||
* 구간명이나 구간 개수가 바뀌어도 고정 매핑 없이 동일한 로직을 사용합니다.
|
|
||||||
*/
|
|
||||||
export function buildOldPplChartData(items: PplLengthContent[]): OldPplChartData {
|
|
||||||
const responseZones = [...new Set(items.map((item) => item.zoneNm).filter(Boolean))];
|
|
||||||
const labels = [
|
|
||||||
...DEFAULT_BASIN_ORDER,
|
|
||||||
...responseZones.filter((zone) => !DEFAULT_BASIN_ORDER.includes(zone)).sort((left, right) => left.localeCompare(right, "ko")),
|
|
||||||
];
|
|
||||||
const yearGroups = [
|
|
||||||
...new Set(
|
|
||||||
items
|
|
||||||
.map((item) => item.yearGroup?.trim())
|
|
||||||
.filter((yearGroup): yearGroup is string => Boolean(yearGroup)),
|
|
||||||
),
|
|
||||||
].sort(compareYearGroups);
|
|
||||||
const colors = buildYearGroupColors(yearGroups.length);
|
|
||||||
|
|
||||||
const lengthByZoneAndGroup = new Map<string, number>();
|
|
||||||
items.forEach((item) => {
|
|
||||||
const yearGroup = item.yearGroup?.trim();
|
|
||||||
if (!item.zoneNm || !yearGroup) return;
|
|
||||||
lengthByZoneAndGroup.set(`${item.zoneNm}\u0000${yearGroup}`, Number(item.sumPrlgVl) || 0);
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
labels,
|
|
||||||
datasets: yearGroups.map((yearGroup, index) => ({
|
|
||||||
label: yearGroup,
|
|
||||||
data: labels.map((zone) => lengthByZoneAndGroup.get(`${zone}\u0000${yearGroup}`) ?? 0),
|
|
||||||
backgroundColor: colors[index] ?? YEAR_GROUP_START_COLOR,
|
|
||||||
borderRadius: 4,
|
|
||||||
})),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OldPplChartData를 지도 팝업 데이터 형태인 mapPplOldItem[]으로 변환합니다.
|
* OldPplChartData를 지도 팝업 데이터 형태인 mapPplOldItem[]으로 변환합니다.
|
||||||
* @param chartData 차트 데이터
|
* @param chartData 차트 데이터
|
||||||
@@ -176,16 +96,22 @@ export function transformChartDataToMapData(chartData: OldPplChartData): mapPplO
|
|||||||
const mapData: mapPplOldItem[] = [];
|
const mapData: mapPplOldItem[] = [];
|
||||||
const { labels, datasets } = chartData;
|
const { labels, datasets } = chartData;
|
||||||
|
|
||||||
|
const pplLen2025Data = datasets.find(d => d.label === '20-25년')?.data || [];
|
||||||
|
const pplLen2530Data = datasets.find(d => d.label === '25-30년')?.data || [];
|
||||||
|
const pplLen30Data = datasets.find(d => d.label === '30년이상')?.data || [];
|
||||||
|
|
||||||
labels.forEach((label, index) => {
|
labels.forEach((label, index) => {
|
||||||
const totalLen = datasets.reduce((sum, dataset) => {
|
const pplLen2025 = pplLen2025Data[index] || 0;
|
||||||
const value = dataset.data[index];
|
const pplLen2530 = pplLen2530Data[index] || 0;
|
||||||
return sum + (typeof value === "number" ? value : 0);
|
const pplLen30 = pplLen30Data[index] || 0;
|
||||||
}, 0);
|
const totalLen = pplLen2025 + pplLen2530 + pplLen30;
|
||||||
|
|
||||||
mapData.push({
|
mapData.push({
|
||||||
name: label,
|
name: label,
|
||||||
totalLen,
|
totalLen,
|
||||||
stofcbrCount: 0,
|
pplLen2025,
|
||||||
|
pplLen2530,
|
||||||
|
pplLen30,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -245,7 +171,7 @@ export class SewerageApiService implements SewerageService {
|
|||||||
}));
|
}));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
// 유역별 노후도별 관로 길이(km) MV조회: yearGroup은 MV가 제공하는 동적 구간명
|
// 유역별 노후도별 관로 길이(km) MV조회 : yearGroup - 20년~25년미만,25년~30년미만,30년이상
|
||||||
public async getMvOldPplLength(): Promise<PplLengthContent[]> {
|
public async getMvOldPplLength(): Promise<PplLengthContent[]> {
|
||||||
const response = await client.get<{
|
const response = await client.get<{
|
||||||
PplLengthList: PplLengthContent[];
|
PplLengthList: PplLengthContent[];
|
||||||
@@ -258,18 +184,6 @@ export class SewerageApiService implements SewerageService {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
// CM 대시보드 유역별 우수토실 개소수 조회
|
|
||||||
public async getBasinStofcbrCount(): Promise<BasinStofcbrCountContent[]> {
|
|
||||||
const response = await client.get<{
|
|
||||||
basinStofcbrCountList: BasinStofcbrCountContent[];
|
|
||||||
}>(ENDPOINT.SEWERAGE_SERVICE.BASIN_STOFCBR_COUNT);
|
|
||||||
|
|
||||||
return (response.data.basinStofcbrCountList ?? []).map((item) => ({
|
|
||||||
...item,
|
|
||||||
stofcbrCount: Number(item.stofcbrCount),
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SewerageApi = new SewerageApiService();
|
export const SewerageApi = new SewerageApiService();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { svcInfo } from "../model/map-data";
|
|||||||
import type { mapOperFcltType, mapReuseMapType} from "../model/fo-interface";
|
import type { mapOperFcltType, mapReuseMapType} from "../model/fo-interface";
|
||||||
import type { mapPplOldType } from "../model/sn-interface";
|
import type { mapPplOldType } from "../model/sn-interface";
|
||||||
import { useMapOperFcltStore, OperationApi, useMapReuseMapStore } from "../api/fo-service";
|
import { useMapOperFcltStore, OperationApi, useMapReuseMapStore } from "../api/fo-service";
|
||||||
import { SewerageApi, useMapOldPplStore } from "../api/sn-service";
|
import { useMapOldPplStore } from "../api/sn-service";
|
||||||
import {Button} from "@common/components";
|
import {Button} from "@common/components";
|
||||||
|
|
||||||
const SVG_URL = "/images/region_map.svg"; // public 폴더에 region_map.svg 위치 필요
|
const SVG_URL = "/images/region_map.svg"; // public 폴더에 region_map.svg 위치 필요
|
||||||
@@ -31,12 +31,12 @@ const mapOperFcltData: mapOperFcltType = {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
const mapPplOldData: mapPplOldType = {
|
const mapPplOldData: mapPplOldType = {
|
||||||
colTitle: {stofcbrCount: "우수토실개소수", totalLen: "하수관로총연장" },
|
colTitle: {totalLen: "총길이",pplLen2025: "20~25년",pplLen2530: "25~30년",pplLen30 : "30년 이상" }, //헤더 영역
|
||||||
data: [
|
data: [
|
||||||
{name: "금강", totalLen: 0, stofcbrCount: 0},
|
{name: "금강", totalLen: 4545, pplLen2025: 1140, pplLen2530: 1391, pplLen30 : 2014},
|
||||||
{name: "한강", totalLen: 0, stofcbrCount: 0},
|
{name: "한강", totalLen: 17099, pplLen2025: 3181, pplLen2530: 3615, pplLen30 : 10303},
|
||||||
{name: "낙동강", totalLen: 0, stofcbrCount: 0},
|
{name: "낙동강", totalLen: 14745, pplLen2025: 3100, pplLen2530: 1814, pplLen30 : 9831},
|
||||||
{name: "영산강", totalLen: 0, stofcbrCount: 0},
|
{name: "영산강", totalLen: 5073, pplLen2025: 1662, pplLen2530: 1411, pplLen30 : 2000},
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
const mapReuseMapData: mapReuseMapType = {
|
const mapReuseMapData: mapReuseMapType = {
|
||||||
@@ -62,18 +62,17 @@ export function KoreaBasinMap() {
|
|||||||
const { selectedBasin, setSelectedBasin } = useStore(basinStore);
|
const { selectedBasin, setSelectedBasin } = useStore(basinStore);
|
||||||
const selectedBasinKey = basinKeyMap[selectedBasin];
|
const selectedBasinKey = basinKeyMap[selectedBasin];
|
||||||
const {mapOperFclt} = useMapOperFcltStore();
|
const {mapOperFclt} = useMapOperFcltStore();
|
||||||
const {mapData: mapPplOld, setStofcbrCounts} = useMapOldPplStore();
|
const {mapData: mapPplOld} = useMapOldPplStore();
|
||||||
const {setMapData: setMapReuseMapData} = useMapReuseMapStore();
|
const {setMapData: setMapReuseMapData} = useMapReuseMapStore();
|
||||||
mapOperFcltData.data = mapOperFclt;
|
mapOperFcltData.data = mapOperFclt;
|
||||||
mapPplOldData.data = mapPplOld;
|
mapPplOldData.data = mapPplOld;
|
||||||
// mapReuseMapData.data = mapReuseMap;
|
// mapReuseMapData.data = mapReuseMap;
|
||||||
const [standardYear, setStandardYear] = useState('2024');
|
let standardYear = '2024';
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
try {
|
try {
|
||||||
const fetchedStandardYear = await OperationApi.getStandardYear();
|
standardYear = await OperationApi.getStandardYear();
|
||||||
setStandardYear(fetchedStandardYear);
|
const mapReuseMapRslt = await OperationApi.getReuseMap(standardYear);
|
||||||
const mapReuseMapRslt = await OperationApi.getReuseMap(fetchedStandardYear);
|
|
||||||
setMapReuseMapData(mapReuseMapRslt);
|
setMapReuseMapData(mapReuseMapRslt);
|
||||||
mapReuseMapData.data = mapReuseMapRslt;
|
mapReuseMapData.data = mapReuseMapRslt;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -81,13 +80,7 @@ export function KoreaBasinMap() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
fetchData();
|
fetchData();
|
||||||
}, [setMapReuseMapData]);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
SewerageApi.getBasinStofcbrCount()
|
|
||||||
.then(setStofcbrCounts)
|
|
||||||
.catch((e) => console.error("유역별 우수토실 개소수 조회 실패", e));
|
|
||||||
}, [setStofcbrCounts]);
|
|
||||||
// 유역정보
|
// 유역정보
|
||||||
const showFor = useCallback((g: SVGGElement) => {
|
const showFor = useCallback((g: SVGGElement) => {
|
||||||
const activeService = services.find(s => s.active);
|
const activeService = services.find(s => s.active);
|
||||||
@@ -111,16 +104,24 @@ export function KoreaBasinMap() {
|
|||||||
});
|
});
|
||||||
} else if (activeService.svcId === 'sn') { // 하수관로
|
} else if (activeService.svcId === 'sn') { // 하수관로
|
||||||
const item = mapPplOldData.data.find(d => d.name === basinName);
|
const item = mapPplOldData.data.find(d => d.name === basinName);
|
||||||
newPopupContent.title = `${standardYear}년도 ${basinName}유역 하수관로 현황`;
|
newPopupContent.title = `${standardYear}년도 ${basinName}유역 노후하수관로 현황`;
|
||||||
const colTitles = mapPplOldData.colTitle;
|
const colTitles = mapPplOldData.colTitle;
|
||||||
newPopupContent.items.push({
|
|
||||||
header: colTitles.stofcbrCount,
|
|
||||||
data: item ? `${fmt(item.stofcbrCount)}개소` : '-',
|
|
||||||
});
|
|
||||||
newPopupContent.items.push({
|
newPopupContent.items.push({
|
||||||
header: colTitles.totalLen,
|
header: colTitles.totalLen,
|
||||||
data: item ? `${fmt(item.totalLen)}km` : '-',
|
data: item ? `${fmt(item.totalLen)}km` : '-',
|
||||||
});
|
});
|
||||||
|
newPopupContent.items.push({
|
||||||
|
header: colTitles.pplLen2025,
|
||||||
|
data: item ? `${fmt(item.pplLen2025)}km` : '-',
|
||||||
|
});
|
||||||
|
newPopupContent.items.push({
|
||||||
|
header: colTitles.pplLen2530,
|
||||||
|
data: item ? `${fmt(item.pplLen2530)}km` : '-',
|
||||||
|
});
|
||||||
|
newPopupContent.items.push({
|
||||||
|
header: colTitles.pplLen30,
|
||||||
|
data: item ? `${fmt(item.pplLen30)}km` : '-',
|
||||||
|
});
|
||||||
} else if (activeService.svcId === 'wr') { // 물재이용
|
} else if (activeService.svcId === 'wr') { // 물재이용
|
||||||
const item = mapReuseMapData.data.find(d => d.name === basinName);
|
const item = mapReuseMapData.data.find(d => d.name === basinName);
|
||||||
newPopupContent.title = `${standardYear}년도 ${basinName}유역 물재이용 현황`;
|
newPopupContent.title = `${standardYear}년도 ${basinName}유역 물재이용 현황`;
|
||||||
@@ -159,7 +160,7 @@ export function KoreaBasinMap() {
|
|||||||
);
|
);
|
||||||
popupRef.current.style.left = x + "px";
|
popupRef.current.style.left = x + "px";
|
||||||
}
|
}
|
||||||
}, [services, mapOperFclt, mapPplOld, standardYear]);
|
}, [services, mapOperFclt]);
|
||||||
|
|
||||||
// selectedBasinKey prop이 변경될 때 지도를 업데이트하는 useEffect
|
// selectedBasinKey prop이 변경될 때 지도를 업데이트하는 useEffect
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -409,14 +410,8 @@ export function KoreaBasinMap() {
|
|||||||
};
|
};
|
||||||
// 스타일은 필요에 따라 tailwind, css 등으로 커스터마이즈하세요.
|
// 스타일은 필요에 따라 tailwind, css 등으로 커스터마이즈하세요.
|
||||||
return (
|
return (
|
||||||
<div
|
<div className="col-span-3 !p-0 relative z-10" style={{ height: "765px", background: "rgba(255, 255, 255, 0.6)" }}>
|
||||||
className="absolute inset-0 z-10 col-span-3 h-full !p-0"
|
<div className="card card-border" style={{ height: "100%" }}>
|
||||||
style={{ background: "rgba(255, 255, 255, 0.6)" }}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="card card-border"
|
|
||||||
style={{ height: "calc(100% - 1.2rem)" }}
|
|
||||||
>
|
|
||||||
<div className="card-header text-foreground">
|
<div className="card-header text-foreground">
|
||||||
<h3 className="text-2xl font-medium">유역별 정보</h3>
|
<h3 className="text-2xl font-medium">유역별 정보</h3>
|
||||||
|
|
||||||
|
|||||||
@@ -6,17 +6,11 @@ export interface PplLengthContent {
|
|||||||
yearGroup?: string;
|
yearGroup?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BasinStofcbrCountContent {
|
|
||||||
zoneNm: string;
|
|
||||||
stofcbrCount: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SewerageService {
|
export interface SewerageService {
|
||||||
getPplLength(ymdFrom: string, ymdTo: string, useCd: string): Promise<PplLengthContent[]>;
|
getPplLength(ymdFrom: string, ymdTo: string, useCd: string): Promise<PplLengthContent[]>;
|
||||||
getPplUseLength(ymdFrom: string, ymdTo: string, useCd: string): Promise<PplLengthContent[]>;
|
getPplUseLength(ymdFrom: string, ymdTo: string, useCd: string): Promise<PplLengthContent[]>;
|
||||||
getMvUsgPplLength(): Promise<PplLengthContent[]>;
|
getMvUsgPplLength(): Promise<PplLengthContent[]>;
|
||||||
getMvOldPplLength(): Promise<PplLengthContent[]>;
|
getMvOldPplLength(): Promise<PplLengthContent[]>;
|
||||||
getBasinStofcbrCount(): Promise<BasinStofcbrCountContent[]>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ChartDataSet {
|
export interface ChartDataSet {
|
||||||
@@ -43,13 +37,17 @@ type SnOldPplLength = {
|
|||||||
export type mapPplOldItem = {
|
export type mapPplOldItem = {
|
||||||
name: string;
|
name: string;
|
||||||
totalLen: number;
|
totalLen: number;
|
||||||
stofcbrCount: number;
|
pplLen2025: number;
|
||||||
|
pplLen2530: number;
|
||||||
|
pplLen30: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type mapPplOldType = {
|
export type mapPplOldType = {
|
||||||
colTitle: {
|
colTitle: {
|
||||||
stofcbrCount: string; // 우수토실개소수
|
totalLen: string; // 총길이
|
||||||
totalLen: string; // 총연장
|
pplLen2025: string; // 20~25년
|
||||||
|
pplLen2530: string; // 25~30년
|
||||||
|
pplLen30: string; // 30년 이상
|
||||||
};
|
};
|
||||||
data: mapPplOldItem[];
|
data: mapPplOldItem[];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ function DashboardPage() {
|
|||||||
<div className="p-2 sm:p-4 md:p-6">
|
<div className="p-2 sm:p-4 md:p-6">
|
||||||
<div className="flex flex-col gap-1">
|
<div className="flex flex-col gap-1">
|
||||||
{/* 첫번째 라인 - 좌측 6개 패널(2x3) + 우측 지도/사용자 정보 */}
|
{/* 첫번째 라인 - 좌측 6개 패널(2x3) + 우측 지도/사용자 정보 */}
|
||||||
<div className="flex flex-col gap-1 lg:flex-row lg:items-stretch">
|
<div className="flex flex-col gap-1 lg:flex-row">
|
||||||
{/* 좌측: 드래그 가능한 6개 패널 (2x3 그리드, 화면의 50%) */}
|
{/* 좌측: 드래그 가능한 6개 패널 (2x3 그리드, 화면의 50%) */}
|
||||||
<div className="w-full lg:w-1/2">
|
<div className="w-full lg:w-1/2">
|
||||||
{isMounted ? (
|
{isMounted ? (
|
||||||
@@ -173,9 +173,9 @@ function DashboardPage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 우측: 고정된 지도와 사용자 정보 (화면의 50%) */}
|
{/* 우측: 고정된 지도와 사용자 정보 (화면의 50%) */}
|
||||||
<div className="flex w-full flex-col items-stretch gap-1 lg:w-1/2 lg:flex-row">
|
<div className="flex w-full gap-1 lg:w-1/2">
|
||||||
{/* 지도영역 - 고정 (드래그 불가) */}
|
{/* 지도영역 - 고정 (드래그 불가) */}
|
||||||
<div className="relative min-h-[765px] w-full self-stretch lg:min-h-0 lg:flex-1">
|
<div className="flex-1">
|
||||||
<KoreaBasinMap />
|
<KoreaBasinMap />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ import {
|
|||||||
} from "chart.js";
|
} from "chart.js";
|
||||||
import { Bar } from "react-chartjs-2";
|
import { Bar } from "react-chartjs-2";
|
||||||
import { Button } from "@common/components";
|
import { Button } from "@common/components";
|
||||||
import type { PplLengthContent } from "../model/sn-interface";
|
import type { PplLengthContent, ChartDataSet, OldPplChartData } from "../model/sn-interface";
|
||||||
import { buildOldPplChartData, SewerageApi, useOldPplStore,useMapOldPplStore, transformChartDataToMapData } from "../api/sn-service";
|
import { SewerageApi, useOldPplStore,useMapOldPplStore, transformChartDataToMapData } from "../api/sn-service";
|
||||||
import { useDragHandle } from "./sortable-panel";
|
import { useDragHandle } from "./sortable-panel";
|
||||||
|
|
||||||
|
|
||||||
@@ -41,7 +41,45 @@ export default function SnOldPpl() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (oldPplLenData.length === 0) return;
|
if (oldPplLenData.length === 0) return;
|
||||||
|
|
||||||
const newChartData = buildOldPplChartData(oldPplLenData);
|
// 유역 목록 추출 (중복 제거)
|
||||||
|
const allZones = [...new Set(oldPplLenData.map(d => d.zoneNm))];
|
||||||
|
|
||||||
|
// yearGroup 매핑: API 응답값 -> 차트 label
|
||||||
|
const yearGroupMap: { [key: string]: { label: string; color: string } } = {
|
||||||
|
"20년~25년미만": { label: "20-25년", color: "#3B82F6" },
|
||||||
|
"25년~30년미만": { label: "25-30년", color: "#EF4444" },
|
||||||
|
"30년이상": { label: "30년이상", color: "#F87171" },
|
||||||
|
};
|
||||||
|
|
||||||
|
// 유역별, 노후년도별 데이터 구조화
|
||||||
|
const dataByZone: { [zone: string]: { [yearGroup: string]: number } } = {};
|
||||||
|
allZones.forEach(zone => {
|
||||||
|
dataByZone[zone] = {};
|
||||||
|
});
|
||||||
|
|
||||||
|
oldPplLenData.forEach(item => {
|
||||||
|
let zoneData = dataByZone[item.zoneNm];
|
||||||
|
if (!zoneData) {
|
||||||
|
zoneData = {};
|
||||||
|
dataByZone[item.zoneNm] = zoneData;
|
||||||
|
}
|
||||||
|
if (item.yearGroup) {
|
||||||
|
zoneData[item.yearGroup] = item.sumPrlgVl;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 데이터셋 생성
|
||||||
|
const newDatasets: ChartDataSet[] = Object.entries(yearGroupMap).map(([yearGroup, { label, color }]) => ({
|
||||||
|
label,
|
||||||
|
data: allZones.map(zone => dataByZone[zone]?.[yearGroup] ?? 0),
|
||||||
|
backgroundColor: color,
|
||||||
|
borderRadius: 4,
|
||||||
|
}));
|
||||||
|
|
||||||
|
const newChartData: OldPplChartData = {
|
||||||
|
labels: allZones,
|
||||||
|
datasets: newDatasets,
|
||||||
|
};
|
||||||
|
|
||||||
setChartData(newChartData);
|
setChartData(newChartData);
|
||||||
|
|
||||||
@@ -72,7 +110,9 @@ export default function SnOldPpl() {
|
|||||||
y: {
|
y: {
|
||||||
beginAtZero: true,
|
beginAtZero: true,
|
||||||
min: 0,
|
min: 0,
|
||||||
|
max: 10000,
|
||||||
ticks: {
|
ticks: {
|
||||||
|
stepSize: 2000,
|
||||||
callback: function (value) {
|
callback: function (value) {
|
||||||
return Number(value).toLocaleString() + 'km';
|
return Number(value).toLocaleString() + 'km';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ export const ENDPOINT = {
|
|||||||
OLD_PPL_COUNTS: "/sewerage-service/api/v1/ms/oldPplCounts",
|
OLD_PPL_COUNTS: "/sewerage-service/api/v1/ms/oldPplCounts",
|
||||||
MV_USG_PPL_LENGTH: "/sewerage-service/api/v1/ms/mvUsgPplLength",
|
MV_USG_PPL_LENGTH: "/sewerage-service/api/v1/ms/mvUsgPplLength",
|
||||||
MV_OLD_PPL_LENGTH: "/sewerage-service/api/v1/ms/mvOldPplLength",
|
MV_OLD_PPL_LENGTH: "/sewerage-service/api/v1/ms/mvOldPplLength",
|
||||||
BASIN_STOFCBR_COUNT: "/sewerage-service/api/v1/ms/basinStofcbrCount",
|
|
||||||
},
|
},
|
||||||
OPERATION_SERVICE: {
|
OPERATION_SERVICE: {
|
||||||
MAIN_YEAR: "/operation-service/api/v1/dashBoard/main/year",
|
MAIN_YEAR: "/operation-service/api/v1/dashBoard/main/year",
|
||||||
|
|||||||
@@ -276,7 +276,9 @@ function Post({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</PostAction>
|
</PostAction>
|
||||||
<PostComment bbsId={parseInt(bbsId)} pstNo={parseInt(pstNo)} />
|
{bbsInfo?.cmntUseYn === "Y" && (
|
||||||
|
<PostComment bbsId={parseInt(bbsId)} pstNo={parseInt(pstNo)} />
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,6 @@
|
|||||||
## Project
|
## Project
|
||||||
This repository contains a Next.js web application.
|
This repository contains a Next.js web application.
|
||||||
|
|
||||||
## Portable paths
|
|
||||||
|
|
||||||
Resolve paths from this `apps/dm/AGENTS.md` file, not from a developer-specific drive or the current shell directory.
|
|
||||||
|
|
||||||
- `FE_APP_ROOT`: directory containing this file (`apps/dm`)
|
|
||||||
- `FE_REPO_ROOT`: `FE_APP_ROOT/../..` (`frontend`)
|
|
||||||
- `WORKSPACE_ROOT`: `FE_REPO_ROOT/..`
|
|
||||||
- `COMMON_ROOT_AGENTS`: `WORKSPACE_ROOT/AGENTS.md`
|
|
||||||
- `BE_REPO_ROOT`: `WORKSPACE_ROOT/IIPBS` (Backend repository root)
|
|
||||||
- `BE_SERVICE_ROOT`: `BE_REPO_ROOT/sewerage-service`
|
|
||||||
|
|
||||||
Use an explicitly supplied repository path when the repositories are installed under different parent directories. Verify a calculated path exists before using it.
|
|
||||||
|
|
||||||
Main technologies:
|
Main technologies:
|
||||||
- Next.js
|
- Next.js
|
||||||
- TypeScript
|
- TypeScript
|
||||||
|
|||||||
@@ -1,19 +1,6 @@
|
|||||||
## Project
|
## Project
|
||||||
This repository contains a Next.js web application.
|
This repository contains a Next.js web application.
|
||||||
|
|
||||||
## Portable paths
|
|
||||||
|
|
||||||
Resolve paths from this `apps/fo/AGENTS.md` file, not from a developer-specific drive or the current shell directory.
|
|
||||||
|
|
||||||
- `FE_APP_ROOT`: directory containing this file (`apps/fo`)
|
|
||||||
- `FE_REPO_ROOT`: `FE_APP_ROOT/../..` (`frontend`)
|
|
||||||
- `WORKSPACE_ROOT`: `FE_REPO_ROOT/..`
|
|
||||||
- `COMMON_ROOT_AGENTS`: `WORKSPACE_ROOT/AGENTS.md`
|
|
||||||
- `BE_REPO_ROOT`: `WORKSPACE_ROOT/IIPBS` (Backend repository root)
|
|
||||||
- `BE_SERVICE_ROOT`: `BE_REPO_ROOT/sewerage-service`
|
|
||||||
|
|
||||||
Use an explicitly supplied repository path when the repositories are installed under different parent directories. Verify a calculated path exists before using it.
|
|
||||||
|
|
||||||
Main technologies:
|
Main technologies:
|
||||||
- Next.js
|
- Next.js
|
||||||
- TypeScript
|
- TypeScript
|
||||||
|
|||||||
+3
-37
@@ -43,46 +43,14 @@
|
|||||||
|
|
||||||
## 공통 시작 기준
|
## 공통 시작 기준
|
||||||
|
|
||||||
개발자마다 드라이브와 상위 작업 폴더 위치가 다르므로 특정 드라이브·사용자 디렉터리의 절대경로를 기준으로 사용하지 않는다.
|
Codex 작업 루트는 가능하면 `../../../../../`로 잡고, 공통 시작 기준은 `AGENTS.md`를 따른다.
|
||||||
|
|
||||||
경로 별칭은 `apps/sn/AGENTS.md`가 있는 디렉터리(`FE_APP_ROOT`)를 기준으로 다음과 같이 해석한다. 상대경로는 현재 셸의 실행 위치가 아니라 이 파일의 위치를 기준으로 계산한다.
|
|
||||||
|
|
||||||
- `FE_APP_ROOT`: 이 파일이 있는 `apps/sn` 디렉터리
|
|
||||||
- `FE_REPO_ROOT`: `FE_APP_ROOT/../..`
|
|
||||||
- `WORKSPACE_ROOT`: `FE_APP_ROOT/../../..`
|
|
||||||
- `COMMON_ROOT_AGENTS`: `WORKSPACE_ROOT/AGENTS.md`
|
|
||||||
- `BE_REPO_ROOT`: `WORKSPACE_ROOT/IIPBS` (Backend Git 저장소 루트)
|
|
||||||
- `BE_SERVICE_ROOT`: `BE_REPO_ROOT/sewerage-service` (하수관로 백엔드 서비스 모듈)
|
|
||||||
- `COMMON_DOCS_ROOT`: `BE_REPO_ROOT/docs`
|
|
||||||
- `FE_APP_DOCS_ROOT`: `FE_APP_ROOT/docs`
|
|
||||||
|
|
||||||
경로 결정은 아래 우선순위를 따른다.
|
|
||||||
|
|
||||||
1. 작업 환경이나 사용자가 `WORKSPACE_ROOT`, `COMMON_DOCS_ROOT`, `BE_REPO_ROOT`, `BE_SERVICE_ROOT` 등의 유효한 경로를 명시한 경우 그 값을 우선한다. 저장소를 서로 다른 상위 폴더에 배치한 개발자도 이 방식으로 사용할 수 있다.
|
|
||||||
2. 명시값이 없으면 위의 `FE_APP_ROOT` 기준 상대경로로 계산한다. 드라이브 문자나 사용자별 상위 디렉터리 이름이 달라도 같은 저장소 배치 구조를 사용할 수 있다.
|
|
||||||
3. 계산한 경로는 사용 전에 대상 파일이나 디렉터리의 존재 여부를 확인한다. 없거나 후보가 여러 개인 경우 특정 절대경로를 추측하지 말고 현재 저장소에서 확인 가능한 작업만 진행한 뒤 필요한 경로를 사용자에게 확인한다.
|
|
||||||
4. 작업 문서와 결과 보고에는 특별한 사유가 없으면 개발자별 절대경로 대신 위 경로 별칭이나 저장소 기준 상대경로를 기록한다.
|
|
||||||
|
|
||||||
PowerShell에서 현재 프론트엔드 저장소를 기준으로 확인할 때는 다음처럼 동적으로 계산할 수 있다. 각 단계는 앞 단계에서 찾은 저장소 위치를 기반으로 하므로 개발자별 설치 경로에 의존하지 않는다.
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
$feRepoRoot = (git rev-parse --show-toplevel).Trim()
|
|
||||||
$feAppRoot = Join-Path $feRepoRoot 'apps/sn'
|
|
||||||
$workspaceRoot = Split-Path $feRepoRoot -Parent
|
|
||||||
$commonRootAgents = Join-Path $workspaceRoot 'AGENTS.md'
|
|
||||||
$beRepoRoot = Join-Path $workspaceRoot 'IIPBS'
|
|
||||||
$beServiceRoot = Join-Path $beRepoRoot 'sewerage-service'
|
|
||||||
$commonDocsRoot = Join-Path $beRepoRoot 'docs'
|
|
||||||
```
|
|
||||||
|
|
||||||
공통 시작 기준은 `COMMON_ROOT_AGENTS`를 따른다.
|
|
||||||
|
|
||||||
이 파일은 프론트엔드 `sn` 앱 세부 기준이다.
|
이 파일은 프론트엔드 `sn` 앱 세부 기준이다.
|
||||||
|
|
||||||
백엔드(`sewerage-service`)와 함께 수정하거나 API/응답/DB/인증/권한 연동 영향이 있는 작업은 아래 파일을 함께 확인한다.
|
백엔드(`sewerage-service`)와 함께 수정하거나 API/응답/DB/인증/권한 연동 영향이 있는 작업은 아래 파일을 함께 확인한다.
|
||||||
|
|
||||||
- 공통 시작 기준: `AGENTS.md`
|
- 공통 시작 기준: `AGENTS.md`
|
||||||
- 백엔드 세부 기준: `BE_SERVICE_ROOT/AGENTS.md`
|
- 백엔드 세부 기준: `BE_REPO_ROOT/AGENTS.md`
|
||||||
- 프론트엔드 `sn` 앱 기준: `FE_APP_ROOT/AGENTS.md`
|
- 프론트엔드 `sn` 앱 기준: `FE_APP_ROOT/AGENTS.md`
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -166,8 +134,6 @@ $commonDocsRoot = Join-Path $beRepoRoot 'docs'
|
|||||||
|
|
||||||
## 작업 원칙
|
## 작업 원칙
|
||||||
|
|
||||||
- 일반 목록·모든 팝업은 공통 AGENTS.md의 서버 페이징·지도·Excel 계약을 따른다. 지도 전체 표출에 현재 그리드 페이지 배열을 재사용하지 않는다. Excel은 적용조건 전체를 사용하고 대량 원시 자료는 서버 생성으로 분리한다. 화면 페이징/페이징 없음 예외는 사유와 검증 범위를 메뉴 > 화면명별로 기록한다.
|
|
||||||
|
|
||||||
1. 모든 변경은 원본 요구사항정의서와 화면설계서, 2차 요구사항, 기능 명세 또는 승인된 작업 문서를 근거로 한다.
|
1. 모든 변경은 원본 요구사항정의서와 화면설계서, 2차 요구사항, 기능 명세 또는 승인된 작업 문서를 근거로 한다.
|
||||||
2. `apps/sn`과 `packages/common/business_components` 범위를 넘는 수정은 하지 않는다.
|
2. `apps/sn`과 `packages/common/business_components` 범위를 넘는 수정은 하지 않는다.
|
||||||
3. 공통 패키지 수정은 `sn` 요구사항을 충족하기 위한 최소 범위로 제한한다.
|
3. 공통 패키지 수정은 `sn` 요구사항을 충족하기 위한 최소 범위로 제한한다.
|
||||||
@@ -262,7 +228,7 @@ VSCode나 별도 터미널에서 `sn` Next 개발 서버가 실행 중이면 `ne
|
|||||||
|
|
||||||
### 프론트엔드 실행 프로세스 관리
|
### 프론트엔드 실행 프로세스 관리
|
||||||
|
|
||||||
- 모든 세션·역할·문서/검증 섹션에 `COMMON_ROOT_AGENTS`의 테스트 파일 정리 기준을 적용한다. 에이전트가 테스트를 위해 만든 파일은 정식 회귀 테스트·재사용 가능한 소스·fixture·mock·임시 라우트를 포함해 위치와 관계없이 결과를 요약한 뒤 작업 종료 전에 삭제한다(2026-09-23 사용자 지시). 전용 빈 폴더와 끊어진 실행 명령도 정리한다. 명시 보존 요청 파일·최종 산출물·사용자 원본/복구 백업은 유지한다. 기존 타 작업자 테스트 자산은 삭제 권한을 먼저 확인한다. 사용자 dev server의 .next·공유 캐시·node_modules는 포괄 삭제하지 않는다.
|
- 모든 세션·역할·문서/검증 섹션에 공통 D:/workspace/AGENTS.md의 테스트 임시 파일·결과 파일 정리 기준을 적용한다. 일회성 검증 스크립트·캡처·Network/서버 로그·원시 결과 파일은 최종 보고서에 요약 후 삭제한다. 정식 회귀 테스트·최종 산출물·사용자 원본/복구 백업은 유지한다. 사용자 dev server가 쓰는 .next·공유 캐시·node_modules는 임시 검증물이라는 이유로 포괄 삭제하지 않는다.
|
||||||
|
|
||||||
- Codex 에이전트가 작업 또는 검증을 위해 직접 기동한 `next dev`, `dev:sn`, Turborepo dev와 기타 프론트엔드 장시간 실행 프로세스는 작업 종료 전에 반드시 종료한다.
|
- Codex 에이전트가 작업 또는 검증을 위해 직접 기동한 `next dev`, `dev:sn`, Turborepo dev와 기타 프론트엔드 장시간 실행 프로세스는 작업 종료 전에 반드시 종료한다.
|
||||||
- 셸, 백그라운드, 숨김 창 등 VSCode 밖에서 에이전트가 기동한 프로세스도 종료 대상이다.
|
- 셸, 백그라운드, 숨김 창 등 VSCode 밖에서 에이전트가 기동한 프로세스도 종료 대상이다.
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { useQueryClient } from "@tanstack/react-query";
|
|||||||
import { NoFooterLayout } from "@common/components";
|
import { NoFooterLayout } from "@common/components";
|
||||||
import type { MenuItem } from "@/entities/menu";
|
import type { MenuItem } from "@/entities/menu";
|
||||||
import { useMenuStore } from "@/shared/lib";
|
import { useMenuStore } from "@/shared/lib";
|
||||||
import useStore from "@/entities/reference-data/model/reference-data-store";
|
import useStore from '../store/useStore';
|
||||||
import { authService } from "@/entities/auth";
|
import { authService } from "@/entities/auth";
|
||||||
|
|
||||||
export default function MapLayout({
|
export default function MapLayout({
|
||||||
|
|||||||
@@ -1,71 +0,0 @@
|
|||||||
/** 노후관로의 지도와 목록이 사용하는 DB 레이어 설정 계약이다. */
|
|
||||||
import { getRawJson } from "@/shared/api/sewerage-api";
|
|
||||||
import {
|
|
||||||
buildAgedPipeCqlFilters,
|
|
||||||
isAgedPipeLayerNode,
|
|
||||||
type AgedPipeFilters,
|
|
||||||
} from "@/entities/facility/lib/aged-pipe-utils";
|
|
||||||
|
|
||||||
/** DB 응답을 그대로 보존하며 최초 표출 전에 필터만 해석한다. */
|
|
||||||
export const prepareAgedPipeLayerRows = (
|
|
||||||
rows: any[],
|
|
||||||
filters: AgedPipeFilters,
|
|
||||||
): any[] =>
|
|
||||||
rows.map((row) => {
|
|
||||||
const next = { ...row };
|
|
||||||
if (isAgedPipeLayerNode(row)) {
|
|
||||||
next.agedPipeFilterTemplate = row.flterSql;
|
|
||||||
try {
|
|
||||||
validateAgedPipeLayer(row);
|
|
||||||
next.flterSql = buildAgedPipeCqlFilters(filters, row.flterSql).join(
|
|
||||||
" AND ",
|
|
||||||
);
|
|
||||||
} catch (error) {
|
|
||||||
// 노후관로 DB 미전환이 다른 시설물 레이어까지 중단시키지 않도록 이 행만 차단한다.
|
|
||||||
next.agedPipeConfigError =
|
|
||||||
error instanceof Error ? error.message : "노후관로 레이어 설정 오류";
|
|
||||||
next.actlLyrYn = "N";
|
|
||||||
next.flterSql = "EXCLUDE";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Array.isArray(row.children))
|
|
||||||
next.children = prepareAgedPipeLayerRows(row.children, filters);
|
|
||||||
return next;
|
|
||||||
});
|
|
||||||
|
|
||||||
/** 환경마다 달라질 수 있는 일련번호 대신 DB 업무명을 통해 설정 행을 찾는다. */
|
|
||||||
export const findAgedPipeLayer = (rows: any[]): any | undefined => {
|
|
||||||
for (const row of rows) {
|
|
||||||
if (isAgedPipeLayerNode(row)) return row;
|
|
||||||
const child = Array.isArray(row.children)
|
|
||||||
? findAgedPipeLayer(row.children)
|
|
||||||
: undefined;
|
|
||||||
if (child) return child;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 예전 제어용 행을 실제 WFS 레이어처럼 요청하지 않도록 전환 상태를 확인한다. */
|
|
||||||
export const validateAgedPipeLayer = (row: any) => {
|
|
||||||
if (row?.agedPipeConfigError) throw new Error(row.agedPipeConfigError);
|
|
||||||
if (
|
|
||||||
!row ||
|
|
||||||
row.actlLyrYn !== "Y" ||
|
|
||||||
row.srvcNm !== "wfs" ||
|
|
||||||
!row.lyrTyNm ||
|
|
||||||
row.lyrTyNm === "tb_old_pipe"
|
|
||||||
) {
|
|
||||||
throw new Error(
|
|
||||||
"노후관로 DB 레이어 설정을 실제 WFS 레이어와 sql_filt 템플릿으로 갱신해 주세요.",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 독립 목록 팝업도 부모창의 하드코딩 없이 동일 설정 API를 조회한다. */
|
|
||||||
export const fetchAgedPipeLayer = async () => {
|
|
||||||
const rows = await getRawJson(
|
|
||||||
"/sewerage-service/api/v1/map/lyrStngs/SN_NETWORK",
|
|
||||||
);
|
|
||||||
const row = findAgedPipeLayer(Array.isArray(rows) ? rows : []);
|
|
||||||
validateAgedPipeLayer(row);
|
|
||||||
return row;
|
|
||||||
};
|
|
||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useAlertStore } from "@/shared/lib";
|
import { useAlertStore } from "@/shared/lib";
|
||||||
import { validateElapsedYears, type AgedPipeFilters } from "@/entities/facility/lib/aged-pipe-utils";
|
import { validateElapsedYears, type AgedPipeFilters } from "./agedPipeUtils";
|
||||||
import LayerSettingCard from "../layer-setting/layer-setting-card";
|
import LayerSettingCard from "../layerSetting/LayerSettingCard";
|
||||||
|
|
||||||
type MaybePromise<T = void> = T | Promise<T>;
|
type MaybePromise<T = void> = T | Promise<T>;
|
||||||
|
|
||||||
+39
-79
@@ -3,40 +3,36 @@
|
|||||||
* 노후관로를 검색하고 목록·엑셀 다운로드·지도 위치 확인 기능을 제공한다.
|
* 노후관로를 검색하고 목록·엑셀 다운로드·지도 위치 확인 기능을 제공한다.
|
||||||
*/
|
*/
|
||||||
"use client";
|
"use client";
|
||||||
import { useFacilityCodeCatalog } from "@/entities/facility/lib/use-facility-code-catalog";
|
|
||||||
|
|
||||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||||
import { useSearchParams } from "next/navigation";
|
import { useSearchParams } from "next/navigation";
|
||||||
import { Button, Input } from "@common/components";
|
import { Button, Input } from "@common/components";
|
||||||
import { StandardPopupLayout } from "@common/business_components";
|
import { StandardPopupLayout } from "@common/business_components";
|
||||||
import { getData } from "@/shared/api/sewerage-api";
|
import { getData } from "@/components/lib/api";
|
||||||
import { useAlertStore } from "@/shared/lib";
|
import { useAlertStore } from "@/shared/lib";
|
||||||
import useStore from "@/entities/reference-data/model/reference-data-store";
|
import useStore from "@/store/useStore";
|
||||||
import LoadingOverlay from "@/components/ui/loading-bar";
|
import LoadingOverlay from "@/components/ui/LoadingBar";
|
||||||
import {
|
import {
|
||||||
AGED_PIPE_DEFAULT_FILTERS,
|
AGED_PIPE_DEFAULT_FILTERS,
|
||||||
|
AGED_PIPE_LAYER_TYPE,
|
||||||
AGED_PIPE_LIST_HEADLIST,
|
AGED_PIPE_LIST_HEADLIST,
|
||||||
AGED_PIPE_PAGE_SIZE,
|
AGED_PIPE_PAGE_SIZE,
|
||||||
buildAgedPipeCqlFilters,
|
buildAgedPipeCqlFilters,
|
||||||
getAgedPipeManagementName,
|
|
||||||
normalizeAgedPipeFilters,
|
normalizeAgedPipeFilters,
|
||||||
toDisplayPipeRow,
|
toDisplayPipeRow,
|
||||||
validateElapsedYears,
|
validateElapsedYears,
|
||||||
type AgedPipeFilters,
|
type AgedPipeFilters,
|
||||||
type AgedPipeRow,
|
type AgedPipeRow,
|
||||||
type AgedPipeManagementAgency,
|
} from "./agedPipeUtils";
|
||||||
} from "@/entities/facility/lib/aged-pipe-utils";
|
import { downloadAgedPipeExcel } from "./agedPipeExport";
|
||||||
import { fetchAgedPipeLayer } from "./aged-pipe-layer";
|
import MapPopupDataTable from "@/features/windowPopup/ui/MapPopupDataTable";
|
||||||
import { downloadAgedPipeExcel } from "./aged-pipe-export";
|
import PopupSearchPanel from "@/features/windowPopup/ui/PopupSearchPanel";
|
||||||
import MapPopupDataTable from "@/features/window-popup/ui/map-popup-data-table";
|
|
||||||
import PopupSearchPanel from "@/features/window-popup/ui/popup-search-panel";
|
|
||||||
|
|
||||||
const POPUP_ROW_SELECT_MESSAGE = "SN_AGED_PIPE_ROW_SELECT";
|
const POPUP_ROW_SELECT_MESSAGE = "SN_AGED_PIPE_ROW_SELECT";
|
||||||
const POPUP_MINIMIZE_MESSAGE = "SN_AGED_PIPE_POPUP_MINIMIZE";
|
const POPUP_MINIMIZE_MESSAGE = "SN_AGED_PIPE_POPUP_MINIMIZE";
|
||||||
const POPUP_FILTER_SYNC_MESSAGE = "SN_AGED_PIPE_FILTER_SYNC";
|
const POPUP_FILTER_SYNC_MESSAGE = "SN_AGED_PIPE_FILTER_SYNC";
|
||||||
|
|
||||||
export default function AgedPipePopupPage() {
|
export default function AgedPipePopupPage() {
|
||||||
const facilityCodes = useFacilityCodeCatalog();
|
|
||||||
const alert = useAlertStore((state) => state.setMessage);
|
const alert = useAlertStore((state) => state.setMessage);
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const { ctpv, sgg, fetchCtpv, fetchSgg } = useStore();
|
const { ctpv, sgg, fetchCtpv, fetchSgg } = useStore();
|
||||||
@@ -57,18 +53,6 @@ export default function AgedPipePopupPage() {
|
|||||||
const [appliedFilters, setAppliedFilters] =
|
const [appliedFilters, setAppliedFilters] =
|
||||||
useState<AgedPipeFilters>(initialFilters);
|
useState<AgedPipeFilters>(initialFilters);
|
||||||
const [rows, setRows] = useState<AgedPipeRow[]>([]);
|
const [rows, setRows] = useState<AgedPipeRow[]>([]);
|
||||||
// 관리기관명 조회가 늦게 완료되어도 기존 목록을 재조회하지 않고 표시만 갱신한다.
|
|
||||||
const [managementAgencies, setManagementAgencies] = useState<
|
|
||||||
AgedPipeManagementAgency[]
|
|
||||||
>([]);
|
|
||||||
const displayRows = useMemo(
|
|
||||||
() =>
|
|
||||||
rows.map((row) => ({
|
|
||||||
...row,
|
|
||||||
mngInstNm: getAgedPipeManagementName(row, managementAgencies),
|
|
||||||
})),
|
|
||||||
[rows, managementAgencies],
|
|
||||||
);
|
|
||||||
const [total, setTotal] = useState(0);
|
const [total, setTotal] = useState(0);
|
||||||
const [currentPage, setCurrentPage] = useState(1);
|
const [currentPage, setCurrentPage] = useState(1);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
@@ -89,34 +73,15 @@ export default function AgedPipePopupPage() {
|
|||||||
if (sgg.length === 0) fetchSgg();
|
if (sgg.length === 0) fetchSgg();
|
||||||
}, [ctpv.length, fetchCtpv, fetchSgg, sgg.length]);
|
}, [ctpv.length, fetchCtpv, fetchSgg, sgg.length]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
let active = true;
|
|
||||||
// 기존 GIS 관리 화면과 같은 기관 목록을 사용하고, 실패 시 관로 조회는 유지한다.
|
|
||||||
getData("v1/fcltPpl/mngInsts")
|
|
||||||
.then((response) => {
|
|
||||||
if (active)
|
|
||||||
setManagementAgencies(Array.isArray(response) ? response : []);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
if (active)
|
|
||||||
alert("관리기관명을 불러오지 못해 관리기관 코드로 표시합니다.");
|
|
||||||
});
|
|
||||||
return () => {
|
|
||||||
active = false;
|
|
||||||
};
|
|
||||||
}, [alert]);
|
|
||||||
|
|
||||||
const fetchRows = useCallback(
|
const fetchRows = useCallback(
|
||||||
async (page: number, nextFilters: AgedPipeFilters, size: number) => {
|
async (page: number, nextFilters: AgedPipeFilters, size: number) => {
|
||||||
const normalized = normalizeAgedPipeFilters(nextFilters);
|
const normalized = normalizeAgedPipeFilters(nextFilters);
|
||||||
// 독립 팝업에서도 현재 DB의 원천 레이어와 필터 템플릿을 사용한다.
|
|
||||||
const layer = await fetchAgedPipeLayer();
|
|
||||||
const queryParams = new URLSearchParams({
|
const queryParams = new URLSearchParams({
|
||||||
lyrTypeNm: layer.lyrTyNm,
|
lyrTypeNm: AGED_PIPE_LAYER_TYPE,
|
||||||
page: String(page - 1),
|
page: String(page - 1),
|
||||||
size: String(size),
|
size: String(size),
|
||||||
});
|
});
|
||||||
const cqlFilters = buildAgedPipeCqlFilters(normalized, layer.flterSql);
|
const cqlFilters = buildAgedPipeCqlFilters(normalized);
|
||||||
if (cqlFilters.length > 0) {
|
if (cqlFilters.length > 0) {
|
||||||
queryParams.append("cqlFiter", cqlFilters.join(" and "));
|
queryParams.append("cqlFiter", cqlFilters.join(" and "));
|
||||||
}
|
}
|
||||||
@@ -127,12 +92,12 @@ export default function AgedPipePopupPage() {
|
|||||||
const total = Number(response?.count ?? 0);
|
const total = Number(response?.count ?? 0);
|
||||||
const rows = responseRows.map(
|
const rows = responseRows.map(
|
||||||
(item: Record<string, unknown>, index: number) =>
|
(item: Record<string, unknown>, index: number) =>
|
||||||
toDisplayPipeRow(item, index, page, ctpv, sgg, facilityCodes),
|
toDisplayPipeRow(item, index, page, ctpv, sgg),
|
||||||
);
|
);
|
||||||
|
|
||||||
return { rows, total };
|
return { rows, total };
|
||||||
},
|
},
|
||||||
[ctpv, sgg, facilityCodes],
|
[ctpv, sgg],
|
||||||
);
|
);
|
||||||
|
|
||||||
const loadRows = useCallback(
|
const loadRows = useCallback(
|
||||||
@@ -150,18 +115,13 @@ export default function AgedPipePopupPage() {
|
|||||||
setAppliedFilters(normalizeAgedPipeFilters(nextFilters));
|
setAppliedFilters(normalizeAgedPipeFilters(nextFilters));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("노후관로 목록 조회 중 오류:", error);
|
console.error("노후관로 목록 조회 중 오류:", error);
|
||||||
alert(
|
|
||||||
error instanceof Error
|
|
||||||
? error.message
|
|
||||||
: "노후관로 목록 조회 중 오류가 발생했습니다.",
|
|
||||||
);
|
|
||||||
setRows([]);
|
setRows([]);
|
||||||
setTotal(0);
|
setTotal(0);
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[alert, fetchRows, filters],
|
[fetchRows, filters],
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -287,6 +247,31 @@ export default function AgedPipePopupPage() {
|
|||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<PopupSearchPanel contentClassName="flex flex-wrap items-end gap-x-5 gap-y-3">
|
<PopupSearchPanel contentClassName="flex flex-wrap items-end gap-x-5 gap-y-3">
|
||||||
|
<label className="flex items-center gap-2">
|
||||||
|
<span className="whitespace-nowrap text-[1.3rem] text-label">
|
||||||
|
경과년도
|
||||||
|
</span>
|
||||||
|
<Input
|
||||||
|
className="w-[12rem]"
|
||||||
|
type="text"
|
||||||
|
inputMode="numeric"
|
||||||
|
pattern="[0-9]*"
|
||||||
|
autoComplete="off"
|
||||||
|
value={String(filters.elapsedYears ?? "")}
|
||||||
|
onChange={(event) => {
|
||||||
|
const digits = event.target.value.replace(/[^0-9]/g, "");
|
||||||
|
setFilters({
|
||||||
|
...filters,
|
||||||
|
elapsedYears:
|
||||||
|
digits === "" ? ("" as unknown as number) : Number(digits),
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
onKeyDown={(event) => {
|
||||||
|
if (event.key === "Enter") void handleSearch(1);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
|
||||||
<label className="flex items-center gap-2">
|
<label className="flex items-center gap-2">
|
||||||
<span className="whitespace-nowrap text-[1.3rem] text-label">
|
<span className="whitespace-nowrap text-[1.3rem] text-label">
|
||||||
시도
|
시도
|
||||||
@@ -331,31 +316,6 @@ export default function AgedPipePopupPage() {
|
|||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label className="flex items-center gap-2">
|
|
||||||
<span className="whitespace-nowrap text-[1.3rem] text-label">
|
|
||||||
경과년도
|
|
||||||
</span>
|
|
||||||
<Input
|
|
||||||
className="w-[12rem]"
|
|
||||||
type="text"
|
|
||||||
inputMode="numeric"
|
|
||||||
pattern="[0-9]*"
|
|
||||||
autoComplete="off"
|
|
||||||
value={String(filters.elapsedYears ?? "")}
|
|
||||||
onChange={(event) => {
|
|
||||||
const digits = event.target.value.replace(/[^0-9]/g, "");
|
|
||||||
setFilters({
|
|
||||||
...filters,
|
|
||||||
elapsedYears:
|
|
||||||
digits === "" ? ("" as unknown as number) : Number(digits),
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
onKeyDown={(event) => {
|
|
||||||
if (event.key === "Enter") void handleSearch(1);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<div className="ml-auto flex items-center gap-2">
|
<div className="ml-auto flex items-center gap-2">
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -381,7 +341,7 @@ export default function AgedPipePopupPage() {
|
|||||||
</PopupSearchPanel>
|
</PopupSearchPanel>
|
||||||
|
|
||||||
<MapPopupDataTable
|
<MapPopupDataTable
|
||||||
rows={displayRows}
|
rows={rows as Array<AgedPipeRow & Record<string, unknown>>}
|
||||||
headlist={AGED_PIPE_LIST_HEADLIST}
|
headlist={AGED_PIPE_LIST_HEADLIST}
|
||||||
title="노후관로 목록"
|
title="노후관로 목록"
|
||||||
total={total}
|
total={total}
|
||||||
+7
-3
@@ -1,9 +1,13 @@
|
|||||||
/** 노후관로 목록의 엑셀 다운로드 데이터와 서식을 생성한다. */
|
/** 노후관로 목록의 엑셀 다운로드 데이터와 서식을 생성한다. */
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { postBlobData } from "@/shared/api/file-api";
|
import { postBlobData } from "@/components/lib/api";
|
||||||
import { fileDownload } from "@/components/lib/utils/file-download";
|
import { fileDownload } from "@/components/lib/utils/fileDownload";
|
||||||
import { AGED_PIPE_EXCEL_FIELDS, normalizeAgedPipeFilters, type AgedPipeFilters } from "@/entities/facility/lib/aged-pipe-utils";
|
import {
|
||||||
|
AGED_PIPE_EXCEL_FIELDS,
|
||||||
|
normalizeAgedPipeFilters,
|
||||||
|
type AgedPipeFilters,
|
||||||
|
} from "./agedPipeUtils";
|
||||||
|
|
||||||
type AgedPipeExportProgress = {
|
type AgedPipeExportProgress = {
|
||||||
fileName?: string;
|
fileName?: string;
|
||||||
+32
-108
@@ -2,11 +2,11 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import type { SelectDataType } from "@common/business_components";
|
import type { SelectDataType } from "@common/business_components";
|
||||||
import { formatDisplayData } from "@/components/lib/utils/format-display-value";
|
import { formatDisplayData } from "@/components/lib/utils/formatDisplayValue";
|
||||||
import {
|
import {
|
||||||
MS_SWAGE_PPL_CODES,
|
MS_SWAGE_PPL_CODES,
|
||||||
MS_SWAGE_PPL_USE_CODES,
|
MS_SWAGE_PPL_USE_CODES,
|
||||||
} from "@/entities/facility/model/facility-code-fallbacks";
|
} from "../common/table";
|
||||||
|
|
||||||
export const AGED_PIPE_LAYER_TYPE = "tb_ms_swage_ppl";
|
export const AGED_PIPE_LAYER_TYPE = "tb_ms_swage_ppl";
|
||||||
export const AGED_PIPE_DEFAULT_ELAPSED_YEARS = 30;
|
export const AGED_PIPE_DEFAULT_ELAPSED_YEARS = 30;
|
||||||
@@ -39,12 +39,8 @@ export type AgedPipeRow = {
|
|||||||
|
|
||||||
type PipeSource = Record<string, unknown>;
|
type PipeSource = Record<string, unknown>;
|
||||||
|
|
||||||
const useMap = new Map(
|
const useMap = new Map(MS_SWAGE_PPL_USE_CODES.map((item) => [item.val.trim(), item.text]));
|
||||||
MS_SWAGE_PPL_USE_CODES.map((item) => [item.val.trim(), item.text]),
|
const materialMap = new Map(MS_SWAGE_PPL_CODES.map((item) => [item.val.trim(), item.text]));
|
||||||
);
|
|
||||||
const materialMap = new Map(
|
|
||||||
MS_SWAGE_PPL_CODES.map((item) => [item.val.trim(), item.text]),
|
|
||||||
);
|
|
||||||
|
|
||||||
export const AGED_PIPE_DEFAULT_FILTERS: AgedPipeFilters = {
|
export const AGED_PIPE_DEFAULT_FILTERS: AgedPipeFilters = {
|
||||||
elapsedYears: AGED_PIPE_DEFAULT_ELAPSED_YEARS,
|
elapsedYears: AGED_PIPE_DEFAULT_ELAPSED_YEARS,
|
||||||
@@ -60,36 +56,15 @@ const normalizeRegionFilterCode = (value: unknown, prefixLength: number) => {
|
|||||||
|
|
||||||
export const AGED_PIPE_LIST_HEADLIST = [
|
export const AGED_PIPE_LIST_HEADLIST = [
|
||||||
{ id: "rowNumber", title: "순번", widthPercent: 6 },
|
{ id: "rowNumber", title: "순번", widthPercent: 6 },
|
||||||
{ id: "fcltMngNo", title: "시설관리번호", widthPercent: 16 },
|
{ id: "fcltMngNo", title: "시설관리번호", widthPercent: 18 },
|
||||||
{ id: "mngInstNm", title: "관리기관", widthPercent: 14 },
|
|
||||||
{ id: "instlYmd", title: "설치일자", widthPercent: 12 },
|
{ id: "instlYmd", title: "설치일자", widthPercent: 12 },
|
||||||
|
{ id: "pdmtVl", title: "관경(mm)", widthPercent: 10 },
|
||||||
|
{ id: "prlgVl", title: "연장(m)", widthPercent: 10 },
|
||||||
|
{ id: "usgCd", title: "용도", widthPercent: 12 },
|
||||||
|
{ id: "mqltCd", title: "재질", widthPercent: 18 },
|
||||||
{ id: "elapsedYears", title: "경과년도", widthPercent: 8, align: "right" },
|
{ id: "elapsedYears", title: "경과년도", widthPercent: 8, align: "right" },
|
||||||
{ id: "pdmtVl", title: "관경(mm)", widthPercent: 9 },
|
|
||||||
{ id: "prlgVl", title: "연장(m)", widthPercent: 9 },
|
|
||||||
{ id: "usgCd", title: "용도", widthPercent: 10 },
|
|
||||||
{ id: "mqltCd", title: "재질", widthPercent: 16 },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/** 기존 관리기관 조회 API의 코드와 기관명만 목록 표시용으로 사용한다. */
|
|
||||||
export type AgedPipeManagementAgency = {
|
|
||||||
mngInstCd: string;
|
|
||||||
lwrInstNm?: string | null;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 명칭이 없는 기관은 원본 코드를 표시하며, 행의 관리기관 코드는 변경하지 않는다. */
|
|
||||||
export const getAgedPipeManagementName = (
|
|
||||||
row: PipeSource,
|
|
||||||
agencies: AgedPipeManagementAgency[],
|
|
||||||
): string => {
|
|
||||||
const directName = String(row.mngInstNm ?? row.mng_inst_nm ?? "").trim();
|
|
||||||
if (directName && directName !== "-") return directName;
|
|
||||||
const code = String(row.mngInstCd ?? row.mng_inst_cd ?? "").trim();
|
|
||||||
const agency = agencies.find(
|
|
||||||
(item) => String(item.mngInstCd).trim() === code,
|
|
||||||
);
|
|
||||||
return String(agency?.lwrInstNm ?? "").trim() || code || "-";
|
|
||||||
};
|
|
||||||
|
|
||||||
export const AGED_PIPE_EXCEL_FIELDS = [
|
export const AGED_PIPE_EXCEL_FIELDS = [
|
||||||
"ftreSmbolCd",
|
"ftreSmbolCd",
|
||||||
"fcltMngNo",
|
"fcltMngNo",
|
||||||
@@ -174,15 +149,11 @@ export const AGED_PIPE_EXCEL_HEADER_RANGE = `A1:${getExcelColumnLetter(AGED_PIPE
|
|||||||
const pad2 = (value: number) => String(value).padStart(2, "0");
|
const pad2 = (value: number) => String(value).padStart(2, "0");
|
||||||
|
|
||||||
const normalizeYmd = (value: unknown) =>
|
const normalizeYmd = (value: unknown) =>
|
||||||
String(value ?? "")
|
String(value ?? "").replace(/[^0-9]/g, "").slice(0, 8);
|
||||||
.replace(/[^0-9]/g, "")
|
|
||||||
.slice(0, 8);
|
|
||||||
|
|
||||||
const getToday = () => new Date();
|
const getToday = () => new Date();
|
||||||
|
|
||||||
export const normalizeAgedPipeFilters = (
|
export const normalizeAgedPipeFilters = (filters: AgedPipeFilters): AgedPipeFilters => {
|
||||||
filters: AgedPipeFilters,
|
|
||||||
): AgedPipeFilters => {
|
|
||||||
const elapsedYears = Math.trunc(Number(filters.elapsedYears));
|
const elapsedYears = Math.trunc(Number(filters.elapsedYears));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -201,11 +172,7 @@ export const validateElapsedYears = (value: number) =>
|
|||||||
|
|
||||||
export const getCutoffYmd = (elapsedYears: number) => {
|
export const getCutoffYmd = (elapsedYears: number) => {
|
||||||
const today = getToday();
|
const today = getToday();
|
||||||
const cutoff = new Date(
|
const cutoff = new Date(today.getFullYear() - elapsedYears, today.getMonth(), today.getDate());
|
||||||
today.getFullYear() - elapsedYears,
|
|
||||||
today.getMonth(),
|
|
||||||
today.getDate(),
|
|
||||||
);
|
|
||||||
return `${cutoff.getFullYear()}${pad2(cutoff.getMonth() + 1)}${pad2(cutoff.getDate())}`;
|
return `${cutoff.getFullYear()}${pad2(cutoff.getMonth() + 1)}${pad2(cutoff.getDate())}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -234,9 +201,7 @@ export const isInvalidInstallYmd = (value: unknown) => {
|
|||||||
const normalized = normalizeYmd(value);
|
const normalized = normalizeYmd(value);
|
||||||
return (
|
return (
|
||||||
normalized.length < 8 ||
|
normalized.length < 8 ||
|
||||||
AGED_PIPE_INVALID_INSTALL_YMD_PREFIXES.some((prefix) =>
|
AGED_PIPE_INVALID_INSTALL_YMD_PREFIXES.some((prefix) => normalized.startsWith(prefix))
|
||||||
normalized.startsWith(prefix),
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -245,25 +210,13 @@ export const getElapsedYearsDisplayText = (value: unknown) => {
|
|||||||
return elapsedYears == null ? "확인불가" : `${elapsedYears}년`;
|
return elapsedYears == null ? "확인불가" : `${elapsedYears}년`;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** DB의 SQL 필터 템플릿을 해석한다. 누락/미지원 토큰은 전체 관로 조회로 대체하지 않는다. */
|
export const buildAgedPipeCqlFilters = (filters: AgedPipeFilters) => {
|
||||||
export const buildAgedPipeCqlFilters = (
|
|
||||||
filters: AgedPipeFilters,
|
|
||||||
filterTemplate: string,
|
|
||||||
) => {
|
|
||||||
const normalized = normalizeAgedPipeFilters(filters);
|
const normalized = normalizeAgedPipeFilters(filters);
|
||||||
const template = String(filterTemplate ?? "").trim();
|
const cqlFilters = [
|
||||||
if (!template.includes("${cutoffYmd}")) {
|
"instl_ymd IS NOT NULL",
|
||||||
throw new Error(
|
...AGED_PIPE_INVALID_INSTALL_YMD_PREFIXES.map((prefix) => `instl_ymd NOT LIKE '${prefix}%'`),
|
||||||
"노후관로 DB sql_filt에 ${cutoffYmd} 조건을 등록해 주세요.",
|
`instl_ymd <= '${getCutoffYmd(normalized.elapsedYears)}'`,
|
||||||
);
|
];
|
||||||
}
|
|
||||||
const filter = template
|
|
||||||
.split("${cutoffYmd}")
|
|
||||||
.join(getCutoffYmd(normalized.elapsedYears));
|
|
||||||
if (/\$\{[^}]*\}/.test(filter)) {
|
|
||||||
throw new Error("노후관로 DB sql_filt에 지원하지 않는 치환값이 있습니다.");
|
|
||||||
}
|
|
||||||
const cqlFilters = [`(${filter})`];
|
|
||||||
|
|
||||||
if (normalized.sggCd !== "0") {
|
if (normalized.sggCd !== "0") {
|
||||||
cqlFilters.push(`pbadms_emd_cd LIKE '${normalized.sggCd}%'`);
|
cqlFilters.push(`pbadms_emd_cd LIKE '${normalized.sggCd}%'`);
|
||||||
@@ -277,23 +230,14 @@ export const buildAgedPipeCqlFilters = (
|
|||||||
const getRegionCode = (source: PipeSource) =>
|
const getRegionCode = (source: PipeSource) =>
|
||||||
String(source.pbadmsEmdCd ?? source.pbadms_emd_cd ?? "").trim();
|
String(source.pbadmsEmdCd ?? source.pbadms_emd_cd ?? "").trim();
|
||||||
|
|
||||||
export const matchesAgedPipeFilters = (
|
export const matchesAgedPipeFilters = (source: PipeSource, filters: AgedPipeFilters) => {
|
||||||
source: PipeSource,
|
|
||||||
filters: AgedPipeFilters,
|
|
||||||
) => {
|
|
||||||
const normalized = normalizeAgedPipeFilters(filters);
|
const normalized = normalizeAgedPipeFilters(filters);
|
||||||
const instlYmd = normalizeYmd(source.instl_ymd ?? source.instlYmd);
|
const instlYmd = normalizeYmd(source.instl_ymd ?? source.instlYmd);
|
||||||
if (
|
if (!instlYmd || isInvalidInstallYmd(instlYmd) || instlYmd > getCutoffYmd(normalized.elapsedYears)) return false;
|
||||||
!instlYmd ||
|
|
||||||
isInvalidInstallYmd(instlYmd) ||
|
|
||||||
instlYmd > getCutoffYmd(normalized.elapsedYears)
|
|
||||||
)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
const regionCode = getRegionCode(source);
|
const regionCode = getRegionCode(source);
|
||||||
if (normalized.sggCd !== "0") return regionCode.startsWith(normalized.sggCd);
|
if (normalized.sggCd !== "0") return regionCode.startsWith(normalized.sggCd);
|
||||||
if (normalized.ctpvCd !== "0")
|
if (normalized.ctpvCd !== "0") return regionCode.startsWith(normalized.ctpvCd);
|
||||||
return regionCode.startsWith(normalized.ctpvCd);
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -316,28 +260,16 @@ export const toDisplayPipeRow = (
|
|||||||
page: number,
|
page: number,
|
||||||
ctpvOptions: SelectDataType[],
|
ctpvOptions: SelectDataType[],
|
||||||
sggOptions: SelectDataType[],
|
sggOptions: SelectDataType[],
|
||||||
catalog?: {
|
|
||||||
MS_SWAGE_PPL_USE_CODES: { val: string; text: string }[];
|
|
||||||
MS_SWAGE_PPL_CODES: { val: string; text: string }[];
|
|
||||||
},
|
|
||||||
): AgedPipeRow => {
|
): AgedPipeRow => {
|
||||||
const formatted = formatDisplayData(source) as PipeSource;
|
const formatted = formatDisplayData(source) as PipeSource;
|
||||||
const codePrefix = getRegionCode(source);
|
const codePrefix = getRegionCode(source);
|
||||||
const instlYmd =
|
const instlYmd = formatted.instlYmd ?? source.instlYmd ?? formatted.instl_ymd ?? source.instl_ymd;
|
||||||
formatted.instlYmd ??
|
const invalidInstallYmd = isInvalidInstallYmd(source.instlYmd ?? source.instl_ymd ?? instlYmd);
|
||||||
source.instlYmd ??
|
|
||||||
formatted.instl_ymd ??
|
|
||||||
source.instl_ymd;
|
|
||||||
const invalidInstallYmd = isInvalidInstallYmd(
|
|
||||||
source.instlYmd ?? source.instl_ymd ?? instlYmd,
|
|
||||||
);
|
|
||||||
const trimmedUse = String(source.usgCd ?? source.usg_cd ?? "").trim();
|
const trimmedUse = String(source.usgCd ?? source.usg_cd ?? "").trim();
|
||||||
const trimmedMaterial = String(source.mqltCd ?? source.mqlt_cd ?? "").trim();
|
const trimmedMaterial = String(source.mqltCd ?? source.mqlt_cd ?? "").trim();
|
||||||
const pdmtVl = formatted.pdmtVl ?? source.pdmtVl ?? source.pdmt_vl ?? "-";
|
const pdmtVl = formatted.pdmtVl ?? source.pdmtVl ?? source.pdmt_vl ?? "-";
|
||||||
const prlgVl = formatted.prlgVl ?? source.prlgVl ?? source.prlg_vl ?? "-";
|
const prlgVl = formatted.prlgVl ?? source.prlgVl ?? source.prlg_vl ?? "-";
|
||||||
const fcltMngNo = String(
|
const fcltMngNo = String(formatted.fcltMngNo ?? source.fcltMngNo ?? source.fclt_mng_no ?? "-");
|
||||||
formatted.fcltMngNo ?? source.fcltMngNo ?? source.fclt_mng_no ?? "-",
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...source,
|
...source,
|
||||||
@@ -350,22 +282,11 @@ export const toDisplayPipeRow = (
|
|||||||
instlYmd: invalidInstallYmd ? "확인불가" : String(instlYmd ?? "-"),
|
instlYmd: invalidInstallYmd ? "확인불가" : String(instlYmd ?? "-"),
|
||||||
pdmtVl: typeof pdmtVl === "number" ? pdmtVl : String(pdmtVl),
|
pdmtVl: typeof pdmtVl === "number" ? pdmtVl : String(pdmtVl),
|
||||||
prlgVl: typeof prlgVl === "number" ? prlgVl : String(prlgVl),
|
prlgVl: typeof prlgVl === "number" ? prlgVl : String(prlgVl),
|
||||||
usgCd:
|
usgCd: useMap.get(trimmedUse) ?? String(formatted.usgCd ?? source.usgCd ?? source.usg_cd ?? "-"),
|
||||||
(catalog
|
|
||||||
? catalog.MS_SWAGE_PPL_USE_CODES.find(
|
|
||||||
(item) => item.val.trim() === trimmedUse,
|
|
||||||
)?.text
|
|
||||||
: useMap.get(trimmedUse)) ??
|
|
||||||
String(formatted.usgCd ?? source.usgCd ?? source.usg_cd ?? "-"),
|
|
||||||
mqltCd:
|
mqltCd:
|
||||||
(catalog
|
materialMap.get(trimmedMaterial) ??
|
||||||
? catalog.MS_SWAGE_PPL_CODES.find(
|
|
||||||
(item) => item.val.trim() === trimmedMaterial,
|
|
||||||
)?.text
|
|
||||||
: materialMap.get(trimmedMaterial)) ??
|
|
||||||
String(formatted.mqltCd ?? source.mqltCd ?? source.mqlt_cd ?? "-"),
|
String(formatted.mqltCd ?? source.mqltCd ?? source.mqlt_cd ?? "-"),
|
||||||
elapsedYears:
|
elapsedYears: getElapsedYears(source.instlYmd ?? source.instl_ymd) ?? "확인불가",
|
||||||
getElapsedYears(source.instlYmd ?? source.instl_ymd) ?? "확인불가",
|
|
||||||
ctpvNm: resolveRegionName(
|
ctpvNm: resolveRegionName(
|
||||||
codePrefix,
|
codePrefix,
|
||||||
formatted.ctpvNm ?? source.ctpvNm ?? source.ctpv_nm,
|
formatted.ctpvNm ?? source.ctpvNm ?? source.ctpv_nm,
|
||||||
@@ -396,5 +317,8 @@ export const isAgedPipeLayerNode = (node: any) => {
|
|||||||
const layerName = String(data?.lyrNm ?? node?.text ?? "");
|
const layerName = String(data?.lyrNm ?? node?.text ?? "");
|
||||||
const layerTypeName = String(data?.lyrTyNm ?? "");
|
const layerTypeName = String(data?.lyrTyNm ?? "");
|
||||||
|
|
||||||
return layerTypeName === "tb_old_pipe" || layerName.includes("노후관로");
|
return (
|
||||||
|
layerTypeName === "tb_old_pipe" ||
|
||||||
|
layerName.includes("노후관로")
|
||||||
|
);
|
||||||
};
|
};
|
||||||
+8
-8
@@ -4,10 +4,10 @@
|
|||||||
*/
|
*/
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { getSnRowNumber } from "@/shared/lib/row-number";
|
|
||||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||||
import { Button, Input } from "@common/components";
|
import { Button, Input } from "@common/components";
|
||||||
import {
|
import {
|
||||||
|
getStandardRowNumber,
|
||||||
StandardDataTable,
|
StandardDataTable,
|
||||||
StandardPopupLayout,
|
StandardPopupLayout,
|
||||||
} from "@common/business_components";
|
} from "@common/business_components";
|
||||||
@@ -18,10 +18,10 @@ import {
|
|||||||
type ColumnDef,
|
type ColumnDef,
|
||||||
type PaginationState,
|
type PaginationState,
|
||||||
} from "@tanstack/react-table";
|
} from "@tanstack/react-table";
|
||||||
import { getRawJson } from "@/shared/api/sewerage-api";
|
import { getRawJson } from "@/components/lib/api";
|
||||||
import LoadingOverlay from "@/components/ui/loading-bar";
|
import LoadingOverlay from "@/components/ui/LoadingBar";
|
||||||
import { useAlertStore } from "@/shared/lib";
|
import { useAlertStore } from "@/shared/lib";
|
||||||
import { windowPopupDefinitions } from "@/features/window-popup/model/popup-definitions";
|
import { windowPopupDefinitions } from "@/features/windowPopup/model/popupDefinitions";
|
||||||
import {
|
import {
|
||||||
AGED_PIPE_STATUS_BY_CTPV_DEFAULT_ELAPSED_YEARS,
|
AGED_PIPE_STATUS_BY_CTPV_DEFAULT_ELAPSED_YEARS,
|
||||||
buildAgedPipeStatusYearOptions,
|
buildAgedPipeStatusYearOptions,
|
||||||
@@ -32,9 +32,9 @@ import {
|
|||||||
type AgedPipeStatusByCtpvFilters,
|
type AgedPipeStatusByCtpvFilters,
|
||||||
type AgedPipeStatusByCtpvResponse,
|
type AgedPipeStatusByCtpvResponse,
|
||||||
type AgedPipeStatusByCtpvRow,
|
type AgedPipeStatusByCtpvRow,
|
||||||
} from "./aged-pipe-status-by-ctpv-utils";
|
} from "./agedPipeStatusByCtpvUtils";
|
||||||
import { downloadAgedPipeStatusByCtpvExcel } from "./aged-pipe-status-by-ctpv-export";
|
import { downloadAgedPipeStatusByCtpvExcel } from "./agedPipeStatusByCtpvExport";
|
||||||
import PopupSearchPanel from "@/features/window-popup/ui/popup-search-panel";
|
import PopupSearchPanel from "@/features/windowPopup/ui/PopupSearchPanel";
|
||||||
|
|
||||||
// CS 목록과 동일하게 한 페이지에는 최대 10개 시도만 표시한다.
|
// CS 목록과 동일하게 한 페이지에는 최대 10개 시도만 표시한다.
|
||||||
const AGED_PIPE_STATUS_PAGE_SIZE = 10;
|
const AGED_PIPE_STATUS_PAGE_SIZE = 10;
|
||||||
@@ -71,7 +71,7 @@ export default function AgedPipeStatusByCtpvPopupPage() {
|
|||||||
id: "rowNumber",
|
id: "rowNumber",
|
||||||
header: "순번",
|
header: "순번",
|
||||||
cell: ({ row }) =>
|
cell: ({ row }) =>
|
||||||
getSnRowNumber({
|
getStandardRowNumber({
|
||||||
total: rows.length,
|
total: rows.length,
|
||||||
rowIndex: row.index,
|
rowIndex: row.index,
|
||||||
}),
|
}),
|
||||||
+2
-2
@@ -2,13 +2,13 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import * as XLSX from "xlsx";
|
import * as XLSX from "xlsx";
|
||||||
import { getRawJson } from "@/shared/api/sewerage-api";
|
import { getRawJson } from "@/components/lib/api";
|
||||||
import {
|
import {
|
||||||
getAgedPipeStatusByCtpvValidationMessage,
|
getAgedPipeStatusByCtpvValidationMessage,
|
||||||
normalizeAgedPipeStatusByCtpvFilters,
|
normalizeAgedPipeStatusByCtpvFilters,
|
||||||
type AgedPipeStatusByCtpvFilters,
|
type AgedPipeStatusByCtpvFilters,
|
||||||
type AgedPipeStatusByCtpvResponse,
|
type AgedPipeStatusByCtpvResponse,
|
||||||
} from "./aged-pipe-status-by-ctpv-utils";
|
} from "./agedPipeStatusByCtpvUtils";
|
||||||
|
|
||||||
/** 적용조건의 시도별 노후관로현황 전체를 조회해 연도 그룹 Excel로 생성한다. */
|
/** 적용조건의 시도별 노후관로현황 전체를 조회해 연도 그룹 Excel로 생성한다. */
|
||||||
export const downloadAgedPipeStatusByCtpvExcel = async (
|
export const downloadAgedPipeStatusByCtpvExcel = async (
|
||||||
+2
-3
@@ -66,8 +66,7 @@ export const normalizeAgedPipeStatusByCtpvFilters = (
|
|||||||
filters: Partial<AgedPipeStatusByCtpvFilters>,
|
filters: Partial<AgedPipeStatusByCtpvFilters>,
|
||||||
): AgedPipeStatusByCtpvFilters => {
|
): AgedPipeStatusByCtpvFilters => {
|
||||||
const currentYear = new Date().getFullYear();
|
const currentYear = new Date().getFullYear();
|
||||||
// 최초 진입·초기화는 당해연도 1년 조회로 시작하며 직접 선택한 범위는 유지한다.
|
let startYear = Math.trunc(Number(filters.startYear ?? currentYear - 2));
|
||||||
let startYear = Math.trunc(Number(filters.startYear ?? currentYear));
|
|
||||||
let endYear = Math.trunc(Number(filters.endYear ?? currentYear));
|
let endYear = Math.trunc(Number(filters.endYear ?? currentYear));
|
||||||
let elapsedYears = Math.trunc(
|
let elapsedYears = Math.trunc(
|
||||||
Number(
|
Number(
|
||||||
@@ -75,7 +74,7 @@ export const normalizeAgedPipeStatusByCtpvFilters = (
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!Number.isFinite(startYear)) startYear = currentYear;
|
if (!Number.isFinite(startYear)) startYear = currentYear - 2;
|
||||||
if (!Number.isFinite(endYear)) endYear = currentYear;
|
if (!Number.isFinite(endYear)) endYear = currentYear;
|
||||||
if (
|
if (
|
||||||
!Number.isFinite(elapsedYears) ||
|
!Number.isFinite(elapsedYears) ||
|
||||||
+3
-3
@@ -17,13 +17,13 @@ import {
|
|||||||
Waves,
|
Waves,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
|
|
||||||
import { createPredictionAnalysisTimeRange } from "@/features/fldng-predc-prst/model/analysis-time-range";
|
import { createPredictionAnalysisTimeRange } from "@/features/fldngPredcPrst/model/analysisTimeRange";
|
||||||
import {
|
import {
|
||||||
windowPopupDefinitions,
|
windowPopupDefinitions,
|
||||||
type WindowPopupKey,
|
type WindowPopupKey,
|
||||||
} from "@/features/window-popup/model/popup-definitions";
|
} from "@/features/windowPopup/model/popupDefinitions";
|
||||||
|
|
||||||
import { getRawJson } from "@/shared/api/sewerage-api";
|
import { getRawJson } from "@/components/lib/api";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
onOpenPopup: (popupKey: WindowPopupKey) => Window | null;
|
onOpenPopup: (popupKey: WindowPopupKey) => Window | null;
|
||||||
+41
-66
@@ -1,22 +1,9 @@
|
|||||||
/** 지도 시설 상세정보의 코드값을 업무 표시명으로 변환한다. */
|
/** 지도 시설 상세정보의 코드값을 업무 표시명으로 변환한다. */
|
||||||
import {
|
import { MS_SWAGE_PPL_USE_CODES, MS_SWAGE_PPL_CODES, MS_SWAGE_MHL_CODES, MS_SWAGE_MHL_USE_CODES, DRTW_SEWAGE_PUMP_USE_CODES } from './table';
|
||||||
MS_SWAGE_PPL_USE_CODES,
|
|
||||||
MS_SWAGE_PPL_CODES,
|
|
||||||
MS_SWAGE_MHL_CODES,
|
|
||||||
MS_SWAGE_MHL_USE_CODES,
|
|
||||||
DRTW_SEWAGE_PUMP_USE_CODES,
|
|
||||||
} from "@/entities/facility/model/facility-code-fallbacks";
|
|
||||||
|
|
||||||
interface CodeMapperProps {
|
interface CodeMapperProps {
|
||||||
layerName: string;
|
layerName: string;
|
||||||
data: any;
|
data: any;
|
||||||
/** 호출 화면에서 확인한 CMS 사전. 미주입 시 원래 코드 사전을 유지한다. */
|
|
||||||
catalog?: {
|
|
||||||
MS_SWAGE_PPL_USE_CODES: { val: string; text: string }[];
|
|
||||||
MS_SWAGE_PPL_CODES: { val: string; text: string }[];
|
|
||||||
MS_SWAGE_MHL_CODES: { val: string; text: string }[];
|
|
||||||
MS_SWAGE_MHL_USE_CODES: { val: string; text: string }[];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,22 +12,18 @@ interface CodeMapperProps {
|
|||||||
* @param data - 변환할 데이터 객체
|
* @param data - 변환할 데이터 객체
|
||||||
* @returns 변환된 데이터 객체
|
* @returns 변환된 데이터 객체
|
||||||
*/
|
*/
|
||||||
export const codeMapper = ({
|
export const codeMapper = ({ layerName, data }: CodeMapperProps): any => {
|
||||||
layerName,
|
|
||||||
data,
|
|
||||||
catalog,
|
|
||||||
}: CodeMapperProps): any => {
|
|
||||||
if (!data) return data;
|
if (!data) return data;
|
||||||
|
|
||||||
const processedData = { ...data };
|
const processedData = { ...data };
|
||||||
|
|
||||||
switch (layerName) {
|
switch (layerName) {
|
||||||
case "하수관로":
|
case '하수관로':
|
||||||
// usg_cd 값 변환 (용도코드)
|
// usg_cd 값 변환 (용도코드)
|
||||||
if (processedData.usg_cd) {
|
if (processedData.usg_cd) {
|
||||||
const usageCodeItem = (
|
const usageCodeItem = MS_SWAGE_PPL_USE_CODES.find(
|
||||||
catalog?.MS_SWAGE_PPL_USE_CODES ?? MS_SWAGE_PPL_USE_CODES
|
code => code.val === processedData.usg_cd.trim()
|
||||||
).find((code) => code.val === processedData.usg_cd.trim());
|
);
|
||||||
if (usageCodeItem) {
|
if (usageCodeItem) {
|
||||||
processedData.usg_cd = usageCodeItem.text;
|
processedData.usg_cd = usageCodeItem.text;
|
||||||
}
|
}
|
||||||
@@ -48,21 +31,21 @@ export const codeMapper = ({
|
|||||||
|
|
||||||
// mqlt_cd 값 변환 (재질코드)
|
// mqlt_cd 값 변환 (재질코드)
|
||||||
if (processedData.mqlt_cd) {
|
if (processedData.mqlt_cd) {
|
||||||
const materialCodeItem = (
|
const materialCodeItem = MS_SWAGE_PPL_CODES.find(
|
||||||
catalog?.MS_SWAGE_PPL_CODES ?? MS_SWAGE_PPL_CODES
|
code => code.val === processedData.mqlt_cd.trim()
|
||||||
).find((code) => code.val === processedData.mqlt_cd.trim());
|
);
|
||||||
if (materialCodeItem) {
|
if (materialCodeItem) {
|
||||||
processedData.mqlt_cd = materialCodeItem.text;
|
processedData.mqlt_cd = materialCodeItem.text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "하수맨홀":
|
case '하수맨홀':
|
||||||
// usg_cd 값 변환 (용도코드)
|
// usg_cd 값 변환 (용도코드)
|
||||||
if (processedData.usg_cd) {
|
if (processedData.usg_cd) {
|
||||||
const usageCodeItem = (
|
const usageCodeItem = MS_SWAGE_MHL_USE_CODES.find(
|
||||||
catalog?.MS_SWAGE_MHL_USE_CODES ?? MS_SWAGE_MHL_USE_CODES
|
code => code.val.trim() === processedData.usg_cd.trim()
|
||||||
).find((code) => code.val.trim() === processedData.usg_cd.trim());
|
);
|
||||||
if (usageCodeItem) {
|
if (usageCodeItem) {
|
||||||
processedData.usg_cd = usageCodeItem.text;
|
processedData.usg_cd = usageCodeItem.text;
|
||||||
}
|
}
|
||||||
@@ -70,20 +53,20 @@ export const codeMapper = ({
|
|||||||
|
|
||||||
// mqlt_cd 값 변환 (재질코드)
|
// mqlt_cd 값 변환 (재질코드)
|
||||||
if (processedData.mqlt_cd) {
|
if (processedData.mqlt_cd) {
|
||||||
const materialCodeItem = (
|
const materialCodeItem = MS_SWAGE_MHL_CODES.find(
|
||||||
catalog?.MS_SWAGE_MHL_CODES ?? MS_SWAGE_MHL_CODES
|
code => code.val === processedData.mqlt_cd.trim()
|
||||||
).find((code) => code.val === processedData.mqlt_cd.trim());
|
);
|
||||||
if (materialCodeItem) {
|
if (materialCodeItem) {
|
||||||
processedData.mqlt_cd = materialCodeItem.text;
|
processedData.mqlt_cd = materialCodeItem.text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "하수펌프장":
|
case '하수펌프장':
|
||||||
// usg_cd 값 변환 (용도코드)
|
// usg_cd 값 변환 (용도코드)
|
||||||
if (processedData.usg_cd) {
|
if (processedData.usg_cd) {
|
||||||
const usageCodeItem = DRTW_SEWAGE_PUMP_USE_CODES.find(
|
const usageCodeItem = DRTW_SEWAGE_PUMP_USE_CODES.find(
|
||||||
(code) => code.val === processedData.usg_cd.trim(),
|
code => code.val === processedData.usg_cd.trim()
|
||||||
);
|
);
|
||||||
if (usageCodeItem) {
|
if (usageCodeItem) {
|
||||||
processedData.usg_cd = usageCodeItem.text;
|
processedData.usg_cd = usageCodeItem.text;
|
||||||
@@ -91,30 +74,26 @@ export const codeMapper = ({
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "우수토실":
|
case '우수토실':
|
||||||
// prrtymngYn 값 변환 (중점여부)
|
// prrtymngYn 값 변환 (중점여부)
|
||||||
if (processedData.prrtymngYn) {
|
if (processedData.prrtymngYn) {
|
||||||
if (processedData.prrtymngYn === "Y") {
|
if (processedData.prrtymngYn === 'Y') {
|
||||||
processedData.prrtymngYn = "중점우수토실";
|
processedData.prrtymngYn = '중점우수토실';
|
||||||
} else if (processedData.prrtymngYn === "N") {
|
} else if (processedData.prrtymngYn === 'N') {
|
||||||
processedData.prrtymngYn = "우수토실";
|
processedData.prrtymngYn = '우수토실';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "중점우수토실":
|
case '중점우수토실':
|
||||||
if (processedData.manage_no) {
|
if (processedData.manage_no) {
|
||||||
processedData.mqlt_cd = processedData.manage_no;
|
processedData.mqlt_cd = processedData.manage_no;
|
||||||
}
|
}
|
||||||
if (processedData.mesure_spot_se) {
|
if (processedData.mesure_spot_se) {
|
||||||
const mesureSpotSe = [
|
const mesureSpotSe = [{ id: '0', text: '합류식' }, { id: '1', text: '분류식' }];
|
||||||
{ id: "0", text: "합류식" },
|
|
||||||
{ id: "1", text: "분류식" },
|
|
||||||
];
|
|
||||||
const mesureSpotSeItem = mesureSpotSe.find(
|
const mesureSpotSeItem = mesureSpotSe.find(
|
||||||
(code) => code.id === processedData.mesure_spot_se.trim(),
|
code => code.id === processedData.mesure_spot_se.trim()
|
||||||
);
|
);
|
||||||
if (mesureSpotSeItem)
|
if (mesureSpotSeItem) processedData.mesure_spot_se = mesureSpotSeItem.text;
|
||||||
processedData.mesure_spot_se = mesureSpotSeItem.text;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -132,44 +111,40 @@ export const codeMapper = ({
|
|||||||
* @param data - 역변환할 데이터 객체
|
* @param data - 역변환할 데이터 객체
|
||||||
* @returns 역변환된 데이터 객체
|
* @returns 역변환된 데이터 객체
|
||||||
*/
|
*/
|
||||||
export const reverseCodeMapper = ({
|
export const reverseCodeMapper = ({ layerName, data }: CodeMapperProps): any => {
|
||||||
layerName,
|
|
||||||
data,
|
|
||||||
catalog,
|
|
||||||
}: CodeMapperProps): any => {
|
|
||||||
if (!data) return data;
|
if (!data) return data;
|
||||||
|
|
||||||
const processedData = { ...data };
|
const processedData = { ...data };
|
||||||
|
|
||||||
switch (layerName) {
|
switch (layerName) {
|
||||||
case "하수맨홀":
|
case '하수맨홀':
|
||||||
// mqlt_cd 값 역변환 (텍스트 → 코드)
|
// mqlt_cd 값 역변환 (텍스트 → 코드)
|
||||||
if (processedData.mqlt_cd && typeof processedData.mqlt_cd === "string") {
|
if (processedData.mqlt_cd && typeof processedData.mqlt_cd === 'string') {
|
||||||
const materialCodeItem = (
|
const materialCodeItem = MS_SWAGE_MHL_CODES.find(
|
||||||
catalog?.MS_SWAGE_MHL_CODES ?? MS_SWAGE_MHL_CODES
|
code => code.text === processedData.mqlt_cd.trim()
|
||||||
).find((code) => code.text === processedData.mqlt_cd.trim());
|
);
|
||||||
if (materialCodeItem) {
|
if (materialCodeItem) {
|
||||||
processedData.mqlt_cd = materialCodeItem.val;
|
processedData.mqlt_cd = materialCodeItem.val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "우수토실":
|
case '우수토실':
|
||||||
// prrtymngYn 값 역변환 (텍스트 → Y/N)
|
// prrtymngYn 값 역변환 (텍스트 → Y/N)
|
||||||
if (processedData.prrtymngYn) {
|
if (processedData.prrtymngYn) {
|
||||||
if (processedData.prrtymngYn === "중점우수토실") {
|
if (processedData.prrtymngYn === '중점우수토실') {
|
||||||
processedData.prrtymngYn = "Y";
|
processedData.prrtymngYn = 'Y';
|
||||||
} else if (processedData.prrtymngYn === "우수토실") {
|
} else if (processedData.prrtymngYn === '우수토실') {
|
||||||
processedData.prrtymngYn = "N";
|
processedData.prrtymngYn = 'N';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "하수펌프장":
|
case '하수펌프장':
|
||||||
// usg_cd 값 역변환 (텍스트 → 코드)
|
// usg_cd 값 역변환 (텍스트 → 코드)
|
||||||
if (processedData.usg_cd && typeof processedData.usg_cd === "string") {
|
if (processedData.usg_cd && typeof processedData.usg_cd === 'string') {
|
||||||
const usageCodeItem = DRTW_SEWAGE_PUMP_USE_CODES.find(
|
const usageCodeItem = DRTW_SEWAGE_PUMP_USE_CODES.find(
|
||||||
(code) => code.text === processedData.usg_cd.trim(),
|
code => code.text === processedData.usg_cd.trim()
|
||||||
);
|
);
|
||||||
if (usageCodeItem) {
|
if (usageCodeItem) {
|
||||||
processedData.usg_cd = usageCodeItem.val;
|
processedData.usg_cd = usageCodeItem.val;
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
/** 선택한 지도 레이어 종류에 맞는 시설 상세 컴포넌트를 반환한다. */
|
||||||
|
import MsSwagePpl from "../popupComponent/MsSwagePpl"; // 하수관로
|
||||||
|
import sewagePump from "../popupComponent/sewagePump"; // 하수펌프
|
||||||
|
import smh from "../popupComponent/smh";
|
||||||
|
import Ssc from "../popupComponent/Ssc";
|
||||||
|
import StormWaterPump from "../popupComponent/stormWaterPump";
|
||||||
|
import SwtrmtFclt from "../popupComponent/SwtrmtFclt";
|
||||||
|
import SwtrmtPrcsZoneAnalysis from "../popupComponent/SwtrmtPrcsZoneAnalysis";
|
||||||
|
|
||||||
|
type LayerComponentProps = {
|
||||||
|
featureData: any;
|
||||||
|
isMainSsc?: boolean;
|
||||||
|
isDrtwSewagePump?: boolean;
|
||||||
|
rainMeasureData?: any;
|
||||||
|
onSaveClick?: () => void;
|
||||||
|
onFormDataChange?: (data: any) => void; // 추가
|
||||||
|
chmbrXcnts: string;
|
||||||
|
chmbrYdnts: string;
|
||||||
|
gisObject?: Record<string, any>; // GIS 객체 추가
|
||||||
|
rawFeatureData?: any;
|
||||||
|
surveyResultContent?: React.ReactNode;
|
||||||
|
};
|
||||||
|
type LayerContentMap = {
|
||||||
|
[key: string]: {
|
||||||
|
component?: React.ComponentType<any>;
|
||||||
|
props?: any;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
// 레이어 이름과 컴포넌트를 매핑
|
||||||
|
// 레이어 선택시 변경되는 팝업 컨텐츠 동적으로 변경하도록 작업
|
||||||
|
const layerContentMap: LayerContentMap = {
|
||||||
|
"하수처리시설": { component: SwtrmtFclt, }, // 디지털 자료관 연계정보가 없으니 일단 주석 처리
|
||||||
|
"하수처리구역": { component: SwtrmtPrcsZoneAnalysis },
|
||||||
|
"우수토실": { component: Ssc, },
|
||||||
|
"중점우수토실": { component: Ssc, }, // 중점우수토실 여부 설정
|
||||||
|
"하수관로": { component: MsSwagePpl, },
|
||||||
|
"하수맨홀": { component: smh, },
|
||||||
|
"하수펌프장": { component: sewagePump },
|
||||||
|
// "빗물펌프": { component: StormWaterPump },
|
||||||
|
// "오수펌프": { component: sewagePump },
|
||||||
|
};
|
||||||
|
|
||||||
|
// 동적 컴포넌트 반환 함수
|
||||||
|
export const getLayerContentComponent = (layerNm: string): React.FC<LayerComponentProps> | null => {
|
||||||
|
const component = layerContentMap[layerNm];
|
||||||
|
if (!component || !component.component) {
|
||||||
|
// component가 없으면 null 반환
|
||||||
|
return () => null;
|
||||||
|
}
|
||||||
|
return component.component as React.FC<LayerComponentProps>
|
||||||
|
};
|
||||||
|
// 사용자 입력 필드 (보수 및 갱신, 청소 및 준설, 점검 및 진단)
|
||||||
|
export const handleInputChange = (section: string,
|
||||||
|
index: number,
|
||||||
|
field: string,
|
||||||
|
value: string,
|
||||||
|
dataMap: {
|
||||||
|
[key: string]: {
|
||||||
|
data: { year: string; type: string, bizInfoNm: string, bizType: string }[];
|
||||||
|
setData: React.Dispatch<React.SetStateAction<{ year: string; type: string, bizInfoNm: string, bizType: string }[]>>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
) => {
|
||||||
|
const target = dataMap[section];
|
||||||
|
if (!target) return;
|
||||||
|
|
||||||
|
const updated = [...target.data];
|
||||||
|
if (updated[index]) {
|
||||||
|
updated[index][field as keyof typeof updated[number]] = value;
|
||||||
|
}
|
||||||
|
target.setData(updated);
|
||||||
|
};
|
||||||
@@ -0,0 +1,924 @@
|
|||||||
|
/** 지도 시설 상세 및 목록에서 사용하는 컬럼·코드 정의를 제공한다. */
|
||||||
|
// 하수관로
|
||||||
|
export const MsSwagePplCol = [
|
||||||
|
{ id: 'fclt_mng_no', title: '시설관리번호' },
|
||||||
|
{ id: 'mngInstNm', title: '관리기관' },
|
||||||
|
{ id: 'inst_mng_no', title: '기관관리번호' },
|
||||||
|
{ id: 'flowDirectionBasis', title: '유하방향 근거' },
|
||||||
|
{ id: 'instl_ymd', title: '설치일자' },
|
||||||
|
{ id: 'elapsedYears', title: '경과년도' },
|
||||||
|
{ id: 'mapsht_no', title: '도엽번호' },
|
||||||
|
{ id: 'pdmt_vl', title: '관경(mm)' },
|
||||||
|
{ id: 'prlg_vl', title: '연장(m)' },
|
||||||
|
{ id: 'usg_cd', title: '용도' },
|
||||||
|
{ id: 'mqlt_cd', title: '재질' },
|
||||||
|
{ id: 'avg_grdn', title: '평균구배(m/m)' },
|
||||||
|
{ id: 'drtw_mltv_area', title: '오수배수면적(m²)' },
|
||||||
|
{ id: 'excln_mltv_area', title: '우수배수면적(m²)' },
|
||||||
|
{ id: 'tmpt_dpth', title: '시점깊이(m)' },
|
||||||
|
{ id: 'tmpt_mhl_mng_no', title: '시점맨홀관리번호' },
|
||||||
|
{ id: 'scend_dpth', title: '종점깊이(m)' },
|
||||||
|
{ id: 'scend_mhl_mng_no', title: '종점맨홀관리번호' },
|
||||||
|
{ id: 'trfln_cnt', title: '차선수' },
|
||||||
|
{ id: 'vrtc_len', title: '세로길이(m)' },
|
||||||
|
{ id: 'wdth_len', title: '가로길이(m)' },
|
||||||
|
// { id: 'rnyssn_fvlc', title: '우기 시 유속(m/s)' },
|
||||||
|
// { id: 'clar_fvlc', title: '건기 시 유속(m/s)' },
|
||||||
|
// { id: 'mng_inst_cd', title: '관리기관코드' },
|
||||||
|
// { id: 'pbadms_emd_cd', title: '행정읍면동코드' },
|
||||||
|
// { id: 'fclty_shp_cd', title: '시설물형태코드' },
|
||||||
|
// { id: 'fid', title: 'FID' },
|
||||||
|
// { id: 'ftre_smbol_cd', title: '지형지물부호코드' },
|
||||||
|
// { id: 'lyrTypeNm', title: '레이어타입명' },
|
||||||
|
]
|
||||||
|
// 하수관로 searchModal 기본정보tab
|
||||||
|
export const MsSwagePplCol2 = [
|
||||||
|
{ id: 'rowNumber', title: '순번' },
|
||||||
|
{ id: 'fcltMngNo', title: '시설\n관리번호' },
|
||||||
|
{ id: 'instMngNo', title: '기관\n관리번호' },
|
||||||
|
{ id: 'flowDirectionBasis', title: '유하방향\n근거' },
|
||||||
|
{ id: 'ctpvNm', title: '시도' },
|
||||||
|
{ id: 'sggNm', title: '시군구' },
|
||||||
|
{ id: "swtrmt_zone_nm", title: "처리구역" },
|
||||||
|
{ id: 'instlYmd', title: '설치일자' },
|
||||||
|
// { id: 'mapshtNo', title: '도엽번호' },
|
||||||
|
{ id: 'usgCd', title: '용도' },
|
||||||
|
{ id: 'pdmtVl', title: '관경\n(mm)' },
|
||||||
|
{ id: 'prlgVl', title: '연장\n(m)' },
|
||||||
|
// { id: 'avgGrdn', title: '평균구배\n(m/m)' },
|
||||||
|
{ id: 'tmptDpth', title: '시점깊이\n(m)' },
|
||||||
|
{ id: 'tmptMhlMngNo', title: '시점맨홀\n관리번호' },
|
||||||
|
{ id: 'scendDpth', title: '종점깊이\n(m)' },
|
||||||
|
{ id: 'scendMhlMngNo', title: '종점맨홀\n관리번호' },
|
||||||
|
{ id: 'vrtcLen', title: '세로길이\n(m)' },
|
||||||
|
{ id: 'wdthLen', title: '가로길이\n(m)' },
|
||||||
|
{ id: 'fcltyShpCd', title: '시설물형태코드' },
|
||||||
|
// { id: 'fid', title: 'FID' },
|
||||||
|
// { id: 'ftreSmbolCd', title: '지형지물부호코드' },
|
||||||
|
// { id: 'mngInstCd', title: '관리기관코드' },
|
||||||
|
{ id: 'mqltCd', title: '재질코드' },
|
||||||
|
// { id: 'pbadmsEmdCd', title: '행정읍면동코드' },
|
||||||
|
// { id: 'usgCd', title: '용도코드' },
|
||||||
|
// { id: 'lyrTypeNm', title: '레이어타입명' },
|
||||||
|
]
|
||||||
|
export const MsSwagePplExcelCol = {
|
||||||
|
'fcltMngNo': '시설 관리번호',
|
||||||
|
'instMngNo': '기관 관리번호',
|
||||||
|
'ctpvNm': '시도',
|
||||||
|
'sggNm': '시군구',
|
||||||
|
'swtrmt_zone_nm': '처리구역',
|
||||||
|
'instlYmd': '설치일자',
|
||||||
|
'usgCd': '용도',
|
||||||
|
'pdmtVl': '관경(mm)',
|
||||||
|
'prlgVl': '연장(m)',
|
||||||
|
'tmptDpth': '시점 깊이(m)',
|
||||||
|
'tmptMhlMngNo': '시점맨홀 관리번호',
|
||||||
|
'scendDpth': '종점 깊이(m)',
|
||||||
|
'scendMhlMngNo': '종점맨홀 관리번호',
|
||||||
|
'vrtcLen': '세로길이(m)',
|
||||||
|
'wdthLen': '가로길이(m)',
|
||||||
|
'fcltyShpCd': '시설물형태코드',
|
||||||
|
'mqltCd': '재질코드',
|
||||||
|
};
|
||||||
|
// 하수관로 용도 코드표
|
||||||
|
export const MS_SWAGE_PPL_USE_CODES = [
|
||||||
|
{ val: "SBA000", text: "미분류" },
|
||||||
|
{ val: "SBA001", text: "합류관" },
|
||||||
|
{ val: "SBA002", text: "차집관" },
|
||||||
|
{ val: "SBA003", text: "우수관" },
|
||||||
|
{ val: "SBA004", text: "오수관" },
|
||||||
|
{ val: "SBA999", text: "기타" },
|
||||||
|
];
|
||||||
|
// 하수관로 재질 코드표
|
||||||
|
export const MS_SWAGE_PPL_CODES = [
|
||||||
|
{ val: "MOP000", text: "미분류" },
|
||||||
|
{ val: "MOP001", text: "닥타일주철관(DCIP)" },
|
||||||
|
{ val: "MOP002", text: "강관(SP)" },
|
||||||
|
{ val: "MOP003", text: "아연도강관(GS)" },
|
||||||
|
{ val: "MOP004", text: "염화비닐관(PVC)" },
|
||||||
|
{ val: "MOP005", text: "폴리에틸렌관(PE)" },
|
||||||
|
{ val: "MOP006", text: "스테인레스관(SSP)" },
|
||||||
|
{ val: "MOP007", text: "동관(COP)" },
|
||||||
|
{ val: "MOP008", text: "P.S.콘크리트관(PC)" },
|
||||||
|
{ val: "MOP009", text: "석면시멘트관(AS)" },
|
||||||
|
{ val: "MOP010", text: "회주철관(CIP)" },
|
||||||
|
{ val: "MOP011", text: "연관(LP)" },
|
||||||
|
{ val: "MOP012", text: "흉관(HP)" },
|
||||||
|
{ val: "MOP013", text: "철근콘크리트관(RC)" },
|
||||||
|
{ val: "MOP014", text: "강관(ST)" },
|
||||||
|
{ val: "MOP015", text: "주철관(CI)" },
|
||||||
|
{ val: "MOP016", text: "화학제품류관(PV)" },
|
||||||
|
{ val: "MOP017", text: "도관(VC)" },
|
||||||
|
{ val: "MOP018", text: "석축(SE)" },
|
||||||
|
{ val: "MOP019", text: "도복장 강관(SP)" },
|
||||||
|
{ val: "MOP020", text: "흉관(EP)" },
|
||||||
|
{ val: "MOP021", text: "아연도강관(GP)" },
|
||||||
|
{ val: "MOP022", text: "청동관(BR)" },
|
||||||
|
{ val: "MOP023", text: "고무몰딩(RM)" },
|
||||||
|
{ val: "MOP024", text: "주강(CS)" },
|
||||||
|
{ val: "MOP025", text: "VR관" },
|
||||||
|
{ val: "MOP026", text: "HDPE관" },
|
||||||
|
{ val: "MOP027", text: "시멘트라이닝주철관(C)" },
|
||||||
|
{ val: "MOP028", text: "수도용 PE관(PE)" },
|
||||||
|
{ val: "MOP029", text: "석면시멘트관(AC)" },
|
||||||
|
{ val: "MOP030", text: "폴리에틸렌분체라이닝강관(PEP)" },
|
||||||
|
{ val: "MOP031", text: "에폭시코팅강관(EPS)" },
|
||||||
|
{ val: "MOP032", text: "HI-3P" },
|
||||||
|
{ val: "MOP033", text: "철근콘크리트박스(RCB)" },
|
||||||
|
{ val: "MOP034", text: "콘크리트중선함(CD)" },
|
||||||
|
{ val: "MOP035", text: "후랙시불전선함(FP)" },
|
||||||
|
{ val: "MOP036", text: "전선함(FD)" },
|
||||||
|
{ val: "MOP038", text: "이중보온관" },
|
||||||
|
{ val: "MOP039", text: "폴리에틸렌피복강관(PLP)" },
|
||||||
|
{ val: "MOP041", text: "FRP" },
|
||||||
|
{ val: "MOP042", text: "강재" },
|
||||||
|
{ val: "MOP999", text: "기타" },
|
||||||
|
{ val: "MOP800", text: "2중벽PE관" },
|
||||||
|
{ val: "MOP801", text: "3중벽PE관" },
|
||||||
|
{ val: "MOP802", text: "가스배관용 강관" },
|
||||||
|
{ val: "MOP803", text: "강관(피복 Double, 용접접합)" },
|
||||||
|
{ val: "MOP804", text: "강관(피복 Single, 용접접합)" },
|
||||||
|
{ val: "MOP805", text: "강관(CP)" },
|
||||||
|
{ val: "MOP806", text: "강철" },
|
||||||
|
{ val: "MOP807", text: "강화플라스틱복합관" },
|
||||||
|
{ val: "MOP808", text: "경질염화비닐관(HI-VP)" },
|
||||||
|
{ val: "MOP809", text: "고강성PVC이중벽관" },
|
||||||
|
{ val: "MOP810", text: "고광도PVC이중벽관" },
|
||||||
|
{ val: "MOP811", text: "고밀도폴리에틸렌관(THP)" },
|
||||||
|
{ val: "MOP812", text: "고밀도폴리에틸렌파상형이중벽관" },
|
||||||
|
{ val: "MOP813", text: "공장제 박스관거" },
|
||||||
|
{ val: "MOP814", text: "관로없음(알케이블)" },
|
||||||
|
{ val: "MOP815", text: "나선형강관" },
|
||||||
|
{ val: "MOP816", text: "내충격수도관" },
|
||||||
|
{ val: "MOP817", text: "내충격용하수도용경질염화비닐관(HI-VG)" },
|
||||||
|
{ val: "MOP818", text: "내충격HI-VG2관" },
|
||||||
|
{ val: "MOP819", text: "내충격PVC하수관" },
|
||||||
|
{ val: "MOP820", text: "녹석(돌산호과 일종)" },
|
||||||
|
{ val: "MOP821", text: "동관(구리관, 용접)" },
|
||||||
|
{ val: "MOP822", text: "둥근잔돌" },
|
||||||
|
{ val: "MOP823", text: "무근콘크리트" },
|
||||||
|
{ val: "MOP824", text: "백관" },
|
||||||
|
{ val: "MOP825", text: "복합철판파형관" },
|
||||||
|
{ val: "MOP826", text: "분체라이닝관" },
|
||||||
|
{ val: "MOP827", text: "석축박스" },
|
||||||
|
{ val: "MOP828", text: "석축철콘" },
|
||||||
|
{ val: "MOP829", text: "수도용경질염화비관" },
|
||||||
|
{ val: "MOP830", text: "수도용경질염화비닐이음관" },
|
||||||
|
{ val: "MOP831", text: "수도용엑포시수지분체내외면코팅강관" },
|
||||||
|
{ val: "MOP832", text: "수지파형강관(PCS)" },
|
||||||
|
{ val: "MOP833", text: "수지CSP" },
|
||||||
|
{ val: "MOP834", text: "스테인레스 주름관" },
|
||||||
|
{ val: "MOP835", text: "스테인레스관(STS)" },
|
||||||
|
{ val: "MOP836", text: "스테인레스스틸파이프관" },
|
||||||
|
{ val: "MOP837", text: "아스콘" },
|
||||||
|
{ val: "MOP838", text: "아스팔트" },
|
||||||
|
{ val: "MOP839", text: "아스팔트도복장강관(ASP)" },
|
||||||
|
{ val: "MOP840", text: "아연" },
|
||||||
|
{ val: "MOP841", text: "아연도금(백관)" },
|
||||||
|
{ val: "MOP842", text: "알루미늄" },
|
||||||
|
{ val: "MOP843", text: "알루미늄합금" },
|
||||||
|
{ val: "MOP844", text: "압력배관용 탄소강관" },
|
||||||
|
{ val: "MOP845", text: "양철관" },
|
||||||
|
{ val: "MOP846", text: "양철주름관(CSP)" },
|
||||||
|
{ val: "MOP847", text: "연합인슈강판" },
|
||||||
|
{ val: "MOP848", text: "와사관(GSP)" },
|
||||||
|
{ val: "MOP849", text: "원심력철근콘크리트" },
|
||||||
|
{ val: "MOP850", text: "유리섬유관(GRP)" },
|
||||||
|
{ val: "MOP851", text: "유리섬유복합관(GRP)" },
|
||||||
|
{ val: "MOP852", text: "이음매없는동및동합금관" },
|
||||||
|
{ val: "MOP853", text: "일반배관용스테인리스강관" },
|
||||||
|
{ val: "MOP854", text: "전압 콘크리트관" },
|
||||||
|
{ val: "MOP855", text: "주름관" },
|
||||||
|
{ val: "MOP856", text: "주름주철파형강관" },
|
||||||
|
{ val: "MOP857", text: "지중 저압케이블 입상관" },
|
||||||
|
{ val: "MOP858", text: "진동및전압철근콘크리트관" },
|
||||||
|
{ val: "MOP859", text: "철근콘크리트" },
|
||||||
|
{ val: "MOP860", text: "철근콘크리트 블록" },
|
||||||
|
{ val: "MOP861", text: "철근콘크리트조립흙막이" },
|
||||||
|
{ val: "MOP862", text: "철판매입관" },
|
||||||
|
{ val: "MOP863", text: "청동" },
|
||||||
|
{ val: "MOP864", text: "코아식프리스트레스트콘크리트관" },
|
||||||
|
{ val: "MOP865", text: "콘크리트" },
|
||||||
|
{ val: "MOP866", text: "콘크리트 폴륨관" },
|
||||||
|
{ val: "MOP867", text: "콘크리트블록" },
|
||||||
|
{ val: "MOP868", text: "탄소강" },
|
||||||
|
{ val: "MOP869", text: "탄소강(카본스틸)" },
|
||||||
|
{ val: "MOP870", text: "탄소주강" },
|
||||||
|
{ val: "MOP871", text: "트러후" },
|
||||||
|
{ val: "MOP872", text: "파선형강관(RCF)" },
|
||||||
|
{ val: "MOP873", text: "파형강관(CSP)" },
|
||||||
|
{ val: "MOP874", text: "파형관" },
|
||||||
|
{ val: "MOP875", text: "파형플라스틱관" },
|
||||||
|
{ val: "MOP876", text: "폴리머관" },
|
||||||
|
{ val: "MOP877", text: "폴리에스테르수지콘크리트관" },
|
||||||
|
{ val: "MOP878", text: "폴리에틸렌 전선관" },
|
||||||
|
{ val: "MOP879", text: "폴리에틸렌 피복강관" },
|
||||||
|
{ val: "MOP880", text: "폴리에틸렌관 1호관" },
|
||||||
|
{ val: "MOP881", text: "폴리에틸렌관 2호관" },
|
||||||
|
{ val: "MOP882", text: "폴리에틸렌관(2중벽)" },
|
||||||
|
{ val: "MOP883", text: "폴리에틸렌관(3중벽)" },
|
||||||
|
{ val: "MOP884", text: "폴리에틸렌분체라이닝" },
|
||||||
|
{ val: "MOP885", text: "폴리에틸렌이중벽하수관" },
|
||||||
|
{ val: "MOP886", text: "폴리탄산에스테르" },
|
||||||
|
{ val: "MOP887", text: "프리스트레스트콘크리트실린더관" },
|
||||||
|
{ val: "MOP888", text: "플라스틱" },
|
||||||
|
{ val: "MOP889", text: "플라스틱주름관" },
|
||||||
|
{ val: "MOP890", text: "하수도용고강성경질염화비닐이중벽주름관" },
|
||||||
|
{ val: "MOP891", text: "현장타설관" },
|
||||||
|
{ val: "MOP892", text: "현장타설철근콘크리트관" },
|
||||||
|
{ val: "MOP893", text: "흑관" },
|
||||||
|
{ val: "MOP894", text: "흙" },
|
||||||
|
{ val: "MOP895", text: "AP" },
|
||||||
|
{ val: "MOP896", text: "API관" },
|
||||||
|
{ val: "MOP897", text: "ASP" },
|
||||||
|
{ val: "MOP898", text: "CMCIP" },
|
||||||
|
{ val: "MOP899", text: "CSP" },
|
||||||
|
{ val: "MOP900", text: "DRP" },
|
||||||
|
{ val: "MOP901", text: "DSP" },
|
||||||
|
{ val: "MOP902", text: "DTC관" },
|
||||||
|
{ val: "MOP903", text: "ELP" },
|
||||||
|
{ val: "MOP904", text: "EPP" },
|
||||||
|
{ val: "MOP905", text: "FC관" },
|
||||||
|
{ val: "MOP906", text: "H" },
|
||||||
|
{ val: "MOP907", text: "H6" },
|
||||||
|
{ val: "MOP908", text: "HCP" },
|
||||||
|
{ val: "MOP909", text: "HI_2P관" },
|
||||||
|
{ val: "MOP910", text: "HI-KP" },
|
||||||
|
{ val: "MOP911", text: "HL" },
|
||||||
|
{ val: "MOP912", text: "IP" },
|
||||||
|
{ val: "MOP913", text: "KCGP" },
|
||||||
|
{ val: "MOP914", text: "KP관" },
|
||||||
|
{ val: "MOP915", text: "P2S관" },
|
||||||
|
{ val: "MOP916", text: "PC박스(PCB)" },
|
||||||
|
{ val: "MOP917", text: "PCS" },
|
||||||
|
{ val: "MOP918", text: "PDP" },
|
||||||
|
{ val: "MOP919", text: "PE이중벽관" },
|
||||||
|
{ val: "MOP920", text: "PE적측벽1종관" },
|
||||||
|
{ val: "MOP921", text: "PFP관" },
|
||||||
|
{ val: "MOP922", text: "PG관" },
|
||||||
|
{ val: "MOP923", text: "PIP관(이중보온관)" },
|
||||||
|
{ val: "MOP924", text: "PLCSP" },
|
||||||
|
{ val: "MOP925", text: "PS" },
|
||||||
|
{ val: "MOP926", text: "PUB" },
|
||||||
|
{ val: "MOP927", text: "PVB" },
|
||||||
|
{ val: "MOP928", text: "PVC이중벽관(PVC2)" },
|
||||||
|
{ val: "MOP929", text: "PVC-DC" },
|
||||||
|
{ val: "MOP930", text: "PVC-DV" },
|
||||||
|
{ val: "MOP931", text: "SBK" },
|
||||||
|
{ val: "MOP932", text: "SCP" },
|
||||||
|
{ val: "MOP933", text: "SEB" },
|
||||||
|
{ val: "MOP934", text: "SIS관(이중보온관)" },
|
||||||
|
{ val: "MOP935", text: "SMC" },
|
||||||
|
{ val: "MOP936", text: "STW" },
|
||||||
|
{ val: "MOP937", text: "SUS" },
|
||||||
|
{ val: "MOP938", text: "THP나선관" },
|
||||||
|
{ val: "MOP939", text: "U관" },
|
||||||
|
{ val: "MOP940", text: "VG2" },
|
||||||
|
{ val: "MOP941", text: "WSP(와사피)" },
|
||||||
|
{ val: "MOP942", text: "Steel Grating" },
|
||||||
|
{ val: "MOP943", text: "모래" },
|
||||||
|
{ val: "MOP944", text: "인조석" },
|
||||||
|
{ val: "MOP945", text: "SPOL" },
|
||||||
|
{ val: "MOP946", text: "PCF관(강판보강 PE 나선형관)" },
|
||||||
|
{ val: "MOP947", text: "PVC3(PVC3중벽관)" },
|
||||||
|
{ val: "MOP948", text: "PE다중벽관" },
|
||||||
|
{ val: "MOP977", text: "전주용입상관" },
|
||||||
|
{ val: "MOP978", text: "MD관" },
|
||||||
|
];
|
||||||
|
// 하수관로 'fcltyShpCd' '시설물형태코드'
|
||||||
|
export const MS_SWAGE_PPL_SHAPE = [
|
||||||
|
{ val: "FOR000 ", text: "미분류" },
|
||||||
|
{ val: "FOR001 ", text: "원형" },
|
||||||
|
{ val: "FOR002 ", text: "원추형" },
|
||||||
|
{ val: "FOR003 ", text: "원통형" },
|
||||||
|
{ val: "FOR004 ", text: "구형" },
|
||||||
|
{ val: "FOR005 ", text: "타원형" },
|
||||||
|
{ val: "FOR006 ", text: "난원" },
|
||||||
|
{ val: "FOR007 ", text: "반원형" },
|
||||||
|
|
||||||
|
{ val: "FOR010 ", text: "피라미드형" },
|
||||||
|
{ val: "FOR011 ", text: "사면체형" },
|
||||||
|
{ val: "FOR012 ", text: "기둥,축" },
|
||||||
|
{ val: "FOR013 ", text: "돛대,활대처럼 둥글고 긴 원재" },
|
||||||
|
{ val: "FOR014 ", text: "아치형" },
|
||||||
|
{ val: "FOR015 ", text: "다중아치형" },
|
||||||
|
{ val: "FOR016 ", text: "돔형" },
|
||||||
|
{ val: "FOR017 ", text: "고형체형" },
|
||||||
|
|
||||||
|
{ val: "FOR020 ", text: "사각형" },
|
||||||
|
{ val: "FOR021 ", text: "평방형" },
|
||||||
|
{ val: "FOR022 ", text: "다이아몬드형" },
|
||||||
|
{ val: "FOR023 ", text: "사다리꼴" },
|
||||||
|
{ val: "FOR024 ", text: "각형" },
|
||||||
|
{ val: "FOR025 ", text: "마제형관" },
|
||||||
|
{ val: "FOR026 ", text: "태형" },
|
||||||
|
|
||||||
|
{ val: "FOR030 ", text: "A형" },
|
||||||
|
{ val: "FOR031 ", text: "H형" },
|
||||||
|
{ val: "FOR032 ", text: "I형" },
|
||||||
|
{ val: "FOR033 ", text: "Y형" },
|
||||||
|
{ val: "FOR034 ", text: "T형" },
|
||||||
|
|
||||||
|
{ val: "FOR050 ", text: "불규칙한 형태" },
|
||||||
|
|
||||||
|
{ val: "FOR900 ", text: "계란형" },
|
||||||
|
{ val: "FOR901 ", text: "구(사각)형" },
|
||||||
|
{ val: "FOR902 ", text: "높이조절철개형" },
|
||||||
|
{ val: "FOR903 ", text: "박스형(RCB)" },
|
||||||
|
{ val: "FOR904 ", text: "반월개거" },
|
||||||
|
{ val: "FOR905 ", text: "반월개거(측구)" },
|
||||||
|
{ val: "FOR906 ", text: "벽돌조" },
|
||||||
|
{ val: "FOR907 ", text: "사각철판" },
|
||||||
|
{ val: "FOR908 ", text: "석축개거" },
|
||||||
|
{ val: "FOR909 ", text: "석축개거(측구)" },
|
||||||
|
{ val: "FOR910 ", text: "승수로" },
|
||||||
|
{ val: "FOR911 ", text: "옹벽개거" },
|
||||||
|
{ val: "FOR912 ", text: "옹벽개거(측구)" },
|
||||||
|
{ val: "FOR913 ", text: "이단" },
|
||||||
|
{ val: "FOR914 ", text: "이중침전형" },
|
||||||
|
{ val: "FOR915 ", text: "자연개거" },
|
||||||
|
{ val: "FOR916 ", text: "자연개거(측구)" },
|
||||||
|
{ val: "FOR917 ", text: "조립식" },
|
||||||
|
{ val: "FOR918 ", text: "지상관" },
|
||||||
|
{ val: "FOR919 ", text: "지상단구" },
|
||||||
|
{ val: "FOR920 ", text: "지상쌍구" },
|
||||||
|
{ val: "FOR921 ", text: "지하단구" },
|
||||||
|
{ val: "FOR922 ", text: "지하쌍구" },
|
||||||
|
{ val: "FOR923 ", text: "직사각형" },
|
||||||
|
{ val: "FOR924 ", text: "타설식" },
|
||||||
|
{ val: "FOR925 ", text: "토류형" },
|
||||||
|
{ val: "FOR926 ", text: "흄관원형" },
|
||||||
|
{ val: "FOR927 ", text: "L형측구" },
|
||||||
|
{ val: "FOR928 ", text: "LO형측구" },
|
||||||
|
{ val: "FOR929 ", text: "LU형측구" },
|
||||||
|
{ val: "FOR930 ", text: "PVC이중벽관" },
|
||||||
|
{ val: "FOR931 ", text: "RCB 맨홀" },
|
||||||
|
{ val: "FOR932 ", text: "U형" },
|
||||||
|
{ val: "FOR933 ", text: "U형측구(미복개)" },
|
||||||
|
{ val: "FOR934 ", text: "U형측구(복개)" },
|
||||||
|
|
||||||
|
{ val: "FOR999 ", text: "기타" }
|
||||||
|
];
|
||||||
|
// 하수처리시설
|
||||||
|
export const SwtrmtFcltCol = [
|
||||||
|
{ id: 'swtrmt_fclt_nm', title: '하수처리시설명' },
|
||||||
|
{ id: 'fclt_cpct', title: '시설용량(㎥/d)' },
|
||||||
|
{ id: 'rgn_expln', title: '지역설명' },
|
||||||
|
{ id: 'cmcn_ymd', title: '준공일자' },
|
||||||
|
{ id: 'oprtng_strt_ymd', title: '가동개시일자' },
|
||||||
|
{ id: 'clsg_ymd', title: '폐쇄일자' },
|
||||||
|
// { id: 'prcs_msrc_cd', title: '처리공법코드' },
|
||||||
|
// { id: 'lae_cd', title: '지자체코드' },
|
||||||
|
{ id: 'lae_nm', title: '지자체명' },
|
||||||
|
{ id: 'ctpv_nm', title: '시도명' },
|
||||||
|
{ id: 'sgg_nm', title: '시군구명' },
|
||||||
|
// { id: 'sarea_cd', title: '권역코드' },
|
||||||
|
{ id: 'sarea_nm', title: '권역명' },
|
||||||
|
{ id: 'lrge_sarea_nm', title: '대권역명' },
|
||||||
|
{ id: 'rvr_nm', title: '하천명' },
|
||||||
|
{ id: 'addr', title: '주소' },
|
||||||
|
{ id: 'dtl_addr', title: '상세주소' },
|
||||||
|
{ id: 'rdnm_addr', title: '도로명주소' },
|
||||||
|
{ id: 'dtl_rdnm_addr', title: '상세도로명주소' },
|
||||||
|
{ id: 'dschg_wtst_nm', title: '방류수계명' },
|
||||||
|
{ id: 'plln_area', title: '부지면적(m²)' },
|
||||||
|
{ id: 'mng_rprtv_bzenty_nm', title: '관리대행업제명' },
|
||||||
|
{ id: 'swtrmt_ppltn_cnt', title: '하수처리인구수(인)' },
|
||||||
|
{ id: 'prcs_zone_area_sum', title: '처리구역면적합계(m²)' },
|
||||||
|
{ id: 'xcrd', title: 'X좌표' },
|
||||||
|
{ id: 'ycrd', title: 'Y좌표' },
|
||||||
|
// { id: 'oprtngSttsCd', title: '가동상태코드' },
|
||||||
|
{ id: 'rprs_msrc_cn', title: '대표공법내용' },
|
||||||
|
// { id: 'stty_crtr_bod', title: '법정기준생물화학적산소요구량(mg/L)' },
|
||||||
|
// { id: 'stty_crtr_toc', title: '법정기준TOC((mg/L))' },
|
||||||
|
// { id: 'stty_crtr_ss', title: '법정기준SS(mg/L)' },
|
||||||
|
// { id: 'stty_crtr_tn', title: '법정기준총질소(mg/L)' },
|
||||||
|
// { id: 'stty_crtr_tph', title: '법정기준총인(mg/L)' },
|
||||||
|
// { id: 'stty_crtr_clbcl_cnt', title: '법정기준대장균수(군수/100mL)' },
|
||||||
|
{ id: 'bsn_nm', title: '유역명' },
|
||||||
|
// { id: 'obsrvnSptCd', title: '관측지점코드' },
|
||||||
|
];
|
||||||
|
export const SwtrmtFcltCol2 = [
|
||||||
|
{ id: 'rowNumber', title: '순번' },
|
||||||
|
{ id: 'swtrmtFcltNm', title: '하수처리\n시설명' },
|
||||||
|
{ id: 'fcltCpct', title: '시설\n용량\n(㎥/d)' },
|
||||||
|
{ id: 'rgnExpln', title: '지역설명' },
|
||||||
|
// { id: 'cmcnYmd', title: '준공일자' },
|
||||||
|
{ id: 'oprtngStrtYmd', title: '가동개시일자' },
|
||||||
|
// { id: 'clsgYmd', title: '폐쇄일자' },
|
||||||
|
// { id: 'prcsMsrcCd', title: '처리공법코드' },
|
||||||
|
// { id: 'laeCd', title: '지자체코드' },
|
||||||
|
{ id: 'laeNm', title: '지자체명' },
|
||||||
|
// { id: 'ctpvNm', title: '시도명' },
|
||||||
|
// { id: 'sggNm', title: '시군구명' },
|
||||||
|
// { id: 'sareaCd', title: '권역코드' },
|
||||||
|
{ id: 'sareaNm', title: '권역명' },
|
||||||
|
// { id: 'lrgeSareaNm', title: '대권역명' },
|
||||||
|
{ id: 'rvrNm', title: '하천명' },
|
||||||
|
// { id: 'addr', title: '주소' },
|
||||||
|
// { id: 'dtlAddr', title: '상세주소' },
|
||||||
|
// { id: 'rdnmAddr', title: '도로명주소' },
|
||||||
|
// { id: 'dtlRdnmAddr', title: '상세도로명주소' },
|
||||||
|
{ id: 'dschgWtstNm', title: '방류수계명' },
|
||||||
|
// { id: 'pllnArea', title: '부지면적(m²)' },
|
||||||
|
// { id: 'mngRprtvBzentyNm', title: '관리대행업체명' },
|
||||||
|
{ id: 'swtrmtPpltnCnt', title: '하수\n처리\n인구수\n(인)' },
|
||||||
|
// { id: 'prcsZoneAreaSum', title: '처리구역면적합계(m²)' },
|
||||||
|
// { id: 'xcrd', title: 'X좌표' },
|
||||||
|
// { id: 'ycrd', title: 'Y좌표' },
|
||||||
|
// { id: 'oprtngSttsCd', title: '가동상태코드' },
|
||||||
|
{ id: 'rprsMsrcCn', title: '대표\n공법\n내용' },
|
||||||
|
// { id: 'sttyCrtrBod', title: '법정기준생물화학적산소요구량(mg/L)' },
|
||||||
|
// { id: 'sttyCrtrToc', title: '법정기준TOC(mg/L)' },
|
||||||
|
// { id: 'sttyCrtrSs', title: '법정기준SS(mg/L)' },
|
||||||
|
// { id: 'sttyCrtrTn', title: '법정기준총질소(mg/L)' },
|
||||||
|
// { id: 'sttyCrtrTph', title: '법정기준총인(mg/L)' },
|
||||||
|
// { id: 'sttyCrtrClbclCnt', title: '법정기준대장균수(군수/100mL)' },
|
||||||
|
// { id: 'bsnNm', title: '유역명' },
|
||||||
|
// { id: 'obsrvnSptCd', title: '관측지점코드' },
|
||||||
|
];
|
||||||
|
export const SwtrmtFcltExcelCol = {
|
||||||
|
'swtrmtFcltNm': '하수처리시설명',
|
||||||
|
'fcltCpct': '시설 용량(㎥/d)',
|
||||||
|
'rgnExpln': '지역설명',
|
||||||
|
'oprtngStrtYmd': '가동개시 일자',
|
||||||
|
'laeNm': '지자체명',
|
||||||
|
'sareaNm': '권역명',
|
||||||
|
'rvrNm': '하천명',
|
||||||
|
'dschgWtstNm': '방류수계명',
|
||||||
|
'swtrmtPpltnCnt': '하수 처리 인구수(인)',
|
||||||
|
'rprsMsrcCn': '대표 공법 내용'
|
||||||
|
};
|
||||||
|
|
||||||
|
// 하수처리구역
|
||||||
|
export const SwtrmtPrcsZoneCol = [
|
||||||
|
// { id: 'swtrmtZoneSn', title: '하수처리구역 일련번호' },
|
||||||
|
{ id: 'swtrmt_zone_nm', title: '하수처리구역명' },
|
||||||
|
// { id: 'swtrmt_fclt_cd', title: '하수처리시설코드' },
|
||||||
|
// { id: 'ctpv_cd', title: '시도코드' },
|
||||||
|
{ id: 'ctpv_nm', title: '시도명' },
|
||||||
|
// { id: 'sgg_cd', title: '시군구코드' },
|
||||||
|
{ id: 'sgg_nm', title: '시군구명' },
|
||||||
|
{ id: 'swtrmt_fclt_nm', title: '하수처리시설명' },
|
||||||
|
];
|
||||||
|
export const SwtrmtPrcsZoneCol2 = [
|
||||||
|
{ id: 'rowNumber', title: '순번' },
|
||||||
|
// { id: 'swtrmtZoneSn', title: '하수처리구역 일련번호' },
|
||||||
|
{ id: 'swtrmtZoneNm', title: '하수처리구역명' },
|
||||||
|
// { id: 'swtrmt_fclt_cd', title: '하수처리시설코드' },
|
||||||
|
// { id: 'ctpv_cd', title: '시도코드' },
|
||||||
|
{ id: 'ctpvNm', title: '시도' },
|
||||||
|
// { id: 'sgg_cd', title: '시군구코드' },
|
||||||
|
{ id: 'sggNm', title: '시군구' },
|
||||||
|
{ id: 'swtrmtFcltNm', title: '하수처리시설명' },
|
||||||
|
];
|
||||||
|
export const SwtrmtPrcsZoneExcelCol = {
|
||||||
|
'swtrmtZoneNm': '하수처리구역명',
|
||||||
|
'ctpvNm': '시도',
|
||||||
|
'sggNm': '시군구',
|
||||||
|
'swtrmtFcltNm': '하수처리시설명'
|
||||||
|
};
|
||||||
|
|
||||||
|
// 침수흔적도
|
||||||
|
export const FldngWtlvMapCol = [
|
||||||
|
{ id: 'fldng_yr', title: '침수년도' },
|
||||||
|
{ id: 'fldng_dstr_nm', title: '침수재해명' },
|
||||||
|
{ id: 'ctpv_nm', title: '시도명' },
|
||||||
|
{ id: 'sgg_nm', title: '시군구명' },
|
||||||
|
{ id: 'fldng_bgng_dtm', title: '침수시작일시' },
|
||||||
|
{ id: 'fldng_end_dtm', title: '침수종료일시' },
|
||||||
|
{ id: 'fldng_hr', title: '침수시간' },
|
||||||
|
{ id: 'fldng_dstrct_nm', title: '침수지구명' },
|
||||||
|
{ id: 'fldng_cs_dtl_cd', title: '침수원인상세코드' },
|
||||||
|
{ id: 'dtl_ocrn_cs_cn', title: '침수발생원인' },
|
||||||
|
{ id: 'avg_fldng_wtlv', title: '평균침수위' },
|
||||||
|
{ id: 'fldng_area', title: '침수면적' },
|
||||||
|
{ id: 'exmn_yr', title: '조사년도' },
|
||||||
|
{ id: 'dam_amt', title: '피해금액' },
|
||||||
|
{ id: 'rain_bgng_tm', title: '강우시작일시' },
|
||||||
|
{ id: 'rain_end_tm', title: '강우종료일시' },
|
||||||
|
{ id: 'rain_tot', title: '총강우량(mm)' },
|
||||||
|
{ id: 'rain_str', title: '강우강도(mm/hr)' },
|
||||||
|
];
|
||||||
|
export const FldngWtlvMapCol2 = [
|
||||||
|
{ id: 'rowNumber', title: '순번' },
|
||||||
|
{ id: 'fldngYr', title: '침수년도' },
|
||||||
|
{ id: 'fldngDstrNm', title: '침수재해명' },
|
||||||
|
{ id: 'ctpvNm', title: '시도' },
|
||||||
|
{ id: 'sggNm', title: '시군구' },
|
||||||
|
{ id: 'fldngBgngDtm', title: '침수시작일시' },
|
||||||
|
{ id: 'fldngEndDtm', title: '침수종료일시' },
|
||||||
|
{ id: 'fldngHr', title: '침수시간' },
|
||||||
|
{ id: 'fldngDstrctNm', title: '침수지구명' },
|
||||||
|
{ id: 'fldngCsDtlCd', title: '침수원인상세코드' },
|
||||||
|
{ id: 'avgFldngWtlv', title: '평균침수위' },
|
||||||
|
{ id: 'fldngArea', title: '침수면적' },
|
||||||
|
{ id: 'exmnYr', title: '조사년도' },
|
||||||
|
{ id: 'damAmt', title: '피해금액' },
|
||||||
|
{ id: 'rainBgngTm', title: '강우시작일시' },
|
||||||
|
{ id: 'rainEndTm', title: '강우종료일시' },
|
||||||
|
{ id: 'rainTot', title: '총강우량(mm)' },
|
||||||
|
{ id: 'rainStr', title: '강우강도(mm/hr)' },
|
||||||
|
];
|
||||||
|
export const FldngDpthMapCol = [
|
||||||
|
{ id: 'fldng_yr', title: '침수년도' },
|
||||||
|
{ id: 'ctpv_nm', title: '시도명' },
|
||||||
|
{ id: 'sgg_nm', title: '시군구명' },
|
||||||
|
{ id: 'fldng_dpth', title: '침수깊이(m)' },
|
||||||
|
{ id: 'fldng_area', title: '침수면적(㎡)' },
|
||||||
|
// { id: 'shape_area', title: '형상면적(㎡)' },
|
||||||
|
// { id: 'shape_len', title: '형상길이' },
|
||||||
|
];
|
||||||
|
export const FldngWtlvMapExcelCol = {
|
||||||
|
'fldngYr': '침수년도',
|
||||||
|
'fldngDstrNm': '침수재해명',
|
||||||
|
'ctpvNm': '시도',
|
||||||
|
'sggNm': '시군구',
|
||||||
|
'bgngYmd': '침수시작일자',
|
||||||
|
'fldngBgngHm': '침수시작시분',
|
||||||
|
'endYmd': '침수종료일자',
|
||||||
|
'fldngEndHm': '침수종료시분',
|
||||||
|
'fldngHr': '침수시간',
|
||||||
|
'fldngDstrctNm': '침수지구명',
|
||||||
|
'fldngCsDtlCd': '침수원인상세코드',
|
||||||
|
'avgFldngWtlv': '평균침수위',
|
||||||
|
'fldngArea': '침수면적',
|
||||||
|
'exmnYr': '조사년도',
|
||||||
|
'damAmt': '피해금액'
|
||||||
|
};
|
||||||
|
|
||||||
|
// 하수맨홀
|
||||||
|
export const MsSwageMhlCol = [
|
||||||
|
// { id: 'fid', title: 'FID' },
|
||||||
|
// { id: 'geom', title: 'geometry' },
|
||||||
|
// { id: 'ftre_smbol_cd', title: '지형지물부호코드' },
|
||||||
|
{ id: 'fclt_mng_no', title: '시설관리번호' },
|
||||||
|
// { id: 'pbadms_emd_cd', title: '행정읍면동코드' },
|
||||||
|
{ id: 'mapsht_no', title: '도엽번호' },
|
||||||
|
// { id: 'mng_inst_cd', title: '관리기관코드' },
|
||||||
|
{ id: 'instl_ymd', title: '설치일자' },
|
||||||
|
{ id: 'last_drdgn_ymd', title: '최종준설일자' },
|
||||||
|
// { id: 'usg_cd', title: '용도코드' },
|
||||||
|
// { id: 'fclty_shp_cd', title: '시설물형태코드' },
|
||||||
|
// { id: 'mhl_knd_cd', title: '맨홀종류코드' },
|
||||||
|
{ id: 'swage_mhL_diam_vl', title: '하수맨홀구경(mm)' },
|
||||||
|
{ id: 'mqlt_cd', title: '재질' },
|
||||||
|
{ id: 'wdth_len', title: '가로길이(m)' },
|
||||||
|
{ id: 'vrtc_len', title: '세로길이(m)' },
|
||||||
|
// { id: 'ang_dir', title: '표고' },
|
||||||
|
{ id: 'altd_vl', title: '지표고(EL.m)' },
|
||||||
|
{ id: 'dpthl_vl', title: '맨홀저고(EL.m)' },
|
||||||
|
// { id: 'inst_mng_no', title: '기관관리번호' }
|
||||||
|
];
|
||||||
|
export const MsSwageMhlCol2 = [
|
||||||
|
{ id: 'rowNumber', title: '순번' },
|
||||||
|
// { id: 'fid', title: 'FID' },
|
||||||
|
// { id: 'geom', title: 'geometry' },
|
||||||
|
// { id: 'ftreSmbolCd', title: '지형지물부호코드' },
|
||||||
|
{ id: 'fcltMngNo', title: '시설관리번호' },
|
||||||
|
{ id: 'ctpvNm', title: '시도' },
|
||||||
|
{ id: 'sggNm', title: '시군구' },
|
||||||
|
// { id: 'pbadmsEmdCd', title: '행정읍면동코드' },
|
||||||
|
// { id: 'mapshtNo', title: '도엽번호' },
|
||||||
|
// { id: 'mngInstCd', title: '관리기관코드' },
|
||||||
|
{ id: 'instlYmd', title: '설치일자' },
|
||||||
|
// { id: 'lastDrdgnYmd', title: '최종준설일자' },
|
||||||
|
{ id: 'usgCd', title: '용도' },
|
||||||
|
// { id: 'fcltyShpCd', title: '시설물형태코드' },
|
||||||
|
// { id: 'mhlKndCd', title: '맨홀종류코드' },
|
||||||
|
{ id: 'swageMhlDiamVl', title: '하수맨홀구경(mm)' },
|
||||||
|
// { id: 'mqltCd', title: '재질코드' },
|
||||||
|
{ id: 'wdthLen', title: '가로길이(m)' },
|
||||||
|
{ id: 'vrtcLen', title: '세로길이(m)' },
|
||||||
|
// { id: 'angDir', title: '표고' },
|
||||||
|
{ id: 'altdVl', title: '지표고(EL.m)' },
|
||||||
|
{ id: 'dpthlVl', title: '맨홀저고(EL.m)' },
|
||||||
|
// { id: 'instMngNo', title: '기관관리번호' }
|
||||||
|
];
|
||||||
|
export const MsSwageMhlExcelCol = {
|
||||||
|
'fcltMngNo': '시설관리번호',
|
||||||
|
'ctpvNm': '시도',
|
||||||
|
'sggNm': '시군구',
|
||||||
|
'instlYmd': '설치일자',
|
||||||
|
'usgCd': '용도',
|
||||||
|
'swageMhlDiamVl': '하수맨홀구경(mm)',
|
||||||
|
'wdthLen': '가로길이(m)',
|
||||||
|
'vrtcLen': '세로길이(m)',
|
||||||
|
'altdVl': '지표고(EL.m)',
|
||||||
|
'dpthlVl': '맨홀저고(EL.m)'
|
||||||
|
};
|
||||||
|
// 하수맨홀 뚜껑재질 코드표
|
||||||
|
export const MS_SWAGE_MHL_CODES = [
|
||||||
|
{ val: "SBC000", text: "미분류" },
|
||||||
|
{ val: "SBC001", text: "주철" },
|
||||||
|
{ val: "SBC002", text: "철판" },
|
||||||
|
{ val: "SBC003", text: "콘크리트" },
|
||||||
|
{ val: "SBC004", text: "그레이팅" },
|
||||||
|
{ val: "SBC091", text: "칼라" },
|
||||||
|
{ val: "SBC092", text: "S.G" },
|
||||||
|
{ val: "SBC999", text: "기타" },
|
||||||
|
{ val: "SBC900", text: "각주철" },
|
||||||
|
{ val: "SBC901", text: "강재" },
|
||||||
|
{ val: "SBC902", text: "나무" },
|
||||||
|
{ val: "SBC903", text: "나무,널판지,합판" },
|
||||||
|
{ val: "SBC904", text: "대리석" },
|
||||||
|
{ val: "SBC905", text: "뚜껑없음" },
|
||||||
|
{ val: "SBC906", text: "보도용콘크리트" },
|
||||||
|
{ val: "SBC907", text: "스틸(ST)" },
|
||||||
|
{ val: "SBC908", text: "신형 CON" },
|
||||||
|
{ val: "SBC909", text: "알루미늄" },
|
||||||
|
{ val: "SBC910", text: "염화비닐(PE)" },
|
||||||
|
{ val: "SBC911", text: "인조석" },
|
||||||
|
{ val: "SBC912", text: "인조석(주철)" },
|
||||||
|
{ val: "SBC913", text: "인조CONC" },
|
||||||
|
{ val: "SBC914", text: "철, 철근" },
|
||||||
|
{ val: "SBC915", text: "칼라콘크리트" },
|
||||||
|
{ val: "SBC916", text: "플라스틱" },
|
||||||
|
{ val: "SBC917", text: "PVC" },
|
||||||
|
{ val: "SBC918", text: "SP" },
|
||||||
|
{ val: "SBC919", text: "SS" },
|
||||||
|
{ val: "SBC920", text: "닥타일주철" },
|
||||||
|
{ val: "SBC921", text: "철근G" },
|
||||||
|
{ val: "SBC922", text: "폴리에틸렌(PE)" },
|
||||||
|
{ val: "SBC923", text: "회주철" }
|
||||||
|
];
|
||||||
|
// 하수맨홀 용도 코드표
|
||||||
|
export const MS_SWAGE_MHL_USE_CODES = [
|
||||||
|
{ val: "SMU000 ", text: "미분류" },
|
||||||
|
{ val: "SMU001 ", text: "우수" },
|
||||||
|
{ val: "SMU002 ", text: "오수" },
|
||||||
|
{ val: "SMU003 ", text: "집수" },
|
||||||
|
{ val: "SMU004 ", text: "합류" },
|
||||||
|
{ val: "SMU005 ", text: "차집" },
|
||||||
|
{ val: "SMU999 ", text: "기타" },
|
||||||
|
{ val: "SMU900 ", text: "1호" },
|
||||||
|
{ val: "SMU901 ", text: "2호" },
|
||||||
|
{ val: "SMU902 ", text: "3호" },
|
||||||
|
{ val: "SMU903 ", text: "4호" },
|
||||||
|
{ val: "SMU904 ", text: "5호" },
|
||||||
|
{ val: "SMU905 ", text: "6호" },
|
||||||
|
{ val: "SMU906 ", text: "7호" },
|
||||||
|
{ val: "SMU907 ", text: "8호" },
|
||||||
|
{ val: "SMU908 ", text: "구거용맨홀" },
|
||||||
|
{ val: "SMU909 ", text: "부관부착맨홀" },
|
||||||
|
{ val: "SMU910 ", text: "조립식맨홀" },
|
||||||
|
{ val: "SMU911 ", text: "특1호" },
|
||||||
|
{ val: "SMU912 ", text: "특2호" },
|
||||||
|
{ val: "SMU913 ", text: "특3호" },
|
||||||
|
{ val: "SMU914 ", text: "특4호" },
|
||||||
|
{ val: "SMU915 ", text: "특5호" },
|
||||||
|
{ val: "SMU916 ", text: "하수맨홀용도" },
|
||||||
|
{ val: "SMU917 ", text: "현장타설관거용" }
|
||||||
|
];
|
||||||
|
|
||||||
|
// 우수펌프장
|
||||||
|
export const ExclnSewagePumpCol = [
|
||||||
|
// { id: 'fid', title: 'FID' },
|
||||||
|
// { id: 'geom', title: 'geometry' },
|
||||||
|
// { id: 'ftreSmbolCd', title: '지형지물부호코드' },
|
||||||
|
{ id: 'fclt_mng_no', title: '시설관리번호' },
|
||||||
|
// { id: 'pbadmsEmdCd', title: '행정읍면동코드' },
|
||||||
|
{ id: 'mapsht_no', title: '도엽번호' },
|
||||||
|
// { id: 'mngInstCd', title: '관리기관코드' },
|
||||||
|
{ id: 'instl_ymd', title: '설치일자' },
|
||||||
|
{ id: 'swage_pmstn_nm', title: '하수펌프장명' },
|
||||||
|
{ id: 'plln_area', title: '부지면적(m²)' },
|
||||||
|
// { id: 'opngSttsCd', title: '개통상태코드' },
|
||||||
|
// { id: 'usgCd', title: '용도코드' },
|
||||||
|
{ id: 'daily_prcs_cpct', title: '일일처리용량(㎥)' },
|
||||||
|
{ id: 'max_impnd_cpct', title: '최대저수용량(㎥)' },
|
||||||
|
{ id: 'altd_vl', title: '표고(EL.m)' },
|
||||||
|
{ id: 'wtlv_vl', title: '수위(m)' },
|
||||||
|
{ id: 'excln_wpmp_ablt_vl', title: '우수양수능력(m²/d)' },
|
||||||
|
// { id: 'instMngNo', title: '기관관리번호' },
|
||||||
|
]
|
||||||
|
export const ExclnSewagePumpCol2 = [
|
||||||
|
{ id: 'rowNumber', title: '순번' },
|
||||||
|
// { id: 'fid', title: 'FID' },
|
||||||
|
// { id: 'geom', title: 'geometry' },
|
||||||
|
// { id: 'ftreSmbolCd', title: '지형지물부호코드' },
|
||||||
|
{ id: 'fcltMngNo', title: '시설관리번호' },
|
||||||
|
{ id: 'ctpvNm', title: '시도' },
|
||||||
|
{ id: 'sggNm', title: '시군구' },
|
||||||
|
// { id: 'pbadmsEmdCd', title: '행정읍면동코드' },
|
||||||
|
// { id: 'mapshtNo', title: '도엽번호' },
|
||||||
|
// { id: 'mngInstCd', title: '관리기관코드' },
|
||||||
|
{ id: 'swagePmstnNm', title: '하수펌프장명' },
|
||||||
|
{ id: 'instlYmd', title: '설치일자' },
|
||||||
|
// { id: 'pllnArea', title: '부지면적(m²)' },
|
||||||
|
// { id: 'opngSttsCd', title: '개통상태코드' },
|
||||||
|
// { id: 'usgCd', title: '용도코드' },
|
||||||
|
{ id: 'dailyPrcsCpct', title: '일일처리용량(㎥)' },
|
||||||
|
{ id: 'maxImpndCpct', title: '최대저수용량(㎥)' },
|
||||||
|
{ id: 'altdVl', title: '표고(EL.m)' },
|
||||||
|
{ id: 'wtlvVl', title: '수위(m)' },
|
||||||
|
{ id: 'exclnWpmpAbltVl', title: '우수양수능력(m²/d)' },
|
||||||
|
// { id: 'instMngNo', title: '기관관리번호' },
|
||||||
|
]
|
||||||
|
export const ExclnSewagePumpExcelCol = {
|
||||||
|
'fcltMngNo': '시설관리번호',
|
||||||
|
'ctpvNm': '시도',
|
||||||
|
'sggNm': '시군구',
|
||||||
|
'swagePmstnNm': '하수펌프장명',
|
||||||
|
'instlYmd': '설치일자',
|
||||||
|
'dailyPrcsCpct': '일일처리용량(㎥)',
|
||||||
|
'maxImpndCpct': '최대저수용량(㎥)',
|
||||||
|
'altdVl': '표고(EL.m)',
|
||||||
|
'wtlvVl': '수위(m)',
|
||||||
|
'exclnWpmpAbltVl': '우수양수능력(m²/d)'
|
||||||
|
};
|
||||||
|
// 오수펌프장
|
||||||
|
export const DrtwSewagePumpCol = [
|
||||||
|
// { id: 'fid', title: 'FID' },
|
||||||
|
// { id: 'geom', title: 'geometry' },
|
||||||
|
// { id: 'ftreSmbolCd', title: '지형지물부호코드' },
|
||||||
|
{ id: 'fclt_mng_no', title: '시설관리번호' },
|
||||||
|
// { id: 'pbadmsEmdCd', title: '행정읍면동코드' },
|
||||||
|
{ id: 'mapsht_no', title: '도엽번호' },
|
||||||
|
// { id: 'mngInstCd', title: '관리기관코드' },
|
||||||
|
{ id: 'instl_ymd', title: '설치일자' },
|
||||||
|
{ id: 'swage_pmstn_nm', title: '하수펌프장명' },
|
||||||
|
{ id: 'plln_area', title: '부지면적(m²)' },
|
||||||
|
// { id: 'opngSttsCd', title: '개통상태코드' },
|
||||||
|
// { id: 'usgCd', title: '용도코드' },
|
||||||
|
{ id: 'daily_prcs_cpct', title: '일일처리용량(㎥)' },
|
||||||
|
{ id: 'max_impnd_cpct', title: '최대저수용량(㎥)' },
|
||||||
|
{ id: 'altd_vl', title: '표고(EL.m)' },
|
||||||
|
{ id: 'wtlv_vl', title: '수위(m)' },
|
||||||
|
{ id: 'excln_wpmp_ablt_vl', title: '오수양수능력(m²/d)' },
|
||||||
|
// { id: 'instMngNo', title: '기관관리번호' },
|
||||||
|
]
|
||||||
|
export const DrtwSewagePumpCol2 = [
|
||||||
|
{ id: 'rowNumber', title: '순번' },
|
||||||
|
// { id: 'fid', title: 'FID' },
|
||||||
|
// { id: 'geom', title: 'geometry' },
|
||||||
|
// { id: 'ftreSmbolCd', title: '지형지물부호코드' },
|
||||||
|
{ id: 'fcltMngNo', title: '시설관리번호' },
|
||||||
|
// { id: 'pbadmsEmdCd', title: '행정읍면동코드' },
|
||||||
|
// { id: 'mapshtNo', title: '도엽번호' },
|
||||||
|
{ id: 'ctpvNm', title: '시도' },
|
||||||
|
{ id: 'sggNm', title: '시군구' },
|
||||||
|
// { id: 'mngInstCd', title: '관리기관코드' },
|
||||||
|
{ id: 'swagePmstnNm', title: '하수펌프장명' },
|
||||||
|
{ id: 'instlYmd', title: '설치일자' },
|
||||||
|
// { id: 'pllnArea', title: '부지면적(m²)' },
|
||||||
|
// { id: 'opngSttsCd', title: '개통상태코드' },
|
||||||
|
// { id: 'usgCd', title: '용도코드' },
|
||||||
|
{ id: 'dailyPrcsCpct', title: '일일처리용량(㎥)' },
|
||||||
|
{ id: 'maxImpndCpct', title: '최대저수용량(㎥)' },
|
||||||
|
{ id: 'altdVl', title: '표고(EL.m)' },
|
||||||
|
{ id: 'wtlvVl', title: '수위(m)' },
|
||||||
|
{ id: 'exclnWpmpAbltVl', title: '오수양수능력(m²/d)' },
|
||||||
|
// { id: 'instMngNo', title: '기관관리번호' },
|
||||||
|
]
|
||||||
|
// 펌프장 용도 코드표
|
||||||
|
export const DRTW_SEWAGE_PUMP_USE_CODES = [
|
||||||
|
{ val: "SBE000", text: "미분류" },
|
||||||
|
{ val: "SBE001", text: "빗물펌프장" },
|
||||||
|
{ val: "SBE002", text: "오수펌프장" },
|
||||||
|
{ val: "SBE003", text: "처리장내펌프장" },
|
||||||
|
{ val: "SBE900", text: "오수배제" },
|
||||||
|
{ val: "SBE901", text: "우수배제" },
|
||||||
|
{ val: "SBE999", text: "기타" },
|
||||||
|
];
|
||||||
|
|
||||||
|
// 우수토실
|
||||||
|
export const stofcbrCol = [
|
||||||
|
// { id: 'ftre_smbol_cd', title: '지형지물부호코드' },
|
||||||
|
{ id: 'fclt_mng_no', title: '시설관리번호' },
|
||||||
|
// { id: 'pbadms_emd_cd', title: '행정읍면동코드' },
|
||||||
|
{ id: 'mapsht_no', title: '도엽번호' },
|
||||||
|
// { id: 'mng_inst_cd', title: '관리기관코드' },
|
||||||
|
{ id: 'instl_ymd', title: '설치일자' },
|
||||||
|
// { id: 'fclty_shp_cd', title: '시설물형태코드' },
|
||||||
|
{ id: 'worflw_wall_hgt', title: '월류벽높이(m)' },
|
||||||
|
// { id: 'mhl_exst_yn_cd', title: '맨홀존재여부코드' },
|
||||||
|
// { id: 'swage_mhl_ftre_smbol_cd', title: '하수맨홀지형지물부호코드' },
|
||||||
|
{ id: 'swage_mhl_mng_no', title: '하수맨홀관리번호' },
|
||||||
|
{ id: 'drtn_angl', title: '방향각도(°)' },
|
||||||
|
]
|
||||||
|
export const stofcbrCol2 = [
|
||||||
|
{ id: 'rowNumber', title: '순번' },
|
||||||
|
// { id: 'ftreSmbolCd', title: '지형지물부호코드' },
|
||||||
|
{ id: 'fcltMngNo', title: '시설관리번호' },
|
||||||
|
// { id: 'pbadmsEmdCd', title: '행정읍면동코드' },
|
||||||
|
{ id: 'mapshtNo', title: '도엽번호' },
|
||||||
|
{ id: 'ctpvNm', title: '시도' },
|
||||||
|
{ id: 'sggNm', title: '시군구' },
|
||||||
|
// { id: 'mngInstCd', title: '관리기관코드' },
|
||||||
|
{ id: 'instlYmd', title: '설치일자' },
|
||||||
|
// { id: 'fcltyShpCd', title: '시설물형태코드' },
|
||||||
|
{ id: 'worflwWallHgt', title: '월류벽높이(m)' },
|
||||||
|
// { id: 'mhlExstYnCd', title: '맨홀존재여부코드' },
|
||||||
|
// { id: 'swageMhlFtreSmbolCd', title: '하수맨홀지형지물부호코드' },
|
||||||
|
{ id: 'swageMhlMngNo', title: '하수맨홀관리번호' },
|
||||||
|
{ id: 'drtnAngl', title: '방향각도(°)' },
|
||||||
|
]
|
||||||
|
export const stofcbrExcelCol = {
|
||||||
|
'fcltMngNo': '시설관리번호',
|
||||||
|
'mapshtNo': '도엽번호',
|
||||||
|
'ctpvNm': '시도',
|
||||||
|
'sggNm': '시군구',
|
||||||
|
'instlYmd': '설치일자',
|
||||||
|
'worflwWallHgt': '월류벽높이(m)',
|
||||||
|
'swageMhlMngNo': '하수맨홀관리번호',
|
||||||
|
'drtnAngl': '방향각도(°)'
|
||||||
|
};
|
||||||
|
|
||||||
|
// 중점우수토실 측정지점
|
||||||
|
export const untrtSwgRainCol1 = [
|
||||||
|
{ id: 'manage_no', title: '관리번호' },
|
||||||
|
{ id: 'swr_ppl_eqp_nm', title: '처리구역' },
|
||||||
|
{ id: 'swr_ppl_trt_nm', title: '처리분구' },
|
||||||
|
{ id: 'addr', title: '인근주소' },
|
||||||
|
{ id: 'chmbr_xcnts', title: '토실 위도' },
|
||||||
|
{ id: 'chmbr_ydnts', title: '토실 경도' }
|
||||||
|
];
|
||||||
|
|
||||||
|
// 중점우수토실 측정지점 시설현황
|
||||||
|
export const untrtSwgRainCol2 = [
|
||||||
|
{ id: 'mesure_spot_se', title: '구분' }, // 유량계측정방식 기타
|
||||||
|
{ id: 'discharge_pipe_spec', title: '방류관로 규격(m)' },
|
||||||
|
{ id: 'swr_ppl_eqp_ar', title: '배수구역 면적(m²)' },
|
||||||
|
{ id: 'swr_trt_popl', title: '하수처리 인구(인)' },
|
||||||
|
{ id: 'screen_instl_at', title: '스크린설치 여부' },
|
||||||
|
{ id: 'weir_hg', title: '위어 높이(m)' },
|
||||||
|
{ id: 'weir_lt', title: '위어 길이(m)' }
|
||||||
|
];
|
||||||
|
|
||||||
|
// 중점우수토실 강우정보 (id값 틀릴 수 있음)
|
||||||
|
export const untrtSwgRainCol3 = [
|
||||||
|
{ id: 'rainBeginDt', title: '강우시작일시' },
|
||||||
|
{ id: 'rainEndDt', title: '강우종료일시' },
|
||||||
|
{ id: 'precdngDry', title: '선행건기(h)' },
|
||||||
|
{ id: 'rainInfo', title: '강우정보' },
|
||||||
|
{ id: 'rainFall', title: '누적강우량(mm)' },
|
||||||
|
{ id: 'cntncTime', title: '지속시간(h)' },
|
||||||
|
{ id: 'rainIn', title: '강우강도(mm/h)' }
|
||||||
|
];
|
||||||
|
|
||||||
|
// 중점우수토실 측정정보 (id값 틀릴 수 있음)
|
||||||
|
export const untrtSwgRainCol4 = [
|
||||||
|
{ id: 'mesureBeginDt', title: '측정시작일시' },
|
||||||
|
{ id: 'mesureEndDt', title: '측정종료일시' },
|
||||||
|
{ id: 'mesureIntrvl', title: '측정간격(분)' },
|
||||||
|
{ id: 'mesureMhrlsInstlLc', title: '측정기기 설치위치' },
|
||||||
|
{ id: 'flwmtrCombined', title: '유량계 종류 및 모델명' }, // 합쳐진 컬럼
|
||||||
|
{ id: 'qltwtrBeginDt', title: '채수시작일시' },
|
||||||
|
{ id: 'qltwtrEndDt', title: '채수종료일시' },
|
||||||
|
{ id: 'qltwtrCo', title: '채수횟수' }
|
||||||
|
];
|
||||||
|
|
||||||
|
// 중점우수토실 수량/수질측정 정보
|
||||||
|
export const untrtSwgRainCol5 = [
|
||||||
|
{ id: 'odr', title: '회차' },
|
||||||
|
{ id: 'mesureDt', title: '측정일자' },
|
||||||
|
{ id: 'mesureQy', title: '수량(m³)' },
|
||||||
|
{ id: 'mesureBod', title: 'BOD(mg/L)' },
|
||||||
|
{ id: 'mesureToc', title: 'TOC(mg/L)' },
|
||||||
|
{ id: 'mesureLoad', title: '오염부하량(kg)' }
|
||||||
|
];
|
||||||
|
|
||||||
|
// 🎯 날짜 필드들 (yyyymmdd -> yyyy년 mm월 dd일)
|
||||||
|
export const dateFields = [
|
||||||
|
'instl_ymd', 'last_drdgn_ymd', 'cmcn_ymd', 'oprtng_strt_ymd', 'clsg_ymd',
|
||||||
|
'mesure_begin_dt', 'mesure_end_dt', 'qltwtr_begin_dt', 'qltwtr_end_dt',
|
||||||
|
'rain_begin_dt', 'rain_end_dt', 'mesureDt',
|
||||||
|
// 🎯 camelCase 버전 추가
|
||||||
|
'instlYmd', 'lastDrdgnYmd', 'cmcnYmd', 'oprtngStrtYmd', 'clsgYmd',
|
||||||
|
'mesureBeginDt', 'mesureEndDt', 'qltwtrBeginDt', 'qltwtrEndDt',
|
||||||
|
'rainBeginDt', 'rainEndDt',
|
||||||
|
'flfmtBgngYmd', 'flfmtEndYmd', 'flfmtYr',
|
||||||
|
'bgng_ymd', 'end_ymd', 'bgngYmd', 'endYmd'
|
||||||
|
];
|
||||||
|
|
||||||
|
// 🎯 연월 필드들 (yyyymm -> yyyy년 m월)
|
||||||
|
export const yearMonthFields = ['aplcnYm',];
|
||||||
|
|
||||||
|
// 🎯 날짜시간 필드들 (yyyy-mm-dd hh:mm:ss -> yyyy년 m월 d일 hh:mm)
|
||||||
|
export const dateTimeFields = ['regDt',];
|
||||||
|
|
||||||
|
// 🎯 숫자 필드들 (천 단위 구분자)
|
||||||
|
export const numberFields = [
|
||||||
|
'pdmt', 'prlg', 'avg_grdn', 'drtw_mltv_area', 'excln_mltv_area', 'tmpt_dpth', 'scend_dpth', 'trfln_cnt', 'vrtc_len', 'wdth_len',
|
||||||
|
'fclt_cpct', 'plln_area', 'prcs_zone_area_sum', 'swtrmt_ppltn_cnt', 'stty_crtr_bod', 'stty_crtr_toc', 'stty_crtr_ss', 'stty_crtr_tn', 'stty_crtr_tph', 'stty_crtr_clbcl_cnt',
|
||||||
|
'swage_mh_diam', 'wdth_len', 'vrtc_len', 'altd_vl', 'dpthlVl',
|
||||||
|
'plln_area', 'daily_prcs_cpct', 'max_impnd_cpct', 'altd_vl', 'wtlv_vl', 'excln_wpmp_ablt',
|
||||||
|
'worflw_wall_hgt',
|
||||||
|
'swr_ppl_eqp_ar', 'swr_trt_popl', 'weir_hg', 'weir_lt',
|
||||||
|
'precdng_dry', 'rain_fall', 'cntnc_time', 'rain_in',
|
||||||
|
'mesure_intrvl', 'qltwtr_co', 'mesureQy', 'mesureBod', 'mesureToc', 'mesureLoad',
|
||||||
|
// 🎯 camelCase 버전 추가
|
||||||
|
'avgGrdn', 'drtwMltvArea', 'exclnMltvArea', 'tmptDpth', 'scendDpth', 'trflnCnt', 'vrtcLen', 'wdthLen',
|
||||||
|
'fcltCpct', 'pllnArea', 'prcsZoneAreaSum', 'swtrmtPpltnCnt', 'sttyCltrBod', 'sttyCltrToc', 'sttyCltrSs', 'sttyCltrTn', 'sttyCltrTph', 'sttyCltrClbclCnt',
|
||||||
|
'swageMhDiam', 'altdVl', 'dpthlVl',
|
||||||
|
'dailyPrcsCpct', 'maxImpndCpct', 'wtlvVl', 'exclnWpmpAblt',
|
||||||
|
'worflwWallHgt',
|
||||||
|
'swrPplEqpAr', 'swrTrtPopl', 'weirHg', 'weirLt',
|
||||||
|
'precdngDry', 'rainFall', 'cntncTime', 'rainIn',
|
||||||
|
'mesureIntrvl', 'qltwtrCo', 'rnysnFvlc', 'clarFvlc',
|
||||||
|
'bizAmt', 'count',
|
||||||
|
'chmbr_xcnts', 'chmbr_ydnts',
|
||||||
|
'fldng_hr', 'avg_fldng_wtlv', 'fldng_area', 'dam_amt',
|
||||||
|
'fldngHr', 'avgFldngWtlv', 'fldngArea', 'damAmt'
|
||||||
|
];
|
||||||
+2
-5
@@ -4,8 +4,8 @@
|
|||||||
*/
|
*/
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import type { ExmnMapFilters, ExmnMapJobType } from "./exmn-map-types";
|
import type { ExmnMapFilters, ExmnMapJobType } from "./exmnMapTypes";
|
||||||
import LayerSettingCard from "../layer-setting/layer-setting-card";
|
import LayerSettingCard from "../layerSetting/LayerSettingCard";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
jobType: ExmnMapJobType;
|
jobType: ExmnMapJobType;
|
||||||
@@ -14,7 +14,6 @@ type Props = {
|
|||||||
enabled?: boolean;
|
enabled?: boolean;
|
||||||
onEnabledChange?: (enabled: boolean) => void;
|
onEnabledChange?: (enabled: boolean) => void;
|
||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
statusMessage?: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const GRADE_OPTIONS = ["", "1", "2", "3", "4", "5"];
|
const GRADE_OPTIONS = ["", "1", "2", "3", "4", "5"];
|
||||||
@@ -27,7 +26,6 @@ export default function ExmnLayerSettingPanel({
|
|||||||
enabled = true,
|
enabled = true,
|
||||||
onEnabledChange = () => {},
|
onEnabledChange = () => {},
|
||||||
onClose = () => {},
|
onClose = () => {},
|
||||||
statusMessage = "",
|
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const updateFilter = (key: keyof ExmnMapFilters, value: string) => {
|
const updateFilter = (key: keyof ExmnMapFilters, value: string) => {
|
||||||
onFiltersChange({
|
onFiltersChange({
|
||||||
@@ -48,7 +46,6 @@ export default function ExmnLayerSettingPanel({
|
|||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
>
|
>
|
||||||
<div className="space-y-[6px]">
|
<div className="space-y-[6px]">
|
||||||
{statusMessage ? <p role="status" className="text-[1.1rem] text-muted-foreground">{statusMessage}</p> : null}
|
|
||||||
<label className="flex min-h-[24px] flex-col items-stretch gap-1">
|
<label className="flex min-h-[24px] flex-col items-stretch gap-1">
|
||||||
<span className={`flex items-center gap-1 ${labelClass}`}>
|
<span className={`flex items-center gap-1 ${labelClass}`}>
|
||||||
<span
|
<span
|
||||||
+1
-1
@@ -13,7 +13,7 @@ import {
|
|||||||
} from "@common/components";
|
} from "@common/components";
|
||||||
|
|
||||||
import { getExmnPipeReportAvailability } from "@/features/exmn";
|
import { getExmnPipeReportAvailability } from "@/features/exmn";
|
||||||
import { openWindowPopup } from "@/features/window-popup/lib/open-window-popup";
|
import { openWindowPopup } from "@/features/windowPopup/lib/openWindowPopup";
|
||||||
import { useAlertStore } from "@/shared/lib";
|
import { useAlertStore } from "@/shared/lib";
|
||||||
|
|
||||||
type ExmnSurveyResultSectionProps = {
|
type ExmnSurveyResultSectionProps = {
|
||||||
+4
-9
@@ -1,13 +1,11 @@
|
|||||||
/** 관로조사 지도 데이터 조회 API와 응답 변환 함수를 제공한다. */
|
/** 관로조사 지도 데이터 조회 API와 응답 변환 함수를 제공한다. */
|
||||||
import { getRawJson } from "@/shared/api/sewerage-api";
|
import { getRawJson } from "../../../../components/lib/api";
|
||||||
import type { ExmnMapFilters, ExmnMapJobType } from "./exmn-map-types";
|
import type { ExmnMapFilters, ExmnMapJobType } from "./exmnMapTypes";
|
||||||
|
|
||||||
type ExmnLayerScope = {
|
type ExmnLayerScope = {
|
||||||
sggCd?: string;
|
sggCd?: string;
|
||||||
ctpvNm?: string;
|
ctpvNm?: string;
|
||||||
sggNm?: string;
|
sggNm?: string;
|
||||||
exmnBizId?: string;
|
|
||||||
trtdstId?: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 구버전 응답이 하류맨홀을 포함해도 업로드 관로조사의 상류맨홀 피처만 지도에 전달한다. */
|
/** 구버전 응답이 하류맨홀을 포함해도 업로드 관로조사의 상류맨홀 피처만 지도에 전달한다. */
|
||||||
@@ -38,19 +36,16 @@ export const retainUpstreamManholeFeatures = (response: any) => {
|
|||||||
export const getExmnMapLayer = async (
|
export const getExmnMapLayer = async (
|
||||||
jobType: ExmnMapJobType,
|
jobType: ExmnMapJobType,
|
||||||
filters: ExmnMapFilters,
|
filters: ExmnMapFilters,
|
||||||
scope: ExmnLayerScope = {},
|
scope: ExmnLayerScope,
|
||||||
signal?: AbortSignal,
|
|
||||||
) => {
|
) => {
|
||||||
const query = new URLSearchParams({ jobType });
|
const query = new URLSearchParams({ jobType });
|
||||||
if (scope.sggCd?.trim()) query.set("sggCd", scope.sggCd.trim());
|
if (scope.sggCd?.trim()) query.set("sggCd", scope.sggCd.trim());
|
||||||
if (scope.ctpvNm?.trim()) query.set("ctpvNm", scope.ctpvNm.trim());
|
if (scope.ctpvNm?.trim()) query.set("ctpvNm", scope.ctpvNm.trim());
|
||||||
if (scope.sggNm?.trim()) query.set("sggNm", scope.sggNm.trim());
|
if (scope.sggNm?.trim()) query.set("sggNm", scope.sggNm.trim());
|
||||||
if (scope.exmnBizId?.trim()) query.set("exmnBizId", scope.exmnBizId.trim());
|
|
||||||
if (scope.trtdstId?.trim()) query.set("trtdstId", scope.trtdstId.trim());
|
|
||||||
if (filters.bizCycl) query.set("bizCycl", filters.bizCycl);
|
if (filters.bizCycl) query.set("bizCycl", filters.bizCycl);
|
||||||
if (filters.structuralGrade) query.set("structuralGrade", filters.structuralGrade);
|
if (filters.structuralGrade) query.set("structuralGrade", filters.structuralGrade);
|
||||||
if (filters.operationalGrade) query.set("operationalGrade", filters.operationalGrade);
|
if (filters.operationalGrade) query.set("operationalGrade", filters.operationalGrade);
|
||||||
|
|
||||||
const response = await getRawJson(`/sewerage-service/api/v1/exmnMap/layers?${query.toString()}`, { signal });
|
const response = await getRawJson(`/sewerage-service/api/v1/exmnMap/layers?${query.toString()}`);
|
||||||
return jobType === "MNHL" ? retainUpstreamManholeFeatures(response) : response;
|
return jobType === "MNHL" ? retainUpstreamManholeFeatures(response) : response;
|
||||||
};
|
};
|
||||||
-2
@@ -21,7 +21,6 @@ export type ExmnMapFilters = {
|
|||||||
|
|
||||||
export type ExmnMapEntryContext = {
|
export type ExmnMapEntryContext = {
|
||||||
exmnBizId: string;
|
exmnBizId: string;
|
||||||
trtdstId: string;
|
|
||||||
ctpvNm: string;
|
ctpvNm: string;
|
||||||
sggNm: string;
|
sggNm: string;
|
||||||
bizCycl: string;
|
bizCycl: string;
|
||||||
@@ -292,7 +291,6 @@ export const buildExmnMapEntryContext = (
|
|||||||
const rawJobType = String(searchParams.get("exmnJobType") ?? "").toUpperCase();
|
const rawJobType = String(searchParams.get("exmnJobType") ?? "").toUpperCase();
|
||||||
return {
|
return {
|
||||||
exmnBizId: String(searchParams.get("exmnBizId") ?? "").trim(),
|
exmnBizId: String(searchParams.get("exmnBizId") ?? "").trim(),
|
||||||
trtdstId: String(searchParams.get("trtdstId") ?? "").trim(),
|
|
||||||
ctpvNm: String(searchParams.get("ctpvNm") ?? "").trim(),
|
ctpvNm: String(searchParams.get("ctpvNm") ?? "").trim(),
|
||||||
sggNm: String(searchParams.get("sggNm") ?? "").trim(),
|
sggNm: String(searchParams.get("sggNm") ?? "").trim(),
|
||||||
bizCycl: String(searchParams.get("bizCycl") ?? "").replace(/[^0-9]/g, ""),
|
bizCycl: String(searchParams.get("bizCycl") ?? "").replace(/[^0-9]/g, ""),
|
||||||
@@ -1,264 +0,0 @@
|
|||||||
"use client";
|
|
||||||
import { beginMapNavigation } from "@/features/map-search/lib/map-navigation";
|
|
||||||
|
|
||||||
import {
|
|
||||||
useCallback,
|
|
||||||
useEffect,
|
|
||||||
useRef,
|
|
||||||
useState,
|
|
||||||
type RefObject,
|
|
||||||
} from "react";
|
|
||||||
import GeoJSON from "ol/format/GeoJSON";
|
|
||||||
import VectorLayer from "ol/layer/Vector";
|
|
||||||
import VectorSource from "ol/source/Vector";
|
|
||||||
import { getExmnMapLayer } from "./exmn-map-api";
|
|
||||||
import {
|
|
||||||
EMPTY_EXMN_MAP_FILTERS,
|
|
||||||
EXMN_RESULT_PPL_LAYER_ID,
|
|
||||||
EXMN_RESULT_MNHL_LAYER_ID,
|
|
||||||
type ExmnMapEntryContext,
|
|
||||||
type ExmnMapFilters,
|
|
||||||
type ExmnMapJobType,
|
|
||||||
} from "./exmn-map-types";
|
|
||||||
|
|
||||||
type Options = {
|
|
||||||
gisApp: any;
|
|
||||||
mapRef: RefObject<any>;
|
|
||||||
ready: boolean;
|
|
||||||
treeData: any[];
|
|
||||||
entry: ExmnMapEntryContext;
|
|
||||||
pipeChecked: boolean;
|
|
||||||
manholeChecked: boolean;
|
|
||||||
pipeEnabled: boolean;
|
|
||||||
manholeEnabled: boolean;
|
|
||||||
pipeFilters: ExmnMapFilters;
|
|
||||||
manholeFilters: ExmnMapFilters;
|
|
||||||
pipeStyle: any;
|
|
||||||
manholeStyle: any;
|
|
||||||
};
|
|
||||||
|
|
||||||
type LayerState = {
|
|
||||||
layer?: VectorLayer<any>;
|
|
||||||
controller?: AbortController;
|
|
||||||
sequence: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 전체 조사 레이어와 상세현황 위치 이동을 분리하며 유형별 요청을 취소/무효화한다. */
|
|
||||||
export const useExmnResultMap = (options: Options) => {
|
|
||||||
const {
|
|
||||||
gisApp,
|
|
||||||
mapRef,
|
|
||||||
ready,
|
|
||||||
treeData,
|
|
||||||
entry,
|
|
||||||
pipeChecked,
|
|
||||||
manholeChecked,
|
|
||||||
pipeEnabled,
|
|
||||||
manholeEnabled,
|
|
||||||
pipeFilters,
|
|
||||||
manholeFilters,
|
|
||||||
pipeStyle,
|
|
||||||
manholeStyle,
|
|
||||||
} = options;
|
|
||||||
// 지도 객체/요청 수명은 React 렌더링과 분리하고 관로·맨홀을 독립적으로 관리한다.
|
|
||||||
const layers = useRef<Record<ExmnMapJobType, LayerState>>({
|
|
||||||
PPL: { sequence: 0 },
|
|
||||||
MNHL: { sequence: 0 },
|
|
||||||
});
|
|
||||||
const fittedContext = useRef("");
|
|
||||||
const [messages, setMessages] = useState<Record<ExmnMapJobType, string>>({
|
|
||||||
PPL: "",
|
|
||||||
MNHL: "",
|
|
||||||
});
|
|
||||||
|
|
||||||
/** 체크 해제/언마운트 시 늦게 도착한 응답도 다시 표시되지 않게 한다. */
|
|
||||||
const removeLayer = useCallback(
|
|
||||||
(job: ExmnMapJobType) => {
|
|
||||||
const state = layers.current[job];
|
|
||||||
state.sequence++;
|
|
||||||
state.controller?.abort();
|
|
||||||
state.controller = undefined;
|
|
||||||
if (state.layer) {
|
|
||||||
gisApp.Module.select?.removeLayer?.(state.layer);
|
|
||||||
mapRef.current?.removeLayer?.(state.layer);
|
|
||||||
}
|
|
||||||
state.layer = undefined;
|
|
||||||
},
|
|
||||||
[gisApp, mapRef],
|
|
||||||
);
|
|
||||||
|
|
||||||
/** 지역 검색값 없이 전체를 요청하고, 선택 진입 context는 위치 이동 범위 조회에만 사용한다. */
|
|
||||||
const loadLayer = useCallback(
|
|
||||||
async (job: ExmnMapJobType, filters: ExmnMapFilters) => {
|
|
||||||
const map = mapRef.current;
|
|
||||||
if (!map) return;
|
|
||||||
const navigation = entry.jobType === job && entry.exmnBizId && entry.trtdstId
|
|
||||||
? beginMapNavigation(map) : null;
|
|
||||||
removeLayer(job);
|
|
||||||
const state = layers.current[job];
|
|
||||||
const sequence = state.sequence;
|
|
||||||
const controller = new AbortController();
|
|
||||||
state.controller = controller;
|
|
||||||
const active = () =>
|
|
||||||
state.sequence === sequence && !controller.signal.aborted;
|
|
||||||
setMessages((current) => ({
|
|
||||||
...current,
|
|
||||||
[job]: "조사결과를 불러오는 중입니다.",
|
|
||||||
}));
|
|
||||||
try {
|
|
||||||
const response = await getExmnMapLayer(
|
|
||||||
job,
|
|
||||||
filters,
|
|
||||||
{},
|
|
||||||
controller.signal,
|
|
||||||
);
|
|
||||||
if (!active()) return;
|
|
||||||
const data = response?.data ?? response;
|
|
||||||
const features = new GeoJSON().readFeatures(data, {
|
|
||||||
dataProjection: "EPSG:5179",
|
|
||||||
featureProjection: gisApp.TO_PROJ,
|
|
||||||
});
|
|
||||||
const source = new VectorSource({ features });
|
|
||||||
const layer = new VectorLayer({
|
|
||||||
source,
|
|
||||||
zIndex: job === "PPL" ? 9988 : 9989,
|
|
||||||
style: job === "PPL" ? pipeStyle : manholeStyle,
|
|
||||||
});
|
|
||||||
layer.setProperties({
|
|
||||||
id:
|
|
||||||
job === "PPL"
|
|
||||||
? EXMN_RESULT_PPL_LAYER_ID
|
|
||||||
: EXMN_RESULT_MNHL_LAYER_ID,
|
|
||||||
lyrNm: job === "PPL" ? "관로조사" : "맨홀조사",
|
|
||||||
lyrTyNm: job === "PPL" ? "tb_ms_swage_ppl" : "tb_ms_swage_mhl",
|
|
||||||
clickPsblYn: "Y",
|
|
||||||
chcYn: "Y",
|
|
||||||
});
|
|
||||||
state.layer = layer;
|
|
||||||
map.addLayer(layer);
|
|
||||||
gisApp.Module.select?.addLayer?.(layer);
|
|
||||||
const missing = Number(data?.missingGeometryCount ?? 0);
|
|
||||||
const diagnostics = data?.diagnostics ?? {};
|
|
||||||
const reasons = [
|
|
||||||
["지역 확인 불가", diagnostics.regionUnresolvedCount],
|
|
||||||
["시설번호 없음", diagnostics.identifierMissingCount],
|
|
||||||
["도형 없음", diagnostics.geometryNotFoundCount],
|
|
||||||
["도형 중복", diagnostics.ambiguousGeometryCount],
|
|
||||||
]
|
|
||||||
.filter(([, count]) => Number(count) > 0)
|
|
||||||
.map(([label, count]) => `${label} ${count}건`)
|
|
||||||
.join(", ");
|
|
||||||
const summary = features.length
|
|
||||||
? `${features.length.toLocaleString()}개 표시`
|
|
||||||
: "표시할 조사결과가 없습니다.";
|
|
||||||
const status = missing
|
|
||||||
? `${summary} · 공간정보 미연결 ${missing}건${reasons ? ` (${reasons})` : ""}`
|
|
||||||
: summary;
|
|
||||||
setMessages((current) => ({ ...current, [job]: status }));
|
|
||||||
|
|
||||||
if (entry.jobType !== job || !entry.exmnBizId || !entry.trtdstId)
|
|
||||||
return;
|
|
||||||
// 위치 조회 실패가 정상적으로 조회된 기본 레이어를 지우지 않도록 별도 처리한다.
|
|
||||||
try {
|
|
||||||
const selectedResponse = await getExmnMapLayer(
|
|
||||||
job,
|
|
||||||
filters,
|
|
||||||
{ exmnBizId: entry.exmnBizId, trtdstId: entry.trtdstId },
|
|
||||||
controller.signal,
|
|
||||||
);
|
|
||||||
if (!active()) return;
|
|
||||||
const selectedData = selectedResponse?.data ?? selectedResponse;
|
|
||||||
const selectedFeatures = new GeoJSON().readFeatures(selectedData, {
|
|
||||||
dataProjection: "EPSG:5179",
|
|
||||||
featureProjection: gisApp.TO_PROJ,
|
|
||||||
});
|
|
||||||
if (!selectedFeatures.length) {
|
|
||||||
setMessages((current) => ({
|
|
||||||
...current,
|
|
||||||
[job]: `${status} · 선택한 처리분구에 현재 조건으로 표시할 공간정보가 없습니다.`,
|
|
||||||
}));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const selectedSource = new VectorSource({
|
|
||||||
features: selectedFeatures,
|
|
||||||
});
|
|
||||||
// 별도 강조선을 추가하지 않고 기존 조사 레이어 색상으로 표시한다.
|
|
||||||
const contextKey = `${entry.exmnBizId}:${entry.trtdstId}:${job}`;
|
|
||||||
const extent = selectedSource.getExtent();
|
|
||||||
if (
|
|
||||||
fittedContext.current !== contextKey &&
|
|
||||||
extent.every(Number.isFinite) && navigation?.commit(extent)
|
|
||||||
) {
|
|
||||||
map
|
|
||||||
.getView()
|
|
||||||
.fit(extent, {
|
|
||||||
duration: 300,
|
|
||||||
padding: [80, 420, 80, 80],
|
|
||||||
maxZoom: 18,
|
|
||||||
constrainResolution: true,
|
|
||||||
nearest: true,
|
|
||||||
});
|
|
||||||
fittedContext.current = contextKey;
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
if (active())
|
|
||||||
setMessages((current) => ({
|
|
||||||
...current,
|
|
||||||
[job]: `${status} · 선택 영역 조회 실패: ${error instanceof Error ? error.message : "다시 조회해 주세요."}`,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
if (active())
|
|
||||||
setMessages((current) => ({
|
|
||||||
...current,
|
|
||||||
[job]: `조회 실패: ${error instanceof Error ? error.message : "다시 조회해 주세요."}`,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[
|
|
||||||
entry.exmnBizId,
|
|
||||||
entry.trtdstId,
|
|
||||||
entry.jobType,
|
|
||||||
gisApp,
|
|
||||||
mapRef,
|
|
||||||
pipeStyle,
|
|
||||||
manholeStyle,
|
|
||||||
removeLayer,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (ready && pipeChecked)
|
|
||||||
void loadLayer("PPL", pipeEnabled ? pipeFilters : EMPTY_EXMN_MAP_FILTERS);
|
|
||||||
else removeLayer("PPL");
|
|
||||||
return () => removeLayer("PPL");
|
|
||||||
}, [
|
|
||||||
ready,
|
|
||||||
pipeChecked,
|
|
||||||
pipeEnabled,
|
|
||||||
pipeFilters,
|
|
||||||
treeData,
|
|
||||||
loadLayer,
|
|
||||||
removeLayer,
|
|
||||||
]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (ready && manholeChecked)
|
|
||||||
void loadLayer(
|
|
||||||
"MNHL",
|
|
||||||
manholeEnabled ? manholeFilters : EMPTY_EXMN_MAP_FILTERS,
|
|
||||||
);
|
|
||||||
else removeLayer("MNHL");
|
|
||||||
return () => removeLayer("MNHL");
|
|
||||||
}, [
|
|
||||||
ready,
|
|
||||||
manholeChecked,
|
|
||||||
manholeEnabled,
|
|
||||||
manholeFilters,
|
|
||||||
treeData,
|
|
||||||
loadLayer,
|
|
||||||
removeLayer,
|
|
||||||
]);
|
|
||||||
|
|
||||||
return { removeLayer, messages };
|
|
||||||
};
|
|
||||||
+2
-2
@@ -5,8 +5,8 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useMemo, useState } from "react";
|
import { useMemo, useState } from "react";
|
||||||
import type { FldngHstryItem } from "@/entities/flood-history/model/flood-history-types";
|
import type { FldngHstryItem } from "./fldngHstryTypes";
|
||||||
import { formatFldngHstryArea, formatFldngHstryDepth } from "@/entities/flood-history/lib/flood-history-utils";
|
import { formatFldngHstryArea, formatFldngHstryDepth } from "./fldngHstryUtils";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
detail: FldngHstryItem;
|
detail: FldngHstryItem;
|
||||||
+7
-11
@@ -3,7 +3,6 @@
|
|||||||
* 우측 정보 화면의 심선·위선 목록, 선택 상태와 화면 생명주기 캐시를 관리한다.
|
* 우측 정보 화면의 심선·위선 목록, 선택 상태와 화면 생명주기 캐시를 관리한다.
|
||||||
*/
|
*/
|
||||||
"use client";
|
"use client";
|
||||||
import { mapSearchNavigationOptions } from "@/features/map-search/lib/map-navigation";
|
|
||||||
|
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||||
import type { RefObject } from "react";
|
import type { RefObject } from "react";
|
||||||
@@ -11,8 +10,12 @@ import GisApp from "@common/business_components/ui/map/lib/gis.core";
|
|||||||
import type Feature from "ol/Feature.js";
|
import type Feature from "ol/Feature.js";
|
||||||
import VectorSource from "ol/source/Vector.js";
|
import VectorSource from "ol/source/Vector.js";
|
||||||
|
|
||||||
import { loadFldngHstryDetail } from "./fldng-hstry-client";
|
import { loadFldngHstryDetail } from "./fldngHstryClient";
|
||||||
import { FLDNG_HSTRY_DEPTH_LAYER_TYPE, FLDNG_HSTRY_LAYER_TYPE, type FldngHstryDetailCacheValue } from "@/entities/flood-history/model/flood-history-types";
|
import {
|
||||||
|
FLDNG_HSTRY_DEPTH_LAYER_TYPE,
|
||||||
|
FLDNG_HSTRY_LAYER_TYPE,
|
||||||
|
type FldngHstryDetailCacheValue,
|
||||||
|
} from "./fldngHstryTypes";
|
||||||
|
|
||||||
type FldngHstryGisLayer = {
|
type FldngHstryGisLayer = {
|
||||||
searchLayer?: { getSource?: () => VectorSource | null } | null;
|
searchLayer?: { getSource?: () => VectorSource | null } | null;
|
||||||
@@ -24,7 +27,6 @@ type FldngHstryGisLayer = {
|
|||||||
showSearchResultsFromGeoJSON: (
|
showSearchResultsFromGeoJSON: (
|
||||||
layerTypeName: string,
|
layerTypeName: string,
|
||||||
featureId: string,
|
featureId: string,
|
||||||
options?: { beforeFocus: (extent: unknown) => boolean },
|
|
||||||
) => void | Promise<void>;
|
) => void | Promise<void>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -129,14 +131,11 @@ const displayCachedFldngHstryFeatures = (
|
|||||||
gisLayer: FldngHstryGisLayer,
|
gisLayer: FldngHstryGisLayer,
|
||||||
layerTypeName: string,
|
layerTypeName: string,
|
||||||
features: Feature[],
|
features: Feature[],
|
||||||
beforeFocus: (extent: unknown) => boolean,
|
|
||||||
) => {
|
) => {
|
||||||
const matched = Object.values(GisApp.layerCode ?? {}).find(
|
const matched = Object.values(GisApp.layerCode ?? {}).find(
|
||||||
(item: any) => item?.lyrTyNm === layerTypeName,
|
(item: any) => item?.lyrTyNm === layerTypeName,
|
||||||
) as any;
|
) as any;
|
||||||
if (!matched || features.length === 0) return;
|
if (!matched || features.length === 0) return;
|
||||||
// 캐시를 재사용해도 최신 선택의 유효 도형일 때만 검색조건을 초기화한다.
|
|
||||||
if (!beforeFocus(features[0]?.getGeometry()?.getExtent())) return;
|
|
||||||
|
|
||||||
gisLayer.clearSearchLayer(matched);
|
gisLayer.clearSearchLayer(matched);
|
||||||
const layer = gisLayer.ensureSearchLayer(matched);
|
const layer = gisLayer.ensureSearchLayer(matched);
|
||||||
@@ -153,20 +152,17 @@ const showFldngHstryFeature = async (
|
|||||||
featureId: string,
|
featureId: string,
|
||||||
) => {
|
) => {
|
||||||
const cacheKey = `${layerTypeName}:${featureId}`;
|
const cacheKey = `${layerTypeName}:${featureId}`;
|
||||||
/** 캐시 대기와 신규 WFS 조회가 동일한 이동 성공/취소 계약을 사용한다. */
|
|
||||||
const navigationOptions = mapSearchNavigationOptions((GisApp.Module.core as any).map);
|
|
||||||
const cachedRequest = cache.get(cacheKey);
|
const cachedRequest = cache.get(cacheKey);
|
||||||
if (cachedRequest) {
|
if (cachedRequest) {
|
||||||
displayCachedFldngHstryFeatures(
|
displayCachedFldngHstryFeatures(
|
||||||
gisLayer,
|
gisLayer,
|
||||||
layerTypeName,
|
layerTypeName,
|
||||||
await cachedRequest,
|
await cachedRequest,
|
||||||
navigationOptions.beforeFocus,
|
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await gisLayer.showSearchResultsFromGeoJSON(layerTypeName, featureId, navigationOptions);
|
await gisLayer.showSearchResultsFromGeoJSON(layerTypeName, featureId);
|
||||||
const source = gisLayer.searchLayer?.getSource?.();
|
const source = gisLayer.searchLayer?.getSource?.();
|
||||||
if (!source) return;
|
if (!source) return;
|
||||||
|
|
||||||
+6
-3
@@ -5,9 +5,12 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { SelectBox } from "@common/business_components/ui";
|
import { SelectBox } from "@common/business_components/ui";
|
||||||
import { FLDNG_HSTRY_MIN_YEAR, type FldngHstryYearRange } from "@/entities/flood-history/model/flood-history-types";
|
import {
|
||||||
import { normalizeFldngHstryYearRange } from "@/entities/flood-history/lib/flood-history-utils";
|
FLDNG_HSTRY_MIN_YEAR,
|
||||||
import LayerSettingCard from "../layer-setting/layer-setting-card";
|
type FldngHstryYearRange,
|
||||||
|
} from "./fldngHstryTypes";
|
||||||
|
import { normalizeFldngHstryYearRange } from "./fldngHstryUtils";
|
||||||
|
import LayerSettingCard from "../layerSetting/LayerSettingCard";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
yearRange: FldngHstryYearRange;
|
yearRange: FldngHstryYearRange;
|
||||||
+60
-16
@@ -7,16 +7,34 @@
|
|||||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||||
import { Button, Input } from "@common/components";
|
import { Button, Input } from "@common/components";
|
||||||
import { StandardPopupLayout } from "@common/business_components";
|
import { StandardPopupLayout } from "@common/business_components";
|
||||||
import { getRawJson } from "@/shared/api/sewerage-api";
|
import { getRawJson } from "@/components/lib/api";
|
||||||
import { requestGridExcel } from "@/shared/api/grid-export";
|
import { downloadExcelWithKoreanHeaders } from "@/shared/lib/download-excel";
|
||||||
import { WINDOW_POPUP_MESSAGE_TYPE } from "@/features/window-popup/model/types";
|
import { WINDOW_POPUP_MESSAGE_TYPE } from "@/features/windowPopup/model/types";
|
||||||
import { useAlertStore } from "@/shared/lib";
|
import { useAlertStore } from "@/shared/lib";
|
||||||
import useStore from "@/entities/reference-data/model/reference-data-store";
|
import { fetchAllPages } from "@/shared/lib/fetch-all-pages";
|
||||||
import LoadingOverlay from "@/components/ui/loading-bar";
|
import useStore from "@/store/useStore";
|
||||||
import MapPopupDataTable from "@/features/window-popup/ui/map-popup-data-table";
|
import LoadingOverlay from "@/components/ui/LoadingBar";
|
||||||
import PopupSearchPanel from "@/features/window-popup/ui/popup-search-panel";
|
import MapPopupDataTable from "@/features/windowPopup/ui/MapPopupDataTable";
|
||||||
import { FLDNG_HSTRY_LAYER_TYPE, FLDNG_HSTRY_DEFAULT_FILTERS, FLDNG_HSTRY_LIST_HEADLIST, FLDNG_HSTRY_PAGE_SIZE, FLDNG_HSTRY_ROW_SELECT_MESSAGE, type FldngHstryApiItem, type FldngHstryFilters, type FldngHstryTableRow } from "@/entities/flood-history/model/flood-history-types";
|
import PopupSearchPanel from "@/features/windowPopup/ui/PopupSearchPanel";
|
||||||
import { attachFldngHstryGeometry, buildFldngHstryListQueryString, buildFldngHstryYearOptions, normalizeFldngHstryFilters, toFldngHstryTableRows } from "@/entities/flood-history/lib/flood-history-utils";
|
import {
|
||||||
|
FLDNG_HSTRY_LAYER_TYPE,
|
||||||
|
FLDNG_HSTRY_DEFAULT_FILTERS,
|
||||||
|
FLDNG_HSTRY_DOWNLOAD_BATCH_SIZE,
|
||||||
|
FLDNG_HSTRY_DOWNLOAD_HEADERS,
|
||||||
|
FLDNG_HSTRY_LIST_HEADLIST,
|
||||||
|
FLDNG_HSTRY_PAGE_SIZE,
|
||||||
|
FLDNG_HSTRY_ROW_SELECT_MESSAGE,
|
||||||
|
type FldngHstryApiItem,
|
||||||
|
type FldngHstryFilters,
|
||||||
|
type FldngHstryTableRow,
|
||||||
|
} from "./fldngHstryTypes";
|
||||||
|
import {
|
||||||
|
attachFldngHstryGeometry,
|
||||||
|
buildFldngHstryListQueryString,
|
||||||
|
buildFldngHstryYearOptions,
|
||||||
|
normalizeFldngHstryFilters,
|
||||||
|
toFldngHstryTableRows,
|
||||||
|
} from "./fldngHstryUtils";
|
||||||
|
|
||||||
const unwrapPayload = <T,>(response: any): T =>
|
const unwrapPayload = <T,>(response: any): T =>
|
||||||
(response?.data ?? response) as T;
|
(response?.data ?? response) as T;
|
||||||
@@ -40,6 +58,26 @@ const resolveFldngHstryMapFeatureFid = (row: FldngHstryTableRow) => {
|
|||||||
return "";
|
return "";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const buildDownloadRows = (rows: FldngHstryTableRow[]) =>
|
||||||
|
rows.map((row) => ({
|
||||||
|
rowNo: row.rowNo,
|
||||||
|
floodYearDisplay: row.floodYearDisplay,
|
||||||
|
ctpvNm: row.ctpvNm,
|
||||||
|
sggNm: row.sggNm,
|
||||||
|
disasterName: row.disasterName,
|
||||||
|
rainBgngTmDisplay: row.rainBgngTmDisplay,
|
||||||
|
rainEndTmDisplay: row.rainEndTmDisplay,
|
||||||
|
rainTotDisplay: row.rainTotDisplay,
|
||||||
|
rainStrDisplay: row.rainStrDisplay,
|
||||||
|
floodHourDisplay: row.floodHourDisplay,
|
||||||
|
districtName: row.districtName,
|
||||||
|
causeDetailCode: row.causeDetailCode,
|
||||||
|
causeDetailName: row.causeDetailName,
|
||||||
|
avgFloodDepthDisplay: row.avgFloodDepthDisplay,
|
||||||
|
floodAreaDisplay: row.floodAreaDisplay,
|
||||||
|
exmnYearDisplay: row.exmnYearDisplay,
|
||||||
|
damageAmountDisplay: row.damageAmountDisplay,
|
||||||
|
}));
|
||||||
|
|
||||||
const resolveRegionNames = (
|
const resolveRegionNames = (
|
||||||
row: FldngHstryTableRow,
|
row: FldngHstryTableRow,
|
||||||
@@ -227,13 +265,19 @@ export default function FldngHstryPopupPage() {
|
|||||||
|
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
try {
|
try {
|
||||||
const params = new URLSearchParams(buildFldngHstryListQueryString(appliedFilters, 1, FLDNG_HSTRY_PAGE_SIZE));
|
const response = await fetchAllPages({
|
||||||
params.delete("page"); params.delete("size");
|
batchSize: FLDNG_HSTRY_DOWNLOAD_BATCH_SIZE,
|
||||||
await requestGridExcel("v1/spatialGridExports/floodHistories", {
|
fetchPage: (page, size) => fetchRows(page + 1, appliedFilters, size),
|
||||||
history: Object.fromEntries(params),
|
getItems: (page) => page.rows,
|
||||||
ctpvNames: Object.fromEntries(ctpv.map((item) => [String(item.val).trim(), item.text])),
|
getTotal: (page) => page.total,
|
||||||
sggNames: Object.fromEntries(sgg.map((item) => [String(item.val).trim(), item.text])),
|
});
|
||||||
}, `침수발생이력_${new Date().toISOString().slice(0, 10)}.xlsx`);
|
await downloadExcelWithKoreanHeaders({
|
||||||
|
data: buildDownloadRows(response.items) as unknown as JSON[],
|
||||||
|
fileName: `침수발생이력_${new Date().toISOString().slice(0, 10)}.xlsx`,
|
||||||
|
sheetNameArray: ["침수발생이력"],
|
||||||
|
headerRange: "A1:Q1",
|
||||||
|
headerMapping: FLDNG_HSTRY_DOWNLOAD_HEADERS,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("침수발생이력 다운로드 중 오류:", error);
|
console.error("침수발생이력 다운로드 중 오류:", error);
|
||||||
alert(
|
alert(
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
/** 침수흔적 강우분석과 연결된 심선·위선 목록 조회를 담당한다. */
|
/** 침수흔적 강우분석과 연결된 심선·위선 목록 조회를 담당한다. */
|
||||||
|
|
||||||
import { getData } from "@/shared/api/sewerage-api";
|
import { getData } from "@/components/lib/api";
|
||||||
|
|
||||||
import type { FldngHstryDetailCacheValue } from "@/entities/flood-history/model/flood-history-types";
|
import type { FldngHstryDetailCacheValue } from "./fldngHstryTypes";
|
||||||
|
|
||||||
const normalizeFldngHstryRainAnalysisPayload = (data: any) => {
|
const normalizeFldngHstryRainAnalysisPayload = (data: any) => {
|
||||||
if (!data || typeof data !== "object") return {};
|
if (!data || typeof data !== "object") return {};
|
||||||
+1
-1
@@ -17,7 +17,7 @@ import {
|
|||||||
type FldngHstryItem,
|
type FldngHstryItem,
|
||||||
type FldngHstryTableRow,
|
type FldngHstryTableRow,
|
||||||
type FldngHstryYearRange,
|
type FldngHstryYearRange,
|
||||||
} from "@/entities/flood-history/model/flood-history-types";
|
} from "./fldngHstryTypes";
|
||||||
|
|
||||||
export const normalizeFldngHstryWtlvDisplayId = (value: unknown) => {
|
export const normalizeFldngHstryWtlvDisplayId = (value: unknown) => {
|
||||||
const normalized = String(value ?? "").trim();
|
const normalized = String(value ?? "").trim();
|
||||||
+7
-7
@@ -7,12 +7,12 @@
|
|||||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||||
import { Button } from "@common/components";
|
import { Button } from "@common/components";
|
||||||
import { StandardPopupLayout } from "@common/business_components";
|
import { StandardPopupLayout } from "@common/business_components";
|
||||||
import { getData } from "@/shared/api/sewerage-api";
|
import { getData } from "@/components/lib/api";
|
||||||
import LoadingOverlay from "@/components/ui/loading-bar";
|
import LoadingOverlay from "@/components/ui/LoadingBar";
|
||||||
import { WINDOW_POPUP_MESSAGE_TYPE } from "@/features/window-popup/model/types";
|
import { WINDOW_POPUP_MESSAGE_TYPE } from "@/features/windowPopup/model/types";
|
||||||
import MapPopupDataTable from "@/features/window-popup/ui/map-popup-data-table";
|
import MapPopupDataTable from "@/features/windowPopup/ui/MapPopupDataTable";
|
||||||
import PopupSearchPanel from "@/features/window-popup/ui/popup-search-panel";
|
import PopupSearchPanel from "@/features/windowPopup/ui/PopupSearchPanel";
|
||||||
import useStore from "@/entities/reference-data/model/reference-data-store";
|
import useStore from "@/store/useStore";
|
||||||
import {
|
import {
|
||||||
FLOOD_DNGR_MAP_DEFAULT_FILTERS,
|
FLOOD_DNGR_MAP_DEFAULT_FILTERS,
|
||||||
FLOOD_DNGR_MAP_DEPTH_OPTIONS,
|
FLOOD_DNGR_MAP_DEPTH_OPTIONS,
|
||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
type FloodDngrMapExtent,
|
type FloodDngrMapExtent,
|
||||||
type FloodDngrMapFilters,
|
type FloodDngrMapFilters,
|
||||||
type FloodDngrMapTableRow,
|
type FloodDngrMapTableRow,
|
||||||
} from "./flood-dngr-map-types";
|
} from "./floodDngrMapTypes";
|
||||||
|
|
||||||
const FLOOD_DNGR_MAP_REQUEST_TIMEOUT_MS = 10_000;
|
const FLOOD_DNGR_MAP_REQUEST_TIMEOUT_MS = 10_000;
|
||||||
const FLOOD_DNGR_MAP_LOADING_WATCHDOG_MS = 12_000;
|
const FLOOD_DNGR_MAP_LOADING_WATCHDOG_MS = 12_000;
|
||||||
+1
-1
@@ -159,7 +159,7 @@ export const toFloodDngrMapTableRows = (
|
|||||||
): FloodDngrMapTableRow[] =>
|
): FloodDngrMapTableRow[] =>
|
||||||
items.map((item, index) => ({
|
items.map((item, index) => ({
|
||||||
...item,
|
...item,
|
||||||
rowNo: page * pageSize + index + 1,
|
rowNo: total - page * pageSize - index,
|
||||||
ctpvNm: resolveAdministrativeName(item.ctpvCd, ctpvOptions, 2),
|
ctpvNm: resolveAdministrativeName(item.ctpvCd, ctpvOptions, 2),
|
||||||
sggNm: resolveAdministrativeName(item.sggCd, sggOptions, 5),
|
sggNm: resolveAdministrativeName(item.sggCd, sggOptions, 5),
|
||||||
sbmrgDpthlDisplay: toDepthRangeDisplay(
|
sbmrgDpthlDisplay: toDepthRangeDisplay(
|
||||||
+22
-61
@@ -4,19 +4,15 @@
|
|||||||
*/
|
*/
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect, useMemo, useState, useRef } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { useFacilityCodeCatalog } from "@/entities/facility/lib/use-facility-code-catalog";
|
|
||||||
|
|
||||||
import { Button } from "@common/components/ui";
|
import { Button } from "@common/components/ui";
|
||||||
|
|
||||||
import { getData } from "@/shared/api/sewerage-api";
|
import { getData } from "@/components/lib/api";
|
||||||
import { VerticalTable } from "@/components/ui/vertical-table";
|
import { VerticalTable } from "@/components/ui/verticalTable";
|
||||||
|
|
||||||
import type { GisEditChange, GisEditPipeBasicInfo } from "./gis-edit-types";
|
import type { GisEditChange, GisEditPipeBasicInfo } from "./gisEditTypes";
|
||||||
import {
|
import { MS_SWAGE_PPL_CODES, MS_SWAGE_PPL_USE_CODES } from "../common/table";
|
||||||
MS_SWAGE_PPL_CODES,
|
|
||||||
MS_SWAGE_PPL_USE_CODES,
|
|
||||||
} from "@/entities/facility/model/facility-code-fallbacks";
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
change: GisEditChange;
|
change: GisEditChange;
|
||||||
@@ -210,25 +206,20 @@ const normalizeBasicFormValues = (values: Record<string, any>) => {
|
|||||||
return nextValues;
|
return nextValues;
|
||||||
};
|
};
|
||||||
|
|
||||||
const buildBaseFeatureValues = (
|
const buildBaseFeatureValues = (featureData: any) => {
|
||||||
featureData: any,
|
|
||||||
catalog?: ReturnType<typeof useFacilityCodeCatalog>,
|
|
||||||
) => {
|
|
||||||
const resolveUsageCode = (value: unknown) => {
|
const resolveUsageCode = (value: unknown) => {
|
||||||
const raw = String(value ?? "").trim();
|
const raw = String(value ?? "").trim();
|
||||||
const matched = [
|
const matched = MS_SWAGE_PPL_USE_CODES.find(
|
||||||
...(catalog?.MS_SWAGE_PPL_USE_CODES ?? []),
|
(item) => item.val === raw || item.text === raw,
|
||||||
...MS_SWAGE_PPL_USE_CODES,
|
);
|
||||||
].find((item) => item.val === raw || item.text === raw);
|
|
||||||
return matched?.val.trim() ?? raw;
|
return matched?.val.trim() ?? raw;
|
||||||
};
|
};
|
||||||
|
|
||||||
const resolveMaterialCode = (value: unknown) => {
|
const resolveMaterialCode = (value: unknown) => {
|
||||||
const raw = String(value ?? "").trim();
|
const raw = String(value ?? "").trim();
|
||||||
const matched = [
|
const matched = MS_SWAGE_PPL_CODES.find(
|
||||||
...(catalog?.MS_SWAGE_PPL_CODES ?? []),
|
(item) => item.val === raw || item.text === raw,
|
||||||
...MS_SWAGE_PPL_CODES,
|
);
|
||||||
].find((item) => item.val === raw || item.text === raw);
|
|
||||||
return matched?.val.trim() ?? raw;
|
return matched?.val.trim() ?? raw;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -252,12 +243,13 @@ const buildBaseFeatureValues = (
|
|||||||
}, {});
|
}, {});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPipeUsageLabel = (value: unknown, codes = MS_SWAGE_PPL_USE_CODES) => {
|
const getPipeUsageLabel = (value: unknown) => {
|
||||||
const raw = String(value ?? "").trim();
|
const raw = String(value ?? "").trim();
|
||||||
if (!raw) return "";
|
if (!raw) return "";
|
||||||
return (
|
return (
|
||||||
codes.find((item) => item.val.trim() === raw || item.text === raw)?.text ??
|
MS_SWAGE_PPL_USE_CODES.find(
|
||||||
raw
|
(item) => item.val.trim() === raw || item.text === raw,
|
||||||
|
)?.text ?? raw
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -277,17 +269,10 @@ export default function GisEditPipeSessionPopup({
|
|||||||
onClose,
|
onClose,
|
||||||
onSave,
|
onSave,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const catalog = useFacilityCodeCatalog();
|
|
||||||
// CMS 명칭 갱신은 입력 중인 초안을 초기화할 이유가 아니다.
|
|
||||||
const initializedSource = useRef<{
|
|
||||||
featureData: any;
|
|
||||||
changeId: string;
|
|
||||||
isNewPipe: boolean;
|
|
||||||
} | null>(null);
|
|
||||||
const isNewPipe = change.editType === "ADD";
|
const isNewPipe = change.editType === "ADD";
|
||||||
const baseFeatureValues = useMemo(
|
const baseFeatureValues = useMemo(
|
||||||
() => buildBaseFeatureValues(featureData, catalog),
|
() => buildBaseFeatureValues(featureData),
|
||||||
[featureData, catalog],
|
[featureData],
|
||||||
);
|
);
|
||||||
const [basicInfoTableData, setBasicInfoTableData] = useState<
|
const [basicInfoTableData, setBasicInfoTableData] = useState<
|
||||||
Record<string, any>
|
Record<string, any>
|
||||||
@@ -337,36 +322,12 @@ export default function GisEditPipeSessionPopup({
|
|||||||
PIPE_BASIC_INFO_FIELDS.map((field) =>
|
PIPE_BASIC_INFO_FIELDS.map((field) =>
|
||||||
field.id === "mngInstCd"
|
field.id === "mngInstCd"
|
||||||
? { ...field, options: mngInstSelectOptions }
|
? { ...field, options: mngInstSelectOptions }
|
||||||
: field.id === "usgCd" || field.id === "mqltCd"
|
: field,
|
||||||
? {
|
|
||||||
...field,
|
|
||||||
options: [
|
|
||||||
EMPTY_SELECT_OPTION,
|
|
||||||
...(field.id === "usgCd"
|
|
||||||
? catalog.MS_SWAGE_PPL_USE_CODES
|
|
||||||
: catalog.MS_SWAGE_PPL_CODES
|
|
||||||
).map((item) => ({ value: item.val, label: item.text })),
|
|
||||||
],
|
|
||||||
}
|
|
||||||
: field,
|
|
||||||
),
|
),
|
||||||
[mngInstSelectOptions, catalog],
|
[mngInstSelectOptions],
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const previous = initializedSource.current;
|
|
||||||
if (
|
|
||||||
previous &&
|
|
||||||
previous.featureData === featureData &&
|
|
||||||
previous.changeId === change.changeId &&
|
|
||||||
previous.isNewPipe === isNewPipe
|
|
||||||
)
|
|
||||||
return;
|
|
||||||
initializedSource.current = {
|
|
||||||
featureData,
|
|
||||||
changeId: change.changeId,
|
|
||||||
isNewPipe,
|
|
||||||
};
|
|
||||||
const initialBasicValues: Record<string, any> = {
|
const initialBasicValues: Record<string, any> = {
|
||||||
...baseFeatureValues,
|
...baseFeatureValues,
|
||||||
...normalizeBasicFormValues(change.basicInfo ?? {}),
|
...normalizeBasicFormValues(change.basicInfo ?? {}),
|
||||||
@@ -374,7 +335,7 @@ export default function GisEditPipeSessionPopup({
|
|||||||
|
|
||||||
setBasicInfoTableData(initialBasicValues);
|
setBasicInfoTableData(initialBasicValues);
|
||||||
setInputInfoTableData(buildInitialInputDraft(change));
|
setInputInfoTableData(buildInitialInputDraft(change));
|
||||||
}, [baseFeatureValues, featureData, change.changeId, isNewPipe]);
|
}, [baseFeatureValues, change.changeId, isNewPipe]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isNewPipe) return;
|
if (isNewPipe) return;
|
||||||
@@ -468,7 +429,7 @@ export default function GisEditPipeSessionPopup({
|
|||||||
<h3 className="whitespace-nowrap text-2xl font-medium text-primary-foreground">
|
<h3 className="whitespace-nowrap text-2xl font-medium text-primary-foreground">
|
||||||
하수관로
|
하수관로
|
||||||
{basicInfoTableData?.usgCd
|
{basicInfoTableData?.usgCd
|
||||||
? `(${getPipeUsageLabel(basicInfoTableData.usgCd, catalog.MS_SWAGE_PPL_USE_CODES)})`
|
? `(${getPipeUsageLabel(basicInfoTableData.usgCd)})`
|
||||||
: ""}{" "}
|
: ""}{" "}
|
||||||
정보 <br />
|
정보 <br />
|
||||||
관리번호 : {displayManagementNo || "신규"}
|
관리번호 : {displayManagementNo || "신규"}
|
||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
import { Button } from "@common/components";
|
import { Button } from "@common/components";
|
||||||
|
|
||||||
import type { GisEditSessionSnapshot, GisEditTool } from "./gis-edit-types";
|
import type { GisEditSessionSnapshot, GisEditTool } from "./gisEditTypes";
|
||||||
import { useGisEditOperationLabels } from "./use-gis-edit-common-codes";
|
import { useGisEditOperationLabels } from "./useGisEditCommonCodes";
|
||||||
|
|
||||||
type Props = GisEditSessionSnapshot & {
|
type Props = GisEditSessionSnapshot & {
|
||||||
onRemoveFocusedChange: () => void;
|
onRemoveFocusedChange: () => void;
|
||||||
+2
-2
@@ -7,8 +7,8 @@
|
|||||||
import { Check, Move, PenTool, Plus, Trash2, X } from "lucide-react";
|
import { Check, Move, PenTool, Plus, Trash2, X } from "lucide-react";
|
||||||
import { Button } from "@common/components/ui";
|
import { Button } from "@common/components/ui";
|
||||||
|
|
||||||
import type { GisEditTool } from "./gis-edit-types";
|
import type { GisEditTool } from "./gisEditTypes";
|
||||||
import { useGisEditOperationLabels } from "./use-gis-edit-common-codes";
|
import { useGisEditOperationLabels } from "./useGisEditCommonCodes";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
isEditMode: boolean;
|
isEditMode: boolean;
|
||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
/** GIS 편집 모델은 기능이 소유하고 기존 화면 import 경로는 유지한다. */
|
/** GIS 편집 모델은 기능이 소유하고 기존 화면 import 경로는 유지한다. */
|
||||||
export * from "@/features/gis-edit/model/types";
|
export * from "@/features/gisEdit/model/types";
|
||||||
+3
-3
@@ -22,15 +22,15 @@ import {
|
|||||||
getFeatureProperties,
|
getFeatureProperties,
|
||||||
normalizePipeGeometry,
|
normalizePipeGeometry,
|
||||||
createChangeId,
|
createChangeId,
|
||||||
} from "@/features/gis-edit";
|
} from "@/features/gisEdit";
|
||||||
export { EMPTY_GIS_EDIT_PIPE_BASIC_INFO } from "@/features/gis-edit";
|
export { EMPTY_GIS_EDIT_PIPE_BASIC_INFO } from "@/features/gisEdit";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
GisEditChange,
|
GisEditChange,
|
||||||
GisEditPipeBasicInfo,
|
GisEditPipeBasicInfo,
|
||||||
GisEditSavePayload,
|
GisEditSavePayload,
|
||||||
GisEditTool,
|
GisEditTool,
|
||||||
} from "./gis-edit-types";
|
} from "./gisEditTypes";
|
||||||
|
|
||||||
export const useGisEdit = (treeData: any[]) => {
|
export const useGisEdit = (treeData: any[]) => {
|
||||||
const editableLayers = useMemo(() => collectEditableLayers(treeData), [treeData]);
|
const editableLayers = useMemo(() => collectEditableLayers(treeData), [treeData]);
|
||||||
+2
-2
@@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
import { getCommonCodes } from "@/entities/code/api/common-code-api";
|
import { getCommonCodes } from "@/components/lib/common/apiHelpers";
|
||||||
|
|
||||||
import type { GisEditTool } from "./gis-edit-types";
|
import type { GisEditTool } from "./gisEditTypes";
|
||||||
|
|
||||||
const GIS_EDIT_OPERATION_UP_CD = "GISEDITOPRT";
|
const GIS_EDIT_OPERATION_UP_CD = "GISEDITOPRT";
|
||||||
|
|
||||||
+18
-14
@@ -12,22 +12,26 @@ import {
|
|||||||
} from "@common/business_components";
|
} from "@common/business_components";
|
||||||
import { Button, Input } from "@common/components";
|
import { Button, Input } from "@common/components";
|
||||||
|
|
||||||
import { getBlobDataWithHeaders, postMutiPart } from "@/shared/api/file-api";
|
import {
|
||||||
import { getData, postRawJson } from "@/shared/api/sewerage-api";
|
getBlobDataWithHeaders,
|
||||||
import LoadingOverlay from "@/components/ui/loading-bar";
|
getData,
|
||||||
import { windowPopupDefinitions } from "@/features/window-popup/model/popup-definitions";
|
postMutiPart,
|
||||||
import MapPopupDataTable from "@/features/window-popup/ui/map-popup-data-table";
|
postRawJson,
|
||||||
|
} from "@/components/lib/api";
|
||||||
|
import LoadingOverlay from "@/components/ui/LoadingBar";
|
||||||
|
import { windowPopupDefinitions } from "@/features/windowPopup/model/popupDefinitions";
|
||||||
|
import MapPopupDataTable from "@/features/windowPopup/ui/MapPopupDataTable";
|
||||||
import { useAlertStore } from "@/shared/lib";
|
import { useAlertStore } from "@/shared/lib";
|
||||||
import { useUserStore } from "@/shared/lib/use-user-store";
|
import { useUserStore } from "@/shared/lib/use-user-store";
|
||||||
import GisUploadPreviewMap from "./gis-upload-preview-map";
|
import GisUploadPreviewMap from "./GisUploadPreviewMap";
|
||||||
import PopupSearchPanel from "@/features/window-popup/ui/popup-search-panel";
|
import PopupSearchPanel from "@/features/windowPopup/ui/PopupSearchPanel";
|
||||||
import { useGisManagementCommonCodes } from "./use-gis-management-common-codes";
|
import { useGisManagementCommonCodes } from "./useGisManagementCommonCodes";
|
||||||
import type { UploadFacilityType, MngInstOption, UploadHistoryItem, GisUploadResponse, ValidationErrorItem, ViewMode } from "@/features/gis-management/model/upload-types";
|
import type { UploadFacilityType, MngInstOption, UploadHistoryItem, GisUploadResponse, ValidationErrorItem, ViewMode } from "@/features/gisManagement/model/upload-types";
|
||||||
import { getLocalizedValidationErrorMessage, getFileExtension, formatDateTime, toScopeKey, buildManagementLabel, getErrorMessage } from "@/features/gis-management/lib/upload-display";
|
import { getLocalizedValidationErrorMessage, getFileExtension, formatDateTime, toScopeKey, buildManagementLabel, getErrorMessage } from "@/features/gisManagement/lib/upload-display";
|
||||||
import { createGisDownloadClient, saveBlob } from "@/features/gis-management/api/gis-download";
|
import { createGisDownloadClient, saveBlob } from "@/features/gisManagement/api/gis-download";
|
||||||
import { postRefreshMessageToOpener } from "@/features/gis-management/lib/popup-refresh";
|
import { postRefreshMessageToOpener } from "@/features/gisManagement/lib/popup-refresh";
|
||||||
|
|
||||||
import { createGisUploadRetryGuard, getGisPartialSuccessNotice } from "@/features/gis-management";
|
import { createGisUploadRetryGuard, getGisPartialSuccessNotice } from "@/features/gisManagement";
|
||||||
|
|
||||||
// 기존 전송 경로를 유지하며 다운로드 작업의 비동기 처리는 기능 모듈에 위임한다.
|
// 기존 전송 경로를 유지하며 다운로드 작업의 비동기 처리는 기능 모듈에 위임한다.
|
||||||
const { downloadGeoPackage, startDownloadJob, waitForDownloadJob } =
|
const { downloadGeoPackage, startDownloadJob, waitForDownloadJob } =
|
||||||
@@ -53,7 +57,7 @@ const GIS_UPLOAD_HISTORY_HEADLIST: UiHeadProps[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
/** 오류 원본 행번호와 공통 표의 오름차순 표시 순번을 별도 열로 표시한다. */
|
/** 오류 원본 행번호와 공통 표의 역순 순번을 별도 열로 표시한다. */
|
||||||
const GIS_VALIDATION_ERROR_HEADLIST: UiHeadProps[] = [
|
const GIS_VALIDATION_ERROR_HEADLIST: UiHeadProps[] = [
|
||||||
{ id: "no", title: "순번", widthPercent: 8 },
|
{ id: "no", title: "순번", widthPercent: 8 },
|
||||||
{ id: "sourceRowNo", title: "행번호", widthPercent: 10 },
|
{ id: "sourceRowNo", title: "행번호", widthPercent: 10 },
|
||||||
+1
-1
@@ -20,7 +20,7 @@ import { get as getProjection } from "ol/proj";
|
|||||||
import { register } from "ol/proj/proj4";
|
import { register } from "ol/proj/proj4";
|
||||||
import proj4 from "proj4";
|
import proj4 from "proj4";
|
||||||
|
|
||||||
import { getRawJson } from "@/shared/api/sewerage-api";
|
import { getRawJson } from "@/components/lib/api";
|
||||||
|
|
||||||
type GisUploadPreviewMapProps = {
|
type GisUploadPreviewMapProps = {
|
||||||
uploadId: string;
|
uploadId: string;
|
||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
import { getCommonCodes } from "@/entities/code/api/common-code-api";
|
import { getCommonCodes } from "@/components/lib/common/apiHelpers";
|
||||||
|
|
||||||
type CodeLabelMap = Record<string, string>;
|
type CodeLabelMap = Record<string, string>;
|
||||||
|
|
||||||
+35
-16
@@ -11,25 +11,26 @@ import {
|
|||||||
type UiHeadProps,
|
type UiHeadProps,
|
||||||
type UiTableSort,
|
type UiTableSort,
|
||||||
} from "@common/business_components";
|
} from "@common/business_components";
|
||||||
import { downloadAnalysisExcel } from "@/shared/lib/download-analysis-excel";
|
import { downloadExcelWithKoreanHeaders } from "@/shared/lib/download-excel";
|
||||||
|
import { fetchAllPages } from "@/shared/lib/fetch-all-pages";
|
||||||
import { useAlertStore } from "@/shared/lib";
|
import { useAlertStore } from "@/shared/lib";
|
||||||
import { Button } from "@common/components";
|
import { Button } from "@common/components";
|
||||||
|
|
||||||
import { getData } from "@/shared/api/sewerage-api";
|
import { getData } from "@/components/lib/api";
|
||||||
import { appendApiSearchParams } from "@/shared/util/util";
|
import { appendApiSearchParams } from "@/shared/util/util";
|
||||||
import { CtpvSggPrcsFcltSelectBox } from "@/components/ui/ctpv-sgg-prcs-fclt-select-box";
|
import { CtpvSggPrcsFcltSelectBox } from "@/components/ui/ctpvSggPrcsFcltSelectBox";
|
||||||
import { formatDisplayData } from "@/components/lib/utils/format-display-value";
|
import { formatDisplayData } from "@/components/lib/utils/formatDisplayValue";
|
||||||
import useStore from "@/entities/reference-data/model/reference-data-store";
|
import useStore from "@/store/useStore";
|
||||||
import { windowPopupDefinitions } from "@/features/window-popup/model/popup-definitions";
|
import { windowPopupDefinitions } from "@/features/windowPopup/model/popupDefinitions";
|
||||||
import MapPopupDataTable from "@/features/window-popup/ui/map-popup-data-table";
|
import MapPopupDataTable from "@/features/windowPopup/ui/MapPopupDataTable";
|
||||||
import PopupSearchPanel from "@/features/window-popup/ui/popup-search-panel";
|
import PopupSearchPanel from "@/features/windowPopup/ui/PopupSearchPanel";
|
||||||
import LoadingOverlay from "@/components/ui/loading-bar";
|
import LoadingOverlay from "@/components/ui/LoadingBar";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
INFTWT_RESULT_ROW_SELECT_MESSAGE,
|
INFTWT_RESULT_ROW_SELECT_MESSAGE,
|
||||||
INFTWT_RESULT_ROW_SELECT_STORAGE_KEY,
|
INFTWT_RESULT_ROW_SELECT_STORAGE_KEY,
|
||||||
type InftwtResultRow,
|
type InftwtResultRow,
|
||||||
} from "./inftwt-result-types";
|
} from "./inftwtResultTypes";
|
||||||
|
|
||||||
const INFTWT_RESULT_PAGE_SIZE = 10;
|
const INFTWT_RESULT_PAGE_SIZE = 10;
|
||||||
|
|
||||||
@@ -77,8 +78,6 @@ const DEFAULT_FILTERS: InftwtResultFilters = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const postRowSelectMessage = (row: InftwtResultRow) => {
|
const postRowSelectMessage = (row: InftwtResultRow) => {
|
||||||
// 같은 클릭의 message/storage 전달을 식별한다.
|
|
||||||
const requestId = `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
||||||
if (typeof window !== "undefined") {
|
if (typeof window !== "undefined") {
|
||||||
try {
|
try {
|
||||||
window.localStorage.setItem(
|
window.localStorage.setItem(
|
||||||
@@ -86,7 +85,6 @@ const postRowSelectMessage = (row: InftwtResultRow) => {
|
|||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
row,
|
row,
|
||||||
timestamp: Date.now(),
|
timestamp: Date.now(),
|
||||||
requestId,
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -99,7 +97,6 @@ const postRowSelectMessage = (row: InftwtResultRow) => {
|
|||||||
{
|
{
|
||||||
type: INFTWT_RESULT_ROW_SELECT_MESSAGE,
|
type: INFTWT_RESULT_ROW_SELECT_MESSAGE,
|
||||||
row,
|
row,
|
||||||
requestId,
|
|
||||||
},
|
},
|
||||||
window.location.origin,
|
window.location.origin,
|
||||||
);
|
);
|
||||||
@@ -163,7 +160,7 @@ export default function InftwtResultPopupPage() {
|
|||||||
return {
|
return {
|
||||||
...(formattedItem as Record<string, unknown>),
|
...(formattedItem as Record<string, unknown>),
|
||||||
rowNumber: Math.max(
|
rowNumber: Math.max(
|
||||||
(page - 1) * INFTWT_RESULT_PAGE_SIZE + index + 1,
|
totalElements - ((page - 1) * INFTWT_RESULT_PAGE_SIZE + index),
|
||||||
0,
|
0,
|
||||||
),
|
),
|
||||||
ctpvNm: ctpvOption ? ctpvOption.text : String(item?.ctpvCd ?? "-"),
|
ctpvNm: ctpvOption ? ctpvOption.text : String(item?.ctpvCd ?? "-"),
|
||||||
@@ -244,7 +241,29 @@ export default function InftwtResultPopupPage() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
await downloadAnalysisExcel("inftwt", selectedRow.inftwtAnlsSn, `침입수분석결과_${selectedRow.swtrmtFcltNm}_${selectedRow.aplcnYm}_${selectedRow.inftwtAnlsSn}`);
|
const response = await fetchAllPages<any, Record<string, unknown>>({
|
||||||
|
fetchPage: (page, size) =>
|
||||||
|
getData(
|
||||||
|
`v1/inftwtAnlsRslt/ppl/${selectedRow.inftwtAnlsSn}?page=${page}&size=${size}`,
|
||||||
|
),
|
||||||
|
getItems: (page) =>
|
||||||
|
Array.isArray(page?.content) ? page.content : [],
|
||||||
|
getTotal: (page) => Number(page?.totalElements ?? 0),
|
||||||
|
});
|
||||||
|
const excelRows = response.items;
|
||||||
|
|
||||||
|
await downloadExcelWithKoreanHeaders({
|
||||||
|
data: excelRows as unknown as JSON[],
|
||||||
|
fileName: `침입수분석결과_${selectedRow.swtrmtFcltNm}_${selectedRow.aplcnYm}_${selectedRow.inftwtAnlsSn}`,
|
||||||
|
sheetNameArray: ["침입수 분석결과"],
|
||||||
|
headerRange: "A1:D1",
|
||||||
|
headerMapping: {
|
||||||
|
inftwtAnlsSn: "침입수분석\n분석번호",
|
||||||
|
pplMngNo: "관로\n관리번호",
|
||||||
|
anlsTm: "분석시각",
|
||||||
|
predcOilq: "예측유량\n(m³/h)",
|
||||||
|
},
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("침입수 분석결과 다운로드 중 오류:", error);
|
console.error("침입수 분석결과 다운로드 중 오류:", error);
|
||||||
alert("침입수 분석결과 다운로드 중 오류가 발생했습니다.");
|
alert("침입수 분석결과 다운로드 중 오류가 발생했습니다.");
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user