중수도 수정 완료

This commit is contained in:
leedj312
2025-07-04 20:06:07 +09:00
parent 7c34c87aaf
commit 76a511a5e0
5 changed files with 29 additions and 12 deletions
@@ -51,8 +51,11 @@ export default function Home() {
if (code.sggCd.length > 0) {
const rainData = tableData(rainRes, { code }).map(
(item: customRainBdst) => {
let archArea = item?.archArea.split('.')[0]!=='-1'?item?.archArea.split('.')[0]:'확인불가'
return {
...item,
archArea:archArea,
bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N",
};
}
@@ -20,6 +20,7 @@ import {
import ListDiv from "@common/business_components/ui/list_div";
import { Button } from "@common/components";
import { useEffect, useState } from "react";
import { Toaster } from "react-hot-toast";
export default function Home() {
const { code, rswt, initRswt, rswtBdstSearch, getRswtBdstData } = useWrStore(
@@ -45,8 +46,13 @@ export default function Home() {
if (code.sggCd.length > 0 && rswtRes?.length > 0) {
const rswtData = tableData(rswtRes, { code })?.map(
(item: customRswtBdst) => {
let archArea =
item?.archArea.split(".")[0] !== "-1"
? item?.archArea.split(".")[0]
: "확인불가";
return {
...item,
archArea: archArea,
bdstChgYn: item.chgBuilding[0]?.bdstChgNm != null ? "Y" : "N",
bdstUsgCd: item.reuseBuilding[0]?.bdstUsgCd,
};
@@ -151,7 +157,13 @@ export default function Home() {
</div>
<UiModal
body={<BdstReg moType="RST" setIsModal={setIsNewReg} isModal={issNewReg}></BdstReg>}
body={
<BdstReg
moType="RST"
setIsModal={setIsNewReg}
isModal={issNewReg}
></BdstReg>
}
bodyClass="w-[68vw] max-w-none h-[90vh]"
open={issNewReg}
onOpenChange={(open) => {
@@ -162,12 +174,14 @@ export default function Home() {
bodyClass={""}
open={bdstChgProps.isOpen}
body={
<BdstChgModal chgBuilding={bdstChgProps.chgBuilding} ></BdstChgModal>
<BdstChgModal chgBuilding={bdstChgProps.chgBuilding}></BdstChgModal>
}
onOpenChange={(open) => {
setBdstChgProps({ ...bdstChgProps, isOpen: open });
}}
/>
<Toaster position="top-center" />
</ContentsDiv>
</>
);
@@ -223,9 +223,9 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) {
placeholder="면적을 입력하세요"
type="text"
onChange={(e) => {
handleCommaNumberChange(e, field.onChange);
field.onChange(e.target.value)
}}
value={formatCommaNumber(field.value)}
value={field.value}
/>
</FormUi>
)}
@@ -81,11 +81,11 @@ export default function RswtrRegForm({
? new Date(item.instlCmptnDt)
: new Date(), // item?.instlCmptnDt가 유효하지 않으면 현재 날짜로 초기화
operMngCd: item?.operMngCd ?? "", // null → ""
instlCstSprtYn: item?.instlCstSprtYn ?? "Y", // null → "Y"
grntchBdstCertYn: item?.grntchBdstCertYn ?? "Y",
instlCstSprtYn: item?.instlCstSprtYn || code.yn[0]?.val, // null → "Y"
grntchBdstCertYn: item?.grntchBdstCertYn|| code.yn[0]?.val,
rswtrObj: {
...item?.rswtrObj,
filtrTrtmfctYn: item?.rainyObj?.filtrTrtmfctYn ?? "Y",
filtrTrtmfctYn: item?.rainyObj?.filtrTrtmfctYn || code.yn[0]?.val,
filtrTrtmfctCpct: item?.rswtrObj?.filtrTrtmfctCpct ?? null,
filtrTrtmfctProcs: item?.rswtrObj?.filtrTrtmfctProcs || code.rswtPrscCdMthdCd[0]?.val,
orgwtKndCd: item?.rswtrObj?.orgwtKndCd || code.orgwtKndCd[0]?.val,
@@ -349,7 +349,7 @@ export default function RswtrRegForm({
if (readonly) return;
handleMinusNumberChange(e, field.onChange);
}}
disabled={instlCstSprtYn !== "Y"}
disabled={instlCstSprtYn === "N"||instlCstSprtYn === "D"}
/>
</FormUi>
);
@@ -374,7 +374,7 @@ export default function RswtrRegForm({
label={""}
selectArray={code.bdstIncenYn}
onSelectValue={readonly ? () => {} : field.onChange}
value={field.value ?? code.yn[0]?.val}
value={field.value || code.yn[0]?.val}
readOnly={readonly}
/>
</FormUi>
@@ -410,7 +410,7 @@ export default function RswtrRegForm({
field.onChange(e.target.value);
}
}}
disabled={grntchBdstCertYn !== "Y"}
disabled={grntchBdstCertYn == "N" || grntchBdstCertYn == "D"}
max={4}
/>
</FormUi>
@@ -447,7 +447,7 @@ export default function RswtrRegForm({
field.onChange(e.target.value);
}
}}
disabled={grntchBdstCertYn !== "Y"}
disabled={grntchBdstCertYn == "N" || grntchBdstCertYn == "D"}
@@ -147,7 +147,7 @@ export function BdstReg<T extends MoType>({ moType,setIsModal,isModal }: BdstReg
{ moType === 'RNB'?
<RainRegForm rainForm={rainBdstForm as customRainBdst} isModal={isModal} setIsModal={setIsModal} />
:moType==='RST'
? <RswtrRegForm rswtForm={rainBdstForm as customRswtBdst} isModal={isModal} setIsModal={(open) =>{setIsModal}}></RswtrRegForm>
? <RswtrRegForm rswtForm={rainBdstForm as customRswtBdst} isModal={isModal} setIsModal={(open) =>{setIsModal && setIsModal(open)}}></RswtrRegForm>
:<HtdflRegForm htdflForm={rainBdstForm as unknown as customHtdflBdst} isModal={true} setIsModal={(open) =>{setIsModal && setIsModal(open)}}></HtdflRegForm>
}