Merge commit 'b2bd7ce16a48f72951ada66f9fc53607e49a949b'

This commit is contained in:
leedj312
2025-08-26 13:07:36 +09:00
31 changed files with 258 additions and 221 deletions
@@ -5,7 +5,7 @@ import {
type SelectDataType,
} from "@common/business_components/ui";
import { Button, Label } from "@common/components/ui";
import { useCallback, useEffect, useState } from "react";
import { useCallback, useState } from "react";
import SearchInputText from "../SearchInputText/SearchInputText";
export function SearchBar({
@@ -15,7 +15,7 @@ export function SearchBar({
setHasuPk: (hasuPk: any) => void;
onApply: () => void;
}) {
const { map, code, codeInit, findRuseFclt } = useWrStore(
const { map, code, findRuseFclt } = useWrStore(
(state) => state
);
const [sidoValue, setSidoValue] = useState<string>("");
@@ -24,9 +24,6 @@ export function SearchBar({
{ text: "전체", val: "0" },
]);
useEffect(() => {
//codeInit();
}, [codeInit]);
const initializeSigunData = useCallback(
(sidoCd: string) => {
@@ -585,7 +585,7 @@ export default function CoMatRvw() {
control={form.control}
name="ph"
render={({ field }) => (
<FormUi label="수소이온농도(PH)">
<FormUi label="수소이온농도(ph)">
<div className="flex items-center gap-2">
<div className="relative flex-1 min-w-0">
<Input
@@ -1,7 +1,7 @@
"use client";
import { useWrStore } from "@/app/store";
import { type customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { formatCommaNumber, tableData } from "@/components/lib/func/commom";
import { rainRegSize, type customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { formatArchArea, tableData } from "@/components/lib/func/commom";
import RainRegForm from "@/components/ui/form/fcltReg/rainReg/rainRegForm";
import { BdstReg } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
import {
@@ -49,14 +49,11 @@ export default function Home() {
if (rainRes && rainRes.length > 0) {
const rainData = tableData(rainRes, { code }).map(
(item: customRainBdst) => {
const archArea =
item?.archArea.split(".")[0] !== "-1"
? item?.archArea.split(".")[0]
: "확인불가";
return {
...item,
archArea: formatCommaNumber(archArea),
archArea: formatArchArea(item?.archArea,1),
bdstChgYn: item.chgBuilding[0]?.bdstChgNm != null ? "Y" : "N",
frstArchPrmsnDt:item?.frstArchPrmsnDt||'확인불가'
};
}
);
@@ -129,7 +126,7 @@ export default function Home() {
<UiTable
tableData={bdstTable || []}
headlist={rain.upHeadList}
pageSize={20}
pageSize={rainRegSize}
total={rainResCount}
headName={"건축물 목록"}
cellClick={(val) => {
@@ -140,9 +137,9 @@ export default function Home() {
{/* </ScrollArea> */}
</ListDiv>
</div>
<div className="col-span-2 max-h-full">
<ListDiv className="">
<ScrollArea className="h-[65vh]">
<div className="col-span-2 ">
<ListDiv >
<ScrollArea className="h-[75vh]">
<RainRegForm
rainForm={rainForm ?? ({} as customRainBdst)}
isModal={false}
@@ -1,6 +1,6 @@
"use client";
import { useWrStore } from "@/app/store";
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
import { rswtRegSize, type customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
import { tableData } from "@/components/lib/func/commom";
import RswtrRegForm from "@/components/ui/form/fcltReg/rswtrReg/rswtrRegForm";
import { BdstReg } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
@@ -134,7 +134,7 @@ export default function Home() {
<UiTable
tableData={bdstTable || []}
headlist={rswt.upHeadList}
pageSize={20}
pageSize={rswtRegSize}
total={rswtResCount}
headName={"건축물 목록"}
cellClick={cellClick}
@@ -145,7 +145,7 @@ export default function Home() {
</div>
<div className="col-span-2 max-h-full">
<ListDiv className="">
<ScrollArea className="h-[65vh]">
<ScrollArea className="h-[75vh]">
<RswtrRegForm
rswtForm={rswtForm ?? ({} as customRswtBdst)}
isModal={false}
@@ -5,6 +5,7 @@ import { btnClass } from "@/app/store/common/code";
import type {
customRainBdst
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { htdflSttnSize } from "@/app/store/ruseFcltMng/fcltSttn/htdflSttn";
import {
excelDownload,
getCity,
@@ -57,7 +58,7 @@ export default function HtdflSttn() {
const [fcltNm, setFcltNm] = useState<string>("");
useEffect(() => {
htdflSttnSearch(false, pageNation, "20", String(getConValue()), fcltNm, code.cityCd, code.sggCd);
htdflSttnSearch(false, pageNation, htdflSttnSize, String(getConValue()), fcltNm, code.cityCd, code.sggCd);
isResetPage(false)
}, [pageNation]);
@@ -102,7 +103,7 @@ export default function HtdflSttn() {
const excelClick = useCallback(() => {
isDownloadTriggered.current = true;
htdflSttnSearch(true, 1, String(htdflSttnResCount), String(getConValue()), fcltNm, code.cityCd, code.sggCd);
htdflSttnSearch(true, 1, htdflSttnResCount, String(getConValue()), fcltNm, code.cityCd, code.sggCd);
}, [htdflSttnSearch, objSearch, code.cityCd, code.sggCd, fcltNm, htdflSttnResCount]);
useEffect(() => {
@@ -124,7 +125,7 @@ export default function HtdflSttn() {
useEffect(() => {
if (!htdflSttn.isInit) {
initHtdfl(false, 1, "20", "0", fcltNm, code.cityCd, code.sggCd);
initHtdfl(false, 1, htdflSttnSize, "0", fcltNm, code.cityCd, code.sggCd);
}
}, [htdflSttn.isInit, initHtdfl]);
@@ -185,7 +186,7 @@ export default function HtdflSttn() {
<Button
size={"sm"}
onClick={() => {
htdflSttnSearch(false, 1, "20", String(getConValue()), fcltNm, code.cityCd, code.sggCd);
htdflSttnSearch(false, 1,htdflSttnSize, String(getConValue()), fcltNm, code.cityCd, code.sggCd);
isResetPage(true)
}}
>
@@ -219,7 +220,7 @@ export default function HtdflSttn() {
headName={undefined}
tableData={bdstTable || []}
headlist={htdflSttn.htdflSttHeadList}
pageSize={20}
pageSize={htdflSttnSize}
total={htdflSttnResCount || 0}
cellClick={(index: number | undefined, headId: string) => {
cellClick(index ?? undefined, headId);
@@ -4,6 +4,7 @@ import { btnClass } from "@/app/store/common/code";
import type {
customRainBdst,
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { rainSttnSize } from "@/app/store/ruseFcltMng/fcltSttn/rainSttn";
import {
excelDownload,
getCity,
@@ -91,7 +92,7 @@ export default function RainSttn() {
useEffect(() => {
if (!rainSttn.isInit) {
rainSttnInit(false, 1, "20", "0", fcltNm, code.cityCd, code.sggCd);
rainSttnInit(false, 1, rainSttnSize, "0", fcltNm, code.cityCd, code.sggCd);
}
}, [rainSttn.isInit, rainSttnInit]);
@@ -115,7 +116,7 @@ export default function RainSttn() {
item.reuseBuilding[0].instlCstSprtAmt === -1
? "확인불가"
: item.reuseBuilding[0].instlCstSprtAmt,
chBuildingYn: item.chgBuilding[0]?.bdstChgNm !== null ? "Y" : "N",
chBuildingYn: item?.chgBuilding[0]?.bdstChgNm !== null && item?.chgBuilding.length > 0 ? 'Y' : 'N',
pntfColArea:
item.reuseBuilding[0].rainyObj.pntfColArea === -1
? "확인불가"
@@ -130,7 +131,8 @@ export default function RainSttn() {
? item.archArea
: Math.floor(Number(item.archArea)) === -1
? '확인불가'
: Math.trunc(Number(item.archArea))
: Math.trunc(Number(item.archArea)),
pntfColKnd: code.rainFcltCd.find((pnt) => pnt.val === item.reuseBuilding[0].rainyObj?.pntfColKnd)?.text ??''
};
})
.filter((item: any) => item.rainyObj !== undefined);
@@ -141,7 +143,7 @@ export default function RainSttn() {
rainSttnSearch(
false,
pageNation,
"20",
rainSttnSize,
String(getConValue()),
fcltNm,
code.cityCd,
@@ -172,7 +174,7 @@ export default function RainSttn() {
rainSttnSearch(
true,
1,
String(rainSttnResCount),
rainSttnResCount,
String(getConValue()),
fcltNm,
code.cityCd,
@@ -232,7 +234,7 @@ export default function RainSttn() {
rainSttnSearch(
false,
1,
"20",
rainSttnSize,
String(getConValue()),
fcltNm,
code.cityCd,
@@ -271,7 +273,7 @@ export default function RainSttn() {
headName={undefined}
tableData={bdstTable || []}
headlist={rainSttn.rainSttHeadList}
pageSize={20}
pageSize={rainSttnSize}
total={rainSttnResCount || 0}
cellClick={(index: number | undefined) => {
cellClick(index ?? undefined);
@@ -2,6 +2,7 @@
import { useWrStore } from "@/app/store";
import { btnClass } from "@/app/store/common/code";
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
import { rswtSttnSize } from "@/app/store/ruseFcltMng/fcltSttn/rswtSttn";
import {
excelDownload,
getCity,
@@ -83,7 +84,7 @@ export default function RswtSttn() {
useEffect(() => {
if (!rswtSttn.isInit) {
rswtSttnInit(false, 1, "20", "0", fcltNm, code.cityCd, code.sggCd);
rswtSttnInit(false, 1, rswtSttnSize, "0", fcltNm, code.cityCd, code.sggCd);
}
}, [rswtSttn.isInit, rswtSttnInit]);
@@ -91,10 +92,12 @@ export default function RswtSttn() {
const data = tableData(rswtSttnRes, { code });
const chData = data
.map((item: customRswtBdst) => {
const isOrgwtKndCd = item.reuseBuilding[0]?.rswtrObj.orgwtKndCd
return {
...item,
...item.reuseBuilding[0],
...item.reuseBuilding[0]?.rswtrObj,
orgwtKndCd: isOrgwtKndCd? code.orgwtKndCd.find((item) => item.val===isOrgwtKndCd)?.text : "확인불가",
chBuildingYn: item?.chgBuilding[0]?.bdstChgNm !== null && item?.chgBuilding.length > 0 ? 'Y' : 'N',
instlCst: item.reuseBuilding[0]?.instlCst === -1 ? "확인불가" : item.reuseBuilding[0]?.instlCst,
instlCstSprtAmt: item.reuseBuilding[0]?.instlCstSprtAmt === -1 ? "확인불가" : item.reuseBuilding[0]?.instlCstSprtAmt,
@@ -128,11 +131,11 @@ export default function RswtSttn() {
const excelClick = useCallback(() => {
isDownloadTriggered.current = true;
rswtSttnSearch(true, 1, String(rswtSttnResCount), String(getConValue()), fcltNm, code.cityCd, code.sggCd);
rswtSttnSearch(true, 1, rswtSttnResCount, String(getConValue()), fcltNm, code.cityCd, code.sggCd);
}, [rswtSttnSearch, objSearch, code.cityCd, code.sggCd, fcltNm, rswtSttnResCount]);
useEffect(() => {
rswtSttnSearch(false, pageNation, "20", String(getConValue()), fcltNm, code.cityCd, code.sggCd);
rswtSttnSearch(false, pageNation, rswtSttnSize, String(getConValue()), fcltNm, code.cityCd, code.sggCd);
isResetPage(false)
}, [pageNation]);
@@ -183,7 +186,7 @@ export default function RswtSttn() {
<Button
size={"sm"}
onClick={() => {
rswtSttnSearch(false, 1, "20", String(getConValue()), fcltNm, code.cityCd, code.sggCd);
rswtSttnSearch(false, 1, rswtSttnSize, String(getConValue()), fcltNm, code.cityCd, code.sggCd);
isResetPage(true)
}}
>
@@ -217,7 +220,7 @@ export default function RswtSttn() {
headName={undefined}
tableData={bdstTable || []}
headlist={rswtSttn.rswtSttHeadList}
pageSize={20}
pageSize={rswtSttnSize}
total={rswtSttnResCount || 0}
cellClick={(index: number | undefined) => { cellClick(index ?? undefined) }}
onPageChange={setPageNation}
+45 -15
View File
@@ -71,6 +71,35 @@ export const bdstUsgCd: SelectDataType[] = [
{ val: "14", text: "골프장" },
{ val: "15", text: "대규모점포" },
{ val: "16", text: "기타" },
{ text: "숙박업", val: "17" },
{ text: "목욕장업", val: "18" },
{ text: "공장", val: "19" },
{ text: "발전시설", val: "20" },
{ text: "관광단지개발사업", val: "21" },
{ text: "도시개발사업", val: "22" },
{ text: "산업단지개발사업", val: "23" },
{ text: "택지개발사업", val: "24" },
{ text: "대규모점포(대형마트)", val: "25" },
{ text: "대규모점포(전문점)", val: "26" },
{ text: "대규모점포(백화점)", val: "27" },
{ text: "대규모점포(쇼핑센터)", val: "28" },
{ text: "대규모점포(복합쇼핑몰)", val: "29" },
{ text: "물류시설", val: "30" },
{ text: "운수시설(여객자동차터미널)", val: "31" },
{ text: "운수시설(철도시설)", val: "32" },
{ text: "운수시설(공항시설)", val: "33" },
{ text: "운수시설(항만시설)", val: "34" },
{ text: "업무시설(공공업무시설)", val: "35" },
{ text: "업무시설(금융업소)", val: "36" },
{ text: "업무시설(사무소)", val: "37" },
{ text: "업무시설(결혼상담소 등 소개업소)", val: "38" },
{ text: "업무시설(출판사)", val: "39" },
{ text: "업무시설(신문사)", val: "40" },
{ text: "업무시설(오피스텔)", val: "41" },
{ text: "교정시설", val: "42" },
{ text: "방송국", val: "43" },
{ text: "전신전화국", val: "44" },
{ text: "기타", val: "45" },
];
export const rswtBdstType: SelectDataType[] = [
@@ -106,11 +135,11 @@ export const rswtBdstType: SelectDataType[] = [
];
export const orgwtKndCd = [
{ text: "오수(변기 오수 제외)", val: "1" },
{ text: "오수", val: "2" },
{ text: "폐수", val: "3" },
{ text: "오수 및 폐수", val: "4" },
{ text: "기타", val: "5" },
{ text: "오수(변기 오수 제외)", val: "01" },
{ text: "오수", val: "02" },
{ text: "폐수", val: "03" },
{ text: "오수 및 폐수", val: "04" },
{ text: "기타", val: "05" },
];
export const chBuCd = [
@@ -157,18 +186,19 @@ export const pplLenght = [
];
export const rainFcltCd = [
{ val: "지붕", text: "지붕" },
{ val: "건물옥상", text: "건물옥상" },
{ val: "골프장 연못", text: "골프장 연못" },
{ val: "운동장 바닥", text: "운동장 바닥" },
{ val: "운동장 지붕", text: "운동장 지붕" },
{ val: "주차장", text: "주차장" },
{ val: "태양광패널", text: "태양광패널" },
{ val: "연못", text: "연못" },
{ val: "기타", text: "기타" },
{ val: "확인불가", text: "확인불가" },
{ val: "01", text: "지붕" },
{ val: "02", text: "건물옥상" },
{ val: "03", text: "골프장 연못" },
{ val: "04", text: "운동장 바닥" },
{ val: "05", text: "운동장 지붕" },
{ val: "06", text: "주차장" },
{ val: "07", text: "태양광패널" },
{ val: "08", text: "연못" },
{ val: "09", text: "기타" },
{ val: "10", text: "확인불가" },
];
//물리화학적처리(스크린, 응집, 침전)/생물학적처리(활성슬러지법 등)/소독(염소, UV 등)/기타
export const rswtPrscCdMthdCd = [
{
+63 -75
View File
@@ -1,17 +1,38 @@
import { getFetch } from "@/components/lib/api";
import type { EnvPartSelectDataType, SelectDataType } from "@common/business_components/ui";
import { bdstFilterYn, bdstGrntchClass, bdstIncenYn, bdstUsgCd, chBuCd, dmdUszCd, erctUswtrPrcsMeth, htdPowerMthdCd, htdUtztnUsgCd, orgwtKndCd, pplLenght, pplQulity, rainFcltCd, rswtPrscCdMthdCd, ruseBizMthdCd, ruseMngMtd, rusePrcsMthdCd, ruseSeCd, yn } from "./basicCode";
export const btnClass = "p-4 m-2 text-white rounded-sm text-lg font-medium "
const laeSecd = '41'
import type {
EnvPartSelectDataType,
SelectDataType,
} from "@common/business_components/ui";
import {
bdstFilterYn,
bdstGrntchClass,
bdstIncenYn,
bdstUsgCd,
chBuCd,
dmdUszCd,
erctUswtrPrcsMeth,
htdPowerMthdCd,
htdUtztnUsgCd,
orgwtKndCd,
pplLenght,
pplQulity,
rainFcltCd,
rswtPrscCdMthdCd,
ruseBizMthdCd,
ruseMngMtd,
rusePrcsMthdCd,
ruseSeCd,
yn,
} from "./basicCode";
export const btnClass = "p-4 m-2 text-white rounded-sm text-lg font-medium ";
const laeSecd = "41";
//물재이용 주소 코드: devU01TX0FVVEgyMDI1MDgyNTEwMzkwNDExNjEwNTM=
export const buildingType = {
RST: "RST",
RNB: "RNB",
HTB:"HTB"
}
HTB: "HTB",
};
export const getSggCd = async (set: any) => {
const sgg = await getFetch("common", "/addr/sgg");
/* const sggCd = sgg.map((item: any) => ({
@@ -21,11 +42,10 @@ export const getSggCd = async (set: any) => {
const sggCd = [
// { text: "전체", val: '0' },
...sgg
.map((item: any) => ({
text: item.gugun || '',
val: String(item.adstDstrCd) || ''
}))
...sgg.map((item: any) => ({
text: item.gugun || "",
val: String(item.adstDstrCd) || "",
})),
];
set((state: comCodeState) => ({
@@ -41,7 +61,7 @@ export const getCityCd = async (set: any) => {
val: item.adstDstrCd,
text: item.sido,
}));
cityCd.unshift({ val: '0', text: '전체' })
cityCd.unshift({ val: "0", text: "전체" });
set((state: comCodeState) => ({
code: {
...state.code,
@@ -58,7 +78,7 @@ export const getRegionCd = async (set: any) => {
val: item.rvbsnCd,
text: item.rvbsn,
}));
rvbsnCd.unshift({ val: '0', text: '전체' })
rvbsnCd.unshift({ val: "0", text: "전체" });
set((state: comCodeState) => ({
code: {
...state.code,
@@ -66,7 +86,7 @@ export const getRegionCd = async (set: any) => {
},
}));
} catch (error) {
console.error('권역 데이터를 가져오는데 실패했습니다:', error);
console.error("권역 데이터를 가져오는데 실패했습니다:", error);
}
};
@@ -78,7 +98,7 @@ export const getMiddleRegionCd = async (set: any) => {
val: item.rvbsnCd,
text: item.mdmbsn,
}));
mdmbsnCd.unshift({ val: '0', text: '전체' })
mdmbsnCd.unshift({ val: "0", text: "전체" });
set((state: comCodeState) => ({
code: {
...state.code,
@@ -86,11 +106,10 @@ export const getMiddleRegionCd = async (set: any) => {
},
}));
} catch (error) {
console.error('중권역 데이터를 가져오는데 실패했습니다:', error);
console.error("중권역 데이터를 가져오는데 실패했습니다:", error);
}
};
// 단위유역 API 호출 함수 추가
export const getUnitWaterShedCd = async (set: any) => {
try {
@@ -99,7 +118,7 @@ export const getUnitWaterShedCd = async (set: any) => {
val: item.rvbsnCd,
text: item.lgbsn,
}));
lgbsnCd.unshift({ val: '0', text: '전체' })
lgbsnCd.unshift({ val: "0", text: "전체" });
set((state: comCodeState) => ({
code: {
...state.code,
@@ -107,23 +126,20 @@ export const getUnitWaterShedCd = async (set: any) => {
},
}));
} catch (error) {
console.error('대영역 데이터를 가져오는데 실패했습니다:', error);
console.error("대영역 데이터를 가져오는데 실패했습니다:", error);
}
};
// 환경청 데이터
export const getEnvPartCd = async (set: any) => {
try {
const lclgvrnmnt = await getFetch('common', '/addr/govArea');
const lclgvrnmnt = await getFetch("common", "/addr/govArea");
const lclgvrnmntCd = lclgvrnmnt.map((item: any) => ({
val: item.lclgvrnmntCd,
text: item.lclgvrnmntNm,
adstDliStrCd: item.adstDliStrCd || ''
adstDliStrCd: item.adstDliStrCd || "",
}));
lclgvrnmntCd.unshift({ val: '0', text: '전체', adstDliStrCd: '' })
lclgvrnmntCd.unshift({ val: "0", text: "전체", adstDliStrCd: "" });
set((state: comCodeState) => ({
code: {
...state.code,
@@ -131,17 +147,14 @@ export const getEnvPartCd = async (set: any) => {
},
}));
} catch (error) {
console.error('환경청 데이터를 가져오는데 실패했습니다:', error);
console.error("환경청 데이터를 가져오는데 실패했습니다:", error);
}
};
export type comCodeState = {
code: {
isInit: boolean;
chBuCd: SelectDataType[]
chBuCd: SelectDataType[];
rainFcltCd: SelectDataType[];
bdstUsgCd: SelectDataType[];
cityCd: SelectDataType[];
@@ -154,13 +167,13 @@ export type comCodeState = {
yn: SelectDataType[];
pplQulity: SelectDataType[];
pplLenght: SelectDataType[];
dmdUszCd:SelectDataType[]
dmdUszCd: SelectDataType[];
buildingType: {
RST:string,
RNB:string,
HTB:string
}
ruseMngMtd:SelectDataType[]
RST: string;
RNB: string;
HTB: string;
};
ruseMngMtd: SelectDataType[];
ruseSeCd: SelectDataType[];
ruseBizMthdCd: SelectDataType[];
rusePrcsMthdCd: SelectDataType[];
@@ -169,17 +182,14 @@ export type comCodeState = {
bdstIncenYn: SelectDataType[];
bdstGrntchClass: SelectDataType[];
rswtPrscCdMthdCd: SelectDataType[];
htdPowerMthdCd:SelectDataType[]
htdUtztnUsgCd:SelectDataType[]
htdPowerMthdCd: SelectDataType[];
htdUtztnUsgCd: SelectDataType[];
userSiSggCd: string;
};
};
export type comCodeType = comCodeState & comCodeActions;
export const comCodeStateExport: comCodeState = {
code: {
isInit: false,
@@ -214,41 +224,19 @@ export const comCodeStateExport: comCodeState = {
};
export type comCodeActions = {
codeInit: () => void;
returnCodeText: (val: string, codeName: string) => string;
};
export const codeActionExport: (set: any) => comCodeActions = (set: any) => {
return {
codeInit: async () => {
const sgg = await getFetch("common", "/addr/sgg");
const sggCd = sgg.map((item: any) => ({
val: item.adstDstrCd,
text: item.gugun,
}));
const city = await getFetch("common", "/addr/city");
const cityCd = city.map((item: any) => ({
val: item.adstDstrCd,
text: item.sido,
}));
return set((state: comCodeState) => ({
code: {
...state.code,
sggCd: sggCd,
cityCd: cityCd,
},
}));
},
divCityCd: async (cd: string) => {
set((state: comCodeState) => ({
code: {
...state.code,
sggCd: state.code.sggCd.filter((item) => { return item.val.toString().slice(0, 2) === cd }),
},
}));
returnCodeText: (val: string, codeName: string) => {
console.log('val', val, 'codeName', codeName);
return set((state: comCodeState) => {
const codeList = state.code[codeName] || [];
const found = codeList.find((item) => item.val === val);
return found ? found.text : val;
}
);
},
};
};
@@ -291,7 +291,7 @@ export const ldrmntNodeListExport: CommonTableProps[] = [
},
{
id: "usgRgnArea",
title: "용지면적",
title: "용지면적(m²)",
visible: true,
row: 1,
rowSpan: 1,
@@ -167,7 +167,7 @@ export const ruseCaseHeadListExport: TableUpperProps[] = [
},
{
id: "grnteWqPh",
title: "수소이온농도(PH)​",
title: "수소이온농도(ph)​",
visible: true,
row: 1,
},
@@ -151,7 +151,7 @@ export const rainChkgdnHeadListExport: TableUpperProps[] = [
{ id: "totalRuseFcltUtztnQnt", title: "연간빗물이용량(m³)" },
{
id: "ph",
title: "수소이온농도(PH)",
title: "수소이온농도(ph)",
upName: "useQuilty",
upSequnce: 1,
type: "number",
@@ -167,7 +167,7 @@ export const rswtChkHeadListExport: TableUpperProps[] = [
{ 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: "ph", title: "수소이온농도(ph)", upName: "useQuilty", upSequnce: 9,type: "text" },
{ id: "clIonQnt", title: "염화물(mg/L)", upName: "useQuilty", upSequnce: 10 ,type: "number"},
{
@@ -15,7 +15,7 @@ export const rainChkgdnHeadSttnExport: TableUpperProps[] = [
{ id: "totalRuseFcltUtztnQnt", title: "연간빗물이용량(m³)" },
{
id: "ph",
title: "수소이온농도(PH)",
title: "수소이온농도(ph)",
upName: "useQuilty",
upSequnce: 1,
type: "number",
@@ -64,7 +64,7 @@ export const rswtChkSttnHeadListExport: TableUpperProps[] = [
upSequnce: 8,
type: "number",
},
{ id: "ph", title: "수소이온농도(PH)", upName: "useQuilty", upSequnce: 9, type: "text" },
{ id: "ph", title: "수소이온농도(ph)", upName: "useQuilty", upSequnce: 9, type: "text" },
{
id: "clIonQnt",
title: "염화물(mg/L)",
@@ -6,7 +6,7 @@ import { makeMdfr, makeRstr } from "../bdstReg";
import { baseReuseBuildingSchema, chgBuildingSchema, validationMessages } from "./type";
export const TEST_UUID = '2d4b151d-1828-41e0-91d9-4cd28ea1cc7e'
export const rainRegSize =15
const rainyObjSchema = z.object({
bdstReuseFcltFk: z.number().nullish(),
pntfColKnd: z.string().min(1, { message: validationMessages.requiredSelect("종류") }),
@@ -99,7 +99,7 @@ export const rainFacStateExport: rainFacState = {
const initFetch = async (code: string | number) => {
// const rainRes =await getFetch("wr", `/reuseFc/rainyInfoList/1/10/${code}`);
const rainRes = await getFetchWithCount("wr", `/reuseFc/rainyInfoList/1/11/${code}`);
const rainRes = await getFetchWithCount("wr", `/reuseFc/rainyInfoList/1/${rainRegSize}/${code}`);
return rainRes;
};
export const rainFacActionsExport: (set: any) => rainFacSActions = (
@@ -108,7 +108,7 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
return {
getRainData: async (pageNation: number, code: string | number) => {
try {
const rainRes = await getFetchWithCount("wr", `/reuseFc/rainyInfoList/${pageNation}/11/${code}`);
const rainRes = await getFetchWithCount("wr", `/reuseFc/rainyInfoList/${pageNation}/${rainRegSize}/${code}`);
// 여기서 상태 업데이트
return set((state: rainFacState) => ({
@@ -149,7 +149,7 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
try {
// const rainRes = await getFetch('wr' , `/reuseFc/rainyInfoList/${pageNation}/20/41` +(txt? `/${txt}`:''))
const rainRes = await getFetchWithCount('wr', `/reuseFc/rainyInfoList/${pageNation}/11/41` + (txt ? `/${txt}` : ''))
const rainRes = await getFetchWithCount('wr', `/reuseFc/rainyInfoList/${pageNation}/${rainRegSize}/41` + (txt ? `/${txt}` : ''))
console.log("rainRes", rainRes)
set((state: rainFacState) => {
return {
@@ -6,14 +6,13 @@ export const validationMessages = {
requiredSelect: (field: string) => `${field}을(를) 선택해주세요.`,
yearFormat: '4자리 연도만 입력하세요',
};
export const baseReuseBuildingSchema = z.object({
bdstRuseFcltSn: z.number().nullish(),
bdstInfoSn: z.number().nullish(),
instlCmptnDt: z.coerce.date().default(() => new Date()),
instlCst: z
.number()
.max(9_999_999, { message: "최대 9,999,999까지 입력 가능합니다." })
.max(999_999_999_999, { message: "최대 1,000,000,000,000까지 입력 가능합니다." })
.nullish(),
operMngCd: z.string().optional().default(""),
anlOperCst: z.number().default(0),
@@ -7,6 +7,8 @@ import { z } from "zod";
import { makeMdfr, makeRstr } from "../bdstReg";
import { baseReuseBuildingSchema, chgBuildingSchema, validationMessages } from "../rainReg/type";
export const rswtRegSize =15;
const rswtrObjSchema = z.object({
bdstRuseFcltSn: z.number().nullish(),
//wtrUsqty: z.number({ required_error: validationMessages.required("물사용량(m³)") }).positive({ message: validationMessages.required("물사용량(m³)") }),
@@ -84,7 +86,7 @@ export const rswtFacStateExport: rswtFacState = {
};
const initFetch = async (code: string | number) => {
const rswtRes = await getFetchWithCount("wr", `/reuseFc/waterreuseFc/1/11/${code}`);
const rswtRes = await getFetchWithCount("wr", `/reuseFc/waterreuseFc/1/${rswtRegSize}/${code}`);
return rswtRes;
};
export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
@@ -99,7 +101,7 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
try {
const rswtRes = await getFetchWithCount(
"wr",
`/reuseFc/waterreuseFc/${pageNation}/11/${code}` +
`/reuseFc/waterreuseFc/${pageNation}/${rswtRegSize}/${code}` +
(txt ? `/${txt}` : "")
);
set((state: rswtFacState) => {
@@ -121,7 +123,7 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
try {
const rswtRes = await getFetchWithCount(
"wr",
`/reuseFc/waterreuseFc/${pageNation}/11/${code}`
`/reuseFc/waterreuseFc/${pageNation}/${rswtRegSize}/${code}`
);
console.log(pageNation);
// 여기서 상태 업데이트
@@ -11,6 +11,8 @@ import { htdflSttHeadListExport, htdflSttNodeListExport } from "./headList";
const htdflSttHeadList = htdflSttHeadListExport;
const htdflSttNodeList = htdflSttNodeListExport;
export const htdflSttnSize =10;
export type htdflSttnState = {
htdflSttn: {
isInit: boolean;
@@ -22,10 +24,10 @@ export type htdflSttnState = {
};
};
type htdflSttnActions = {
initHtdfl: (isExcel: boolean, page: number, total: string, con: string, txt: string,
initHtdfl: (isExcel: boolean, page: number, total: number, con: string, txt: string,
sidoCode: SelectDataType[],
sggCode: SelectDataType[]) => void;
htdflSttnSearch: (isExcel: boolean, page: number, total: string, con: string, txt: string,
htdflSttnSearch: (isExcel: boolean, page: number, total: number, con: string, txt: string,
sidoCode: SelectDataType[],
sggCode: SelectDataType[]) => void;
htdflChSttnHead: (
@@ -45,7 +47,7 @@ export const htdflSttnStateExport: htdflSttnState = {
htdflSttnResCount: 1,
},
};
const initFetch = async (page: number, total: string, con: string, txt: string) => {
const initFetch = async (page: number, total: number, con: string, txt: string) => {
const htdflRes = await getFetchWithCount(
"wr",
`/drain/facilityList` +
@@ -62,7 +64,7 @@ export const htdflSttnActionsExport: (set: any) => htdflSttnActions = (
set: any
) => {
return {
initHtdfl: async (isExcel: boolean, page: number, total: string, con: string, txt: string,
initHtdfl: async (isExcel: boolean, page: number, total: number, con: string, txt: string,
sidoCode: SelectDataType[],
sggCode: SelectDataType[]) => {
try {
@@ -95,7 +97,7 @@ export const htdflSttnActionsExport: (set: any) => htdflSttnActions = (
console.log(error);
}
},
htdflSttnSearch: async (isExcel: boolean, page: number, total: string, con: string, txt: string,
htdflSttnSearch: async (isExcel: boolean, page: number, total: number, con: string, txt: string,
sidoCode: SelectDataType[],
sggCode: SelectDataType[]) => {
try {
@@ -461,7 +461,7 @@ export const ruseGuranteeHeadListExport: TableUpperProps[] = [
{ id: "crmty", title: "색도(도)", visible: true },
{ id: "tn", title: "총질소(mg/L)", visible: true },
{ id: "tph", title: "총인(mg/L)", visible: true },
{ id: "ph", title: "수소이온농도(PH)", visible: true },
{ id: "ph", title: "수소이온농도(ph)", visible: true },
{ id: "clIonQnt", title: "염화물(mg/L)", visible: true },
{ id: "cdtnv", title: "전기전도도(μs/cm)​", visible: true },
];
@@ -228,7 +228,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [
},
{
id: "archArea",
title: "건축면적(m³)",
title: "건축면적(m²)",
upName: "bdnstInfo",
visible: true,
row: 2,
@@ -15,6 +15,8 @@ import type { z } from "zod";
import type { CommonTableProps } from "@/app/store/common/type/header";
import type { SelectDataType } from "@common/business_components/ui";
export const rainSttnSize = 10;
// 테이블 헤드 리스트
const rainSttHeadList = rainSttHeadListExport;
const rainSttNodeList = rainSttNodeListExport;
@@ -100,10 +102,10 @@ export type rainSttnState = {
};
};
type rainSttnActions = {
rainSttnInit: (isExcel: boolean, page: number, total: string, con: string, txt: string,
rainSttnInit: (isExcel: boolean, page: number, total: number, con: string, txt: string,
sidoCode: SelectDataType[],
sggCode: SelectDataType[]) => void
rainSttnSearch: (isExcel: boolean, page: number, total: string, con: string, txt: string,
rainSttnSearch: (isExcel: boolean, page: number, total: number, con: string, txt: string,
sidoCode: SelectDataType[],
sggCode: SelectDataType[]) => void;
rainChSttnHead: (
@@ -132,7 +134,7 @@ export const rainSttnActionsExport: (set: any) => rainSttnActions = (
set: any
) => {
return {
rainSttnInit: async (isExcel: boolean, page: number, total: string, con: string, txt: string,
rainSttnInit: async (isExcel: boolean, page: number, total: number, con: string, txt: string,
sidoCode: SelectDataType[],
sggCode: SelectDataType[]) => {
try {
@@ -141,7 +143,7 @@ export const rainSttnActionsExport: (set: any) => rainSttnActions = (
fetchType.WR,
`/reuseFc/rainyInfoList` +
(page ? `/${page}` : "/1") +
(total ? `/${total}` : "/20") +
(total ? `/${total}` : "/15") +
(con ? `/${con}` : "/0") +
(txt ? `/${txt}` : "")
);
@@ -172,7 +174,7 @@ export const rainSttnActionsExport: (set: any) => rainSttnActions = (
console.log(e)
}
},
rainSttnSearch: async (isExcel: boolean, page: number, total: string, con: string, txt: string,
rainSttnSearch: async (isExcel: boolean, page: number, total: number, con: string, txt: string,
sidoCode: SelectDataType[],
sggCode: SelectDataType[]) => {
try {
@@ -180,7 +182,7 @@ export const rainSttnActionsExport: (set: any) => rainSttnActions = (
fetchType.WR,
`/reuseFc/rainyInfoList` +
(page ? `/${page}` : "/1") +
(total ? `/${total}` : "/20") +
(total ? `/${total}` : "/15") +
(con ? `/${con}` : "/0") +
(txt ? `/${txt}` : "")
);
@@ -16,6 +16,7 @@ const rswtSttHeadList = rswtSttHeadListExport;
const rswtSttnRes: customRswtBdst[] = [];
export const rswtSttnSize = 10;
export type rswtSttnState = {
rswtSttn: {
@@ -29,10 +30,10 @@ export type rswtSttnState = {
};
type rswtSttnActions = {
rswtSttnInit: (isExcel: boolean, page: number, total: string, con: string, txt: string,
rswtSttnInit: (isExcel: boolean, page: number, total: number, con: string, txt: string,
sidoCode: SelectDataType[],
sggCode: SelectDataType[]) => void;
rswtSttnSearch: (isExcel: boolean, page: number, total: string, con: string, txt: string,
rswtSttnSearch: (isExcel: boolean, page: number, total: number, con: string, txt: string,
sidoCode: SelectDataType[],
sggCode: SelectDataType[]) => void;
rswtChSttnHead: (
@@ -59,7 +60,7 @@ export const rswtSttnActionsExport: (set: any) => rswtSttnActions = (
set: any
) => {
return {
rswtSttnInit: async (isExcel: boolean, page: number, total: string, con: string, txt: string,
rswtSttnInit: async (isExcel: boolean, page: number, total: number, con: string, txt: string,
sidoCode: SelectDataType[],
sggCode: SelectDataType[]) => {
try {
@@ -67,7 +68,7 @@ export const rswtSttnActionsExport: (set: any) => rswtSttnActions = (
fetchType.WR,
`/reuseFc/waterreuseFc` +
(page ? `/${page}` : "/1") +
(total ? `/${total}` : "/20") +
(total ? `/${total}` : "/10") +
(con ? `/${con}` : "/0") +
(txt ? `/${txt}` : "")
);
@@ -99,7 +100,7 @@ export const rswtSttnActionsExport: (set: any) => rswtSttnActions = (
console.log(e)
}
},
rswtSttnSearch: async (isExcel: boolean, page: number, total: string, con: string, txt: string,
rswtSttnSearch: async (isExcel: boolean, page: number, total: number, con: string, txt: string,
sidoCode: SelectDataType[],
sggCode: SelectDataType[]) => {
try {
@@ -107,7 +108,7 @@ export const rswtSttnActionsExport: (set: any) => rswtSttnActions = (
fetchType.WR,
`/reuseFc/waterreuseFc` +
(page ? `/${page}` : "/1") +
(total ? `/${total}` : "/20") +
(total ? `/${total}` : "/10") +
(con ? `/${con}` : "/0") +
(txt ? `/${txt}` : "")
);
+24
View File
@@ -273,3 +273,27 @@ export const formatYyyymmdd = (val: string | undefined) => {
const m = moment(val);
return m.isValid() ? m.format("YYYY-MM-DD") : val;
};
/**
* 문자열 숫자(콤마 포함 가능)를 반올림 처리해 반환.
* 숫자가 아닌 경우(예: "확인불가")는 원래 값을 그대로 반환.
*
* @param value 입력 문자열
* @param digits 소수점 자릿수 (기본 0 = 정수 반올림)
*/
export const formatArchArea =(value: string, digits: number=0 ) => {
// "확인불가" 등 숫자 아님 → 그대로 반환
const cleaned = value.replace(/,/g, "");
const num = parseFloat(cleaned);
if (isNaN(num)) {
return value;
}
// 반올림 (digits 자릿수까지)
const rounded = num.toFixed(digits);
// 다시 천 단위 콤마 찍어서 반환
return Number(rounded).toLocaleString();
}
@@ -212,7 +212,7 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
control={form.control}
name="archArea"
render={({ field }) => (
<FormUi label="건축면적(m³)">
<FormUi label="건축면적(m²)">
<Input
className={selectClass}
placeholder="면적을 입력하세요"
@@ -881,7 +881,7 @@ export default function HtdflRegForm({
</div>
<div className="grid grid-cols-12 gap-4">
<div className="col-span-6">
<Label className="text-xl">수소이온농도(PH)</Label>
<Label className="text-xl">수소이온농도(ph)</Label>
<div className="flex flex-row items-center gap-2">
<Input
className="!text-xl w-1/2"
@@ -445,7 +445,7 @@ export function PbnstBuseForm({
onSelectValue={(val) => setPpiYn(String(val))}
readOnly={readonly}
/>
<Label className="text-right">합계</Label>
<Label className="text-right">합계(m)</Label>
<Input
type="text"
value={formatCommaNumber(sumCpct)}
@@ -14,9 +14,9 @@ import {
} from "@/components/lib/func/commom";
import { DatePicker, FormUi } from "@common/business_components";
import { Form, FormField, SelectBox } from "@common/business_components/ui";
import { Button, Input, ScrollArea } from "@common/components/ui";
import { Button, Input } from "@common/components/ui";
import { zodResolver } from "@hookform/resolvers/zod";
import { useEffect, useState } from "react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";
import BdstReg from "../bdstReg/bdstReg";
@@ -54,18 +54,12 @@ export default function RainRegForm({
"reuseBuilding.0.rainyObj.filtrTrtmfctYn",
]);
const [divStyle, setDivStyle] = useState("h-[53vh]");
// const [divStyle, setDivStyle] = useState("h-[53vh]");
useEffect(() => {
if(isMap=== true){
setDivStyle("h-[100vh]")
}else if (isModal === true) {
setDivStyle("h-[53vh] max-h-[37vh]")
} else if (readonly === true) {
setDivStyle("h-[62vh]")
} else {
setDivStyle("h-[57vh]")
}
}, [isModal, readonly ,isMap]);
}, [isMap]);
const cleanRainData = (raw: any): z.infer<typeof rainZod> => {
const buildings =
@@ -94,6 +88,8 @@ export default function RainRegForm({
grntchBdstCertYn: item?.grntchBdstCertYn ?? "Y",
rainyObj: {
...item?.rainyObj,
pntfColKnd:item.rainyObj?.pntfColKnd??'확인불가',
filtrTrtmfctPrs:item.rainyObj?.filtrTrtmfctPrs??'',
filtrTrtmfctYn: item?.rainyObj?.filtrTrtmfctYn ?? "Y",
},
})),
@@ -180,7 +176,7 @@ export default function RainRegForm({
)}
</div>
</div>
<ScrollArea className={divStyle}>
{/* <ScrollArea className={divStyle}> */}
{isModal && rainForm != undefined ? <BdstReg form={form} /> : <></>}
{isModal ? (
<h1 className="pl-3 text-xl col-span-10 mt-4">
@@ -614,7 +610,7 @@ export default function RainRegForm({
</div>
</div>
<BdstAdd form={form} readonly={readonly}></BdstAdd>
</ScrollArea>
{/* </ScrollArea> */}
</form>
</Form>
</div>
@@ -19,9 +19,9 @@ import {
FormUi,
SelectBox,
} from "@common/business_components/ui";
import { Button, Input, ScrollArea } from "@common/components/ui";
import { Button, Input } from "@common/components/ui";
import { zodResolver } from "@hookform/resolvers/zod";
import { useEffect, useState } from "react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";
import BdstAdd from "../bdstReg/bdstAdd";
@@ -46,18 +46,11 @@ export default function RswtrRegForm({
const { code, rswtBdstUpdate, rswtBdstReg } = useWrStore(
(state) => state
);
const [divStyle, setDivStyle] = useState("h-[53vh]");
// const [divStyle, setDivStyle] = useState("h-[53vh]");
useEffect(() => {
if(isMap){
setDivStyle("h-[100vh]")
}else if (isModal === true) {
setDivStyle("h-[53vh] max-h-[37vh]")
} else if (readonly === true) {
setDivStyle("h-[62vh]")
} else {
setDivStyle("h-[57vh]")
}
}, [isModal, readonly ,isMap]);
}, [isMap]);
// const defaultValues: z.infer<typeof rswtZod> = rswtZod.parse({});
const form = useForm<z.infer<typeof rswtZod>>({
@@ -176,7 +169,7 @@ export default function RswtrRegForm({
)}
</div>
</div>
<ScrollArea className={divStyle}>
{/* <ScrollArea className={divStyle}> */}
{isModal && rswtForm != undefined ? <BdstReg form={form} /> : <></>}
{isModal ? (
<h1 className="pl-3 text-xl col-span-10 mt-4 ">
@@ -506,7 +499,7 @@ export default function RswtrRegForm({
</div>
</div>
<BdstAdd form={form} readonly={readonly}></BdstAdd>
</ScrollArea>
{/* </ScrollArea> */}
</form>
</Form>
</div>
@@ -196,7 +196,7 @@ export function BdstReg<T extends MoType>({
</div>
</ScrollArea>
<div className="border-t border-gray-300 my-4"></div>
{/* <ScrollArea className="h-[40vh]"> */}
<ScrollArea className="h-[40vh]">
<div>
{moType === "RNB" ? (
<RainRegForm
@@ -226,7 +226,7 @@ export function BdstReg<T extends MoType>({
></HtdflRegForm>
)}
</div>
{/* </ScrollArea> */}
</ScrollArea>
</div>
</>
);
@@ -571,7 +571,7 @@ export default function CoDetailModal({
control={form.control}
name="usgRgnArea"
render={({ field }) => (
<FormUi label="용지면적">
<FormUi label="용지면적(m²)">
<Input
className={selectClass}
placeholder=""