-
-
(
-
- {
- field.onChange(val);
- }}
- value={field.value}
- />
-
- )}
- />
+
+
+ 건축물 시설 정보
+
+
+
+ (
+
+ {
+ field.onChange(val);
+ }}
+ value={field.value}
+ />
+
+ )}
+ />
+
+
+ (
+
+ {
+ field.onChange(val);
+ }}
+ value={field.value}
+ />
+
+ )}
+ />
+
-
- (
-
- {
- field.onChange(val);
- }}
- value={field.value}
- />
-
- )}
- />
-
-
- (
-
-
-
- )}
- />
-
-
-
-
-
+
+ 중축, 개축, 증축
+
+
+
+
+
>
);
}
diff --git a/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx b/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx
index 6139ab5b5..98d0e28a9 100644
--- a/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx
+++ b/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx
@@ -7,37 +7,55 @@ import { useForm } from "react-hook-form";
import { z } from "zod";
import { FormUi } from "@common/business_components";
import { useWrStore } from "@/app/store";
-import { selectClass, type rainRuseBd, } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
+import {
+ selectClass,
+ type rainRuseBd,
+} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { useEffect } from "react";
-import { bdstDefZod, bdstZod, rainDefZod, rainZod } from "@/components/lib/type/zod/fcltReg/controlZod";
+import {
+ bdstDefZod,
+ bdstZod,
+ rainDefZod,
+ rainZod,
+} from "@/components/lib/type/zod/fcltReg/controlZod";
import BdstReg from "../bdstReg/component";
-export function RainRegForm({data,isModal}:{data:rainRuseBd[], isModal:boolean} ) {
-
- console.log(isModal)
+export function RainRegForm({
+ data,
+ isModal,
+}: {
+ data: rainRuseBd[];
+ isModal: boolean;
+}) {
+ console.log(isModal);
const formSchema = isModal
- ? z.object({ ...rainZod, ...bdstZod })
- : z.object(rainZod)
+ ? z.object({ ...rainZod, ...bdstZod })
+ : z.object(rainZod);
- const { rain ,code} = useWrStore((state) => state);
- const {rainFcltCd } = code
+ const { rain, code } = useWrStore((state) => state);
+ const { rainFcltCd } = code;
useEffect(() => {
- if (data && data.length > 0) {
- console.log(data)
- const selectedOption = rainFcltCd.find(item => item.val === String(data[0]?.pntfColKnd ?? ""));
- const formData = {
- ...data[0],
- pntfColKnd: selectedOption ? selectedOption.val : "",
- instlCmptnDt: data[0]?.instlCmptnDt ? new Date(data[0].instlCmptnDt) : undefined
- };
- form.reset(formData);
- }
- }, [data, rainFcltCd]);
+ if (data && data.length > 0) {
+ console.log(data);
+ const selectedOption = rainFcltCd.find(
+ (item) => item.val === String(data[0]?.pntfColKnd ?? "")
+ );
+ const formData = {
+ ...data[0],
+ pntfColKnd: selectedOption ? selectedOption.val : "",
+ instlCmptnDt: data[0]?.instlCmptnDt
+ ? new Date(data[0].instlCmptnDt)
+ : undefined,
+ };
+ form.reset(formData);
+ }
+ }, [data, rainFcltCd]);
const form = useForm
>({
resolver: zodResolver(formSchema),
- defaultValues: isModal ? {...rainDefZod, ...bdstDefZod} : {...rainDefZod}
-
+ defaultValues: isModal
+ ? { ...rainDefZod, ...bdstDefZod }
+ : { ...rainDefZod },
});
// form 값이 변경될 때마다 로그 출력
@@ -65,13 +83,18 @@ export function RainRegForm({data,isModal}:{data:rainRuseBd[], isModal:boolean}
{/* */}
-
○ 빗물이용시설 운영정보
-
+
+ {isModal ? "○건축물 운영정보" : "○ 빗물이용시설 운영정보"}
+
+
+ {isModal ?
: <>>}
+ {isModal ?
○ 빗물이용시설 운영정보
: <>>}
기본정보
+
field.onChange(e.target.value ? new Date(e.target.value) : undefined)}
- value={field.value ? field?.value.toString().split('T')[0] : ""}
+ onChange={(e) =>
+ field.onChange(
+ e.target.value ? new Date(e.target.value) : undefined
+ )
+ }
+ value={
+ field.value ? field?.value.toString().split("T")[0] : ""
+ }
/>
)}
@@ -106,9 +135,7 @@ export function RainRegForm({data,isModal}:{data:rainRuseBd[], isModal:boolean}
)}
/>
-
-
- {isModal?
:<>>}
+
빗물이용시설 정보
diff --git a/apps/wr/components/ui/modal/bdstReg/component.tsx b/apps/wr/components/ui/modal/bdstReg/component.tsx
index e505242ae..d2693cd35 100644
--- a/apps/wr/components/ui/modal/bdstReg/component.tsx
+++ b/apps/wr/components/ui/modal/bdstReg/component.tsx
@@ -1,70 +1,100 @@
-'use client'
+"use client";
import { headMakeColSpan } from "@/app/ruseFcltMng/fcltReg/rainReg/page";
import { useWrStore } from "@/app/store";
-import { selectClass, type bdstType } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
-import { ScrollArea, SelectBox, UiTable } from "@common/business_components";
+import {
+ selectClass,
+ type bdstType,
+} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
+import { ScrollArea, SearchInput, SelectBox, UiTable } from "@common/business_components";
import { Button, Input } from "@common/components";
import { useEffect, useState } from "react";
import { RainRegForm } from "../../form/fcltReg/rainReg/component";
-export function BdstReg(){
+export function BdstReg() {
+ const { rain, code, init } = useWrStore((state) => {
+ return state;
+ });
- const { rain, code,init } = useWrStore((state) => {
- return state
- });
+ const [bdstTable, setbdstTable] = useState();
+ const [rainBdstForm, setRainBdstForm] = useState<[]>();
+ const { bdstObj, rainRuseObj } = rain;
+ const getCity = (val: string | number) => {
+ console.log(val);
+ };
- const[bdstTable, setbdstTable] = useState ();
- const [rainBdstForm, setRainBdstForm] = useState<[]>()
- const {bdstObj, rainRuseObj } =rain
- const getCity =(val:string|number)=>{
+ const getSgg = (val: string | number) => {
+ console.log(val);
+ };
- console.log(val)
- }
+ useEffect(() => {
+ if (code.sggCd.length > 0) {
+ const table = bdstObj.map((item) => {
+ const sggText = code.sggCd.find(
+ (cd) => cd.val.toString() === item.sggCd
+ )?.text;
+ const cityText = code.cityCd.find(
+ (cd) => cd.val.toString() === item.ctpvCd
+ )?.text;
+ return { ...item, sggText: sggText, cityText: cityText };
+ });
+ setbdstTable(table);
+ }
+ }, [code, bdstObj]);
- const getSgg =(val:string|number)=>{
+ const cellClick = () => {};
+ const nodeList = headMakeColSpan(rain.upHeadList);
+ return (
+ <>
+
+
+ {" "}
+
+
+ {" "}
+
+
+
+
+
+
+ {nodeList}
+
+
+
- console.log(val)
- }
-
- useEffect ( () => {
- if(code.sggCd.length>0){
- const table= bdstObj.map((item) => {
- const sggText= code.sggCd.find((cd)=>cd.val.toString() === item.sggCd )?.text;
- const cityText= code.cityCd.find((cd)=>cd.val.toString() === item.ctpvCd )?.text;
- return(
- {...item,
- sggText:sggText,
- cityText:cityText
- })
- })
- setbdstTable(table)
- }
- }, [code,bdstObj]);
-
- const cellClick = ()=>{
-
- }
- const nodeList = headMakeColSpan(rain.upHeadList)
- return(
- <>
-
건축물조회
< h2/>
-
-
-
- {nodeList}
-
-
-
-
-
-
-
- >
- )
-}
\ No newline at end of file
+
+ >
+ );
+}