diff --git a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx index 0820e5609..1aec73e63 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx @@ -19,7 +19,7 @@ import type { customPbnst, fcBizSchema, fcBizType, ruseFcltType } from "@/app/st import { PbnstMngForm } from "@/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm"; import { PbnstBuseForm } from "@/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm"; import { z } from "zod"; -import { BdstReg } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal"; +import { PbnstRegModal } from "@/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal"; export default function PublicReuseFaciltyInsert() { const { code, pbnst, pubHasuInit,pbnstRegInit } = useWrStore((state) => state); @@ -99,7 +99,7 @@ useEffect(() => { @@ -140,7 +140,14 @@ useEffect(() => { - + } + bodyClass="w-[68vw] max-w-none h-[90vh]" + open={issNewReg} + onOpenChange={(open) => { + setIsNewReg(open); + }} + /> diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx index 731f32e1d..e9ec31965 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx @@ -37,7 +37,10 @@ import { import RuseMngTable from "@/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable"; export function PbnstBuseForm({ data }: { data: fcBizType[] }) { - const ref = useRef(data[0]?.pplInstls ?? null); + // const ref = useRef(data[0]?.pplInstls ?? null); + const ref = useRef( + Array.isArray(data) && data.length > 0 ? data[0]?.pplInstls ?? null : null + ); const { code, pbnst } = useWrStore((state) => state); const { pbnstBizCycle, pbnstRes } = pbnst; const [getBizCycle, setBizCycle] = useState("1"); diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx index 1786b5f2e..3d37a8832 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx @@ -1,29 +1,23 @@ "use client"; -import { SelectBox } from "@common/business_components"; -import { FileUpload, FormUi, UiTable } from "@common/business_components/ui"; -import { Form, FormField } from "@common/business_components/ui/form"; -import { Button, Input, TableHead, TableRow } from "@common/components"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { use, useEffect, useRef, useState } from "react"; -import { set, useFieldArray, useForm } from "react-hook-form"; -import { nullable, z } from "zod"; import { useWrStore } from "@/app/store"; -import { - selectClass, - type TableUpperProps, -} from "@/app/store/ruseFcltMng/fcltReg/rainReg"; +import { FileUpload, FormUi } from "@common/business_components/ui"; +import { Form, FormField } from "@common/business_components/ui/form"; +import { Button, Input } from "@common/components"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { useEffect, useRef, useState } from "react"; +import { useFieldArray, useForm } from "react-hook-form"; +import { z } from "zod"; +import { pbnstRegZod, type customPbnst, type operType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type"; import { commonButonSize, formH1Class, - formH2Class, - formTableName, + formTableName } from "@/components/lib/class/comClass"; -import RuseMngTable from "@/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable"; import { TusClientUpload } from "@/components/lib/useTus_wr/useTusWr"; +import RuseMngTable from "@/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable"; import type { Upload } from "tus-js-client"; -import { pbnstRegZod, type customPbnst, type operType, type ruseFcltType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type"; export function PbnstMngForm({ data }: { data: customPbnst }) { const { pbnst ,pbnstUpdate} = useWrStore((state) => state); @@ -44,7 +38,7 @@ export function PbnstMngForm({ data }: { data: customPbnst }) { - const ref = useRef(data.fcOpers ?? null); + const ref = useRef(data?.fcOpers ?? null); const form = useForm>({ resolver: zodResolver(pbnstRegZod), defaultValues: pbnstRegZod.parse({}), @@ -83,7 +77,7 @@ export function PbnstMngForm({ data }: { data: customPbnst }) { useEffect(() => { form.reset(data); - setRuseOperData(data.fcOpers); + setRuseOperData(data?.fcOpers); }, [data]); // 2. Define a submit handler. @@ -178,7 +172,7 @@ export function PbnstMngForm({ data }: { data: customPbnst }) {

재이용수 공급 가능량

-
+
-
+
-
+
-
+
field.onChange(date) } - className={"rounded-lg w-full"} + className={"rounded-lg !w-full"} /> ) : item.type === "number" ? ( diff --git a/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx b/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx new file mode 100644 index 000000000..3d33d3e92 --- /dev/null +++ b/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx @@ -0,0 +1,121 @@ +"use client"; + +import { useWrStore } from "@/app/store"; +import type { customPbnst, fcBizType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type"; +import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; +import { getCity } from "@/components/lib/func/commom"; +import { PbnstMngForm } from "@/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm"; +import { ScrollArea, SelectBox, UiTable, type SelectDataType } from "@common/business_components"; +import { Button, Input, Label, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components/ui"; +import { useState } from "react"; +import type { objSearchType } from "../bdstRegModal/bdstRegModal"; +import { PbnstBuseForm } from "@/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm"; + +export function PbnstRegModal() { + const {code, pbnst} = useWrStore((state) => { + return state; + }); + const { pubFacHeadList, pbnstHasuRes, pbnstRes } = pbnst; + const [selectSgg, setSelectSgg] = useState() + const [objSearch, setObjSearch] = useState({sgg:"",city:""}); + const [searchTxt, setSearchTxt] = useState() + const [bdstTable, setbdstTable] = useState(); + const [selectBdst, setSelectBdst] = useState(null); + const [pbnstBiz, setPbnstBiz] = useState(); + const [pbnstBdstForm, setPbnstBdstForm] = useState({} as customPbnst); + const [currentTab, setCurrentTab] = useState("mng"); + // const nodeList = headMakeColSpan(pubFacHeadList.moUpHeadList); + const getSelCity = (val: string | number) => { + const cityValue = String(val); + const data = getCity(cityValue, code.sggCd); + setSelectSgg(data); + setObjSearch({ city: cityValue, sgg: '' }); + }; + const getSgg = (val: string | number) => { + console.log(val); + setObjSearch({...objSearch,sgg: String(val)}) + }; + const tableClick: (val: number | undefined , headId:string) => void = (val ,headId) => { + // if(val!==undefined && bdst?.bdstBase.length>0){ + // const data:BdstTypeMap[T] =bdst?.bdstBase[val] + // if (data) { + // setRainBdstForm(data); + // } + // } + } + const handleTabChange = (value: string) => { + setCurrentTab(value); + }; + + return ( + <> +
+ + {""} + + + {" "} + + + {}}/> + +
+
+
+

공공 하수처리시설 목록

+ +
+ (tableClick(idx, headId || ""))} + onPageChange={function (page: number): void { + throw new Error("Function not implemented."); + }}> + {/* {nodeList} */} + +
+
+
+ + + + 시설정보 + 차수별정보 + + + + + + + + +
+ + + + +
+
+
+ + + ) +} + +