From 3ed0049eee193e0a6226c1067b45767d55b7bbe0 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Mon, 11 Aug 2025 19:10:35 +0900 Subject: [PATCH 01/20] =?UTF-8?q?=EC=88=98=EC=9A=94=EC=B2=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/(map-layout)/map/mainMap/page.tsx | 1 + apps/wr/components/lib/func/mapUtil.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/wr/app/(map-layout)/map/mainMap/page.tsx b/apps/wr/app/(map-layout)/map/mainMap/page.tsx index 0006631d3..a2b104d76 100644 --- a/apps/wr/app/(map-layout)/map/mainMap/page.tsx +++ b/apps/wr/app/(map-layout)/map/mainMap/page.tsx @@ -143,6 +143,7 @@ const Map = () => { } select.selectFeature(foundFeature, true); } else { + toast.error('위치정보를 찾을수 없습니다') console.warn("OpenLayers Feature를 찾을 수 없습니다:"); console.log("foundFeature :", foundFeature ); console.warn("featureId : ", featureId); diff --git a/apps/wr/components/lib/func/mapUtil.ts b/apps/wr/components/lib/func/mapUtil.ts index 78aa71427..f85bf36a8 100644 --- a/apps/wr/components/lib/func/mapUtil.ts +++ b/apps/wr/components/lib/func/mapUtil.ts @@ -26,11 +26,12 @@ const wrFeaturePK = [ // { text: "잠재수요처", val: "tb_wr_tmpr_dmd_co" }, export const getFeatureCd = (featurePropertise: any, layerNm: string) => { + + console.log('featurePropertise ', featurePropertise) const featureCd = layerNm === "tb_wr_bdst_ruse_fclt" ? featurePropertise?.swtrmt_fclt_cd : [ - "tb_wr_ruse_fclt_dmd_co", "tb_wr_rswtr_fclt", "tb_wr_htdfl_fclt", "tb_wr_rnwtr_utztn_fclt", @@ -39,6 +40,8 @@ export const getFeatureCd = (featurePropertise: any, layerNm: string) => { ? featurePropertise?.bdst_nm : layerNm === "tb_il_swage_prcs_fclt" ? featurePropertise?.swtrmt_fclt_nm + : layerNm === "tb_wr_ruse_fclt_dmd_co"? + featurePropertise?.bdst_info_sn : null; return featureCd; From f2dd0ae3a9ad8cb20161188ab3b41214a7667d2e Mon Sep 17 00:00:00 2001 From: leedj312 Date: Mon, 11 Aug 2025 19:46:55 +0900 Subject: [PATCH 02/20] =?UTF-8?q?=ED=95=98=EC=88=98=EC=9E=AC=EC=9D=B4?= =?UTF-8?q?=EC=9A=A9=20=EC=8B=9C=EC=84=A4=20=EC=A7=80=EB=8F=84=20=EC=B0=BE?= =?UTF-8?q?=EA=B8=B0=20pk=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/components/lib/func/mapUtil.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/wr/components/lib/func/mapUtil.ts b/apps/wr/components/lib/func/mapUtil.ts index f85bf36a8..79c23f9e2 100644 --- a/apps/wr/components/lib/func/mapUtil.ts +++ b/apps/wr/components/lib/func/mapUtil.ts @@ -9,7 +9,7 @@ const wrLayerList = [ ]; const wrFeaturePK = [ { text: "bscFctCd", val: "tb_il_swage_prcs_fclt" }, - { text: "pbnstRuseFcltId", val: "tb_wr_bdst_ruse_fclt" }, + { text: "searchPk", val: "tb_wr_bdst_ruse_fclt" }, { text: "bdstInfoSn", val: "tb_wr_rnwtr_utztn_fclt" }, { text: "bdstInfoSn", val: "tb_wr_rswtr_fclt" }, { text: "bdstInfoSn", val: "tb_wr_htdfl_fclt" }, From 33e46e0fe8a3a493c075805cf64cb2cb23cc9fad Mon Sep 17 00:00:00 2001 From: leedj312 Date: Mon, 11 Aug 2025 21:04:19 +0900 Subject: [PATCH 03/20] =?UTF-8?q?=EC=A7=80=EB=8F=84=EC=A0=90=EA=B2=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/public/sample_rainy.xlsx | Bin 11262 -> 11548 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/apps/wr/public/sample_rainy.xlsx b/apps/wr/public/sample_rainy.xlsx index ec7577c510bf5ffefdbf146c56ac3d6569ce5b0b..3ab3495695d258c0eabbd0f1f1c3416bdca5c9e3 100644 GIT binary patch delta 6889 zcmZvBbx<5y?=}v_9f~dP4#llSiWMs^#bt44DU`)w@v^W$S)@>;xVuYnDDF}U#obvb zU+=x|Z{E4@eCLmx%#)lP2bcQYf2~q;rs!SCNcYn1>!LkS51-?1B+>x!TMGOLUu&^)%Kov zahYgcc3*cyGhO(sUroh)&R_5OylJT5o|^~6n9^sa(y`MnS5a_vsHBc1#h677-@YRn zq5m?#X=_Y*zDShBSAeamV|U0vK@L*(BPv08N9>|{DZHK&Ls~j`FdH2(aRYD)Er_Sa zPi??OBmGrS8ouSs4rVq`RQ6li-MnDS8g|ON8r!}fSatmESAVNVedUxN#BlvW46Nitu7)a ztE=^+trS-Uv!e&~6z0YF;Ia{ypFP=@hE!VKm`)keBm3>JG5m&`I1Ov}xx?pXw{`=E zepKW%*M7BO@75iJF_mY4_BhQeo(9UUq15fT zUsa`)K|fO}*|qowxaTf973h~U6)7kuD0H{%@`T=e$$)D(3Z7$#`kpg-19<2XxO zJEBPLMNcv@QxY~&r%B~PI9P|7?3!;aRuoC#wtQ3JFacNxtclwkrnek7X6er#*48fD zEgw3O8=|=XqHV_avSn=0GBQs^kyM*soD!FTd)31q(B9Q2UyrzHesd`5ZJ;-u(eqd1lIV{GuP%FHhOq62d+N$B> z`O#llYtV0BC2WA_ZNCapUhN1Q?o_d7Ow3jvsWY!7@cWa8gzP zn`=KNeD8p3#|wG!Q?#7~B6Eh@)$gmeYWHrB8`sDkJzKvExKWiBgBID6t`olPnRnk* z@htj4zwBuIY9c0~GN~y+<{Uz(%Vzy;e;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uAQ0)lBFa%Gex)W) z1laxo{+C1kFYp8XGmt2;n+@;ph;#QzR3XnF#fuCA5&SFS=*z@QHZXD^(_h;E0SG~j ANB{r; From 99aff0c53c3330907f8f72dc7f21e0b0ef597023 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Mon, 11 Aug 2025 21:04:31 +0900 Subject: [PATCH 04/20] =?UTF-8?q?=EC=A7=80=EB=8F=84=EC=A0=90=EA=B2=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../prfmncReg/chkgdnReg/rainChkgdn/excel.tsx | 11 ++++-- .../prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx | 35 ++++++++++++------- apps/wr/components/lib/func/excelFunc.tsx | 21 +++++++++-- .../ruseCaseMng/ruseCaseMngExcelModal.tsx | 1 - 4 files changed, 51 insertions(+), 17 deletions(-) diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx index 8e18317a8..38e2cab7f 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx @@ -172,9 +172,16 @@ console.log("rainChkgdData", rainChkgdData); ` 연간운영비(원/년): 숫자 형식 아님 /입력값:${rain.anlOperCst}` ); } - if (rain.oilqMeasMthd.length > 1 && !chkMngType.includes(rain.oilqMeasMthd)) { + + if (rain.operMngCd.length > 1 && !chkMngType.includes(rain.operMngCd)) { issues.push( - defaultMessage + `유량측정방법: 위탁 혹은 자체 만 허용) /입력값:${rain.oilqMeasMthd}` + defaultMessage + `운영관리 형태: 위탁 혹은 자체 만 허용) /입력값:${rain.oilqMeasMthd}` + ); + } + + if (rain.oilqMeasMthd.length > 1 && !chkSpwtPositnType.includes(rain.oilqMeasMthd)) { + issues.push( + defaultMessage + `유량측정방법: 유량계, 수위계, 펌프적산전력계, 기타) /입력값:${rain.oilqMeasMthd}` ); } diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx index d9016410d..3ae35e82c 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx @@ -2,12 +2,12 @@ import { TEST_UUID } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import { isInvalidDate, isInvalidNumber, + parseCommaRawValue, parseRawValue, } from "@/components/lib/func/excelFunc"; import type { SelectDataType } from "@common/business_components/ui"; import type { rswtChkZodType } from "."; import { - chkSpwtPositnType, useTypes, type Buildingtype } from "../rainChkgdn/excel"; @@ -160,7 +160,7 @@ export const excelToRswtGuideData = ( return { bdstRuseFcltSn: Number(item["NO"]), operMngCd: item["운영관리형태"], - anlOperCst: parseRawValue(item[`연간운영비(원/년)`]), + anlOperCst: parseCommaRawValue(item["연간운영비(원/년)"]), prcsCpct: parseRawValue(item[`처리용량(m³)`]), spwtPositn: item["채수지점"], chckYmd: checkYmd, @@ -175,6 +175,8 @@ export const excelToRswtGuideData = ( .filter((el: any) => el !== undefined); if (rswtChkgdData.length > 0) { + + console.log('rswtChkgdData ', rswtChkgdData) rswtExcelDataCheck(rswtChkgdData, issues); } @@ -185,7 +187,11 @@ export const excelToRswtGuideData = ( return { data: rswtChkgdData, issues: [] }; }; + + + export const excelToRswtPolution = (excelData: any, issues: string[]) => { + const rswtChkgdData: rswtChkZodType[] = excelData .map((item: any) => { if (item["점검일"] !== undefined) { @@ -226,12 +232,14 @@ export const excelToRswtPolution = (excelData: any, issues: string[]) => { mdfr: TEST_UUID, }; }); + + console.log( 'item["연간운영비(원/년)"] ', item["연간운영비(원/년)"]) return { bdstRuseFcltSn: Number(item["NO"]), chckYmd: checkYmd, utztnUsgCd: item["이용용도"], operMngCd: item["운영관리형태"], - anlOperCst: parseRawValue(item["연간운영비(원/년)"]), + anlOperCst: parseCommaRawValue(item["연간운영비(원/년)"]), prcsCpct: parseRawValue(item["처리용량(m³)"]), spwtPositn: item["채수지점"], rswtrPollutions: makePoluttion, @@ -266,6 +274,7 @@ const rswtExcelDataCheck = ( rswtChkgdData: rswtChkZodType[], issues: string[] ) => { + rswtChkgdData.forEach((rswt: any) => { const defaultMessage = `*중수도 수질 [NO: ${rswt.bdstRuseFcltSn}, 점검일: ${rswt.chckYmd}, 이용용도: ${rswt.utztnUsgCd}] 항목에서 `; @@ -273,6 +282,8 @@ const rswtExcelDataCheck = ( issues.push(defaultMessage + `점검일: 날짜 형식 아님 (${rswt.chckYmd})`); } if (rswt.anlOperCst.length > 2 && isInvalidNumber(rswt.anlOperCst)) { + + console.log('rswt.anlOperCst ', rswt.anlOperCst ) issues.push( defaultMessage + ` 연간운영비(원/년): 숫자 형식 아님 (${rswt.anlOperCst})` @@ -283,15 +294,15 @@ const rswtExcelDataCheck = ( defaultMessage + ` 처리용량(m³): 숫자 형식 아님 (${rswt.prcsCpct})` ); } - if ( - rswt.spwtPositn.length > 1 && - !chkSpwtPositnType.includes(rswt.spwtPositn) - ) { - issues.push( - defaultMessage + - `측정위치: 유량계, 수위계, 펌프적산전력계, 기타 중 하나만 허용) /입력값:${rswt.spwtPositn}` - ); - } + // if ( + // rswt.spwtPositn.length > 1 && + // !chkSpwtPositnType.includes(rswt.spwtPositn) + // ) { + // issues.push( + // defaultMessage + + // `채수지점 : 유량계, 수위계, 펌프적산전력계, 기타 중 하나만 허용) /입력값:${rswt.spwtPositn}` + // ); + // } if (rswt?.rswtrPollutions && rswt?.rswtrPollutions.length > 0) { rswt.rswtrPollutions.forEach((pol) => { diff --git a/apps/wr/components/lib/func/excelFunc.tsx b/apps/wr/components/lib/func/excelFunc.tsx index 2383bdbb3..7a1cc1d2e 100644 --- a/apps/wr/components/lib/func/excelFunc.tsx +++ b/apps/wr/components/lib/func/excelFunc.tsx @@ -12,6 +12,23 @@ export const isInvalidNumber = (val: any) => { if (val === "" || val === undefined || val === null) return 0; if (typeof val === "string" && ["보류", "N/A"].includes(val.trim())) return val; - return !isNaN(val) && val !== " " ? Number(val) : val; + return !isNaN(val) && val !== " " ? Number(val.replaceAll(',','')) : val; }; - \ No newline at end of file + + + export const parseCommaRawValue = (val: any): number | string => { + if (val === "" || val === undefined || val === null) return 0; + + // 문자열이고 "보류"나 "N/A"면 그대로 반환 + if (typeof val === "string" && ["보류", "N/A"].includes(val.trim())) { + return val; + } + + // 문자열에 쉼표가 있으면 제거 + if (typeof val === "string" && val.includes(",")) { + val = val.replace(/,/g, ""); + } + + // 숫자로 변환 가능하면 숫자로, 아니면 그대로 + return !isNaN(val) && val !== " " ? Number(val) : val; + }; \ No newline at end of file diff --git a/apps/wr/components/ui/modal/coMat/ruseCaseMng/ruseCaseMngExcelModal.tsx b/apps/wr/components/ui/modal/coMat/ruseCaseMng/ruseCaseMngExcelModal.tsx index a809c88f6..911dd2ed2 100644 --- a/apps/wr/components/ui/modal/coMat/ruseCaseMng/ruseCaseMngExcelModal.tsx +++ b/apps/wr/components/ui/modal/coMat/ruseCaseMng/ruseCaseMngExcelModal.tsx @@ -79,7 +79,6 @@ export default function RuseCaseMngExcel() { }; Object.keys(reUseCaseNames).forEach((key: string) => { - console.log("reUseCaseNames", reUseCaseNames) if (item && reUseCaseNames[key] !== undefined) { const mappedKey = reUseCaseNames[key]; if (mappedKey && object.hasOwnProperty(mappedKey)) { From b8cd98643508b0b23927bb4e74196218727335e2 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Tue, 12 Aug 2025 09:55:09 +0900 Subject: [PATCH 05/20] =?UTF-8?q?=EC=A4=91=EC=88=98=EB=8F=84=20=EC=A7=80?= =?UTF-8?q?=EB=8F=84=EC=A0=90=EA=B2=80=20=EC=97=91=EC=85=80=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx index 3ae35e82c..4cdef5b70 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx @@ -209,11 +209,11 @@ export const excelToRswtPolution = (excelData: any, issues: string[]) => { const combResdch = parseRawValue(item[`${quarter}분기_결합잔류염소`]); const trbt = parseRawValue(item[`${quarter}분기_탁도`]); const bod = parseRawValue(item[`${quarter}분기_BOD`]); - const smll = parseRawValue(item[`${quarter}분기_냄새`]); + const smll = String(item[`${quarter}분기_냄새`]); const crmty = parseRawValue(item[`${quarter}분기_색도`]); const tph = parseRawValue(item[`${quarter}분기_T-P`]); const tn = parseRawValue(item[`${quarter}분기_T-N`]); - const ph = parseRawValue(item[`${quarter}분기_PH`]); + const ph = String(item[`${quarter}분기_PH`]) ; const clIonQnt = parseRawValue(item[`${quarter}분기_염화물`]); return { node: quarter, From 70dcc69f2dae3fe80daa1b24b30b26bafbb6598e Mon Sep 17 00:00:00 2001 From: leedj312 Date: Tue, 12 Aug 2025 10:18:54 +0900 Subject: [PATCH 06/20] =?UTF-8?q?=EC=A4=91=EC=88=98=EB=8F=84=20=EC=A7=80?= =?UTF-8?q?=EB=8F=84=EC=A0=90=EA=B2=80=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=EC=8B=9C=20=EC=A1=B0=ED=9A=8C=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/index.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/index.tsx index 5f72998d1..afba2f813 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/index.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/index.tsx @@ -285,6 +285,7 @@ export const rswtChkgdnActionsExport: (set: any) => rswtChkgdnActions = ( ...state.rswtChkgdn, rswtChkRes: rswtChkRes.data, rswtChkCount: rswtChkRes.count, + }, })); } catch (error) { @@ -361,7 +362,8 @@ export const rswtChkgdnActionsExport: (set: any) => rswtChkgdnActions = ( ...state, rswtChkgdn: { ...state.rswtChkgdn, - rswtChkRes: rswtChkRes, + rswtChkRes: rswtChkRes.data, + rswtChkCount: rswtChkRes.count, }, })); } catch (error) { From 1feec308c1e576355e3a159138fce8982c8a121e Mon Sep 17 00:00:00 2001 From: leedj312 Date: Tue, 12 Aug 2025 11:03:41 +0900 Subject: [PATCH 07/20] =?UTF-8?q?=EC=A4=91=EC=88=98=EB=8F=84=20=EC=A7=80?= =?UTF-8?q?=EB=8F=84=EC=A0=90=EA=B2=80=20=EC=97=91=EC=85=80=20=EA=B2=80?= =?UTF-8?q?=EC=A6=9D=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx | 46 +++++-------------- .../ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx | 39 +++++++++------- 2 files changed, 34 insertions(+), 51 deletions(-) diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx index 4cdef5b70..a3372639b 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx @@ -137,7 +137,6 @@ export const rswtMakeExcelSample = ( export const excelToRswtGuideData = ( excelData: any, year: string, - issues: string[] ) => { const rswtChkgdData: rswtChkZodType[] = excelData .map((item: any) => { @@ -174,23 +173,14 @@ export const excelToRswtGuideData = ( }) .filter((el: any) => el !== undefined); - if (rswtChkgdData.length > 0) { - console.log('rswtChkgdData ', rswtChkgdData) - rswtExcelDataCheck(rswtChkgdData, issues); - } - - if (issues.length > 0) { - return { data: [], issues }; - } - - return { data: rswtChkgdData, issues: [] }; + return rswtChkgdData }; -export const excelToRswtPolution = (excelData: any, issues: string[]) => { +export const excelToRswtPolution = (excelData: any) => { const rswtChkgdData: rswtChkZodType[] = excelData .map((item: any) => { @@ -233,7 +223,6 @@ export const excelToRswtPolution = (excelData: any, issues: string[]) => { }; }); - console.log( 'item["연간운영비(원/년)"] ', item["연간운영비(원/년)"]) return { bdstRuseFcltSn: Number(item["NO"]), chckYmd: checkYmd, @@ -259,18 +248,18 @@ export const excelToRswtPolution = (excelData: any, issues: string[]) => { } }) .filter((el: any) => el !== undefined); - if (rswtChkgdData.length > 0) { - rswtExcelDataCheck(rswtChkgdData, issues); - } + // if (rswtChkgdData.length > 0) { + // rswtExcelDataCheck(rswtChkgdData, issues); + // } - if (issues.length > 0) { - return { data: [], issues }; - } + // if (issues.length > 0) { + // return { data: [], issues }; + // } - return { data: rswtChkgdData, issues: [] }; + return rswtChkgdData }; -const rswtExcelDataCheck = ( +export const rswtExcelDataCheck = ( rswtChkgdData: rswtChkZodType[], issues: string[] ) => { @@ -283,7 +272,6 @@ const rswtExcelDataCheck = ( } if (rswt.anlOperCst.length > 2 && isInvalidNumber(rswt.anlOperCst)) { - console.log('rswt.anlOperCst ', rswt.anlOperCst ) issues.push( defaultMessage + ` 연간운영비(원/년): 숫자 형식 아님 (${rswt.anlOperCst})` @@ -329,12 +317,6 @@ const rswtExcelDataCheck = ( defaultMessage + `${pol.node}분기_BOD: 숫자 형식 아님 (${pol.bod})` ); } - if (isInvalidNumber(pol.smll)) { - issues.push( - defaultMessage + - `${pol.node}분기_냄새: 숫자 형식 아님 (${pol.smll})` - ); - } if (isInvalidNumber(pol.crmty)) { issues.push( defaultMessage + @@ -351,20 +333,16 @@ const rswtExcelDataCheck = ( defaultMessage + `${pol.node}분기_T-N: 숫자 형식 아님 (${pol.tn})` ); } - if (isInvalidNumber(pol.ph)) { - issues.push( - defaultMessage + `${pol.node}분기_PH: 숫자 형식 아님 (${pol.ph})` - ); if (isInvalidNumber(pol.clIonQnt)) { issues.push( defaultMessage + - `${pol.node}분기_PH: 숫자 형식 아님 (${pol.clIonQnt})` + `${pol.node}분기_염소이온량: 숫자 형식 아님 (${pol.clIonQnt})` ); - } } }); } + if (rswt?.rswtrDetails && rswt?.rswtrDetails.length > 0) { rswt?.rswtrDetails.forEach((key) => { if (key.levyAmt?.length > 1 && isInvalidNumber(key.levyAmt)) { diff --git a/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx b/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx index 46e6c5d30..405061390 100644 --- a/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx +++ b/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx @@ -6,6 +6,7 @@ import type { rswtChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn import { excelToRswtGuideData, excelToRswtPolution, + rswtExcelDataCheck, } from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel"; import { showConfirmToast } from "@/components/lib/func/commom"; import { @@ -110,30 +111,23 @@ export default function ChkgdExcel({ }); } else if (type === "RST") { filePickedArray(file, 0).then((res) => { - let issues: string[] = []; + if (res && res?.length > 1) { const guideData = excelToRswtGuideData( res[0], form.getValues("chckYr"), - issues ); - const polutionData = excelToRswtPolution(res[1], issues); + const polutionData = excelToRswtPolution(res[1]); - issues = [...guideData.issues, ...polutionData.issues]; + - if (issues && issues.length > 0) { - issues.some((err, index) => { - showConfirmToast(err); - return index === 6; // true 반환 시 반복 종료 - }); - clearFile(); - } else { + const keyGenerator = (item: rswtChkZodType) => `${item.bdstRuseFcltSn}|${item.chckYmd}|${item.utztnUsgCd}`; - const totalData: rswtChkZodType[] = guideData.data.map( + const totalData: rswtChkZodType[] = guideData.map( (guide) => { - const fusion = polutionData.data.find( + const fusion = polutionData.find( (polution) => guide.bdstRuseFcltSn === polution.bdstRuseFcltSn && guide.chckYmd === polution.chckYmd && @@ -153,8 +147,8 @@ export default function ChkgdExcel({ } } ); - const guideKey = new Set(guideData.data.map(keyGenerator)); - const onlypolution = polutionData.data.filter( + const guideKey = new Set(guideData.map(keyGenerator)); + const onlypolution = polutionData.filter( (item) => !guideKey.has(keyGenerator(item)) ); @@ -162,9 +156,20 @@ export default function ChkgdExcel({ ...totalData, ...onlypolution, ]; + const issues: string[] = []; - setExcelRswtData(listTotalData); - } + console.log('listTotalData ', listTotalData) + rswtExcelDataCheck(listTotalData,issues) + + if (issues && issues.length > 0) { + issues.some((err, index) => { + showConfirmToast(err); + return index === 6; // true 반환 시 반복 종료 + }); + clearFile(); + } else { + setExcelRswtData(listTotalData); + } } }); } From 667dc58847a647b134daf32cc573ea2b916c832c Mon Sep 17 00:00:00 2001 From: leedj312 Date: Tue, 12 Aug 2025 14:38:01 +0900 Subject: [PATCH 08/20] =?UTF-8?q?=ED=95=98=EC=88=98=EC=9E=AC=EC=9D=B4?= =?UTF-8?q?=EC=9A=A9=20=EC=8B=9C=EC=84=A4=20=ED=98=84=ED=99=A9=20=ED=8C=9D?= =?UTF-8?q?=EC=97=85=20=EC=8B=A4=EC=A0=81=20=EC=97=86=EC=9D=84=EC=8B=9C=20?= =?UTF-8?q?=ED=91=9C=EC=B6=9C=20=EC=95=88=ED=95=A8=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx b/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx index d7ad10a76..c507e5470 100644 --- a/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx +++ b/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx @@ -169,7 +169,7 @@ export function PbnstSttnModal({ data, titleVisible,isMap}: { data: customPbnst; const inSubtotal = { ...structuredClone(subTotalObj), 구분: "장내용수" }; const outSubtotal = { ...structuredClone(subTotalObj), 구분: "장외용수" }; - if (prfList) { + if (prfList&&prfList.length>0) { prfList?.forEach((prfItem) => { const month = Number(prfItem?.ym?.slice(4)); // "MM" const monthKey = `${month}월`; @@ -220,12 +220,16 @@ export function PbnstSttnModal({ data, titleVisible,isMap}: { data: customPbnst; outPrf: outUsageData, totalPrf: tableData, }); + }else{ + setPrfData(undefined); } }; useEffect(() => { if(isMap){ if(data.prfList &&data.prfList.length>0){ getTablePrfData(data.prfList); + }else{ + getTablePrfData([]); } }else{ From 2edb56284e4902c8a3652e4fbc841d2879b50fd3 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Tue, 12 Aug 2025 17:31:57 +0900 Subject: [PATCH 09/20] =?UTF-8?q?=EB=AC=BC=EC=9E=AC=EC=9D=B4=EC=9A=A9=20?= =?UTF-8?q?=EC=A7=80=EB=8F=84=20=ED=8C=9D=EC=97=85=20=EC=B0=BD=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../(popUp-layout)/mapFeaturePopup/page.tsx | 2 +- .../ruseFcltMng/fcltSttn/pbnstSttn/page.tsx | 10 ++++++---- apps/wr/components/lib/func/commom.tsx | 1 - apps/wr/components/lib/func/mapUtil.ts | 7 ++++--- .../ui/map/detailPopup/ruseDetailPopup.tsx | 20 +++++++++++++------ .../sttn/pbnstSttnModal/pbnstSttnModal.tsx | 15 +++++++------- .../sttn/sttnDetailModal/sttnDetailModal.tsx | 8 ++++---- 7 files changed, 37 insertions(+), 26 deletions(-) diff --git a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx index a660e5e6b..2b8a32342 100644 --- a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx +++ b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx @@ -82,7 +82,7 @@ export default function MapFeaturePopup() { return ( <> {isDetail ? ( -
+
{layerNm === "tb_wr_bdst_ruse_fclt" ? ( ) : layerNm === "tb_il_swage_prcs_fclt" ? ( diff --git a/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx index 21f72f449..bbab4d9ce 100644 --- a/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx +++ b/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx @@ -237,11 +237,13 @@ export default function PbnstSttn() { /> +
+ +
} - bodyClass="w-[68vw] max-w-none h-[90vh]" + bodyClass="w-[68vw] max-w-none h-[90vh] overflow-hidden flex flex-col min-h-0" open={pbnDetaileData.isModal} onOpenChange={(open) => { //TODO:OPEN 상태 확인필요 diff --git a/apps/wr/components/lib/func/commom.tsx b/apps/wr/components/lib/func/commom.tsx index 0733f1bee..343852e39 100644 --- a/apps/wr/components/lib/func/commom.tsx +++ b/apps/wr/components/lib/func/commom.tsx @@ -173,7 +173,6 @@ export const getCityOrSgg = (ref: RefObject) => { export const safeDate = (value: any): Date | undefined => { const date = new Date(value); - console.log(' date ', date) return isNaN(date.getTime()) ? undefined : date; }; diff --git a/apps/wr/components/lib/func/mapUtil.ts b/apps/wr/components/lib/func/mapUtil.ts index 79c23f9e2..155bd5c07 100644 --- a/apps/wr/components/lib/func/mapUtil.ts +++ b/apps/wr/components/lib/func/mapUtil.ts @@ -128,15 +128,16 @@ export function featurePopUpOpen(layerNm:string,featureCd:string,popupDetailRef) const url = `/mapFeaturePopup?layerNm=${encodeURIComponent(String(layerNm))}&featureCd=${encodeURIComponent(featureCd)} `; const width = String(layerNm) === "tb_wr_bdst_ruse_fclt" - ? Math.floor(window.innerWidth * 0.8) + ? Math.floor(window.innerWidth * 0.6) : Math.floor(window.innerWidth * 0.4); // 화면 폭의 40% const height = String(layerNm) === "tb_wr_bdst_ruse_fclt" - ? Math.floor(window.innerHeight - 150) + ? Math.floor(window.innerHeight - 100) : Math.floor(window.innerHeight - 450); // 150px 여백 확보; // calc(100% - 70px) const left = (window.screen.availWidth - width) / 2; const top = (window.screen.availHeight - height) / 2; - const popupOptions = `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes`; + const popupOptions = `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes `; + popupDetailRef.current = window.open( url, "지도 시설 상세정보 팝업", diff --git a/apps/wr/components/ui/map/detailPopup/ruseDetailPopup.tsx b/apps/wr/components/ui/map/detailPopup/ruseDetailPopup.tsx index 9f0a114f8..7e4c3b603 100644 --- a/apps/wr/components/ui/map/detailPopup/ruseDetailPopup.tsx +++ b/apps/wr/components/ui/map/detailPopup/ruseDetailPopup.tsx @@ -13,7 +13,7 @@ export function RuseDetailPopup({ bscFctCd }: { bscFctCd: string }) { const { ruseMap, getRuseMaplList } = useWrStore((state) => state); const { ruseDetailList } = ruseMap; const [fcltTab, setFcltTab] = useState(""); - const [isDetail, setIsDetail] = useState({} as customPbnst); + const [, setIsDetail] = useState({} as customPbnst); const initRef = useRef(false); useEffect(() => { @@ -38,9 +38,9 @@ export function RuseDetailPopup({ bscFctCd }: { bscFctCd: string }) { if (!(ruseDetailList && ruseDetailList[0])) return; return ( -
+
- + {ruseDetailList.map((item, index) => { return ( - - - + {ruseDetailList.map((item) => ( + +
+ +
+
+ ))}
); diff --git a/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx b/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx index c507e5470..4c06f5722 100644 --- a/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx +++ b/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx @@ -254,16 +254,17 @@ export function PbnstSttnModal({ data, titleVisible,isMap}: { data: customPbnst; } }, [data, form]) + const Wrapper: React.ElementType = isMap ?"div": ScrollArea; return ( <> -
+
{titleVisible && ( <> </> )} - <ScrollArea className={ isMap==true? "h-[100vh]":"h-[70vh]" }> + <Wrapper className={ "h-[70vh]" }> <PbnstMngForm form={form} formType={"sttn"} @@ -293,7 +294,7 @@ export function PbnstSttnModal({ data, titleVisible,isMap}: { data: customPbnst; 재이용 수요처 현황 </TabsTrigger> </TabsList> - <TabsContent className="max-h-full" value={fcltTab}> + <TabsContent className="min-h-0" value={fcltTab}> <UiTable headName={undefined} tableData={ruseTableData || []} @@ -326,10 +327,10 @@ export function PbnstSttnModal({ data, titleVisible,isMap}: { data: customPbnst; 장외용수 </TabsTrigger> </TabsList> - <TabsContent className="max-h-full" value={ruseTab}> + <TabsContent className="min-h-0" value={ruseTab}> {prfData && ( <ListDiv className="col-span-8 pr-6 "> - <ScrollArea className="h-[60vh]"> + {/* <ScrollArea className="h-[60vh]"> */} <div className="card-header"> <h3 className="text-2xl font-medium text-label"> {"하수처리수재이용 실적(m³) 등록결과"} @@ -343,13 +344,13 @@ export function PbnstSttnModal({ data, titleVisible,isMap}: { data: customPbnst; {InputTableBody(prfData[ruseTab as keyof typeof prfData] || [], pbnstPrfmncSttn.monthSttnHeadList, setPrfData as any)} </TableBody> </Table> - </ScrollArea> + {/* </ScrollArea> */} </ListDiv> )} </TabsContent> </Tabs> </div> - </ScrollArea> + </Wrapper> </div> </> ); diff --git a/apps/wr/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal.tsx b/apps/wr/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal.tsx index dfe88413b..2edb47844 100644 --- a/apps/wr/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal.tsx +++ b/apps/wr/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal.tsx @@ -5,7 +5,7 @@ import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg"; import type { customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg"; import { rainChkTableData } from "@/components/lib/func/TableData"; -import { ScrollArea, Title, UiTable } from "@common/business_components/ui"; +import { Title, UiTable } from "@common/business_components/ui"; import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan"; import { useEffect, useState } from "react"; import HtdflRegForm from "../../../form/fcltReg/htdflReg/htdflRegForm"; @@ -89,13 +89,13 @@ export default function SttnDetailModal({ : "온배수시설 상세정보" } > - 0 ? "h-[80vh]" : "h-[70vh]" } - > + > */} {type === "RNB" ? ( )} - + {/* */}
); } From a5f7fb7fe883a3a7c386ebdbd2226b50f6b6ef49 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 13 Aug 2025 09:43:43 +0900 Subject: [PATCH 10/20] =?UTF-8?q?=EB=B9=97=EB=AC=BC=20=ED=86=B5=EA=B3=84?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/store/stats/rainStat/index.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/wr/app/store/stats/rainStat/index.tsx b/apps/wr/app/store/stats/rainStat/index.tsx index ec46c2b4e..80787ae43 100644 --- a/apps/wr/app/store/stats/rainStat/index.tsx +++ b/apps/wr/app/store/stats/rainStat/index.tsx @@ -50,7 +50,13 @@ const excelDownList: ExcelType[] = []; const fetchRainStatList = async (year: string) => { const res = await getFetch(fetchType.WR, `/reuseChk/rainy/stat/${year}`); - return res; + + + return res.map((item) => ({ + ...item, + instlCst:item.instlCst<0?0:item.instlCst, + dtfcltCpct:item.dtfcltCpct<0?0:item.dtfcltCpct + })); }; type rainStatActions = { @@ -83,7 +89,8 @@ export const rainStatActionsExport = ( searchRainStatList: async (year: string, city: SelectDataType[]) => { const res = await fetchRainStatList(year); const cityArr: any[] = []; - + + console.log('res ', res) res.filter((resFilter: RainStatProps) => city.some((cityCd) => @@ -209,6 +216,7 @@ export const rainStatActionsExport = ( utztnUsgCd: utztnUsgArray.join(", "), }); }); + const excelDetailData = excelRainStat(rainDetailList); /* const rainStatHeadList = data.map((item:RainStatProps) => ({ ...item, @@ -230,8 +238,6 @@ export const rainStatActionsExport = ( yearMoney:item.yearMoney, })) */ - console.log(" cityArr ", cityArr); - console.log(" excelDownList ", excelDownList); cityArr.unshift(totalObj); set((state: rainStatState) => ({ From 0964eddc0ede45f6ee8f1402a8e7ce05ed69dfe9 Mon Sep 17 00:00:00 2001 From: truthwing Date: Wed, 13 Aug 2025 11:18:50 +0900 Subject: [PATCH 11/20] =?UTF-8?q?=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C=20fi?= =?UTF-8?q?lter=EB=A1=9C=20=EC=9D=B8=ED=95=9C=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=ED=95=B4=EA=B2=B0.=20jsyang=20product(tit?= =?UTF-8?q?anume=20knife=20=EC=A4=80=EB=B9=84=20=EC=99=84=EB=A3=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/(with-layout)/stats/rswtStat/page.tsx | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/apps/wr/app/(with-layout)/stats/rswtStat/page.tsx b/apps/wr/app/(with-layout)/stats/rswtStat/page.tsx index 99a8bc4f3..21ca5112a 100644 --- a/apps/wr/app/(with-layout)/stats/rswtStat/page.tsx +++ b/apps/wr/app/(with-layout)/stats/rswtStat/page.tsx @@ -132,7 +132,7 @@ export default function RswtStat() { } return item; }); - + // 시도별 합계 계산 transformedRswtDetailList.forEach((item: RswtStatProps[]) => { const sidoText = item[0]?.toString(); @@ -144,18 +144,21 @@ export default function RswtStat() { sidoData[i] = '합계'; } else if (i == 3) { // 해당 시도의 데이터 개수를 계산 - const sidoDataCount = rswtDetailList.filter((data: unknown[]) => - Array.isArray(data) && data.length > 0 && String(data[0]) === sidoText - ).length; - sidoData[i] = sidoDataCount; + if (typeof sidoData[i] === "number") { + sidoData[i] = (sidoData[i] as number) + 1; + } else if ((sidoData[i] === undefined || isNaN(Number(sidoData[i])))) { + sidoData[i] = 1; + } } else if (i == 4) { sidoData[i] = ''; } else if (i == 6) { // 법정 대상 건축물 개수 (인덱스 6이 'Y'인 경우) - const bumCnt = rswtDetailList.filter((data: unknown[]) => - Array.isArray(data) && data.length > 6 && String(data[0]) === sidoText - ).filter((data: unknown[]) => String(data[6]) === '대상').length; - sidoData[i] = bumCnt; + + if (item[i]?.toString() == '대상'&&typeof sidoData[i] === "number") { + sidoData[i] = (sidoData[i] as number) + 1; + } else if (item[i]?.toString() == '대상'&&(sidoData[i] === undefined || isNaN(Number(sidoData[i])))) { + sidoData[i] = 1; + } } else if (i == 9) { const value = Number(item[9]) || 0; sidoData[i] = (Number(sidoData[i]) + value) as string | number; @@ -256,14 +259,14 @@ export default function RswtStat() { From aec7e7de3a006936c703d0d6e40c5d0c42aab84b Mon Sep 17 00:00:00 2001 From: truthwing Date: Wed, 13 Aug 2025 11:40:07 +0900 Subject: [PATCH 12/20] =?UTF-8?q?=EB=85=84=EB=8F=84=20=EC=97=AD=20?= =?UTF-8?q?=EC=A0=95=EB=A0=AC=20=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/components/lib/func/commom.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/wr/components/lib/func/commom.tsx b/apps/wr/components/lib/func/commom.tsx index 343852e39..ef4baa67b 100644 --- a/apps/wr/components/lib/func/commom.tsx +++ b/apps/wr/components/lib/func/commom.tsx @@ -180,8 +180,8 @@ const currentYear = new Date().getFullYear(); export const yearOptions: { val: string; text: string }[] = Array.from( { length: currentYear - 1969 }, (_, i) => ({ - val: String(1970 + i), - text: `${1970 + i}년`, + val: String(currentYear - i), + text: `${currentYear - i}년`, }) ); From 6fef06963d77c298a0201a7a1f101148c22976fd Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 13 Aug 2025 13:17:31 +0900 Subject: [PATCH 13/20] =?UTF-8?q?=EA=B0=90=EB=A6=AC=EC=A7=80=EC=A0=81?= =?UTF-8?q?=EC=82=AC=ED=95=AD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/(map-layout)/map/mainMap/page.tsx | 2 +- apps/wr/app/store/map/htdflMap/index.tsx | 58 +++--- apps/wr/app/store/map/rainMap/index.tsx | 36 +++- apps/wr/app/store/map/rswtMap/index.tsx | 60 ++++--- apps/wr/app/store/map/ruseMap/index.tsx | 65 ++++++- .../wr/app/store/matDmd/ruseCaseMng/excel.tsx | 88 +++++----- .../ruseFcltMng/fcltSttn/rainSttn/excel.tsx | 8 +- .../ruseFcltMng/fcltSttn/rswtSttn/excel.tsx | 2 +- apps/wr/components/lib/func/mapUtil.ts | 4 +- .../LayerPopUp/HedfFacilty/HtdfFacilty.tsx | 107 ++++++++++-- .../LayerPopUp/RainFacility/RainFacility.tsx | 86 +++++++-- .../LayerPopUp/RswtFacilty/RswtFacilty.tsx | 165 ++++++++++++------ .../LayerPopUp/RuseFacilty/RuseFacility.tsx | 37 +++- 13 files changed, 523 insertions(+), 195 deletions(-) diff --git a/apps/wr/app/(map-layout)/map/mainMap/page.tsx b/apps/wr/app/(map-layout)/map/mainMap/page.tsx index a2b104d76..70deb7d42 100644 --- a/apps/wr/app/(map-layout)/map/mainMap/page.tsx +++ b/apps/wr/app/(map-layout)/map/mainMap/page.tsx @@ -143,7 +143,7 @@ const Map = () => { } select.selectFeature(foundFeature, true); } else { - toast.error('위치정보를 찾을수 없습니다') + // toast.error('위치정보를 찾을수 없습니다') console.warn("OpenLayers Feature를 찾을 수 없습니다:"); console.log("foundFeature :", foundFeature ); console.warn("featureId : ", featureId); diff --git a/apps/wr/app/store/map/htdflMap/index.tsx b/apps/wr/app/store/map/htdflMap/index.tsx index 03289a06d..a8b9eb7c1 100644 --- a/apps/wr/app/store/map/htdflMap/index.tsx +++ b/apps/wr/app/store/map/htdflMap/index.tsx @@ -2,12 +2,15 @@ import { fetchType, getFetch, getFetchWithCount } from "@/components/lib/api"; import type { CommonTableProps } from "../../common/type/header"; import type { customHtdflBdst } from "../../ruseFcltMng/fcltReg/htdflReg"; import { htdflSttHeadListExport, htdflSttNodeListExport } from "../../ruseFcltMng/fcltSttn/htdflSttn/headList"; +import type { SelectDataType } from "@common/business_components/ui"; +import { excelHtdflSttnParsing } from "../../ruseFcltMng/fcltSttn/htdflSttn/excel"; export const htdfMapSize = 15; export type htdfMapState = { htdfMap: { htdfMapRes: customHtdflBdst[]; htdfMapCount: number; + htdflMapExcelList:[] isInit: boolean; htdfSttHeadList: CommonTableProps[]; htdfSttNodeList: CommonTableProps[]; @@ -16,7 +19,9 @@ export type htdfMapState = { type htdfMapActions = { htdfMapInit: (page: number, total: number, cityOrSgg: string) => void; - htdfMapSearch: (page: number, total: number, cityOrSgg:string, searchTxt?:string) =>void + htdfMapSearch: (isExcel: boolean, page: number, total: string, con: string, txt: string, + sidoCode: SelectDataType[], + sggCode: SelectDataType[]) => void; htdfMapDetile:(featureCd:string) => Promise; }; @@ -27,6 +32,7 @@ export const htdfMapStateExport: htdfMapState = { htdfMap: { isInit: false, htdfMapRes: [], + htdflMapExcelList:[], htdfMapCount: 1, htdfSttHeadList: htdflSttHeadListExport, htdfSttNodeList: htdflSttNodeListExport, @@ -62,32 +68,44 @@ export const htdfMapActionsExport: (set: any) => htdfMapActions = ( console.log(e); } }, - htdfMapSearch: async ( - page: number, - total: number, - cityOrSgg: string, - searchTxt?: string + htdfMapSearch: async (isExcel: boolean, page: number, total: string, con: string, txt: string, + sidoCode: SelectDataType[], + sggCode: SelectDataType[] ) => { try { const htdfMapRes = await getFetchWithCount( fetchType.WR, `/drain/facilityList` + - (page ? `/${page}` : "/1") + - (total ? `/${total}` : "/20") + - (cityOrSgg ? `/${cityOrSgg}` : "/0") + - (searchTxt ? `/${searchTxt}` : "") + (page ? `/${page}` : "/1") + + (total ? `/${total}` : "/20") + + (con ? `/${con}` : "/0") + + (txt ? `/${txt}` : "") ); + if (isExcel) { + const htdflMapExcelList = excelHtdflSttnParsing(htdfMapRes, sidoCode, sggCode); - set((state: htdfMapState) => { - return { - ...state, - htdfMap: { - ...state.htdfMap, - htdfMapRes: htdfMapRes.data, - htdfMapCount: htdfMapRes.count, - }, - }; - }); + set((state: htdfMapState) => { + return { + ...state, + htdfMap: { + ...state.htdfMap, + htdflMapExcelList: htdflMapExcelList + }, + }; + }); + }else{ + + set((state: htdfMapState) => { + return { + ...state, + htdfMap: { + ...state.htdfMap, + htdfMapRes: htdfMapRes.data, + htdfMapCount: htdfMapRes.count, + }, + }; + }); + } } catch (e) { console.log(e); } diff --git a/apps/wr/app/store/map/rainMap/index.tsx b/apps/wr/app/store/map/rainMap/index.tsx index a8d8ecb04..f80c27cc7 100644 --- a/apps/wr/app/store/map/rainMap/index.tsx +++ b/apps/wr/app/store/map/rainMap/index.tsx @@ -5,12 +5,15 @@ import { rainSttNodeListExport, } from "../../ruseFcltMng/fcltSttn/rainSttn/headList"; import type { customRainBdst } from "../../ruseFcltMng/fcltReg/rainReg"; +import type { SelectDataType } from "@common/business_components/ui"; +import { excelRainSttnParsing } from "../../ruseFcltMng/fcltSttn/rainSttn/excel"; export const rainMapSize = 15 export type rainMapState = { rainMap: { rainMapRes: customRainBdst[]; + rainMapExcelList: []; rainMapCount: number; isInit: boolean; rainSttHeadList: CommonTableProps[]; @@ -20,7 +23,9 @@ export type rainMapState = { type rainMapActions = { rainMapInit: (page: number, total: number, cityOrSgg:string) => void; - rainMapSearch: (page: number, total: number, cityOrSgg:string, searchTxt?:string) =>void + rainMapSearch: (isExcel: boolean, page: number, total: string, con: string, txt: string, + sidoCode: SelectDataType[], + sggCode: SelectDataType[]) => void; rainMapDetile:(featureCd:string) => Promise; }; @@ -30,6 +35,7 @@ export const rainMapStateExport: rainMapState = { rainMap: { isInit: false, rainMapRes: [], + rainMapExcelList:[], rainMapCount: 1, rainSttHeadList: rainSttHeadListExport, rainSttNodeList: rainSttNodeListExport, @@ -65,17 +71,31 @@ export const rainMapActionsExport: (set: any) => rainMapActions = ( console.log(e); } }, - rainMapSearch: async (page: number, total: number, cityOrSgg:string, searchTxt?:string) => { + rainMapSearch: async (isExcel: boolean, page: number, total: string, con: string, txt: string, + sidoCode: SelectDataType[], + sggCode: SelectDataType[]) => { try { const rainMapRes = await getFetchWithCount( fetchType.WR, `/reuseFc/rainyInfoList` + - (page ? `/${page}` : "/1") + - (total ? `/${total}` : "/20") + - (cityOrSgg ? `/${cityOrSgg}` : "/0") + - (searchTxt ? `/${searchTxt}` : "") + (page ? `/${page}` : "/1") + + (total ? `/${total}` : "/20") + + (con ? `/${con}` : "/0") + + (txt ? `/${txt}` : "") ); - + if (isExcel) { + const rainMapExcelList = excelRainSttnParsing(rainMapRes, sidoCode, sggCode); + + set((state: rainMapState) => { + return { + ...state, + rainMap: { + ...state.rainMap, + rainMapExcelList: rainMapExcelList, + }, + }; + }); + }else{ set((state: rainMapState) => { return { ...state, @@ -86,6 +106,8 @@ export const rainMapActionsExport: (set: any) => rainMapActions = ( }, }; }); + + } } catch (e) { console.log(e); } diff --git a/apps/wr/app/store/map/rswtMap/index.tsx b/apps/wr/app/store/map/rswtMap/index.tsx index e788bedc1..4acc0e321 100644 --- a/apps/wr/app/store/map/rswtMap/index.tsx +++ b/apps/wr/app/store/map/rswtMap/index.tsx @@ -5,12 +5,15 @@ import { rswtSttHeadListExport, rswtSttNodeListExport, } from "../../ruseFcltMng/fcltSttn/rswtSttn/headList"; +import type { SelectDataType } from "@common/business_components/ui"; +import { excelRSwtSttnParsing } from "../../ruseFcltMng/fcltSttn/rswtSttn/excel"; export const rswtMapSize = 15; export type rswtMapState = { rswtMap: { rswtMapRes: customRswtBdst[]; rswtMapCount: number; + rswtMapExcelList:[] isInit: boolean; rswtSttHeadList: CommonTableProps[]; rswtSttNodeList: CommonTableProps[]; @@ -20,10 +23,9 @@ export type rswtMapState = { type rswtMapActions = { rswtMapInit: (page: number, total: number, cityOrSgg: string) => void; rswtMapSearch: ( - page: number, - total: number, - cityOrSgg: string, - searchTxt?: string + isExcel: boolean, page: number, total: string, con: string, txt: string, + sidoCode: SelectDataType[], + sggCode: SelectDataType[] ) => void; rswtMapDetile: (featureCd: string) => Promise; }; @@ -34,6 +36,7 @@ export const rswtMapStateExport: rswtMapState = { rswtMap: { isInit: false, rswtMapRes: [], + rswtMapExcelList:[], rswtMapCount: 1, rswtSttHeadList: rswtSttHeadListExport, rswtSttNodeList: rswtSttNodeListExport, @@ -69,32 +72,43 @@ export const rswtMapActionsExport: (set: any) => rswtMapActions = ( console.log(e); } }, - rswtMapSearch: async ( - page: number, - total: number, - cityOrSgg: string, - searchTxt?: string + rswtMapSearch: async (isExcel: boolean, page: number, total: string, con: string, txt: string, + sidoCode: SelectDataType[], + sggCode: SelectDataType[] ) => { try { const rswtMapRes = await getFetchWithCount( fetchType.WR, `/reuseFc/waterreuseFc` + - (page ? `/${page}` : "/1") + - (total ? `/${total}` : "/20") + - (cityOrSgg ? `/${cityOrSgg}` : "/0") + - (searchTxt ? `/${searchTxt}` : "") + (page ? `/${page}` : "/1") + + (total ? `/${total}` : "/20") + + (con ? `/${con}` : "/0") + + (txt ? `/${txt}` : "") ); + if (isExcel) { + const rswtMapExcelList = excelRSwtSttnParsing(rswtMapRes, sidoCode, sggCode); + set((state: rswtMapState) => { + return { + ...state, + rswtMap: { + ...state.rswtMap, + rswtMapExcelList:rswtMapExcelList + }, + }; + }); + }else{ - set((state: rswtMapState) => { - return { - ...state, - rswtMap: { - ...state.rswtMap, - rswtMapRes: rswtMapRes.data, - rswtMapCount: rswtMapRes.count, - }, - }; - }); + set((state: rswtMapState) => { + return { + ...state, + rswtMap: { + ...state.rswtMap, + rswtMapRes: rswtMapRes.data, + rswtMapCount: rswtMapRes.count, + }, + }; + }); + } } catch (e) { console.log(e); } diff --git a/apps/wr/app/store/map/ruseMap/index.tsx b/apps/wr/app/store/map/ruseMap/index.tsx index 6333846b4..cd11bcbd1 100644 --- a/apps/wr/app/store/map/ruseMap/index.tsx +++ b/apps/wr/app/store/map/ruseMap/index.tsx @@ -8,6 +8,7 @@ import { import type { ReturnType } from "@common/business_components/ui"; import { hasuListFetch } from "../../ruseFcltMng/fcltSttn/pbnstSttn"; import type { customPbnst } from "../../ruseFcltMng/fcltReg/pbnstReg/type"; +import { excelPbnstSttnParsing } from "../../ruseFcltMng/fcltSttn/pbnstSttn/excel"; export const ruseMapSize = 15; export type ruseMapState = { @@ -16,6 +17,7 @@ export type ruseMapState = { ruseMapCount: number; isInit: boolean; fclts: string[]; + ruseExcelList:[]; ruseDetailList: customPbnst[]; ruseMapHeadList: CommonTableProps[]; ruseMapNodeList: CommonTableProps[]; @@ -29,7 +31,16 @@ type ruseMapActions = { total: number, reurnValue: ReturnType, year: string, - fclts: string[] + fclts: string[], + isExcel:boolean + ) => void; + ruseMapSearch: ( + page: number, + total: number, + reurnValue: ReturnType, + year: string, + fclts: string[], + fcltNm:string ) => void; ruseMapDetail: (ruseFcltId: string) => Promise; getRuseMaplList: (bscFctCd: string) => void; @@ -45,6 +56,7 @@ export const ruseMapStateExport: ruseMapState = { ruseDetailList: [], fclts: [], ruseMapCount: 1, + ruseExcelList:[], ruseMapHeadList: pbnSttHeadListExport, ruseMapNodeList: pbnstSttNodeListExport, }, @@ -69,7 +81,8 @@ export const ruseMapActionsExport: (set: any) => ruseMapActions = ( total: number, reurnValue: ReturnType, year: string, - fclts: string[] + fclts: string[], + isExcel:boolean ) => { try { const ruseMapRes = await hasuListFetch( @@ -80,7 +93,7 @@ export const ruseMapActionsExport: (set: any) => ruseMapActions = ( year, fclts ); - + if(!isExcel){ set((state: ruseMapState) => { return { ...state, @@ -92,6 +105,19 @@ export const ruseMapActionsExport: (set: any) => ruseMapActions = ( }, }; }); + }else{ + const ruseMapExcel = excelPbnstSttnParsing(ruseMapRes.data); + + set((state: ruseMapState) => { + return { + ...state, + ruseMap: { + ...state.ruseMap, + ruseExcelList: ruseMapExcel, + }, + }; + }); + } } catch (e) { console.log(e); } @@ -148,5 +174,38 @@ export const ruseMapActionsExport: (set: any) => ruseMapActions = ( throw errorHasu; // 호출부에서 catch 가능하도록 } }, + ruseMapSearch: async ( + page: number, + total: number, + reurnValue: ReturnType, + year: string, + fclts: string[], + fcltNm:string + ) => { + try { + const ruseMapRes = await hasuListFetch( + String(page), + String(total), + reurnValue, + fcltNm, + year, + fclts, + ); + + set((state: ruseMapState) => { + return { + ...state, + ruseMap: { + ...state.ruseMap, + ruseMapRes: ruseMapRes.data, + ruseMapCount: ruseMapRes.count, + isInit: false, + }, + }; + }); + } catch (e) { + console.log(e); + } + }, }; }; diff --git a/apps/wr/app/store/matDmd/ruseCaseMng/excel.tsx b/apps/wr/app/store/matDmd/ruseCaseMng/excel.tsx index bb0c18d6a..cd320cd06 100644 --- a/apps/wr/app/store/matDmd/ruseCaseMng/excel.tsx +++ b/apps/wr/app/store/matDmd/ruseCaseMng/excel.tsx @@ -61,49 +61,49 @@ export const reUseCaseNames: nameMap = { "사업비 정산_국고비율(백만원)": "clclnEcqrRt" } -interface PbnstSttnItem { - rvbsn: string; - lgbsn: number; - mdmbsn?: string; - rgnNm?: string; - sido?: number; - gugun?: number; - bscFctNm?: string; - efflWqltStndrdNm?: string; - fctCpc?: number; - tel?: string; - ruseUtztnFcltNm?: string; - fcltCpct?: number; - splyExtraCpct?: number; - ruseCpct?: number; - usageTotal?: number; - inUsage?: number; - outUsage?: number; -} +// interface PbnstSttnItem { +// rvbsn: string; +// lgbsn: number; +// mdmbsn?: string; +// rgnNm?: string; +// sido?: number; +// gugun?: number; +// bscFctNm?: string; +// efflWqltStndrdNm?: string; +// fctCpc?: number; +// tel?: string; +// ruseUtztnFcltNm?: string; +// fcltCpct?: number; +// splyExtraCpct?: number; +// ruseCpct?: number; +// usageTotal?: number; +// inUsage?: number; +// outUsage?: number; +// } -export const excelPbnstSttnParsing = (data: PbnstSttnItem[]): string[][] => { - const excelExportData: string[][] = []; +// export const excelPbnstSttnParsing = (data: PbnstSttnItem[]): string[][] => { +// const excelExportData: string[][] = []; - data.forEach((item) => { - excelExportData.push([ - item.rvbsn, - String(item.lgbsn), - item.mdmbsn ?? "", - item.rgnNm ?? "", - String(item.sido ?? ""), - String(item.gugun ?? ""), - String(item.bscFctNm ?? ""), - String(item.efflWqltStndrdNm ?? ""), - String(item.fctCpc ?? ""), - String(item.tel ?? ""), - String(item.ruseUtztnFcltNm ?? ""), - String(item.fcltCpct ?? ""), - String(item.splyExtraCpct ?? ""), - String(item.ruseCpct ?? ""), - String(item.usageTotal ?? ""), - String(item.inUsage ?? ""), - String(item.outUsage ?? ""), - ]) - }) - return excelExportData; -}; \ No newline at end of file +// data.forEach((item) => { +// excelExportData.push([ +// item.rvbsn, +// String(item.lgbsn), +// item.mdmbsn ?? "", +// item.rgnNm ?? "", +// String(item.sido ?? ""), +// String(item.gugun ?? ""), +// String(item.bscFctNm ?? ""), +// String(item.efflWqltStndrdNm ?? ""), +// String(item.fctCpc ?? ""), +// String(item.tel ?? ""), +// String(item.ruseUtztnFcltNm ?? ""), +// String(item.fcltCpct ?? ""), +// String(item.splyExtraCpct ?? ""), +// String(item.ruseCpct ?? ""), +// String(item.usageTotal ?? ""), +// String(item.inUsage ?? ""), +// String(item.outUsage ?? ""), +// ]) +// }) +// return excelExportData; +// }; \ No newline at end of file diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx index b57e0edde..65f02e26b 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx @@ -22,13 +22,13 @@ export const excelRainSttnParsing = ( String(item.chgBuilding.length > 0 ? "Y" : "N"), String(item.reuseBuilding?.[0]?.lawTrgtYn ?? ""), String(item.reuseBuilding?.[0]?.instlCmptnDt ?? ""), - String(item.reuseBuilding?.[0]?.instlCst ?? ""), + String(item.reuseBuilding?.[0]?.instlCst === -1 ? "확인불가" : String(item.reuseBuilding?.[0]?.instlCst) ?? ""), item.reuseBuilding?.[0]?.rainyObj?.pntfColKnd ?? "", - String(item.reuseBuilding?.[0]?.rainyObj?.pntfColArea ?? ""), + String(item.reuseBuilding?.[0]?.rainyObj?.pntfColArea === -1 ? "확인불가" : String(item.reuseBuilding?.[0]?.rainyObj?.pntfColArea) ?? ""), String(item.reuseBuilding?.[0]?.rainyObj?.filtrTrtmfctYn ?? ""), - String(item.reuseBuilding?.[0]?.rainyObj?.filtrTrtmfctCpct ?? ""), + String(item.reuseBuilding?.[0]?.rainyObj?.filtrTrtmfctCpct === -1 ? "확인불가" : String(item.reuseBuilding?.[0]?.rainyObj?.filtrTrtmfctCpct) ?? ""), String(item.reuseBuilding?.[0]?.rainyObj?.filtrTrtmfctPrs ?? ""), - String(item.reuseBuilding?.[0]?.rainyObj?.dtfcltCpct ?? ""), + String(item.reuseBuilding?.[0]?.rainyObj?.dtfcltCpct === -1 ? "확인불가" : String(item.reuseBuilding?.[0]?.rainyObj?.dtfcltCpct) ?? ""), String(item.reuseBuilding?.[0]?.instlCstSprtYn ?? ""), String(item.reuseBuilding?.[0]?.instlCstSprtAmt === -1 ? "확인불가" : String(item.reuseBuilding?.[0]?.instlCstSprtAmt) ?? ""), String(item.reuseBuilding?.[0]?.grntchBdstCertYn ?? ""), diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx index 803dc2d83..b3d3835c2 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx @@ -25,7 +25,7 @@ export const excelRSwtSttnParsing = ( String(item.reuseBuilding?.[0]?.instlCmptnDt ?? ""), //설치완료일시 String(item.reuseBuilding?.[0]?.instlCst === -1 ? "확인불가" : item.reuseBuilding?.[0]?.instlCst ?? ""), //설치비용 item.reuseBuilding?.[0]?.rswtrObj?.orgwtKndCd ?? "", //원수종류 - String(item.reuseBuilding?.[0]?.rswtrObj.filtrTrtmfctCpct ?? ""), //처리시설용량 + String(item.reuseBuilding?.[0]?.rswtrObj.filtrTrtmfctCpct === -1 ? "확인불가" : item.reuseBuilding?.[0]?.rswtrObj.filtrTrtmfctCpct ?? ""), //처리시설용량 String(item.reuseBuilding?.[0]?.rswtrObj?.filtrTrtmfctProcs ?? ""), //주요처리공정 String(item.reuseBuilding?.[0]?.rswtrObj?.filtrTrtmfctUsgCd ?? ""), //이용용도 String(item.reuseBuilding?.[0]?.instlCstSprtYn ?? ""), //설치지원비용여부 diff --git a/apps/wr/components/lib/func/mapUtil.ts b/apps/wr/components/lib/func/mapUtil.ts index 155bd5c07..a23b48484 100644 --- a/apps/wr/components/lib/func/mapUtil.ts +++ b/apps/wr/components/lib/func/mapUtil.ts @@ -133,7 +133,9 @@ export function featurePopUpOpen(layerNm:string,featureCd:string,popupDetailRef) const height = String(layerNm) === "tb_wr_bdst_ruse_fclt" ? Math.floor(window.innerHeight - 100) - : Math.floor(window.innerHeight - 450); // 150px 여백 확보; // calc(100% - 70px) + : String(layerNm) === "tb_wr_ruse_fclt_dmd_co" + ?Math.floor(window.innerHeight - 430) + : Math.floor(window.innerHeight - 300); // 150px 여백 확보; // calc(100% - 70px) const left = (window.screen.availWidth - width) / 2; const top = (window.screen.availHeight - height) / 2; const popupOptions = `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes `; diff --git a/apps/wr/components/ui/map/LayerPopUp/HedfFacilty/HtdfFacilty.tsx b/apps/wr/components/ui/map/LayerPopUp/HedfFacilty/HtdfFacilty.tsx index 05589e38a..dd280a53f 100644 --- a/apps/wr/components/ui/map/LayerPopUp/HedfFacilty/HtdfFacilty.tsx +++ b/apps/wr/components/ui/map/LayerPopUp/HedfFacilty/HtdfFacilty.tsx @@ -1,7 +1,12 @@ import { useWrStore } from "@/app/store"; +import { htdfMapSize } from "@/app/store/map/htdflMap"; import { rainMapSize } from "@/app/store/map/rainMap"; import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg"; -import { getCity, tableData } from "@/components/lib/func/commom"; +import { + excelDownload, + getCity, + tableData, +} from "@/components/lib/func/commom"; import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal"; import { ContentsDiv, @@ -17,15 +22,26 @@ import { import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan"; import { Button } from "@common/components/ui"; import { useCallback, useEffect, useState } from "react"; +import toast from "react-hot-toast"; +import { useTranslation } from "react-i18next"; export function HtdflFacility({ rtnFeature, }: { rtnFeature: (feature: any) => void; }) { - const { code, htdfMap, htdfMapInit,htdfMapSearch } = useWrStore((state) => state); - const { htdfMapCount, htdfMapRes, htdfSttHeadList, htdfSttNodeList } = - htdfMap; + const { code, htdfMap, htdfMapInit, htdfMapSearch } = useWrStore( + (state) => state + ); + const { t } = useTranslation("base"); + + const { + htdfMapCount, + htdflMapExcelList, + htdfMapRes, + htdfSttHeadList, + htdfSttNodeList, + } = htdfMap; const [htdflTable, setHtdflTable] = useState(); const [isReset, setIsReset] = useState(false); const [selectSgg, setSelectSgg] = useState(); @@ -86,6 +102,19 @@ export function HtdflFacility({ setHtdflTable(chData); }, [code, htdfMapRes]); + useEffect(() => { + if (htdflMapExcelList.length > 0) { + excelDownload( + htdflMapExcelList, + "온배수시설 현황", + "sample_htdflSttn.xlsx", + "A1:R3" + ); + } else { + toast.error(t("excelDownErrMsg")); + } + }, [htdflMapExcelList]); + return ( <> @@ -115,17 +144,50 @@ export function HtdflFacility({ /> { setSearchTxt(e); }} - /> + />{" "} + +
- + */}
-
+
0) { - htdfMapSearch( - page, - rainMapSize, - String(con), - seartchTxt ?? "" - ); - } else { - htdfMapSearch(page, rainMapSize, String(con)); - } + htdfMapSearch( + false, + page, + String(htdfMapSize), + String(con), + seartchTxt||'', + code.cityCd, + code.sggCd + ); setIsReset(false); } }} diff --git a/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx b/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx index e1a917e8f..a19744320 100644 --- a/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx +++ b/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx @@ -1,7 +1,7 @@ import { useWrStore } from "@/app/store"; import { rainMapSize } from "@/app/store/map/rainMap"; import type { customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; -import { getCity, tableData } from "@/components/lib/func/commom"; +import { excelDownload, getCity, tableData } from "@/components/lib/func/commom"; import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal"; import { ContentsDiv, @@ -17,6 +17,8 @@ import { import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan"; import { Button } from "@common/components/ui"; import { useCallback, useEffect, useState } from "react"; +import toast from "react-hot-toast"; +import { useTranslation } from "react-i18next"; export function RainFacility({ rtnFeature, @@ -26,7 +28,7 @@ export function RainFacility({ const { code, rainMap, rainMapInit, rainMapSearch } = useWrStore( (state) => state ); - const { rainMapRes, rainMapCount, rainSttHeadList, rainSttNodeList } = + const { rainMapRes, rainMapExcelList,rainMapCount, rainSttHeadList, rainSttNodeList } = rainMap; const [rainTable, setRainTable] = useState(); const [isReset, setIsReset] = useState(false); @@ -35,6 +37,7 @@ export function RainFacility({ sgg: "", city: "", }); + const { t } = useTranslation('base'); const [seartchTxt, setSearchTxt] = useState(); @@ -116,7 +119,18 @@ export function RainFacility({ .filter((item: any) => item.rainyObj !== undefined); setRainTable(chData); }, [code, rainMapRes]); - + useEffect(() => { + if (rainMapExcelList.length > 0) { + excelDownload( + rainMapExcelList, + "빗물재이용시설 현황", + "sample_rainSttn.xlsx", + "A1:W3" + ); + } else { + toast.error(t("excelDownErrMsg")); + } + }, [rainMapExcelList]); return ( <> @@ -146,17 +160,50 @@ export function RainFacility({ /> { setSearchTxt(e); }} /> + +
- + */}
@@ -187,16 +243,16 @@ export function RainFacility({ ? objSearch.sgg : objSearch.city; if (con) { - if (seartchTxt && seartchTxt?.length > 0) { - rainMapSearch( - page, - rainMapSize, - String(con), - seartchTxt ?? "" - ); - } else { - rainMapSearch(page, rainMapSize, String(con)); - } + rainMapSearch( + false, + page, + String(rainMapSize), + String(con), + seartchTxt ?? "", + code.cityCd, + code.sggCd + ); + 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 18a2b2c1d..c6bb80468 100644 --- a/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx +++ b/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx @@ -1,57 +1,71 @@ import { useWrStore } from "@/app/store"; import { rainMapSize } from "@/app/store/map/rainMap"; import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg"; -import { getCity, tableData } from "@/components/lib/func/commom"; +import { excelDownload, getCity, tableData } from "@/components/lib/func/commom"; import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal"; -import { ContentsDiv, SearchDiv, SearchFormLeft, SearchFormRight, SearchInput, SelectBox, Title, UiTable, type SelectDataType } from "@common/business_components/ui"; +import { + ContentsDiv, + SearchDiv, + SearchFormLeft, + SearchFormRight, + SearchInput, + SelectBox, + Title, + UiTable, + type SelectDataType, +} from "@common/business_components/ui"; import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan"; import { Button } from "@common/components/ui"; import { useCallback, useEffect, useState } from "react"; +import toast from "react-hot-toast"; +import { useTranslation } from "react-i18next"; export function RswtFacility({ rtnFeature, }: { rtnFeature: (feature: any) => void; }) { - const { code, rswtMap, rswtMapInit,rswtMapSearch } = useWrStore((state) => state); - const { rswtMapRes, rswtMapCount, rswtSttHeadList, rswtSttNodeList } = + const { code, rswtMap, rswtMapInit, rswtMapSearch } = useWrStore( + (state) => state + ); + const { rswtMapRes, rswtMapExcelList, rswtMapCount, rswtSttHeadList, rswtSttNodeList } = rswtMap; const [rswtrTable, setRswtrTable] = useState(); const [isReset, setIsReset] = useState(false); - const [selectSgg, setSelectSgg] = useState(); - const [objSearch, setObjSearch] = useState({ - sgg: "", - city: "", - }); - - const [seartchTxt, setSearchTxt] = useState(); - - const getSelCity = useCallback( - (val: string | number) => { - const cityValue = String(val); - const data = getCity(cityValue, code.sggCd); - setSelectSgg(data); - setObjSearch({ city: cityValue, sgg: "0" }); - }, - [code.sggCd] - ); - - const getSgg = useCallback((val: string | number) => { - setObjSearch((prev) => ({ ...prev, sgg: String(val) })); - }, []); - - useEffect(() => { - // code.cityCd 데이터가 로드되었고, 아직 시/도 선택이 안된 초기 상태일 때 실행 - if (code.cityCd && code.cityCd.length > 0 && !objSearch.city) { - const firstCityVal = code.cityCd[0]?.val; - if (firstCityVal) { - // 첫 번째 시/도 값으로 상태를 초기화합니다. - getSelCity(firstCityVal); - } + const [objSearch, setObjSearch] = useState({ + sgg: "", + city: "", + }); + const { t } = useTranslation('base'); + + const [seartchTxt, setSearchTxt] = useState(); + + const getSelCity = useCallback( + (val: string | number) => { + const cityValue = String(val); + const data = getCity(cityValue, code.sggCd); + setSelectSgg(data); + setObjSearch({ city: cityValue, sgg: "0" }); + }, + [code.sggCd] + ); + + const getSgg = useCallback((val: string | number) => { + setObjSearch((prev) => ({ ...prev, sgg: String(val) })); + }, []); + + useEffect(() => { + // code.cityCd 데이터가 로드되었고, 아직 시/도 선택이 안된 초기 상태일 때 실행 + if (code.cityCd && code.cityCd.length > 0 && !objSearch.city) { + const firstCityVal = code.cityCd[0]?.val; + if (firstCityVal) { + // 첫 번째 시/도 값으로 상태를 초기화합니다. + getSelCity(firstCityVal); } - }, [code.cityCd, objSearch.city, getSelCity]); + } + }, [code.cityCd, objSearch.city, getSelCity]); const rswtCellClick = (index: number | undefined, headId: string) => { if ( headId !== "chBuildingYn" && @@ -100,6 +114,19 @@ export function RswtFacility({ ); setRswtrTable(chData); }, [code, rswtMapRes]); + + useEffect(() => { + if (rswtMapExcelList.length > 0) { + excelDownload( + rswtMapExcelList, + "중수도시설 현황", + "sample_rswtSttn.xlsx", + "A1:W3", + ); + } else { + toast.error(t('excelDownErrMsg')); + } + }, [rswtMapExcelList]); return ( <> @@ -129,18 +156,14 @@ export function RswtFacility({ /> { setSearchTxt(e); }} /> -
- - -
+ +
+ + +
+ {/* */}
@@ -166,22 +226,23 @@ export function RswtFacility({ }} onPageChange={(page) => { const con = - objSearch.sgg && objSearch.sgg !== "0" - ? objSearch.sgg - : objSearch.city; - if (con) { - if (seartchTxt && seartchTxt?.length > 0) { + objSearch.sgg && objSearch.sgg !== "0" + ? objSearch.sgg + : objSearch.city; + if (con) { rswtMapSearch( + false, page, - rainMapSize, + String(rainMapSize), String(con), - seartchTxt ?? "" + seartchTxt ?? "", + code.cityCd, + code.sggCd ); - } else { - rswtMapSearch(page, rainMapSize, String(con)); + + setIsReset(false); } - setIsReset(false); - }}} + }} resetPageNo={isReset} > diff --git a/apps/wr/components/ui/map/LayerPopUp/RuseFacilty/RuseFacility.tsx b/apps/wr/components/ui/map/LayerPopUp/RuseFacilty/RuseFacility.tsx index 4fd9c684f..f171cdf6b 100644 --- a/apps/wr/components/ui/map/LayerPopUp/RuseFacilty/RuseFacility.tsx +++ b/apps/wr/components/ui/map/LayerPopUp/RuseFacilty/RuseFacility.tsx @@ -2,7 +2,7 @@ import { useWrStore } from "@/app/store"; import { btnClass } from "@/app/store/common/code"; import { ruseMapSize } from "@/app/store/map/ruseMap"; import type { WaterReuseFacility } from "@/app/store/ruseFcltMng/fcltSttn/pbnstSttn/type"; -import { yearOptions } from "@/components/lib/func/commom"; +import { excelDownload, yearOptions } from "@/components/lib/func/commom"; import { ContentsDiv, SearchBaseForm, @@ -14,17 +14,20 @@ import { } from "@common/business_components/ui"; import { Label } from "@common/components/ui"; import { useEffect, useRef, useState } from "react"; +import toast from "react-hot-toast"; +import { useTranslation } from "react-i18next"; export function RuseFacility({ rtnFeature, }: { rtnFeature: (feature: any) => void; }) { - const { code, ruseMap, ruseMapInit, getMapFlcts } = useWrStore( + const { code, ruseMap, ruseMapInit, getMapFlcts,ruseMapSearch } = useWrStore( (state) => state ); + const { t } = useTranslation("base"); - const { ruseMapCount, fclts, ruseMapRes,ruseMapHeadList } = ruseMap; + const { ruseMapCount, ruseExcelList,fclts, ruseMapRes,ruseMapHeadList } = ruseMap; const [ruseTable, setRuseTable] = useState(); const [isReset, setIsReset] = useState(false); @@ -48,9 +51,26 @@ export function RuseFacility({ } }, [ruseMap.isInit]); useEffect(() => { - ruseMapInit(1,ruseMapSize, ref.current, searchYear, fclts); + ruseMapInit(1,ruseMapSize, ref.current, searchYear, fclts,false); }, [fclts]); + + useEffect(()=>{ + if(ruseExcelList&&ruseExcelList.length>0){ + if (ruseExcelList.length > 0) { + excelDownload( + ruseExcelList, + "하수재이용시설 현황", + "sample_pbnstSttn.xlsx", + "A1:U2", + 3 + ); + } else { + toast.error(t('excelDownErrMsg')); + } + } + + },[ruseExcelList]) useEffect(() => { if (ruseMapRes && ruseMapRes.length > 0) { setRuseTable(ruseMapRes); @@ -113,7 +133,7 @@ export function RuseFacility({ ref={ref} isAdmin={false} excelClick={function (returnType: ReturnType): void { - console.log("pbnstSttnSearch ", returnType); + ruseMapInit(1,100000 , returnType, searchYear, fclts,true); }} />
@@ -127,7 +147,12 @@ export function RuseFacility({ headName={""} cellClick={ruseCellClick} onPageChange={(page) => { - ruseMapInit(page,ruseMapSize , ref.current, searchYear, fclts); + if(pbnRuseNm&&pbnRuseNm.length>0){ + ruseMapSearch(page,ruseMapSize , ref.current, searchYear, fclts,pbnRuseNm) + }else{ + ruseMapInit(page,ruseMapSize , ref.current, searchYear, fclts,false); + } + setIsReset(false); }} resetPageNo={isReset} From 5f559b4e2d3ce567324e69280c70def9cc9e924f Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 13 Aug 2025 13:56:51 +0900 Subject: [PATCH 14/20] =?UTF-8?q?=ED=95=98=EC=88=98=EC=B2=98=EB=A6=AC?= =?UTF-8?q?=EC=8B=9C=EC=84=A4=20=ED=8C=9D=EC=97=85=EB=8F=84=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/store/map/pbnstMap/excel.ts | 21 +++++++ apps/wr/app/store/map/pbnstMap/index.tsx | 56 +++++++++++++++++- .../LayerPopUp/HasuFacilty/HasuFacility.tsx | 33 +++++++++-- apps/wr/public/sample_hasuMap.xlsx | Bin 0 -> 8671 bytes 4 files changed, 104 insertions(+), 6 deletions(-) create mode 100644 apps/wr/app/store/map/pbnstMap/excel.ts create mode 100644 apps/wr/public/sample_hasuMap.xlsx diff --git a/apps/wr/app/store/map/pbnstMap/excel.ts b/apps/wr/app/store/map/pbnstMap/excel.ts new file mode 100644 index 000000000..63484b12f --- /dev/null +++ b/apps/wr/app/store/map/pbnstMap/excel.ts @@ -0,0 +1,21 @@ + +export const excelHasuMapParsing = ( + excel:{data:any[]} +): string[][] => { + const excelExportData: string[][] = []; + + excel.data.forEach((item) => { + + excelExportData.push([ + item.sido??'', + item.gugun??'', + item.bscFctNm ?? "", + String(item.addr??""), + item.efflWqltStndrdNm ?? "", + String(item.fctCpc ?? ""), + String(item.ruse ?? ""), + String(item.rswtrYn ?? ""), + ]); + }); + return excelExportData; +}; \ No newline at end of file diff --git a/apps/wr/app/store/map/pbnstMap/index.tsx b/apps/wr/app/store/map/pbnstMap/index.tsx index c093431ff..4cd118caa 100644 --- a/apps/wr/app/store/map/pbnstMap/index.tsx +++ b/apps/wr/app/store/map/pbnstMap/index.tsx @@ -1,9 +1,10 @@ import { fetchType, postFectch } from "@/components/lib/api"; import type { pubHasuType } from "../../ruseFcltMng/fcltReg/pbnstReg/type"; import { checkWrRegList } from "../../ruseFcltMng/fcltReg/pbnstReg"; -import type { ReturnType } from "@common/business_components/ui"; +import type { ReturnType} from "@common/business_components/ui"; import { pubFacHeadListExport } from "../../ruseFcltMng/fcltReg/pbnstReg/headList"; import type { TableUpperProps } from "../../common/type/header"; +import { excelHasuMapParsing } from "./excel"; export const pbnMapTableSize = 20; @@ -61,12 +62,23 @@ export type pbnMapState = { pbnMapRes: pubHasuType[]; pbnMapCount: number; pbnMapHeadList: TableUpperProps[]; + hasuMapExcelList:[] }; }; type pbnMapActions = { pbnMapInit: (page: number, pageTotal: number, reurnValue: ReturnType) => void; - pbnMapDetaile: (featureCd: string, data: string) => Promise; + pbnMapSearch: ( + isExcel: boolean, + page: number, + pageTotal: number, + reurnValue: ReturnType, + txt: string, + ) => void; + pbnMapDetaile: ( + featureCd: string, + data: string + ) => Promise; }; export type pbnMapType = pbnMapState & pbnMapActions; @@ -77,6 +89,7 @@ export const pbnMapStateExport: pbnMapState = { pbnMapRes: [], pbnMapCount: 1, pbnMapHeadList: pubFacHeadListExport, + hasuMapExcelList:[] }, }; @@ -124,5 +137,44 @@ export const pbnMapActionsExport: (set: any) => pbnMapActions = (set: any) => { throw error; // 호출부에서 catch 가능하도록 } }, + pbnMapSearch: async ( + isExcel: boolean, + page: number, + pageTotal: number, + reurnValue: ReturnType, + txt: string, + ) => { + try { + const hasuMapRes = await hasuListFetch(page, pageTotal, reurnValue, txt); + if (isExcel) { + const hasuMapExcelList = excelHasuMapParsing( + hasuMapRes + ); + set((state: pbnMapState) => { + return { + ...state, + pbnMap: { + ...state.pbnMap, + hasuMapExcelList: hasuMapExcelList + }, + }; + }); + } else { + set((state: pbnMapState) => { + return { + ...state, + pbnMap: { + ...state.pbnMap, + pbnMapRes: hasuMapRes.data, + pbnMapCount: hasuMapRes.count, + isInit: false, + }, + }; + }); + } + } catch (e) { + console.log(e); + } + }, }; }; diff --git a/apps/wr/components/ui/map/LayerPopUp/HasuFacilty/HasuFacility.tsx b/apps/wr/components/ui/map/LayerPopUp/HasuFacilty/HasuFacility.tsx index 4f9d052de..2a8210aa0 100644 --- a/apps/wr/components/ui/map/LayerPopUp/HasuFacilty/HasuFacility.tsx +++ b/apps/wr/components/ui/map/LayerPopUp/HasuFacilty/HasuFacility.tsx @@ -2,7 +2,7 @@ import { useWrStore } from "@/app/store"; import { btnClass } from "@/app/store/common/code"; import { pbnMapTableSize } from "@/app/store/map/pbnstMap"; import type { pubHasuType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type"; -import { tableData } from "@/components/lib/func/commom"; +import { excelDownload, tableData } from "@/components/lib/func/commom"; import { ContentsDiv, SearchBaseForm, @@ -13,14 +13,17 @@ import { } from "@common/business_components/ui"; import { Label } from "@common/components/ui"; import { useEffect, useRef, useState } from "react"; +import toast from "react-hot-toast"; +import { useTranslation } from "react-i18next"; export function HasuFacility({rtnFeature}:{rtnFeature:(feature:any)=>void } ) { - const { code, pbnMap, pbnMapInit } = useWrStore((state) => state); + const { code, pbnMap, pbnMapInit ,pbnMapSearch} = useWrStore((state) => state); const [hasuTable, setHasuTable] = useState(); const [isReset, setIsReset] = useState(false); const [pbnRuseNm, setPbnRuseNm] = useState(""); const ref = useRef({} as ReturnType); - const { pbnMapHeadList, pbnMapRes, pbnMapCount } = pbnMap; + const { pbnMapHeadList, pbnMapRes, pbnMapCount ,hasuMapExcelList} = pbnMap; + const { t } = useTranslation("base"); useEffect(() => { if (!pbnMap.isInit) { @@ -39,6 +42,22 @@ export function HasuFacility({rtnFeature}:{rtnFeature:(feature:any)=>void } ) { rtnFeature(pbnMapRes[index]) } }; + + + useEffect(() => { + if (hasuMapExcelList.length > 0) { + excelDownload( + hasuMapExcelList, + "하수처리시설 현황", + "sample_hasuMap.xlsx", + "A1:H1", + 2 + ); + } else { + toast.error(t("excelDownErrMsg")); + } + }, [hasuMapExcelList]); + return ( <> @@ -83,6 +102,10 @@ export function HasuFacility({rtnFeature}:{rtnFeature:(feature:any)=>void } ) { isAdmin={false} excelClick={function (returnType: ReturnType): void { console.log("pbnstSttnSearch ", returnType); + + + pbnMapSearch(true,1, 100000, returnType,'' ) + }} />
@@ -96,7 +119,9 @@ export function HasuFacility({rtnFeature}:{rtnFeature:(feature:any)=>void } ) { headName={""} cellClick={hasuCellClick} onPageChange={(page) => { - pbnMapInit(page, pbnMapTableSize, ref.current); + //pbnMapInit(page, pbnMapTableSize, ref.current); + + pbnMapSearch(false,page, pbnMapTableSize, ref.current,pbnRuseNm??'' ) setIsReset(false); }} resetPageNo={isReset} diff --git a/apps/wr/public/sample_hasuMap.xlsx b/apps/wr/public/sample_hasuMap.xlsx new file mode 100644 index 0000000000000000000000000000000000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c&008U%n)Ki4Mk&iU z%rGLiv-J9W+m}5iEtFwt?i-~+YsdWj zDDkq{8r*YG0Cfsd?~*&Ih@#P_gEMT|=ebtGhE;wrvhHXkS`qdoj0-AcKIX*Q!ZTUgRpRzlibg4SDdC^12y(I(1&R<6yt-$wuRF-;y|}Ps z6us$nFvFGOIJjY~5w)&VgH(}Blx~$F&xvwZ@o55k2_iN~rJ}W4J&Qd<<*lozu6(Gr zE?9vmd2OA=v>vc`568gAloS==om&ntX8%g!MMH47DbJlEwjX=NonBf6Ak$kR^iVtGBdkJUKgcVmCJfwJZqzfYfmvLX1dT8B({ON;`);|7hA!{Vm#%ik% zVpYRdGz6b46Vo>;T11hmHw?8iQQDHUUV#P@f-EsTN~xq|8e;>xN=rM z=sfiSf7Ux8k5>&|-AJBEeNx|tk+VQfOK0;-4TFsxU}fcA=vd#Y`*8upw029}q4gR0 zaeNEkCpF&-+1_fy{&P!>${Ftwk{P-6Eu6d*$ZO*KpPld5pElri0sr&)FCY9Z@U2b! z8}SDS|9X0B8ox!qbs_(vk6x$uf6)KilY9$*Ypnf+tG(_|Z)~==;J41uU+~Op*uH}Q z2cPII&s!JeFVER)UGmEF)>C;)@V2Y-mmnAMAA-Lqf&RC literal 0 HcmV?d00001 From be11f6252a3b6f629ee0c3b2665cab0442e77d92 Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 13 Aug 2025 16:14:10 +0900 Subject: [PATCH 15/20] =?UTF-8?q?feat:=20=EA=B0=80=EB=AD=84=EC=A7=80?= =?UTF-8?q?=EB=8F=84=20=EC=B4=88=EA=B8=B0=20=ED=99=94=EB=A9=B4=EC=9D=84=20?= =?UTF-8?q?=EC=A0=84=EA=B5=AD=EC=9C=BC=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/(popUp-layout)/mapDrgtPopUp/page.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/wr/app/(popUp-layout)/mapDrgtPopUp/page.tsx b/apps/wr/app/(popUp-layout)/mapDrgtPopUp/page.tsx index a2c843351..e126feb99 100644 --- a/apps/wr/app/(popUp-layout)/mapDrgtPopUp/page.tsx +++ b/apps/wr/app/(popUp-layout)/mapDrgtPopUp/page.tsx @@ -82,6 +82,8 @@ export default function MapDrgtPopUp() { checkInterval={2500} height={`h-[100vh]`} droughtDates={{ startYmd: fromDate, endYmd: toDate }} + defaultZoom={7} + defaultLonLat={[127.4875, 36.4916]} /> ); From 1732f5ba18ddcc2fa05e022dbb179f859b9aebf3 Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 13 Aug 2025 16:26:45 +0900 Subject: [PATCH 16/20] =?UTF-8?q?feat:=20=EA=B0=80=EB=AD=84=EC=A7=80?= =?UTF-8?q?=EB=8F=84=20=EC=8B=9C=EB=8F=84,=20=EC=8B=9C=EA=B5=B0=EA=B5=AC?= =?UTF-8?q?=20Custom=20=EC=A0=95=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../(popUp-layout)/mapDrgtPopUp/searchBar.tsx | 50 ++++++++++++++++--- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/apps/wr/app/(popUp-layout)/mapDrgtPopUp/searchBar.tsx b/apps/wr/app/(popUp-layout)/mapDrgtPopUp/searchBar.tsx index 21a98d696..b1a049236 100644 --- a/apps/wr/app/(popUp-layout)/mapDrgtPopUp/searchBar.tsx +++ b/apps/wr/app/(popUp-layout)/mapDrgtPopUp/searchBar.tsx @@ -46,7 +46,7 @@ export function SearchBar({ gisMaps, ctpvCode, sggCode }: CtpvSggPrcsFcltSelectB async function fetchCtpvData() { try { const ctpvData = await fetch(`/geoserver/hasudo/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=hasudo%3Atb_ms_ctpv&outputFormat=application%2Fjson&cql_filter=mctpv_cd=%27${ctpvCd.trim()}%27&srsName=EPSG:5179`) - .then(res => res.json()); + .then(res => res.json()); console.log('시도 데이터', ctpvData.features[0]); const format = new GeoJSON(); @@ -110,10 +110,48 @@ export function SearchBar({ gisMaps, ctpvCode, sggCode }: CtpvSggPrcsFcltSelectB const url = `/geoserver/hasudo/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=hasudo:tb_ms_ctpv&outputFormat=application/json&propertyName=mctpv_korn_nm,mctpv_cd`; const res = await fetch(url).then(res => res.json()); - const list = res.features.map((f: any) => ({ - text: f.properties.mctpv_korn_nm, - val: f.properties.mctpv_cd, - })); + const list = res.features + .map((f: any) => ({ + text: f.properties.mctpv_korn_nm, + val: f.properties.mctpv_cd, + })) + .sort((a, b) => { + // 커스텀 순서 정의 + const customOrder = [ + "서울특별시", + "부산광역시", + "대구광역시", + "인천광역시", + "광주광역시", + "대전광역시", + "울산광역시", + "세종특별자치시", + "경기도", + "강원특별자치도", // 경기도 다음에 배치 + "충청북도", + "충청남도", + "전북특별자치도", // 충청남도 다음에 배치 + "전라남도", + "경상북도", + "경상남도", + "제주특별자치도" + ]; + + const indexA = customOrder.indexOf(a.text); + const indexB = customOrder.indexOf(b.text); + + // 둘 다 커스텀 순서에 있으면 해당 순서로 + if (indexA !== -1 && indexB !== -1) { + return indexA - indexB; + } + + // 하나만 커스텀 순서에 있으면 그것을 앞으로 + if (indexA !== -1) return -1; + if (indexB !== -1) return 1; + + // 둘 다 커스텀 순서에 없으면 기본 알파벳 순서 + return a.text.localeCompare(b.text, 'ko'); + }); console.log('시도 데이터', list); setCtpv(list); @@ -126,7 +164,7 @@ export function SearchBar({ gisMaps, ctpvCode, sggCode }: CtpvSggPrcsFcltSelectB const list = res.features.map((f: any) => ({ text: f.properties.sgg_korn_nm, val: f.properties.sgg_cd, - })); + })).sort((a, b) => a.text.localeCompare(b.text, 'ko')); console.log('시군구 데이터', list); setSgg(list); From 7c3d4e8f13f6a3e7cd705cc5936b3999dafc9626 Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 13 Aug 2025 17:01:17 +0900 Subject: [PATCH 17/20] =?UTF-8?q?feat:=20=EC=9E=AC=EC=9D=B4=EC=9A=A9?= =?UTF-8?q?=EC=8B=9C=EC=84=A4=ED=98=84=ED=99=A9=20=EC=A7=80=EB=8F=84?= =?UTF-8?q?=EB=A1=9C=EB=B3=B4=EA=B8=B0=20=EC=B4=88=EA=B8=B0=20=ED=99=94?= =?UTF-8?q?=EB=A9=B4=20=EC=A0=84=EA=B5=AD=EC=9C=BC=EB=A1=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/(map-layout)/map/mainMap/page.tsx | 2 ++ apps/wr/app/(popUp-layout)/mapDrgtPopUp/page.tsx | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/wr/app/(map-layout)/map/mainMap/page.tsx b/apps/wr/app/(map-layout)/map/mainMap/page.tsx index 70deb7d42..f75604d86 100644 --- a/apps/wr/app/(map-layout)/map/mainMap/page.tsx +++ b/apps/wr/app/(map-layout)/map/mainMap/page.tsx @@ -276,6 +276,8 @@ const Map = () => { onOpenPopup={(data: any) => { onOpenPopup(data); }} + defaultZoom={7.5} + defaultLonLat={[127.75, 36]} /> diff --git a/apps/wr/app/(popUp-layout)/mapDrgtPopUp/page.tsx b/apps/wr/app/(popUp-layout)/mapDrgtPopUp/page.tsx index e126feb99..e9315a4c9 100644 --- a/apps/wr/app/(popUp-layout)/mapDrgtPopUp/page.tsx +++ b/apps/wr/app/(popUp-layout)/mapDrgtPopUp/page.tsx @@ -82,8 +82,8 @@ export default function MapDrgtPopUp() { checkInterval={2500} height={`h-[100vh]`} droughtDates={{ startYmd: fromDate, endYmd: toDate }} - defaultZoom={7} - defaultLonLat={[127.4875, 36.4916]} + defaultZoom={7.5} + defaultLonLat={[127.75, 36]} /> ); From aacadcb9293345510fb35b22b0e22c74b13e01de Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 13 Aug 2025 17:17:18 +0900 Subject: [PATCH 18/20] =?UTF-8?q?=EB=AC=BC=EC=9E=AC=EC=9D=B4=EC=9A=A9=20?= =?UTF-8?q?=EA=B0=90=EB=A6=AC=20=EC=A7=80=EC=A0=81=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruseFcltMng/fcltReg/pbnstReg/page.tsx | 1 + apps/wr/app/store/map/ruseMap/index.tsx | 69 +++++++++---------- .../ruseFcltMng/fcltReg/pbnstReg/index.tsx | 2 +- .../fcltReg/pbnstReg/mngReg/mngRegForm.tsx | 59 +++++++++------- .../LayerPopUp/HasuFacilty/HasuFacility.tsx | 2 +- .../LayerPopUp/HedfFacilty/HtdfFacilty.tsx | 2 +- .../LayerPopUp/RainFacility/RainFacility.tsx | 2 +- .../LayerPopUp/RswtFacilty/RswtFacilty.tsx | 2 +- .../LayerPopUp/RuseFacilty/RuseFacility.tsx | 8 +-- .../fcltReg/pbnstRegModal/pbnstRegModal.tsx | 1 + 10 files changed, 79 insertions(+), 69 deletions(-) diff --git a/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx index 688fb836c..5f1d0d19c 100644 --- a/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx +++ b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx @@ -236,6 +236,7 @@ export default function PublicReuseFaciltyInsert() { }, [indexMng]); useEffect(() => { + if (pbnst.pbnstRes && pbnst.pbnstRes?.length > 0) { form.reset({ items: pbnst.pbnstRes }); } else { diff --git a/apps/wr/app/store/map/ruseMap/index.tsx b/apps/wr/app/store/map/ruseMap/index.tsx index cd11bcbd1..5e07a9b72 100644 --- a/apps/wr/app/store/map/ruseMap/index.tsx +++ b/apps/wr/app/store/map/ruseMap/index.tsx @@ -17,7 +17,7 @@ export type ruseMapState = { ruseMapCount: number; isInit: boolean; fclts: string[]; - ruseExcelList:[]; + ruseExcelList: []; ruseDetailList: customPbnst[]; ruseMapHeadList: CommonTableProps[]; ruseMapNodeList: CommonTableProps[]; @@ -31,22 +31,21 @@ type ruseMapActions = { total: number, reurnValue: ReturnType, year: string, - fclts: string[], - isExcel:boolean + fclts: string[] ) => void; ruseMapSearch: ( + isExcel: boolean, page: number, total: number, reurnValue: ReturnType, year: string, fclts: string[], - fcltNm:string + fcltNm: string ) => void; ruseMapDetail: (ruseFcltId: string) => Promise; getRuseMaplList: (bscFctCd: string) => void; }; - export type ruseMapType = ruseMapState & ruseMapActions; export const ruseMapStateExport: ruseMapState = { @@ -56,7 +55,7 @@ export const ruseMapStateExport: ruseMapState = { ruseDetailList: [], fclts: [], ruseMapCount: 1, - ruseExcelList:[], + ruseExcelList: [], ruseMapHeadList: pbnSttHeadListExport, ruseMapNodeList: pbnstSttNodeListExport, }, @@ -81,8 +80,7 @@ export const ruseMapActionsExport: (set: any) => ruseMapActions = ( total: number, reurnValue: ReturnType, year: string, - fclts: string[], - isExcel:boolean + fclts: string[] ) => { try { const ruseMapRes = await hasuListFetch( @@ -93,7 +91,6 @@ export const ruseMapActionsExport: (set: any) => ruseMapActions = ( year, fclts ); - if(!isExcel){ set((state: ruseMapState) => { return { ...state, @@ -105,19 +102,6 @@ export const ruseMapActionsExport: (set: any) => ruseMapActions = ( }, }; }); - }else{ - const ruseMapExcel = excelPbnstSttnParsing(ruseMapRes.data); - - set((state: ruseMapState) => { - return { - ...state, - ruseMap: { - ...state.ruseMap, - ruseExcelList: ruseMapExcel, - }, - }; - }); - } } catch (e) { console.log(e); } @@ -175,12 +159,13 @@ export const ruseMapActionsExport: (set: any) => ruseMapActions = ( } }, ruseMapSearch: async ( + isExcel: boolean, page: number, total: number, reurnValue: ReturnType, year: string, fclts: string[], - fcltNm:string + fcltNm: string ) => { try { const ruseMapRes = await hasuListFetch( @@ -189,20 +174,32 @@ export const ruseMapActionsExport: (set: any) => ruseMapActions = ( reurnValue, fcltNm, year, - fclts, + fclts ); - - set((state: ruseMapState) => { - return { - ...state, - ruseMap: { - ...state.ruseMap, - ruseMapRes: ruseMapRes.data, - ruseMapCount: ruseMapRes.count, - isInit: false, - }, - }; - }); + if (isExcel) { + const ruseMapExcel = excelPbnstSttnParsing(ruseMapRes.data); + set((state: ruseMapState) => { + return { + ...state, + ruseMap: { + ...state.ruseMap, + ruseExcelList: ruseMapExcel, + }, + }; + }); + } else { + set((state: ruseMapState) => { + return { + ...state, + ruseMap: { + ...state.ruseMap, + ruseMapRes: ruseMapRes.data, + ruseMapCount: ruseMapRes.count, + isInit: false, + }, + }; + }); + } } catch (e) { console.log(e); } diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx index 3712b4dd1..3272c0509 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx @@ -232,7 +232,7 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { if( response.status === 200) { toast.success(`${pbnstRes.ruseUtztnFcltNm} 하수재이용 시설이 등록되었습니다.`); } - const pbnstHasuRes = await hasuListFetch('1', '0'); + const pbnstHasuRes = await hasuListFetch('1', '41'); return set((state: pubFacState) => ({ ...state, pbnst: { diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx index 68d7634a0..c55c3567e 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx @@ -172,15 +172,17 @@ export function PbnstMngForm({ return [...exFileDatas, ...currentdata]; }; + useEffect(() =>{ + console.log('로그') + + },[]) useEffect(() => { + setRelationFiles([]) + setPlanFiles([]) + setRegFileList([]) + const currentItem = form.getValues(`items.${indexMng}`); const currentKey = JSON.stringify(currentItem); - const isNewItem = - !fileInitRef.current || - fileInitRef.current.index !== indexMng || - fileInitRef.current.key !== currentKey; - - if (!isNewItem) return; // const defaultFiles = currentItem?.fcFiles || []; @@ -190,24 +192,24 @@ export function PbnstMngForm({ const planFileList = defaultFiles.filter( (item) => item.fileKnd === "평면도" ); - - setRelationFiles( - relationFileList.length > 0 - ? relationFileList.map((item) => ({ - atflCd: item.fileTkn, - file: new File([], item.filePath), - })) - : null - ); - - setPlanFiles( - planFileList.length > 0 - ? planFileList.map((item) => ({ - atflCd: item.fileTkn, - file: new File([], item.filePath), - })) - : null - ); + setRelationFiles( + relationFileList.length > 0 + ? relationFileList.map((item) => ({ + atflCd: item.fileTkn, + file: new File([], item.filePath), + })) + : null + ); + + setPlanFiles( + planFileList.length > 0 + ? planFileList.map((item) => ({ + atflCd: item.fileTkn, + file: new File([], item.filePath), + })) + : null + ); + // ✅ 다음 루프에선 다시 안 하도록 저장 fileInitRef.current = { index: indexMng, @@ -217,6 +219,7 @@ export function PbnstMngForm({ useEffect( () => { + //폼이 들어오면 폼에 대한 이름 셀렉트박스를만들기 위해 if (mngRegForm && mngRegForm.length >= 0) { const fcltNmList = mngRegForm?.map((item, index) => ({ @@ -232,28 +235,36 @@ export function PbnstMngForm({ ); useEffect(() => { + console.log('regFileList ', regFileList) if (regFileList && regFileList?.length > 0) { form.setValue(`items.${indexMng}.fcFiles`, regFileList); } }, [regFileList, indexMng]); useEffect(() => { + console.log('relationfiles ' ,relationfiles) if (relationfiles) { setRegFileList(regFileFilter(relationfiles, "계통도", regFileList || [])); } }, [relationfiles]); useEffect(() => { + console.log('planFiles ' ,planFiles) + if (planFiles) { setRegFileList(regFileFilter(planFiles, "평면도", regFileList || [])); } }, [planFiles]); + + useEffect(() => { if (code.ruseMngMtd) { setMngMtdCode([{ name: "ruseMngMtd", val: code.ruseMngMtd }]); } }, [code]); + + return (
diff --git a/apps/wr/components/ui/map/LayerPopUp/HasuFacilty/HasuFacility.tsx b/apps/wr/components/ui/map/LayerPopUp/HasuFacilty/HasuFacility.tsx index 2a8210aa0..dfeeed2ea 100644 --- a/apps/wr/components/ui/map/LayerPopUp/HasuFacilty/HasuFacility.tsx +++ b/apps/wr/components/ui/map/LayerPopUp/HasuFacilty/HasuFacility.tsx @@ -104,7 +104,7 @@ export function HasuFacility({rtnFeature}:{rtnFeature:(feature:any)=>void } ) { console.log("pbnstSttnSearch ", returnType); - pbnMapSearch(true,1, 100000, returnType,'' ) + pbnMapSearch(true,1, 100000, returnType,pbnRuseNm??'' ) }} /> diff --git a/apps/wr/components/ui/map/LayerPopUp/HedfFacilty/HtdfFacilty.tsx b/apps/wr/components/ui/map/LayerPopUp/HedfFacilty/HtdfFacilty.tsx index dd280a53f..0e30572f8 100644 --- a/apps/wr/components/ui/map/LayerPopUp/HedfFacilty/HtdfFacilty.tsx +++ b/apps/wr/components/ui/map/LayerPopUp/HedfFacilty/HtdfFacilty.tsx @@ -174,7 +174,7 @@ export function HtdflFacility({ 1, "1000000", String(con), - "", + seartchTxt||'', code.cityCd, code.sggCd ); diff --git a/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx b/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx index a19744320..80bb8d7ec 100644 --- a/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx +++ b/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx @@ -190,7 +190,7 @@ export function RainFacility({ 1, "1000000", String(con), - "", + seartchTxt ?? "", code.cityCd, code.sggCd ); diff --git a/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx b/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx index c6bb80468..becd76872 100644 --- a/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx +++ b/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx @@ -186,7 +186,7 @@ export function RswtFacility({ 1, "1000000", String(con), - "", + seartchTxt ?? "", code.cityCd, code.sggCd ); diff --git a/apps/wr/components/ui/map/LayerPopUp/RuseFacilty/RuseFacility.tsx b/apps/wr/components/ui/map/LayerPopUp/RuseFacilty/RuseFacility.tsx index f171cdf6b..2c7a5295c 100644 --- a/apps/wr/components/ui/map/LayerPopUp/RuseFacilty/RuseFacility.tsx +++ b/apps/wr/components/ui/map/LayerPopUp/RuseFacilty/RuseFacility.tsx @@ -51,7 +51,7 @@ export function RuseFacility({ } }, [ruseMap.isInit]); useEffect(() => { - ruseMapInit(1,ruseMapSize, ref.current, searchYear, fclts,false); + ruseMapInit(1,ruseMapSize, ref.current, searchYear, fclts); }, [fclts]); @@ -133,7 +133,7 @@ export function RuseFacility({ ref={ref} isAdmin={false} excelClick={function (returnType: ReturnType): void { - ruseMapInit(1,100000 , returnType, searchYear, fclts,true); + ruseMapSearch(true,1,1000000 , returnType, searchYear, fclts,pbnRuseNm??'') }} />
@@ -148,9 +148,9 @@ export function RuseFacility({ cellClick={ruseCellClick} onPageChange={(page) => { if(pbnRuseNm&&pbnRuseNm.length>0){ - ruseMapSearch(page,ruseMapSize , ref.current, searchYear, fclts,pbnRuseNm) + ruseMapSearch(false,page,ruseMapSize , ref.current, searchYear, fclts,pbnRuseNm) }else{ - ruseMapInit(page,ruseMapSize , ref.current, searchYear, fclts,false); + ruseMapInit(page,ruseMapSize , ref.current, searchYear, fclts); } setIsReset(false); diff --git a/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx b/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx index c0cbdda30..e890af27e 100644 --- a/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx +++ b/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx @@ -61,6 +61,7 @@ export function PbnstRegModal({ useEffect(() => { const firstForm = form.getValues("items"); + if (firstForm) { setIndexMng(firstForm.length - 1); } From a4a050a56c9d7ec1ca293430115078653c5eded9 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 13 Aug 2025 23:10:59 +0900 Subject: [PATCH 19/20] =?UTF-8?q?=EC=9E=AC=EC=9D=B4=EC=9A=A9=20=EC=8B=9C?= =?UTF-8?q?=EC=84=A4=20=ED=8F=BC=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruseFcltMng/fcltReg/pbnstReg/page.tsx | 2 + .../fcltReg/pbnstReg/mngReg/mngRegForm.tsx | 140 ++++++++---------- .../fcltReg/pbnstRegModal/pbnstRegModal.tsx | 11 +- 3 files changed, 70 insertions(+), 83 deletions(-) diff --git a/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx index 5f1d0d19c..219d5cfbe 100644 --- a/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx +++ b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx @@ -220,6 +220,7 @@ export default function PublicReuseFaciltyInsert() { setSelectRow(pbnstHasuRes?.[val]); if (selectRow) { pbnstRegClick(selectRow); + setIndexMng(0) } else { console.error("선택된 행이 없습니다."); } @@ -427,6 +428,7 @@ export default function PublicReuseFaciltyInsert() { } }} onInvalid={onInvalid} + newIndexMng={(formWatch?.length -1)} > } bodyClass="w-[68vw] max-w-none h-[90vh]" diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx index c55c3567e..5b4d93d94 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx @@ -9,7 +9,7 @@ import { } from "@common/business_components/ui"; import { Form, FormField } from "@common/business_components/ui/form"; import { Button, Input } from "@common/components"; -import { useEffect, useRef, useState } from "react"; +import { useEffect, useState } from "react"; import { useFieldArray, type UseFormReturn } from "react-hook-form"; import { commonButonSize, @@ -18,7 +18,6 @@ import { } from "@/components/lib/class/comClass"; import { TusClientUpload } from "@/components/lib/useTus_wr/useTusWr"; import { - type fcFileType, type PbnstRegArrrayType, type selectLabel, } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type"; @@ -52,15 +51,11 @@ export function PbnstMngForm({ const { code, pbnst, fileDelete, fileDownLoad } = useWrStore( (state) => state ); - const fileInitRef = useRef<{ index: number; key: string } | null>(null); - const [regFileList, setRegFileList] = useState(null); const [planFiles, setPlanFiles] = useState(null); const [relationfiles, setRelationFiles] = useState(null); const [fcltNm, setFcltNm] = useState(null); const [mngMtdCode, setMngMtdCode] = useState<{ name: string; val: SelectDataType[] }[]>(); - - const { fields: fcOpersField, prepend, @@ -155,72 +150,57 @@ export function PbnstMngForm({ } }; - const regFileFilter = ( - files: FilesType[], - fileKnd: string, - regFile: fcFileType[] - ) => { - const exFileDatas = - regFile?.filter((item) => item.fileKnd !== fileKnd) || []; - const currentdata = files.map((item) => ({ - fileTkn: item.atflCd, - filePath: item.file.name, - fileKnd: fileKnd, - rgtr: TEST_UUID, - mdfr: TEST_UUID, - })); - return [...exFileDatas, ...currentdata]; - }; + // const regFileFilter = ( + // files: FilesType[], + // fileKnd: string, + // regFile: fcFileType[] + // ) => { + // const exFileDatas = + // regFile?.filter((item) => item.fileKnd !== fileKnd) || []; + // const currentdata = files.map((item) => ({ + // fileTkn: item.atflCd, + // filePath: item.file.name, + // fileKnd: fileKnd, + // rgtr: TEST_UUID, + // mdfr: TEST_UUID, + // })); + // return [...exFileDatas, ...currentdata]; + // }; - useEffect(() =>{ - console.log('로그') - - },[]) useEffect(() => { - setRelationFiles([]) - setPlanFiles([]) - setRegFileList([]) + setRelationFiles([]); + setPlanFiles([]); + console.log("indexMng ", indexMng); const currentItem = form.getValues(`items.${indexMng}`); - const currentKey = JSON.stringify(currentItem); - const defaultFiles = currentItem?.fcFiles || []; - const relationFileList = defaultFiles.filter( (item) => item.fileKnd === "계통도" ); const planFileList = defaultFiles.filter( (item) => item.fileKnd === "평면도" ); - setRelationFiles( - relationFileList.length > 0 - ? relationFileList.map((item) => ({ - atflCd: item.fileTkn, - file: new File([], item.filePath), - })) - : null - ); - - setPlanFiles( - planFileList.length > 0 - ? planFileList.map((item) => ({ - atflCd: item.fileTkn, - file: new File([], item.filePath), - })) - : null - ); - - // ✅ 다음 루프에선 다시 안 하도록 저장 - fileInitRef.current = { - index: indexMng, - key: currentKey, - }; - }, [indexMng, form.getValues(`items.${indexMng}`)]); + + setRelationFiles( + relationFileList.length > 0 + ? relationFileList.map((item) => ({ + atflCd: item.fileTkn, + file: new File([], item.filePath), + })) + : null + ); + setPlanFiles( + planFileList.length > 0 + ? planFileList.map((item) => ({ + atflCd: item.fileTkn, + file: new File([], item.filePath), + })) + : null + ); + }, [form.getValues(`items.${indexMng}`)]); useEffect( () => { - - //폼이 들어오면 폼에 대한 이름 셀렉트박스를만들기 위해 if (mngRegForm && mngRegForm.length >= 0) { const fcltNmList = mngRegForm?.map((item, index) => ({ text: item.ruseUtztnFcltNm, @@ -234,29 +214,36 @@ export function PbnstMngForm({ [mngRegForm] ); + const formFileChange = (file: FilesType[], type: string) => { + return file?.map((item) => ({ + fileTkn: item.atflCd, + filePath: item.file.name, + fileKnd: type, + rgtr: TEST_UUID, + mdfr: TEST_UUID, + })); + }; useEffect(() => { - console.log('regFileList ', regFileList) - if (regFileList && regFileList?.length > 0) { - form.setValue(`items.${indexMng}.fcFiles`, regFileList); - } - }, [regFileList, indexMng]); - - useEffect(() => { - console.log('relationfiles ' ,relationfiles) if (relationfiles) { - setRegFileList(regFileFilter(relationfiles, "계통도", regFileList || [])); + console.log("indexMng relationfiles", indexMng); + form.setValue(`items.${indexMng}.fcFiles`, [ + ...(formFileChange(planFiles ?? [], "평면도") ?? []), + ...formFileChange(relationfiles, "계통도"), + ]); + //setRegFileList(regFileFilter(relationfiles, "계통도", regFileList || [])); } }, [relationfiles]); useEffect(() => { - console.log('planFiles ' ,planFiles) - if (planFiles) { - setRegFileList(regFileFilter(planFiles, "평면도", regFileList || [])); + // setRegFileList(regFileFilter(planFiles, "평면도", regFileList || [])); + console.log("indexMng planFiles", indexMng); + form.setValue(`items.${indexMng}.fcFiles`, [ + ...(formFileChange(planFiles ?? [], "평면도") ?? []), + ...formFileChange(relationfiles ?? [], "계통도"), + ]); } }, [planFiles]); - - useEffect(() => { if (code.ruseMngMtd) { setMngMtdCode([{ name: "ruseMngMtd", val: code.ruseMngMtd }]); @@ -264,7 +251,6 @@ export function PbnstMngForm({ }, [code]); - return (
@@ -376,7 +362,7 @@ export function PbnstMngForm({ maxLength={numSize} //입력제한 type="text" onChange={(e) => { - handleCommaNumberChange(e, field.onChange); + handleCommaNumberChange(e, field.onChange); }} value={formatCommaNumber(field.value)} readOnly={readonly} @@ -399,7 +385,7 @@ export function PbnstMngForm({ maxLength={numSize} //입력제한 type="text" onChange={(e) => { - handleCommaNumberChange(e, field.onChange); + handleCommaNumberChange(e, field.onChange); }} value={formatCommaNumber(field.value)} readOnly={readonly} @@ -421,7 +407,7 @@ export function PbnstMngForm({ maxLength={numSize} //입력제한 type="text" onChange={(e) => { - handleCommaNumberChange(e, field.onChange); + handleCommaNumberChange(e, field.onChange); }} value={formatCommaNumber(field.value)} readOnly={readonly} @@ -456,6 +442,7 @@ export function PbnstMngForm({ ) : ( item.file) || []} setFiles={(files: File[] | null) => { if (files) fileHandler(files, "relation"); @@ -493,6 +480,7 @@ export function PbnstMngForm({ ) : ( item.file) || []} setFiles={(files: File[] | null) => { if (files) fileHandler(files, "plan"); diff --git a/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx b/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx index e890af27e..ec79dd42b 100644 --- a/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx +++ b/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx @@ -25,18 +25,20 @@ export function PbnstRegModal({ form, setPbnstInsert, onInvalid, + newIndexMng }: { form: UseFormReturn<{ items: PbnstRegArrrayType }>; setPbnstInsert: (data: customPbnst) => void; onInvalid: ( errors: FieldErrors<{ items: z.infer[] }> ) => void; + newIndexMng:number }) { const { t } = useTranslation("base"); //TODO: 유즈 스테이트에 set만해도 되나? const [, setCurrentTab] = useState("mng"); - const [indexMng, setIndexMng] = useState(0); + const [indexMng, setIndexMng] = useState(newIndexMng); const [indexBiz, setIndexBiz] = useState(0); const onSubmit = async (valuse: { items: PbnstRegArrrayType }) => { @@ -59,13 +61,8 @@ export function PbnstRegModal({ console.log("form errors:", form.formState.errors); }, [form.formState.errors]); - useEffect(() => { - const firstForm = form.getValues("items"); - if (firstForm) { - setIndexMng(firstForm.length - 1); - } - }, [form]); + return ( <>

From c65b3649df70f0e484b4ffa49455f3033d5f70a0 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Thu, 14 Aug 2025 09:29:28 +0900 Subject: [PATCH 20/20] =?UTF-8?q?=ED=95=98=EC=88=98=20=EC=9E=AC=EC=9D=B4?= =?UTF-8?q?=EC=9A=A9=20=EB=93=B1=EB=A1=9D=EC=8B=9C=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx index 3272c0509..423c3c113 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx @@ -232,16 +232,18 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { if( response.status === 200) { toast.success(`${pbnstRes.ruseUtztnFcltNm} 하수재이용 시설이 등록되었습니다.`); } - const pbnstHasuRes = await hasuListFetch('1', '41'); + + const newPbnstRes = await initFetch(pbnstRes.pbnstRuseFcltId.slice(0, 11)); return set((state: pubFacState) => ({ ...state, pbnst: { ...state.pbnst, - pbnstHasuRes: pbnstHasuRes.data, - pbnstHasuResCount:pbnstHasuRes.count, - isInit: false, + pbnstRes: newPbnstRes, + // isInit: false, }, })); + + } catch (error) { console.error("Error updating pbnst:", error); }