From b7164a05423726753f38ee5a8f550bf0a4aff9fb Mon Sep 17 00:00:00 2001 From: leedj312 Date: Mon, 17 Mar 2025 11:26:07 +0900 Subject: [PATCH] =?UTF-8?q?app,=20store,=20=20component=20=ED=8F=B4?= =?UTF-8?q?=EB=8D=94=20=EA=B5=AC=EC=A1=B0=20=EB=B0=8F=20=EB=AA=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/matMng/matDmd/coReg/page.tsx | 4 +- apps/wr/app/matMng/matDmd/dmdReg/page.tsx | 2 +- apps/wr/app/page.tsx | 6 +- .../fcltReg/pbnstReg}/page.tsx | 4 +- .../fcltReg/rainReg}/page.tsx | 6 +- .../fcltReg/rswtReg}/page.tsx | 6 +- apps/wr/app/store/matDmd/index.tsx | 2 +- .../fcltReg/pbnstReg}/index.tsx | 2 +- .../fcltReg/rainReg}/index.tsx | 0 .../fcltReg/rswtReg}/index.tsx | 2 +- apps/wr/app/store/store.tsx | 6 +- apps/wr/components/ui/IteratreForm.tsx | 54 -------------- .../fcltReg/pbnstReg/component.tsx} | 6 +- .../fcltReg/rainReg/component.tsx} | 71 +++++++++++++------ .../fcltReg/rswtrReg/component.tsx} | 70 ++++++++++++------ .../{ => form}/matDmd/coRegForm/component.tsx | 8 +-- .../matDmd/dmdRegform/component.tsx | 2 +- .../components/{ => ui/toast}/toastFromUi.tsx | 1 - 18 files changed, 125 insertions(+), 127 deletions(-) rename apps/wr/app/{reuseFaciltyManage/reuseFacilityInsert/publicReuseFaciltyInsert => ruseFcltMng/fcltReg/pbnstReg}/page.tsx (93%) rename apps/wr/app/{reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert => ruseFcltMng/fcltReg/rainReg}/page.tsx (90%) rename apps/wr/app/{reuseFaciltyManage/reuseFacilityInsert/rswtReuseFacilityInsert => ruseFcltMng/fcltReg/rswtReg}/page.tsx (90%) rename apps/wr/app/store/{publicReuseFaciltyInsert => ruseFcltMng/fcltReg/pbnstReg}/index.tsx (98%) rename apps/wr/app/store/{rainReuseFacilityInsert => ruseFcltMng/fcltReg/rainReg}/index.tsx (100%) rename apps/wr/app/store/{rswtrReuseFaciltyInsert => ruseFcltMng/fcltReg/rswtReg}/index.tsx (97%) delete mode 100644 apps/wr/components/ui/IteratreForm.tsx rename apps/wr/components/ui/{publicReuseInsertForm.tsx => form/fcltReg/pbnstReg/component.tsx} (99%) rename apps/wr/components/ui/{rainReuseInsertForm.tsx => form/fcltReg/rainReg/component.tsx} (78%) rename apps/wr/components/ui/{rswtrReuseInsetForm.tsx => form/fcltReg/rswtrReg/component.tsx} (83%) rename apps/wr/components/ui/{ => form}/matDmd/coRegForm/component.tsx (94%) rename apps/wr/components/ui/{ => form}/matDmd/dmdRegform/component.tsx (99%) rename apps/wr/components/{ => ui/toast}/toastFromUi.tsx (97%) diff --git a/apps/wr/app/matMng/matDmd/coReg/page.tsx b/apps/wr/app/matMng/matDmd/coReg/page.tsx index 0c6ceccaa..282c042f3 100644 --- a/apps/wr/app/matMng/matDmd/coReg/page.tsx +++ b/apps/wr/app/matMng/matDmd/coReg/page.tsx @@ -10,9 +10,9 @@ import { SelectBox, } from "@common/business_components/ui"; import { Button } from "@common/components/ui"; -import { CoRegForm } from "@/components/ui/matDmd/coRegForm/component"; +import { CoRegForm } from "@/components/ui/form/matDmd/coRegForm/component"; import toast, { Toaster } from "react-hot-toast"; -import { ToastFormUi } from "@/components/toastFromUi"; +import { ToastFormUi } from "@/components/ui/toast/toastFromUi"; const formSchema = z.object({ ctpv: z.string(), diff --git a/apps/wr/app/matMng/matDmd/dmdReg/page.tsx b/apps/wr/app/matMng/matDmd/dmdReg/page.tsx index d405d45a6..75918d021 100644 --- a/apps/wr/app/matMng/matDmd/dmdReg/page.tsx +++ b/apps/wr/app/matMng/matDmd/dmdReg/page.tsx @@ -4,7 +4,7 @@ import { zodResolver } from "@hookform/resolvers/zod"; import * as z from "zod"; import { Form } from "@common/business_components/ui"; import { Button } from "@common/components/ui"; -import { DmdRegForm } from "@/components/ui/matDmd/dmdRegform/component"; +import { DmdRegForm } from "@/components/ui/form/matDmd/dmdRegform/component"; import toast, { Toaster } from "react-hot-toast"; import { useRouter } from "next/navigation"; diff --git a/apps/wr/app/page.tsx b/apps/wr/app/page.tsx index 356cfe8c3..0564641f6 100644 --- a/apps/wr/app/page.tsx +++ b/apps/wr/app/page.tsx @@ -8,13 +8,13 @@ export default function Home() { <>
- + {/* */}
diff --git a/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx similarity index 90% rename from apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert/page.tsx rename to apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx index c94a93075..f3d3a2b48 100644 --- a/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx @@ -1,7 +1,7 @@ 'use client' import { useWrStore } from "@/app/store"; -import type { TableUpperProps } from "@/app/store/rainReuseFacilityInsert" -import { RainReuseFaciltyInsertForm } from "@/components/ui/rainReuseInsertForm"; +import type { TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg" +import { RainRegForm } from "@/components/ui/form/fcltReg/rainReg/component"; import { ScrollArea, SearchDiv, SearchInput, UiTable } from "@common/business_components"; import { Button, TableHead, TableRow } from "@common/components"; @@ -57,7 +57,7 @@ export default function Home() {
- +
diff --git a/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rswtReuseFacilityInsert/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx similarity index 90% rename from apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rswtReuseFacilityInsert/page.tsx rename to apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx index cecd4177c..e4b0dc16f 100644 --- a/apps/wr/app/reuseFaciltyManage/reuseFacilityInsert/rswtReuseFacilityInsert/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx @@ -1,7 +1,7 @@ 'use client' import { useWrStore } from "@/app/store"; -import type { TableUpperProps } from "@/app/store/rainReuseFacilityInsert"; -import { RswtrReuseFaciltyInsertForm } from "@/components/ui/rswtrReuseInsetForm"; +import type { TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; +import { RswtrRegForm } from "@/components/ui/form/fcltReg/rswtrReg/component"; import { ScrollArea, SearchDiv, SearchInput, UiTable } from "@common/business_components"; import { Button, TableHead, TableRow } from "@common/components"; @@ -59,7 +59,7 @@ export default function Home() {
- +
diff --git a/apps/wr/app/store/matDmd/index.tsx b/apps/wr/app/store/matDmd/index.tsx index 2ed933348..d35a62951 100644 --- a/apps/wr/app/store/matDmd/index.tsx +++ b/apps/wr/app/store/matDmd/index.tsx @@ -1,4 +1,4 @@ -import type { selectArray } from "../rainReuseFacilityInsert"; +import type { selectArray } from "../ruseFcltMng/fcltReg/rainReg"; diff --git a/apps/wr/app/store/publicReuseFaciltyInsert/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx similarity index 98% rename from apps/wr/app/store/publicReuseFaciltyInsert/index.tsx rename to apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx index 131132b85..e801a082d 100644 --- a/apps/wr/app/store/publicReuseFaciltyInsert/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx @@ -1,4 +1,4 @@ -import type { TableUpperProps } from "../rainReuseFacilityInsert"; +import type { TableUpperProps } from "../rainReg"; export type TableProps = { id: string; diff --git a/apps/wr/app/store/rainReuseFacilityInsert/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx similarity index 100% rename from apps/wr/app/store/rainReuseFacilityInsert/index.tsx rename to apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx diff --git a/apps/wr/app/store/rswtrReuseFaciltyInsert/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx similarity index 97% rename from apps/wr/app/store/rswtrReuseFaciltyInsert/index.tsx rename to apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx index b2621631b..667afef2d 100644 --- a/apps/wr/app/store/rswtrReuseFaciltyInsert/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx @@ -1,4 +1,4 @@ -import { upHeadList, type rainFacOfType, type selectArray, type TableUpperProps } from "../rainReuseFacilityInsert"; +import { upHeadList, type rainFacOfType, type selectArray, type TableUpperProps } from "../rainReg"; const rswtOfObject:rainFacOfType[] = [ diff --git a/apps/wr/app/store/store.tsx b/apps/wr/app/store/store.tsx index 68ca9db7e..e2b8b807a 100644 --- a/apps/wr/app/store/store.tsx +++ b/apps/wr/app/store/store.tsx @@ -1,7 +1,7 @@ import { createStore } from 'zustand/vanilla'; -import { pubFacActionsExport, pubFacStateExport, type pubFacState } from './publicReuseFaciltyInsert/index'; -import { rainFacActionsExport, rainFacStateExport, type rainFacState, type rainFacType } from './rainReuseFacilityInsert'; -import { rswtFacActionsExport, rswtFacStateExport, type rswtFacState, type rswtFacType } from './rswtrReuseFaciltyInsert'; +import { pubFacActionsExport, pubFacStateExport, type pubFacState } from './ruseFcltMng/fcltReg/pbnstReg'; +import { rainFacActionsExport, rainFacStateExport, type rainFacState, type rainFacType } from './ruseFcltMng/fcltReg/rainReg'; +import { rswtFacActionsExport, rswtFacStateExport, type rswtFacState, type rswtFacType } from './ruseFcltMng/fcltReg/rswtReg'; import { matDmdActionsExport, matDmdStateExport, type matDmdState, type matDmdType } from './matDmd'; diff --git a/apps/wr/components/ui/IteratreForm.tsx b/apps/wr/components/ui/IteratreForm.tsx deleted file mode 100644 index 9d35d865e..000000000 --- a/apps/wr/components/ui/IteratreForm.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { FileUpload, FormControl, FormField, FormItem, FormLabel, FormMessage, SelectBox } from "@common/business_components"; -import { DatePicker } from "@common/components"; -import { Input } from "@common/components"; - - -export type typeOfForm ={ - labelName: string; - type: string; - placeholder:any; - formName: string; - selectValue:selectValue|undefined; -} -type onSelectValue = (val:string) => void; -export type selectValue ={ - label:string, - value:{ text: string; val: string }[], - fun:onSelectValue -} - - -export function IteraterFrom(formData:typeOfForm[],form:any , formClass:string ){ - - const formItem =(data:typeOfForm,field:any)=>{ - let tag - if(data.type==='select'){ - tag= (data.selectValue ? {...form} : null) - }else if(data.type==='date'){ - tag =() - }else{ - tag=() - } - return tag; - } - - return ( - <> - {formData.map((data: typeOfForm, index) => ( - ( - - {data.labelName} - - {formItem(data,field)} - - - - )} - /> - ))} - - ); - }; \ No newline at end of file diff --git a/apps/wr/components/ui/publicReuseInsertForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/component.tsx similarity index 99% rename from apps/wr/components/ui/publicReuseInsertForm.tsx rename to apps/wr/components/ui/form/fcltReg/pbnstReg/component.tsx index a521e8a59..3dcd1bc08 100644 --- a/apps/wr/components/ui/publicReuseInsertForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/component.tsx @@ -8,8 +8,8 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { useState } from "react"; import { useForm } from "react-hook-form"; import { z } from "zod"; -import { useWrStore } from "../../app/store/index"; -import { selectClass, type TableUpperProps } from "@/app/store/rainReuseFacilityInsert"; +import { useWrStore } from "@/app/store"; +import { selectClass, type TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; const formSchema = z.object({ username: z.string().min(2).max(50), @@ -30,7 +30,7 @@ const formSchema = z.object({ ) } -export function PublicReuseFaciltyFormInsert() { +export function PbnstRegForm() { const { pubFac } = useWrStore((state) => state); const { pubMngUpHeadList, pubMngFacData,erctUswtrCd,cyclCd,seCd,buseCd,rprcsCd,buseMet,rprcLoCd} = pubFac; const nodeList = headMakeColSpan(pubMngUpHeadList); diff --git a/apps/wr/components/ui/rainReuseInsertForm.tsx b/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx similarity index 78% rename from apps/wr/components/ui/rainReuseInsertForm.tsx rename to apps/wr/components/ui/form/fcltReg/rainReg/component.tsx index 57e30c551..23563ac00 100644 --- a/apps/wr/components/ui/rainReuseInsertForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx @@ -11,21 +11,50 @@ import { useForm } from "react-hook-form"; import { z } from "zod"; import { FormUi } from "@common/business_components"; import { useWrStore } from "@/app/store"; -import { selectClass } from "@/app/store/rainReuseFacilityInsert"; +import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; const formSchema = z.object({ - username: z.string().min(2).max(50), facilityName: z.string().min(2).max(50), + instlCmptnDt:z.string(), + instlCst:z.string(), + chmaraKndCd:z.string(), + chmaraSz:z.string(), + chmaraYn:z.string(), + chmaraCpct:z.string(), + chmaraProcs:z.string(), + instlCstSprtYn:z.string(), + instlCstSprtAmt:z.string(), + grntchCstSprtYn:z.string(), + grntchCstSprtCst:z.string(), + grntchBdstCertYn:z.string(), + grntchBdstCertYr:z.string(), + grntchBdstCertNo:z.string(), + grntchBdstCertGrd:z.string(), }); -export function RainReuseFaciltyInsertForm() { +export function RainRegForm() { const { rain } = useWrStore((state) => state); const form = useForm>({ resolver: zodResolver(formSchema), defaultValues: { - username: "", + facilityName :'', + instlCmptnDt:'', + instlCst:'', + chmaraKndCd:'', + chmaraYn:'', + chmaraSz:'', + chmaraCpct:'', + chmaraProcs:'', + instlCstSprtYn:'', + instlCstSprtAmt:'', + grntchCstSprtYn:'', + grntchCstSprtCst:'', + grntchBdstCertYn:'', + grntchBdstCertYr:'', + grntchBdstCertNo:'', + grntchBdstCertGrd:'', }, }); @@ -57,7 +86,7 @@ export function RainReuseFaciltyInsertForm() {
( @@ -69,7 +98,7 @@ export function RainReuseFaciltyInsertForm() {
( @@ -90,10 +119,10 @@ export function RainReuseFaciltyInsertForm() {
( - + )} /> @@ -101,7 +130,7 @@ export function RainReuseFaciltyInsertForm() {
( @@ -119,10 +148,10 @@ export function RainReuseFaciltyInsertForm() {
( - + )} /> @@ -130,7 +159,7 @@ export function RainReuseFaciltyInsertForm() {
( @@ -141,7 +170,7 @@ export function RainReuseFaciltyInsertForm() {
( @@ -163,10 +192,10 @@ export function RainReuseFaciltyInsertForm() {
( - + )} /> @@ -174,7 +203,7 @@ export function RainReuseFaciltyInsertForm() {
( @@ -191,10 +220,10 @@ export function RainReuseFaciltyInsertForm() {
( - + )} /> @@ -202,7 +231,7 @@ export function RainReuseFaciltyInsertForm() {
( @@ -213,7 +242,7 @@ export function RainReuseFaciltyInsertForm() {
( @@ -224,7 +253,7 @@ export function RainReuseFaciltyInsertForm() {
( diff --git a/apps/wr/components/ui/rswtrReuseInsetForm.tsx b/apps/wr/components/ui/form/fcltReg/rswtrReg/component.tsx similarity index 83% rename from apps/wr/components/ui/rswtrReuseInsetForm.tsx rename to apps/wr/components/ui/form/fcltReg/rswtrReg/component.tsx index e4a540f20..5733078d7 100644 --- a/apps/wr/components/ui/rswtrReuseInsetForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/rswtrReg/component.tsx @@ -2,12 +2,7 @@ import { Form, - FormControl, - FormDescription, FormField, - FormItem, - FormLabel, - FormMessage, FormUi, SelectBox, } from "@common/business_components/ui"; @@ -16,21 +11,50 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { useForm } from "react-hook-form"; import { z } from "zod"; import { useWrStore } from "@/app/store"; -import { selectClass } from "@/app/store/rainReuseFacilityInsert"; +import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; const formSchema = z.object({ - username: z.string().min(2).max(50), - facilityName: z.string().min(2).max(50), + facilityName: z.string().min(2).max(50), + instlCmptnDt:z.string(), + instlCst:z.string(), + wtrUsqty:z.string(), + oblgTrgtwtrUsqty:z.string(), + rswtrKndCd:z.string(), + rswrtProcs:z.string(), + utztmUsgCd:z.string(), + instlCstSprtYn:z.string(), + instlCstSprtAmt:z.string(), + grntchCstSprtYn:z.string(), + grntchCstSprtCst:z.string(), + grntchBdstCertYn:z.string(), + grntchBdstCertYr:z.string(), + grntchBdstCertNo:z.string(), + grntchBdstCertGrd:z.string(), }); -export function RswtrReuseFaciltyInsertForm() { +export function RswtrRegForm() { const { rswt } = useWrStore((state) => state); const form = useForm>({ resolver: zodResolver(formSchema), defaultValues: { - username: "", + facilityName:'' , + instlCmptnDt:'', + instlCst:'', + wtrUsqty:'', + oblgTrgtwtrUsqty:'', + rswtrKndCd:'', + rswrtProcs:'', + utztmUsgCd:'', + instlCstSprtYn:'', + instlCstSprtAmt:'', + grntchCstSprtYn:'', + grntchCstSprtCst:'', + grntchBdstCertYn:'', + grntchBdstCertYr:'', + grntchBdstCertNo:'', + grntchBdstCertGrd:'', }, }); @@ -62,7 +86,7 @@ export function RswtrReuseFaciltyInsertForm() {
( @@ -74,7 +98,7 @@ export function RswtrReuseFaciltyInsertForm() {
( @@ -87,7 +111,7 @@ export function RswtrReuseFaciltyInsertForm() {
( @@ -99,7 +123,7 @@ export function RswtrReuseFaciltyInsertForm() {
( @@ -118,7 +142,7 @@ export function RswtrReuseFaciltyInsertForm() {
( @@ -129,7 +153,7 @@ export function RswtrReuseFaciltyInsertForm() {
( @@ -141,7 +165,7 @@ export function RswtrReuseFaciltyInsertForm() {
( @@ -163,7 +187,7 @@ export function RswtrReuseFaciltyInsertForm() {
( @@ -174,7 +198,7 @@ export function RswtrReuseFaciltyInsertForm() {
( @@ -191,7 +215,7 @@ export function RswtrReuseFaciltyInsertForm() {
( @@ -202,7 +226,7 @@ export function RswtrReuseFaciltyInsertForm() {
( @@ -213,7 +237,7 @@ export function RswtrReuseFaciltyInsertForm() {
( @@ -224,7 +248,7 @@ export function RswtrReuseFaciltyInsertForm() {
( diff --git a/apps/wr/components/ui/matDmd/coRegForm/component.tsx b/apps/wr/components/ui/form/matDmd/coRegForm/component.tsx similarity index 94% rename from apps/wr/components/ui/matDmd/coRegForm/component.tsx rename to apps/wr/components/ui/form/matDmd/coRegForm/component.tsx index f27639251..57fd9239e 100644 --- a/apps/wr/components/ui/matDmd/coRegForm/component.tsx +++ b/apps/wr/components/ui/form/matDmd/coRegForm/component.tsx @@ -1,5 +1,5 @@ import { useWrStore } from "@/app/store"; -import { selectClass } from "@/app/store/rainReuseFacilityInsert"; +import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import { DatePicker, FormField, FormItem, FormLabel, FormUi, SelectBox } from "@common/business_components"; import { Button, Input } from "@common/components"; import { useState } from "react"; @@ -10,9 +10,9 @@ export function CoRegForm(form:any){ return( - <> - + ( diff --git a/apps/wr/components/ui/matDmd/dmdRegform/component.tsx b/apps/wr/components/ui/form/matDmd/dmdRegform/component.tsx similarity index 99% rename from apps/wr/components/ui/matDmd/dmdRegform/component.tsx rename to apps/wr/components/ui/form/matDmd/dmdRegform/component.tsx index 4e6bf0a38..c6a6c5d0a 100644 --- a/apps/wr/components/ui/matDmd/dmdRegform/component.tsx +++ b/apps/wr/components/ui/form/matDmd/dmdRegform/component.tsx @@ -1,5 +1,5 @@ import { useWrStore } from "@/app/store"; -import { selectClass } from "@/app/store/rainReuseFacilityInsert"; +import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import { DatePicker, FormField, FormItem, FormLabel, FormUi, SelectBox } from "@common/business_components"; import { Button, Input } from "@common/components"; import { useState } from "react"; diff --git a/apps/wr/components/toastFromUi.tsx b/apps/wr/components/ui/toast/toastFromUi.tsx similarity index 97% rename from apps/wr/components/toastFromUi.tsx rename to apps/wr/components/ui/toast/toastFromUi.tsx index 5270ca5ec..465870c8b 100644 --- a/apps/wr/components/toastFromUi.tsx +++ b/apps/wr/components/ui/toast/toastFromUi.tsx @@ -1,7 +1,6 @@ import { Button } from "@common/components/ui"; import Link from "next/link"; -import { useRouter } from "next/router"; import toast from "react-hot-toast";