wr: tableBody 분리 외

This commit is contained in:
2026-04-07 17:05:54 +09:00
parent f7c7305ba0
commit bc577e488f
12 changed files with 318 additions and 257 deletions
@@ -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
@@ -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, [])}
</TableHeader>
<TableBody key={prfmnc.pageKey + "pageKey"}>
{InputTableBody(
{pbnstTableBody(
inputData ?? [],
monthHeadList,
setInputData,
@@ -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, [])}
</TableHeader>
<TableBody>
{/* {InputTableBody(prfData ?? [], monthHeadList, setPrfData)} */}
{InputTableBody(prfData ?? [], monthHeadList, setPrfData, false)}
{/* {pbnstTableBody(prfData ?? [], monthHeadList, setPrfData)} */}
{pbnstTableBody(prfData ?? [], monthHeadList, setPrfData, false)}
</TableBody>
</Table>
</ScrollArea>
@@ -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[] = [
@@ -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 },
];
@@ -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,
// },
// ];
@@ -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 },
];
@@ -10,6 +10,7 @@ export const sttnHeadListType = z.array(
})
);
// 빗물이용시설
export const rainSttHeadListExport: z.infer<typeof sttnHeadListType> = [
{ id: "cityText", title: "시도", visible: true, widthPercent: 4 },
{ id: "sggText", title: "시군구", visible: true, widthPercent: 4 },
@@ -41,7 +42,7 @@ export const rainSttHeadListExport: z.infer<typeof sttnHeadListType> = [
{ 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, },