diff --git a/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx index 3613603ad..ba0d34f44 100644 --- a/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx +++ b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx @@ -87,12 +87,13 @@ export default function Page() { String(new Date().getFullYear()) ); - const useInitRef = useRef(false); + // laeSeCd가 아직 준비되기 전 초기 렌더에서 rainChkInit, rswtChkgdnInit 같은 초기 조회 로직이 먼저 도는 것을 막는다. + const useInitRef = useRef(false); //초기 마운트가 한 번 끝났는지 useEffect(() => { getLaeSeCdCheck(); - useInitRef.current = true; + useInitRef.current = true; // getLaeSeCdCheck()를 호출한 뒤 true로 바뀜 }, []); @@ -115,8 +116,8 @@ export default function Page() { } else { // 중수도 if (fcltNm) { rswtChkNmSearch( - rainPageNation, - rainPageSize, + rswtPageNation, + rswtPageSize, searchYear, laeSeCd, fcltNm @@ -149,7 +150,7 @@ export default function Page() { if (fcltNm) { rswtChkNmSearch( pageNo, - rainPageSize, + rswtPageSize, searchYear, laeSeCd, fcltNm diff --git a/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx index 26862aa1e..4838624a2 100644 --- a/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx +++ b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx @@ -18,7 +18,7 @@ import { yearOptions, } from "@/components/lib/func/common"; import { useConfirm } from "@frontend-opensource/use-react-hooks"; -import { InputTableBody } from "@/components/lib/func/TableData"; +import { pbnstTableBody } from "@/components/lib/func/TableData"; import PbnPrfExcelModal from "@/components/ui/modal/chkgd/pbnPrfExcelModal/pbnPrfExcelModal"; import { ContentsDiv, @@ -358,7 +358,7 @@ export default function PrfmncPrfmncReg() { {headMakeprfmnc(monthHeadList, [])} - {InputTableBody( + {pbnstTableBody( inputData ?? [], monthHeadList, setInputData, diff --git a/apps/wr/app/(with-layout)/ruseFcltMng/prfmncSttn/pbnstPrfmncSttn/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncSttn/pbnstPrfmncSttn/page.tsx index adb93cf22..dc3348a0a 100644 --- a/apps/wr/app/(with-layout)/ruseFcltMng/prfmncSttn/pbnstPrfmncSttn/page.tsx +++ b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncSttn/pbnstPrfmncSttn/page.tsx @@ -6,7 +6,7 @@ import { initValInUsage, initValOutUsage, subTotalObj, totalObj, type FcPrfType, import { excelPrfmncSttnParsing } from "@/app/store/prfmncSttn/pbnstPrfmncSttn/excel"; import { excelDownloadNumStyle, yearOptions } from "@/components/lib/func/common"; import { type SheetParameter } from "@common/business_components/ui"; -import { InputTableBody } from "@/components/lib/func/TableData"; +import { pbnstTableBody } from "@/components/lib/func/TableData"; import { CHART_FORM, ContentsDiv, MainChart, ScrollArea, SearchBaseForm, SearchInput, SelectBox, UiTable, type ChartConfig, type ReturnType } from "@common/business_components"; import ListDiv from "@common/business_components/ui/list_div"; import { Label, Table, TableBody, TableHeader } from "@common/components/ui"; @@ -714,8 +714,8 @@ export default function PbnstPrfmncSttn() { {headMakeprfmnc(monthHeadList, [])} - {/* {InputTableBody(prfData ?? [], monthHeadList, setPrfData)} */} - {InputTableBody(prfData ?? [], monthHeadList, setPrfData, false)} + {/* {pbnstTableBody(prfData ?? [], monthHeadList, setPrfData)} */} + {pbnstTableBody(prfData ?? [], monthHeadList, setPrfData, false)} diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx index b615b6532..538135d0a 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx @@ -137,68 +137,25 @@ export const rainSplHeadNmExport: chHeadType[] = [ ]; export const rainChkgdnHeadListExport: TableUpperProps[] = [ - { id: "order", title: "순번", mergeCell: true }, - { id: "checkBox", title: "선택", mergeCell: true }, - { id: "cityText", title: "시도", mergeCell: true }, - { id: "sggText", title: "시군구", mergeCell: true }, - { id: "bdstNm", title: "시설명", mergeCell: true }, - { id: "operMngCdText", title: "운영관리형태", mergeCell: true }, - { id: "oilqMeasMthdText", title: "유량측정방법", mergeCell: true }, - { id: "anlOperCst", title: "연간운영비(원/년)", mergeCell: true }, - { id: "dtfcltCpct", title: "빗물저류조용량(m³)", mergeCell: true }, - { id: "chckYmd", title: "점검일", mergeCell: true }, - { id: "utztnUsgCdText", title: "이용용도" }, - { id: "totalSplyUswtrUtztnQnt", title: "연간대체수이용량(m³)" }, - { id: "totalRuseFcltUtztnQnt", title: "연간빗물이용량(m³)" }, - { - id: "ph", - title: "수소이온농도(pH)", - upName: "useQuilty", - upSequnce: 1, - type: "number", - edit: true, - }, - { - id: "trbt", - title: "탁도(NTU)", - upName: "useQuilty", - upSequnce: 2, - type: "number", - edit: true, - }, - { - id: "grssClfg", - title: "총대장균군수(개/mg)", - upName: "useQuilty", - upSequnce: 3, - type: "number", - edit: true, - }, - - { - id: "vltnDt", - title: "부과일(위반일)", - upName: "feeHist", - upSequnce: 1, - type: "text", - edit: true, - }, - { - id: "vltnMttr", - title: "위반사항", - upName: "feeHist", - upSequnce: 2, - type: "text", - edit: true, - }, - { - id: "levyAmt", - title: "부과금액(천원)", - upName: "feeHist", - upSequnce: 3, - type: "text", - edit: true, - }, + { id: "order", title: "순번", mergeCell: true, widthPercent: 4 }, + { id: "checkBox", title: "선택", mergeCell: true, widthPercent: 4 }, + { id: "cityText", title: "시도", mergeCell: true, widthPercent: 5 }, + { id: "sggText", title: "시군구", mergeCell: true, widthPercent: 5 }, + { id: "bdstNm", title: "시설명", mergeCell: true, widthPercent: 7 }, + { id: "operMngCdText", title: "운영관리형태", mergeCell: true, widthPercent: 6 }, + { id: "oilqMeasMthdText", title: "유량측정방법", mergeCell: true, widthPercent: 6 }, + { id: "anlOperCst", title: "연간운영비(원/년)", mergeCell: true, widthPercent: 7 }, + { id: "dtfcltCpct", title: "빗물저류조용량(m³)", mergeCell: true, widthPercent: 6 }, + { id: "chckYmd", title: "점검일", mergeCell: true, widthPercent: 5 }, + { id: "utztnUsgCdText", title: "이용용도", widthPercent: 5 }, + { id: "totalSplyUswtrUtztnQnt", title: "연간대체수이용량(m³)", widthPercent: 7 }, + { id: "totalRuseFcltUtztnQnt", title: "연간빗물이용량(m³)", widthPercent: 7 }, + { id: "ph", title: "수소이온농도(pH)", upName: "useQuilty", upSequnce: 1, type: "number", edit: true, widthPercent: 5 }, + { id: "trbt", title: "탁도(NTU)", upName: "useQuilty", upSequnce: 2, type: "number", edit: true, widthPercent: 4 }, + { id: "grssClfg", title: "총대장균군수(개/mg)", upName: "useQuilty", upSequnce: 3, type: "number", edit: true, widthPercent: 5 }, + { id: "vltnDt", title: "부과일(위반일)", upName: "feeHist", upSequnce: 1, type: "text", edit: true, widthPercent: 5 }, + { id: "vltnMttr", title: "위반사항", upName: "feeHist", upSequnce: 2, type: "text", edit: true, widthPercent: 6 }, + { id: "levyAmt", title: "부과금액(천원)", upName: "feeHist", upSequnce: 3, type: "text", edit: true, widthPercent: 5 }, ]; export const ruseHeadListExport: TableUpperProps[] = [ diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/headList.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/headList.tsx index d423c7cef..a31b73ba3 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/headList.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/headList.tsx @@ -135,117 +135,45 @@ export const rswtHeadNmExport: chHeadType[] = [ ]; export const rswtChkHeadListExport: TableUpperProps[] = [ - { id: "order", title: "순번", mergeCell: true }, - { id: "checkBox", title: "선택", mergeCell: true }, - { id: "cityText", title: "시도" ,mergeCell: true }, - { id: "sggText", title: "시군구",mergeCell: true }, - { id: "bdstNm", title: "시설명" ,mergeCell: true}, - { id: "operMngCd", title: "운영관리형태" ,mergeCell: true}, - { id: "anlOperCst", title: "연간운영비(원/년)" ,mergeCell: true}, - { id: "prcsCpct", title: "처리용량(m³)" ,mergeCell: true}, - { id: "spwtPositn", title: "채수지점" ,mergeCell: true}, - { id: "chckYmd", title: "점검일" ,mergeCell: true}, - { id: "utztnUsgCdText", title: "이용용도" }, - { id: "splyUswtrUtztnQnt", title: "연간대체수이용량(m³)" ,type: "number"}, - { id: "ruseFcltUtztnQnt", title: "연간중수도이용량(m³)",type: "number"}, - - { - id: "grssClfgUswtr", - title: "총대장균군수(개/mg)", - upName: "useQuilty", - upSequnce: 1, - type: "number" - }, - { - id: "combResdch", - title: "결합잔류염소(mh/L)", - upName: "useQuilty", - upSequnce: 2, - type: "number" - }, - { id: "trbt", title: "탁도(NTU)", upName: "useQuilty", upSequnce: 3 ,type: "number"}, - { id: "bod", title: "BOD(mg/L)", upName: "useQuilty", upSequnce: 4 ,type: "number"}, - { id: "smll", title: "냄새", upName: "useQuilty", upSequnce: 5 ,type: "text"}, - { id: "crmty", title: "색도(도)", upName: "useQuilty", upSequnce: 6 ,type: "number"}, - { id: "tn", title: "총질소(T-N)(mg/L)", upName: "useQuilty", upSequnce: 7 ,type: "number"}, - { id: "tph", title: "총인(T-P)(mg/L)", upName: "useQuilty", upSequnce: 8 ,type: "number"}, - { id: "ph", title: "수소이온농도(pH)", upName: "useQuilty", upSequnce: 9,type: "text" }, - { id: "clIonQnt", title: "염화물(mg/L)", upName: "useQuilty", upSequnce: 10 ,type: "number"}, - - { - id: "vltnDt", - title: "부과일(위반일)", - upName: "feeHist", - upSequnce: 1, - type: "text", - edit:true - }, - { - id: "vltnMttr", - title: "위반사항", - upName: "feeHist", - upSequnce: 2, - type: "text", - edit:true - }, - { - id: "levyAmt", - title: "부과금액(천원)", - upName: "feeHist", - upSequnce: 3, - type: "number", - edit:true - }]; + { id: "order", title: "순번", mergeCell: true, widthPercent: 4 }, + { id: "checkBox", title: "선택", mergeCell: true, widthPercent: 4 }, + { id: "cityText", title: "시도" ,mergeCell: true, widthPercent: 7 }, + { id: "sggText", title: "시군구",mergeCell: true, widthPercent: 5 }, + { id: "bdstNm", title: "시설명" ,mergeCell: true, widthPercent: 10 }, + { id: "operMngCd", title: "운영관리형태" ,mergeCell: true, widthPercent: 6 }, + { id: "anlOperCst", title: "연간운영비(원/년)" ,mergeCell: true, widthPercent: 7 }, + { id: "prcsCpct", title: "처리용량(m³)" ,mergeCell: true, widthPercent: 6 }, + { id: "spwtPositn", title: "채수지점" ,mergeCell: true, widthPercent: 6 }, + { id: "chckYmd", title: "점검일" ,mergeCell: true, widthPercent: 7 }, + { id: "utztnUsgCdText", title: "이용용도", widthPercent: 7 }, + { id: "splyUswtrUtztnQnt", title: "연간대체수이용량(m³)" ,type: "number", widthPercent: 5 }, + { id: "ruseFcltUtztnQnt", title: "연간중수도이용량(m³)",type: "number", widthPercent: 5 }, + { id: "grssClfgUswtr", title: "총대장균군수(개/mg)", upName: "useQuilty", upSequnce: 1 ,type: "number", widthPercent: 6 }, + { id: "combResdch", title: "결합잔류염소(mh/L)", upName: "useQuilty", upSequnce: 2 ,type: "number", widthPercent: 6 }, + { id: "trbt", title: "탁도(NTU)", upName: "useQuilty", upSequnce: 3 ,type: "number", widthPercent: 4 }, + { id: "bod", title: "BOD\n(mg/L)", upName: "useQuilty", upSequnce: 4 ,type: "number", widthPercent: 4 }, + { id: "smll", title: "냄새", upName: "useQuilty", upSequnce: 5 ,type: "text", widthPercent: 4 }, + { id: "crmty", title: "색도(도)", upName: "useQuilty", upSequnce: 6 ,type: "number", widthPercent: 4 }, + { id: "tn", title: "총질소(T-N)(mg/L)", upName: "useQuilty", upSequnce: 7 ,type: "number", widthPercent: 5 }, + { id: "tph", title: "총인(T-P)(mg/L)", upName: "useQuilty", upSequnce: 8 ,type: "number", widthPercent: 5 }, + { id: "ph", title: "수소이온농도(pH)", upName: "useQuilty", upSequnce: 9,type: "text", widthPercent: 5 }, + { id: "clIonQnt", title: "염화물(mg/L)", upName: "useQuilty", upSequnce: 10 ,type: "number", widthPercent: 5 }, + { id: "vltnDt", title: "부과일(위반일)", upName: "feeHist", upSequnce: 1, type: "text", edit:true, widthPercent: 5 }, + { id: "vltnMttr", title: "위반사항", upName: "feeHist", upSequnce: 2, type: "text", edit:true, widthPercent: 6 }, + { id: "levyAmt", title: "부과금액(천원)", upName: "feeHist", upSequnce: 3, type: "number", edit:true, widthPercent: 5 }]; export const rswtDetailHeadListExport: TableUpperProps[] = [ - { id: "utztnUsgCdText", title: "이용용도" }, - - { - id: "grssClfgUswtr", - title: "총대장균군수", - upName: "detailQulity", - upSequnce: 2, - edit: true, - }, - { - id: "combResdch", - title: "결합잔류염소", - upName: "detailQulity", - upSequnce: 3, - edit: true, - }, - { - id: "trbt", - title: "탁도", - upName: "detailQulity", - upSequnce: 4, - edit: true, - }, - { id: "bod", title: "BOD", upName: "detailQulity", upSequnce: 5, edit: true }, - { - id: "smll", - title: "냄새", - upName: "detailQulity", - upSequnce: 6, - edit: true, - }, - { - id: "crmty", - title: "색도", - upName: "detailQulity", - upSequnce: 7, - edit: true, - }, - { id: "tn", title: "T-N", upName: "detailQulity", upSequnce: 8, edit: true }, - { id: "tph", title: "T-P", upName: "detailQulity", upSequnce: 9, edit: true }, - { id: "ph", title: "pH", upName: "detailQulity", upSequnce: 10, edit: true }, - { - id: "clIonQnt", - title: "염화물", - upName: "detailQulity", - upSequnce: 11, - edit: true, - }, + { id: "utztnUsgCdText", title: "이용용도", widthPercent: 20 }, + { id: "grssClfgUswtr", title: "총대장균군수", upName: "detailQulity", upSequnce: 2, edit: true, widthPercent: 8 }, + { id: "combResdch", title: "결합잔류염소", upName: "detailQulity", upSequnce: 3, edit: true, widthPercent: 8 }, + { id: "trbt", title: "탁도", upName: "detailQulity", upSequnce: 4, edit: true, widthPercent: 8 }, + { id: "bod", title: "BOD", upName: "detailQulity", upSequnce: 5, edit: true, widthPercent: 8 }, + { id: "smll", title: "냄새", upName: "detailQulity", upSequnce: 6, edit: true, widthPercent: 8 }, + { id: "crmty", title: "색도", upName: "detailQulity", upSequnce: 7, edit: true, widthPercent: 8 }, + { id: "tn", title: "T-N", upName: "detailQulity", upSequnce: 8, edit: true, widthPercent: 8 }, + { id: "tph", title: "T-P", upName: "detailQulity", upSequnce: 9, edit: true, widthPercent: 8 }, + { id: "ph", title: "pH", upName: "detailQulity", upSequnce: 10, edit: true, widthPercent: 8 }, + { id: "clIonQnt", title: "염화물", upName: "detailQulity", upSequnce: 11, edit: true, widthPercent: 8 }, ]; - \ No newline at end of file + diff --git a/apps/wr/app/store/prfmncSttn/chkgdnSttn/rainChkgdnSttn/headList.tsx b/apps/wr/app/store/prfmncSttn/chkgdnSttn/rainChkgdnSttn/headList.tsx index 1568d567b..c45a772e7 100644 --- a/apps/wr/app/store/prfmncSttn/chkgdnSttn/rainChkgdnSttn/headList.tsx +++ b/apps/wr/app/store/prfmncSttn/chkgdnSttn/rainChkgdnSttn/headList.tsx @@ -56,57 +56,57 @@ export const splSttnHeadListExport: TableUpperProps[] = [ { id: "spl12", title: "12월", upName: "splWater", upSequnce: 13 }, ]; -export const rswtDetailHeadListExport: TableUpperProps[] = [ - { id: "utztnUsgCdText", title: "이용용도" }, +// export const rswtDetailHeadListExport: TableUpperProps[] = [ +// { id: "utztnUsgCdText", title: "이용용도" }, - { - id: "grssClfgUswtr", - title: "총대장균군수", - upName: "detailQulity", - upSequnce: 2, - }, - { - id: "combResdch", - title: "결합잔류염소", - upName: "detailQulity", - upSequnce: 3, - }, - { - id: "trbt", - title: "탁도", - upName: "detailQulity", - upSequnce: 4, - }, - { - id: "bod", - title: "BOD", - upName: "detailQulity", - upSequnce: 5, - }, - { - id: "smll", - title: "냄새", - upName: "detailQulity", - upSequnce: 6, - }, - { - id: "crmty", - title: "색도", - upName: "detailQulity", - upSequnce: 7, - }, - { id: "tn", title: "T-N", upName: "detailQulity", upSequnce: 8}, - { - id: "tph", - title: "T-P", - upName: "detailQulity", - upSequnce: 9, - }, - { id: "ph", title: "pH", upName: "detailQulity", upSequnce: 10 }, - { - id: "clIonQnt", - title: "염화물", - upName: "detailQulity", - upSequnce: 11, - }, -]; +// { +// id: "grssClfgUswtr", +// title: "총대장균군수", +// upName: "detailQulity", +// upSequnce: 2, +// }, +// { +// id: "combResdch", +// title: "결합잔류염소", +// upName: "detailQulity", +// upSequnce: 3, +// }, +// { +// id: "trbt", +// title: "탁도", +// upName: "detailQulity", +// upSequnce: 4, +// }, +// { +// id: "bod", +// title: "BOD", +// upName: "detailQulity", +// upSequnce: 5, +// }, +// { +// id: "smll", +// title: "냄새", +// upName: "detailQulity", +// upSequnce: 6, +// }, +// { +// id: "crmty", +// title: "색도", +// upName: "detailQulity", +// upSequnce: 7, +// }, +// { id: "tn", title: "T-N", upName: "detailQulity", upSequnce: 8}, +// { +// id: "tph", +// title: "T-P", +// upName: "detailQulity", +// upSequnce: 9, +// }, +// { id: "ph", title: "pH", upName: "detailQulity", upSequnce: 10 }, +// { +// id: "clIonQnt", +// title: "염화물", +// upName: "detailQulity", +// upSequnce: 11, +// }, +// ]; diff --git a/apps/wr/app/store/prfmncSttn/chkgdnSttn/rswtChkgdnSttn/headList.tsx b/apps/wr/app/store/prfmncSttn/chkgdnSttn/rswtChkgdnSttn/headList.tsx index 2eba48db1..21a78b07d 100644 --- a/apps/wr/app/store/prfmncSttn/chkgdnSttn/rswtChkgdnSttn/headList.tsx +++ b/apps/wr/app/store/prfmncSttn/chkgdnSttn/rswtChkgdnSttn/headList.tsx @@ -31,16 +31,15 @@ export const rswtChkSttnHeadListExport: TableUpperProps[] = [ ]; export const rswtDetailSttnHeadListExport: TableUpperProps[] = [ - { id: "utztnUsgCd", title: "이용용도" }, - - { id: "grssClfgUswtr", title: "총대장균군수", upName: "detailQulity", upSequnce: 2 }, - { id: "combResdch", title: "결합잔류염소", upName: "detailQulity", upSequnce: 3 }, - { id: "trbt", title: "탁도", upName: "detailQulity", upSequnce: 4 }, - { id: "bod", title: "BOD", upName: "detailQulity", upSequnce: 5 }, - { id: "smll", title: "냄새", upName: "detailQulity", upSequnce: 6 }, - { id: "crmty", title: "색도", upName: "detailQulity", upSequnce: 7 }, - { id: "tn", title: "T-N", upName: "detailQulity", upSequnce: 8 }, - { id: "tph", title: "T-P", upName: "detailQulity", upSequnce: 9 }, - { id: "ph", title: "pH", upName: "detailQulity", upSequnce: 10 }, - { id: "clIonQnt", title: "염화물", upName: "detailQulity", upSequnce: 11 }, + { id: "utztnUsgCd", title: "이용용도", widthPercent: 20 }, + { id: "grssClfgUswtr", title: "총대장균군수", upName: "detailQulity", upSequnce: 2, widthPercent: 8 }, + { id: "combResdch", title: "결합잔류염소", upName: "detailQulity", upSequnce: 3, widthPercent: 8 }, + { id: "trbt", title: "탁도", upName: "detailQulity", upSequnce: 4, widthPercent: 8 }, + { id: "bod", title: "BOD", upName: "detailQulity", upSequnce: 5, widthPercent: 8 }, + { id: "smll", title: "냄새", upName: "detailQulity", upSequnce: 6, widthPercent: 8 }, + { id: "crmty", title: "색도", upName: "detailQulity", upSequnce: 7, widthPercent: 8 }, + { id: "tn", title: "T-N", upName: "detailQulity", upSequnce: 8, widthPercent: 8 }, + { id: "tph", title: "T-P", upName: "detailQulity", upSequnce: 9, widthPercent: 8 }, + { id: "ph", title: "pH", upName: "detailQulity", upSequnce: 10, widthPercent: 8 }, + { id: "clIonQnt", title: "염화물", upName: "detailQulity", upSequnce: 11, widthPercent: 8 }, ]; diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx index 2895d28c5..5eae0cbfc 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx @@ -10,6 +10,7 @@ export const sttnHeadListType = z.array( }) ); +// 빗물이용시설 export const rainSttHeadListExport: z.infer = [ { id: "cityText", title: "시도", visible: true, widthPercent: 4 }, { id: "sggText", title: "시군구", visible: true, widthPercent: 4 }, @@ -41,7 +42,7 @@ export const rainSttHeadListExport: z.infer = [ { id: "grntchBdstCertGrdText", title: "녹색건축물인증등급", visible: true, widthPercent: 4 }, ]; -// id는 다확인해야함 +// export const rainSttNodeListExport: CommonTableProps[] = [ { id: "bdnstInfo", title: "건축물정보", visible: true, row: 1, rowSpan: 1, colSpan: 10, }, { id: "rainFcltInfo", title: "빗물이용시설정보", visible: true, row: 1, rowSpan: 1, colSpan: 7, }, diff --git a/apps/wr/components/lib/func/TableData.tsx b/apps/wr/components/lib/func/TableData.tsx index 0e87ad63c..3fe2129af 100644 --- a/apps/wr/components/lib/func/TableData.tsx +++ b/apps/wr/components/lib/func/TableData.tsx @@ -94,6 +94,7 @@ export const rswtChkTableData = (chkData: rswtChkZodType[]) => { return makeRswtData; }; +// 재이용시설등록 > 지도점검결과 등록 - table body export const chRowspanTable = ( makeTableData: any[], headList: TableUpperProps[], @@ -152,7 +153,7 @@ export const chRowspanTable = ( ) : key === "order" ? ( ++order ) : // value - ["anlOperCst", "dtfcltCpct", "prcsCpct"].includes( + ["anlOperCst", "dtfcltCpct", "prcsCpct"].includes( //연간운영비, 저류조용량, 처리용량 head.id ) ? ( formatCommaNumber(value) @@ -311,6 +312,9 @@ const handleChange = ( }) ); }; + + +// 재이용실적등록 > 지도점검결과 등록 - 상세 modal의 body export const InputTableBody = ( chgRes: any[] | [], headList: TableUpperProps[], @@ -473,3 +477,165 @@ export const InputTableBody = ( ); }; +// 재이용실적등록 > 하수재이용실적등록 목록 body - 하수처리수재이용 실적(m³) 등록결과 +export const pbnstTableBody = ( + chgRes: any[] | [], + headList: TableUpperProps[], + setInputData: (data: any[]) => void, + isEditable: boolean = true +) => { + // mergeCell 처리용 + const getRowSpan = (data: any[], key: string, rowIndex: number) => { + if (rowIndex > 0 && data[rowIndex][key] === data[rowIndex - 1][key]) { + return 0; // 이전과 같으면 셀을 그리지 않음 + } + let span = 1; + for (let i = rowIndex + 1; i < data.length; i++) { + if (data[i][key] === data[rowIndex][key]) span++; + else break; + } + return span; + }; + return ( + <> + {chgRes.map((data, dataIndex) => { + // 소계/총합계 행 판별 + const isSubTotal = data["용수명"] === "소계"; + const isTotal = data["구분"] === 0; + + const bgClass = isTotal + ? "bg-[#d5e1eb] font-bold" + : isSubTotal + ? "bg-[#e6eef5] font-semibold" + : ""; + + return ( + + {headList.map((head, headIndex) => { + //냄새, ph면 계산 못하게 - 로 수정 + if (["smll", "ph"].includes(head.id)) { + return ( + + - + + ); + } + const isTextColumn = head.id === "구분" || head.id === "용수명"; + const textAlignClass = isTextColumn + ? "text-center" + : "text-right"; + + // 총합계 행이면 "구분"에서 colSpan=2로 병합 + if ( + (data["구분"] === 0 || data["용수명"] === 0) && + head.id === "구분" + ) { + return ( + + 총합계 + + ); + } + // 총합계(합계) 행이면 "용수명" 컬럼은 렌더링하지 않음 + if ( + (data["구분"] === 0 || data["용수명"] === 0) && + head.id === "용수명" + ) { + return null; + } + + // 총합계 행의 나머지 셀에도 색상 적용 + if (data["구분"] === 0 || data["용수명"] === 0) { + return ( + + {Number(data[head.id]) + ? formatCommaNumber(data[head.id as keyof any]) + : (data[head.id as keyof any] ?? "")} + + ); + } + // mergeCell 처리 + if (head.mergeCell) { + const rowSpan = getRowSpan(chgRes, head.id, dataIndex); + if (rowSpan === 0) return null; + return ( + + {Number(data[head.id]) + ? formatCommaNumber(data[head.id as keyof any]) + : (data[head.id as keyof any] ?? "")} + + ); + } + // 기본 셀 + // return head.edit === true && data.edit !== false ? ( + return isEditable && head.edit === true && data.edit !== false ? ( + + + handleCommaNumberChange(e, (val) => + handleChange( + dataIndex, + head.id, + String(val), + setInputData + ) + ) + } + value={formatCommaNumber(data[head.id as keyof any]) ?? ""} + maxLength={numSize} + /> + + ) : ( + +
+ {Number(data[head.id]) + ? formatCommaNumber(data[head.id as keyof any]) + : (data[head.id as keyof any] ?? "")} +
+
+ ); + })} +
+ ); + })} + {chgRes.length === 0 && ( + + + 조회된 결과가 없습니다. + + + )} + + ); +}; \ No newline at end of file diff --git a/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx b/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx index 4c06f5722..1a07720a7 100644 --- a/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx +++ b/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx @@ -15,7 +15,7 @@ import { type fcBizType, } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type"; import { formH1Class } from "@/components/lib/class/comClass"; -import { InputTableBody } from "@/components/lib/func/TableData"; +import { pbnstTableBody } from "@/components/lib/func/TableData"; import { PbnstMngForm } from "@/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm"; import { ScrollArea, Title, UiTable } from "@common/business_components/ui"; import ListDiv from "@common/business_components/ui/list_div"; @@ -341,7 +341,7 @@ export function PbnstSttnModal({ data, titleVisible,isMap}: { data: customPbnst; {headMakeprfmnc(pbnstPrfmncSttn.monthSttnHeadList, [])} - {InputTableBody(prfData[ruseTab as keyof typeof prfData] || [], pbnstPrfmncSttn.monthSttnHeadList, setPrfData as any)} + {pbnstTableBody(prfData[ruseTab as keyof typeof prfData] || [], pbnstPrfmncSttn.monthSttnHeadList, setPrfData as any)} {/* */} diff --git a/apps/wr/components/ui/table/chkgdTable/guideDetailTable/guideDetailTable.tsx b/apps/wr/components/ui/table/chkgdTable/guideDetailTable/guideDetailTable.tsx index 4ff4ab14e..35745077c 100644 --- a/apps/wr/components/ui/table/chkgdTable/guideDetailTable/guideDetailTable.tsx +++ b/apps/wr/components/ui/table/chkgdTable/guideDetailTable/guideDetailTable.tsx @@ -1,3 +1,6 @@ +/** + * 재이용실적등록 > 지도점검결과등록 - 연간대체수이용량, 연간중수도이용량 click시 상세 model의 table body + */ "use client"; import { headMakeprfmnc } from "@/app/(with-layout)/ruseFcltMng/prfmncReg/chkgdnReg/TableHead"; import type { TableUpperProps } from "@/app/store/common/type/header"; @@ -41,7 +44,17 @@ export function GuideDetailsTable({ return ( <>
- +
+ + {headList + .filter((head) => head.visible !== false) + .map((head) => ( + + ))} + {headMakeprfmnc(headList, upheadList)} {InputTableBody(inputData ?? [], headList, setInputData, readonly)} diff --git a/apps/wr/components/ui/table/chkgdTable/rswtChkgd/rswtChkgdTable.tsx b/apps/wr/components/ui/table/chkgdTable/rswtChkgd/rswtChkgdTable.tsx index 5694c8085..46e0067cf 100644 --- a/apps/wr/components/ui/table/chkgdTable/rswtChkgd/rswtChkgdTable.tsx +++ b/apps/wr/components/ui/table/chkgdTable/rswtChkgd/rswtChkgdTable.tsx @@ -152,11 +152,7 @@ export default function RswtChkgdTable({ .map((head) => ( ))}