-
+
}
>
diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/buseWaterQulity/buseWaterQulity.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/buseWaterQulity/buseWaterQulity.tsx
index fd9ed6126..dd43658d1 100644
--- a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/buseWaterQulity/buseWaterQulity.tsx
+++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/buseWaterQulity/buseWaterQulity.tsx
@@ -460,7 +460,7 @@ export function BuseWaterQulity({
/>
-
+
void;
readonly?: boolean;
isMap?: boolean;
-
}) {
- const { code, rswtBdstUpdate, rswtBdstReg } = useWrStore(
- (state) => state
- );
+ const { code, rswtBdstUpdate, rswtBdstReg } = useWrStore((state) => state);
// const [divStyle, setDivStyle] = useState("h-[53vh]");
useEffect(() => {
- if(isMap){
+ if (isMap) {
}
}, [isMap]);
// const defaultValues: z.infer
= rswtZod.parse({});
@@ -64,29 +61,27 @@ export default function RswtrRegForm({
"reuseBuilding.0.rswtrObj.filtrTrtmfctProcs",
]);
- const { t } = useTranslation('base');
+ const { t } = useTranslation("base");
const onSubmit = (values: z.infer) => {
if (isModal) {
const handleConfirm = async () => {
rswtBdstReg(values, "41");
if (setIsModal) setIsModal(false);
};
- confirmToast(t('isInsertMsg'), handleConfirm);
-
+ confirmToast(t("isInsertMsg"), handleConfirm);
} else {
const handleConfirm = async () => {
rswtBdstUpdate(values, "41");
};
- confirmToast(t('isUpdateMsg'), handleConfirm);
+ confirmToast(t("isUpdateMsg"), handleConfirm);
}
};
- const filtrTrtmfctCpct = form.watch('reuseBuilding.0.rswtrObj.filtrTrtmfctCpct')
const cleanRswtData = (raw: any): z.infer => {
const buildings =
- raw?.reuseBuilding && raw.reuseBuilding.length > 0
- ? raw.reuseBuilding
- : [{}];
+ raw?.reuseBuilding && raw.reuseBuilding.length > 0
+ ? raw.reuseBuilding
+ : [{}];
return {
...raw,
frstArchPrmsnDt: raw?.frstArchPrmsnDt
@@ -95,31 +90,26 @@ export default function RswtrRegForm({
archChgPrmsnDt: raw?.archChgPrmsnDt
? new Date(raw?.archChgPrmsnDt)
: null,
- reuseBuilding:buildings.map((item: any) => ({
+ reuseBuilding: buildings.map((item: any) => ({
...item,
instlCmptnDt: item?.instlCmptnDt
? new Date(item.instlCmptnDt)
: new Date(), // item?.instlCmptnDt가 유효하지 않으면 현재 날짜로 초기화
operMngCd: item?.operMngCd || "", // null → ""
- instlCstSprtYn: item?.instlCstSprtYn || 'N', // null → "Y"
- grntchBdstCertYn: item?.grntchBdstCertYn ||'N',
+ instlCstSprtYn: item?.instlCstSprtYn || "N", // null → "Y"
+ grntchBdstCertYn: item?.grntchBdstCertYn || "N",
bdstUsgCd: item?.bdstUsgCd ?? Number("-1"), // null → "-1"
rswtrObj: {
...item?.rswtrObj,
filtrTrtmfctYn: item?.rainyObj?.filtrTrtmfctYn || code.yn[0]?.val,
filtrTrtmfctCpct: item?.rswtrObj?.filtrTrtmfctCpct ?? null,
- filtrTrtmfctProcs: item?.rswtrObj?.filtrTrtmfctProcs || code.rswtPrscCdMthdCd[0]?.val,
+ filtrTrtmfctProcs:
+ item?.rswtrObj?.filtrTrtmfctProcs||'',
orgwtKndCd: item?.rswtrObj?.orgwtKndCd || code.orgwtKndCd[0]?.val,
},
})),
};
};
- // useEffect(() =>{
- // console.log(' formform ', form.watch())
- // },[form.formState])
- useEffect(() => {
- console.log(' filtrTrtmfctCpct ', filtrTrtmfctCpct)
- }, [filtrTrtmfctCpct])
useEffect(() => {
console.log("form errors:", form.formState.errors);
@@ -133,7 +123,6 @@ export default function RswtrRegForm({
form.setValue("reuseBuilding.0.instlCstSprtAmt", 0);
}
-
if (grntchBdstCertYn === "D") {
form.setValue("reuseBuilding.0.grntchBdstCertYr", "0000");
form.setValue("reuseBuilding.0.grntchBdstCertNo", "확인불가");
@@ -141,7 +130,6 @@ export default function RswtrRegForm({
} else if (instlCstSprtYn === "D") {
form.setValue("reuseBuilding.0.instlCstSprtAmt", -1);
}
-
}, [grntchBdstCertYn, instlCstSprtYn, filtrTrtmfctProcs, form]);
useEffect(() => {
@@ -149,8 +137,6 @@ export default function RswtrRegForm({
}, [rswtForm, form]);
-
-
return (
{/*
*/}
- {isModal && rswtForm != undefined ? : <>>}
- {isModal ? (
-
- 중수도 시설 정보{" "}
-
- ) : (
- <>>
- )}
- 기본정보
-
-
-
(
-
- field.onChange(date),
+ {isModal && rswtForm != undefined ? : <>>}
+ {isModal ? (
+
+ 중수도 시설 정보{" "}
+
+ ) : (
+ <>>
+ )}
+ 기본정보
+
+
+ (
+
+ field.onChange(date),
+ }}
+ selectClass={"w-full"}
+ readOnly={readonly}
+ />
+
+ )}
+ />
+
+
+ {
+ const value = field.value;
+ const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
+ return (
+
+ {
+ // 입력 시 자동으로 확인불가 해제
+ if (isUnknown && !readonly) {
+ field.onChange(""); // 초기화
+ }
+ }}
+ onChange={(e) => {
+ if (readonly) return;
+ handleMinusNumberChange(e, field.onChange);
}}
- selectClass={"w-full"}
readOnly={readonly}
+ maxLength={numSize}
/>
- )}
- />
-
-
- {
- const value = field.value;
- const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
- return (
-
-
+
+
+
+
중수도 시설 정보
+
+
+
+
+ {
+ const value = field.value;
+ const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
+
+ return (
+
+ {
+ // 입력 시 자동으로 확인불가 해제
+ if (isUnknown && !readonly) {
+ field.onChange(""); // 초기화
}
- onFocus={() => {
- // 입력 시 자동으로 확인불가 해제
- if (isUnknown && !readonly) {
- field.onChange(""); // 초기화
- }
- }}
- onChange={(e) => {
- if (readonly) return;
- handleMinusNumberChange(e, field.onChange);
- }}
- readOnly={readonly}
- maxLength={numSize}
- />
-
- );
- }}
- />
-
+ }}
+ onChange={(e) => {
+ if (readonly) return;
+ handleMinusNumberChange(e, field.onChange);
+ }}
+ readOnly={readonly}
+ maxLength={numSize}
+ />
+
+ );
+ }}
+ />
-
-
중수도 시설 정보
+
+ (
+
+ {} : field.onChange}
+ value={field.value ?? code.orgwtKndCd[0]?.val}
+ readOnly={readonly}
+ />
+
+ )}
+ />
+
+
+
설치비(원) 지원
+
+
+
+ (
+
+ {} : field.onChange}
+ value={field.value || code.bdstIncenYn[0]?.val}
+ readOnly={readonly}
+ />
+
+ )}
+ />
+
+
+ {
+ const value = field.value;
+ const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
+ return (
+
+ {
+ // 입력 시 자동으로 확인불가 해제
+ if (isUnknown && !readonly) {
+ field.onChange(""); // 초기화
}
- onFocus={() => {
- // 입력 시 자동으로 확인불가 해제
- if (isUnknown && !readonly) {
+ }}
+ onChange={(e) => {
+ if (readonly) return;
+ handleMinusNumberChange(e, field.onChange);
+ }}
+ disabled={
+ instlCstSprtYn === "N" || instlCstSprtYn === "D"
+ }
+ maxLength={numSize}
+ />
+
+ );
+ }}
+ />
+
+
- console.log('value')
- field.onChange(""); // 초기화
- }
- }}
- onChange={(e) => {
- if (readonly) return;
- handleMinusNumberChange(e, field.onChange);
- }}
- readOnly={readonly}
- maxLength={numSize}
- />
-
- );
- }}
- />
-
-
- (
-
- { } : field.onChange}
- value={field.value ?? code.orgwtKndCd[0]?.val}
- readOnly={readonly}
- />
-
- )}
- />
-
-
- (
-
- { } : field.onChange}
- value={field.value || code.rswtPrscCdMthdCd[0]?.val}
- readOnly={readonly}
- />
-
- )}
- />
-
+
+
녹색건축물 인증
+
+
+
+ (
+
+ {} : field.onChange}
+ value={field.value || code.yn[0]?.val}
+ readOnly={readonly}
+ />
+
+ )}
+ />
-
-
-
인센티브 정보
-
-
-
설치비(원) 지원
-
-
-
-
-
녹색건축물 인증
-
-
-
- (
-
- { } : field.onChange}
- value={field.value || code.yn[0]?.val}
- readOnly={readonly}
+ }}
+ value={isUnknown ? "확인불가" : (field.value ?? "")}
+ onChange={(e) => {
+ if (readonly) return;
+ if (e.target.value === "확인불가") {
+ field.onChange("0000");
+ } else {
+ field.onChange(e.target.value);
+ }
+ }}
+ disabled={
+ grntchBdstCertYn == "N" || grntchBdstCertYn == "D"
+ }
+ max={4}
/>
- )}
- />
-
-
- {
- const isUnknown = field.value === null || field.value === "0000"; // 또는 Number(value) === -1
- return (
-
- {
- // 입력 시 자동으로 확인불가 해제
- if (isUnknown && !readonly) {
- field.onChange(""); // 초기화
- }
- }}
- value={
- isUnknown ? '확인불가' : field.value ?? ""}
- onChange={(e) => {
- if (readonly) return
- if (e.target.value === '확인불가') {
- field.onChange('0000');
- } else {
- field.onChange(e.target.value);
- }
- }}
- disabled={grntchBdstCertYn == "N" || grntchBdstCertYn == "D"}
- max={4}
- />
-
- )
- }}
- />
-
-
- {
- const isUnknown = field.value === null || field.value === "0000"; // 또는 Number(value) === -1
- return (
-
- {
- // 입력 시 자동으로 확인불가 해제
- if (isUnknown && !readonly) {
- field.onChange(""); // 초기화
- }
- }}
- value={
- isUnknown ? '확인불가' : field.value ?? ""}
- onChange={(e) => {
- if (readonly) return
+ );
+ }}
+ />
+
+
+ {
+ const isUnknown =
+ field.value === null || field.value === "0000"; // 또는 Number(value) === -1
+ return (
+
+ {
+ // 입력 시 자동으로 확인불가 해제
+ if (isUnknown && !readonly) {
+ field.onChange(""); // 초기화
+ }
+ }}
+ value={isUnknown ? "확인불가" : (field.value ?? "")}
+ onChange={(e) => {
+ if (readonly) return;
- if (e.target.value === '확인불가') {
- field.onChange('');
- } else {
- field.onChange(e.target.value);
- }
- }}
- disabled={grntchBdstCertYn == "N" || grntchBdstCertYn == "D"}
- maxLength={txtSize}
- />
-
- )
- }}
- />
-
-
- (
-
- { } : field.onChange}
- value={field.value || code.bdstGrntchClass[0]?.val}
- readOnly={readonly}
+ if (e.target.value === "확인불가") {
+ field.onChange("");
+ } else {
+ field.onChange(e.target.value);
+ }
+ }}
+ disabled={
+ grntchBdstCertYn == "N" || grntchBdstCertYn == "D"
+ }
+ maxLength={txtSize}
/>
- )}
- />
-
+ );
+ }}
+ />
-
+
+ (
+
+ {} : field.onChange}
+ value={field.value || code.bdstGrntchClass[0]?.val}
+ readOnly={readonly}
+ />
+
+ )}
+ />
+
+
+
{/* */}
diff --git a/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx b/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx
index 80bb8d7ec..96ecadcc9 100644
--- a/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx
+++ b/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx
@@ -191,8 +191,7 @@ export function RainFacility({
"1000000",
String(con),
seartchTxt ?? "",
- code.cityCd,
- code.sggCd
+ code as unknown as Record
);
}
}}
@@ -249,8 +248,7 @@ export function RainFacility({
String(rainMapSize),
String(con),
seartchTxt ?? "",
- code.cityCd,
- code.sggCd
+ code as unknown as Record
);
setIsReset(false);
diff --git a/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx b/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx
index becd76872..5c3c238d6 100644
--- a/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx
+++ b/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx
@@ -187,8 +187,7 @@ export function RswtFacility({
"1000000",
String(con),
seartchTxt ?? "",
- code.cityCd,
- code.sggCd
+ code as unknown as Record
);
}
}}
@@ -236,8 +235,7 @@ export function RswtFacility({
String(rainMapSize),
String(con),
seartchTxt ?? "",
- code.cityCd,
- code.sggCd
+ code as unknown as Record
);
setIsReset(false);
diff --git a/apps/wr/components/ui/map/LayerPopUp/RuseFacilty/RuseFacility.tsx b/apps/wr/components/ui/map/LayerPopUp/RuseFacilty/RuseFacility.tsx
index 2c7a5295c..231667898 100644
--- a/apps/wr/components/ui/map/LayerPopUp/RuseFacilty/RuseFacility.tsx
+++ b/apps/wr/components/ui/map/LayerPopUp/RuseFacilty/RuseFacility.tsx
@@ -18,16 +18,17 @@ import toast from "react-hot-toast";
import { useTranslation } from "react-i18next";
export function RuseFacility({
- rtnFeature,
- }: {
- rtnFeature: (feature: any) => void;
- }) {
- const { code, ruseMap, ruseMapInit, getMapFlcts,ruseMapSearch } = useWrStore(
+ rtnFeature,
+}: {
+ rtnFeature: (feature: any) => void;
+}) {
+ const { code, ruseMap, ruseMapInit, getMapFlcts, ruseMapSearch } = useWrStore(
(state) => state
);
const { t } = useTranslation("base");
- const { ruseMapCount, ruseExcelList,fclts, ruseMapRes,ruseMapHeadList } = ruseMap;
+ const { ruseMapCount, ruseExcelList, fclts, ruseMapRes, ruseMapHeadList } =
+ ruseMap;
const [ruseTable, setRuseTable] = useState();
const [isReset, setIsReset] = useState(false);
@@ -38,10 +39,7 @@ export function RuseFacility({
const [pbnRuseNm, setPbnRuseNm] = useState("");
const ruseCellClick = (index: number | undefined) => {
- if (
- index !== undefined &&
- ruseTable !== undefined
- ) {
+ if (index !== undefined && ruseTable !== undefined) {
rtnFeature(ruseTable[index]);
}
};
@@ -51,12 +49,11 @@ export function RuseFacility({
}
}, [ruseMap.isInit]);
useEffect(() => {
- ruseMapInit(1,ruseMapSize, ref.current, searchYear, fclts);
+ ruseMapInit(1, ruseMapSize, ref.current, searchYear, fclts);
}, [fclts]);
-
- useEffect(()=>{
- if(ruseExcelList&&ruseExcelList.length>0){
+ useEffect(() => {
+ if (ruseExcelList && ruseExcelList.length > 0) {
if (ruseExcelList.length > 0) {
excelDownload(
ruseExcelList,
@@ -66,20 +63,18 @@ export function RuseFacility({
3
);
} else {
- toast.error(t('excelDownErrMsg'));
+ toast.error(t("excelDownErrMsg"));
}
}
-
- },[ruseExcelList])
+ }, [ruseExcelList]);
useEffect(() => {
if (ruseMapRes && ruseMapRes.length > 0) {
- setRuseTable(ruseMapRes);
+ setRuseTable(ruseMapRes);
} else {
- setRuseTable([]);
+ setRuseTable([]);
}
}, [ruseMapRes]);
-
return (
<>
@@ -94,34 +89,35 @@ export function RuseFacility({
selectMiddleRegionData={code.mdmbsnCd}
selectEnvPartData={code.lclgvrnmntCd}
buttonOrder={["query", "init", "excel"]}
- rightClassName="ml-auto mr-6 flex items-center space-x-1"
+ rightClassName="ml-auto mr-6 flex items-center space-x-1 "
leftClassName="flex gap-5 w-9/12 m-4"
leftSelectClassName="w-1/4"
rightChildren={<>>}
leftChildren={
-
- setSearchYear(String(val))
- }
- />
-
- {
- setPbnRuseNm(e || "");
- }}
- />
-
+
+ setSearchYear(String(val))
+ }
+ className={""}
+ selectContentClass={''}
+ />
+
+ {
+ setPbnRuseNm(e || "");
+ }}
+ />
+
}
queryClick={() => {
setIsReset(true);
@@ -133,7 +129,15 @@ export function RuseFacility({
ref={ref}
isAdmin={false}
excelClick={function (returnType: ReturnType): void {
- ruseMapSearch(true,1,1000000 , returnType, searchYear, fclts,pbnRuseNm??'')
+ ruseMapSearch(
+ true,
+ 1,
+ 1000000,
+ returnType,
+ searchYear,
+ fclts,
+ pbnRuseNm ?? ""
+ );
}}
/>
@@ -147,10 +151,24 @@ export function RuseFacility({
headName={""}
cellClick={ruseCellClick}
onPageChange={(page) => {
- if(pbnRuseNm&&pbnRuseNm.length>0){
- ruseMapSearch(false,page,ruseMapSize , ref.current, searchYear, fclts,pbnRuseNm)
- }else{
- ruseMapInit(page,ruseMapSize , ref.current, searchYear, fclts);
+ if (pbnRuseNm && pbnRuseNm.length > 0) {
+ ruseMapSearch(
+ false,
+ page,
+ ruseMapSize,
+ ref.current,
+ searchYear,
+ fclts,
+ pbnRuseNm
+ );
+ } else {
+ ruseMapInit(
+ page,
+ ruseMapSize,
+ ref.current,
+ searchYear,
+ fclts
+ );
}
setIsReset(false);
diff --git a/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup.tsx b/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup.tsx
index 26c586561..9f8db7409 100644
--- a/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup.tsx
+++ b/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup.tsx
@@ -23,6 +23,7 @@ export default function CoSttnDetailPopup({isDetail} :{isDetail:DemandCompType})
bodyClassNm={"w-full mx-auto bg-white rounded-lg shadow-md p-6"}
updateList={isDetail}
readOnly={true}
+ openNetwork={false}
>
diff --git a/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx b/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx
index 84dd7d8e3..24a983dce 100644
--- a/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx
+++ b/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx
@@ -18,6 +18,7 @@ import {
SelectBox,
Title,
} from "@common/business_components/ui";
+import LoadingOverlay from "@common/business_components/ui/loadingBar";
import { Button, Input } from "@common/components/ui";
import { zodResolver } from "@hookform/resolvers/zod";
import { useEffect, useRef, useState } from "react";
@@ -35,9 +36,12 @@ export default function ChkgdExcel({
setYearChange: (year: string) => void;
}) {
const {
+ rswtChkgdn,
+ rainChkgdn,
rainChkExcelDataUPload,
rswtChkExceDataUpload,
setRainChkLoading,
+ setRswtChkLoading,
} = useWrStore((state) => {
return state;
});
@@ -110,43 +114,38 @@ export default function ChkgdExcel({
setRainChkLoading(false);
});
} else if (type === "RST") {
- filePickedArray(file, 0).then((res) => {
-
+ setRswtChkLoading(true);
+ filePickedArray(file, 0)
+ .then((res) => {
+ if (res && res?.length > 1) {
+ const guideData = excelToRswtGuideData(
+ res[0],
+ form.getValues("chckYr")
+ );
+ const polutionData = excelToRswtPolution(res[1]);
- if (res && res?.length > 1) {
- const guideData = excelToRswtGuideData(
- res[0],
- form.getValues("chckYr"),
- );
- const polutionData = excelToRswtPolution(res[1]);
-
-
-
-
const keyGenerator = (item: rswtChkZodType) =>
`${item.bdstRuseFcltSn}|${item.chckYmd}|${item.utztnUsgCd}`;
- const totalData: rswtChkZodType[] = guideData.map(
- (guide) => {
- const fusion = polutionData.find(
- (polution) =>
- guide.bdstRuseFcltSn === polution.bdstRuseFcltSn &&
- guide.chckYmd === polution.chckYmd &&
- guide.utztnUsgCd === polution.utztnUsgCd
- );
+ const totalData: rswtChkZodType[] = guideData.map((guide) => {
+ const fusion = polutionData.find(
+ (polution) =>
+ guide.bdstRuseFcltSn === polution.bdstRuseFcltSn &&
+ guide.chckYmd === polution.chckYmd &&
+ guide.utztnUsgCd === polution.utztnUsgCd
+ );
- if (fusion) {
- return {
- ...guide,
- rswtrPollutions: fusion?.rswtrPollutions,
- rswtrDetails: fusion?.rswtrDetails,
- };
- } else {
- return {
- ...guide,
- };
- }
+ if (fusion) {
+ return {
+ ...guide,
+ rswtrPollutions: fusion?.rswtrPollutions,
+ rswtrDetails: fusion?.rswtrDetails,
+ };
+ } else {
+ return {
+ ...guide,
+ };
}
- );
+ });
const guideKey = new Set(guideData.map(keyGenerator));
const onlypolution = polutionData.filter(
(item) => !guideKey.has(keyGenerator(item))
@@ -158,7 +157,7 @@ export default function ChkgdExcel({
];
const issues: string[] = [];
- rswtExcelDataCheck(listTotalData,issues)
+ rswtExcelDataCheck(listTotalData, issues);
if (issues && issues.length > 0) {
issues.some((err, index) => {
@@ -169,8 +168,9 @@ export default function ChkgdExcel({
} else {
setExcelRswtData(listTotalData);
}
- }
- });
+ }
+ })
+ .finally(() => setRswtChkLoading(false));
}
}
}, [file]);
@@ -222,6 +222,11 @@ export default function ChkgdExcel({
return (
<>
+
+
{type === "RNB"
- ? `시설명 : (${obj.bdstNm})` : `시설명 : (${obj.building.bdstNm})`}
+ ? `시설명 : (${obj.bdstNm})`
+ : `시설명 : (${obj.building.bdstNm})`}
@@ -269,7 +293,11 @@ export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: