app, store, component 폴더 구조 및 명 변경

This commit is contained in:
leedj312
2025-03-17 11:26:07 +09:00
parent 00ba7de206
commit b7164a0542
18 changed files with 125 additions and 127 deletions
+2 -2
View File
@@ -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(),
+1 -1
View File
@@ -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";
+3 -3
View File
@@ -8,13 +8,13 @@ export default function Home() {
<>
<div className='flex'>
<Button className='place-self-auto'>
<Link href="reuseFaciltyManage/reuseFacilityInsert/publicReuseFaciltyInsert"> 하수재이용 시설 등록</Link>
<Link href="ruseFcltMng/fcltReg/pbnstReg"> 하수재이용 시설 등록</Link>
</Button>
<Button className='place-self-auto'>
<Link href="reuseFaciltyManage/reuseFacilityInsert/rainReuseFaciltyInsert"> 빗물재이용 시설 등록</Link>
<Link href="ruseFcltMng/fcltReg/rainReg"> 빗물재이용 시설 등록</Link>
</Button>
<Button className='place-self-auto'>
<Link href="reuseFaciltyManage/reuseFacilityInsert/rswtReuseFacilityInsert"> 중수도시설 등록</Link>
<Link href="ruseFcltMng/fcltReg/rswtReg"> 중수도시설 등록</Link>
</Button>
<Button className='place-self-auto'>
@@ -2,8 +2,8 @@
import { ScrollArea, SearchDiv, SelectBox, UiTable } from '@common/business_components';
import { Button } from '@common/components';
import { PublicReuseFaciltyFormInsert } from '../../../../components/ui/publicReuseInsertForm';
import { useWrStore } from '../../../store';
import { PbnstRegForm } from '@/components/ui/form/fcltReg/pbnstReg/component';
@@ -42,7 +42,7 @@ import { useWrStore } from '../../../store';
</div>
<div className="col-span-1 pr-6 max-h-full overflow-y-scroll">
<ScrollArea>
<PublicReuseFaciltyFormInsert />
<PbnstRegForm />
{/* <ScrollBar orientation="vertical"></ScrollBar> */}
</ScrollArea>
</div>
@@ -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() {
</div>
<div className="colsapn-1 pr-11 max-h-full ovreflow-y-scroll">
<ScrollArea>
<RainReuseFaciltyInsertForm></RainReuseFaciltyInsertForm>
<RainRegForm></RainRegForm>
</ScrollArea>
</div>
@@ -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() {
</div>
<div className="colsapn-1 pr-11 max-h-full ovreflow-y-scroll">
<ScrollArea>
<RswtrReuseFaciltyInsertForm></RswtrReuseFaciltyInsertForm>
<RswtrRegForm></RswtrRegForm>
</ScrollArea>
</div>
+1 -1
View File
@@ -1,4 +1,4 @@
import type { selectArray } from "../rainReuseFacilityInsert";
import type { selectArray } from "../ruseFcltMng/fcltReg/rainReg";
@@ -1,4 +1,4 @@
import type { TableUpperProps } from "../rainReuseFacilityInsert";
import type { TableUpperProps } from "../rainReg";
export type TableProps = {
id: string;
@@ -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[] = [
+3 -3
View File
@@ -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';
-54
View File
@@ -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 ? <SelectBox className='' label={data.selectValue.label} selectArray={data.selectValue.value} onSelectValue={data.selectValue.fun} >{...form}</SelectBox> : null)
}else if(data.type==='date'){
tag =(<DatePicker mode="single" {...field} />)
}else{
tag=(<Input className ='w-64'placeholder= {data.placeholder} type="" {...field} />)
}
return tag;
}
return (
<>
{formData.map((data: typeOfForm, index) => (
<FormField key={`${index}+key`}
control={form.control}
name={data.formName}
render={({ field }) => (
<FormItem className={formClass} >
<FormLabel>{data.labelName}</FormLabel>
<FormControl>
{formItem(data,field)}
</FormControl>
<FormMessage />
</FormItem>
)}
/>
))}
</>
);
};
@@ -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({
</TableRow>
</>)
}
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);
@@ -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<z.infer<typeof formSchema>>({
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() {
<div className="col-span-2">
<FormField
control={form.control}
name="name_0211213336"
name="instlCmptnDt"
render={({ field }) => (
<FormUi label="설치완료일">
<Input className="" placeholder="1,000,000" type="" {...field} />
@@ -69,7 +98,7 @@ export function RainReuseFaciltyInsertForm() {
<div className="col-span-2" >
<FormField
control={form.control}
name="name_9765724553"
name="instlCst"
render={({ field }) => (
<FormUi label="설치비">
<Input className="" placeholder="1,000,000" type="" {...field} />
@@ -90,10 +119,10 @@ export function RainReuseFaciltyInsertForm() {
<div className="col-span-5 pl-6" >
<FormField
control={form.control}
name="name_9765724553"
name="chmaraKndCd"
render={({ field }) => (
<FormUi label="종류">
<SelectBox selectClass={selectClass} label={""} selectArray={rain.selectYN} onSelectValue={onSelectValue} {...field}/>
<SelectBox className={""} selectClass={selectClass} label={""} selectArray={rain.selectYN} onSelectValue={onSelectValue} {...field}/>
</FormUi>
)}
/>
@@ -101,7 +130,7 @@ export function RainReuseFaciltyInsertForm() {
<div className="col-span-5" >
<FormField
control={form.control}
name="name_9765724553"
name="chmaraSz"
render={({ field }) => (
<FormUi label="면적(m³)">
@@ -119,10 +148,10 @@ export function RainReuseFaciltyInsertForm() {
<div className="col-span-4 pl-6" >
<FormField
control={form.control}
name="name_9765724553"
name="chmaraYn"
render={({ field }) => (
<FormUi label="유무">
<SelectBox selectClass={selectClass} label={""} selectArray={rain.selectYN} onSelectValue={onSelectValue} {...field}/>
<SelectBox className={""} selectClass={selectClass} label={""} selectArray={rain.selectYN} onSelectValue={onSelectValue} {...field}/>
</FormUi>
)}
/>
@@ -130,7 +159,7 @@ export function RainReuseFaciltyInsertForm() {
<div className="col-span-4" >
<FormField
control={form.control}
name="name_9765724553"
name="chmaraCpct"
render={({ field }) => (
<FormUi label="용량(m³/일)">
<Input className="" placeholder="1,000,000" type="" {...field} />
@@ -141,7 +170,7 @@ export function RainReuseFaciltyInsertForm() {
<div className="col-span-4" >
<FormField
control={form.control}
name="name_9765724553"
name="chmaraProcs"
render={({ field }) => (
<FormUi label="처리공정">
<Input className="" placeholder="1,000,000" type="" {...field} />
@@ -163,10 +192,10 @@ export function RainReuseFaciltyInsertForm() {
<div className="col-span-5" >
<FormField
control={form.control}
name="name_9765724553"
name="instlCstSprtYn"
render={({ field }) => (
<FormUi label="설치비 지원 여부">
<SelectBox selectClass={selectClass} label={""} selectArray={rain.selectYN} onSelectValue={onSelectValue} {...field}/>
<SelectBox className={""} selectClass={selectClass} label={""} selectArray={rain.selectYN} onSelectValue={onSelectValue} {...field}/>
</FormUi>
)}
/>
@@ -174,7 +203,7 @@ export function RainReuseFaciltyInsertForm() {
<div className="col-span-5" >
<FormField
control={form.control}
name="name_9765724553"
name="instlCstSprtAmt"
render={({ field }) => (
<FormUi label="지원금액(원)">
<Input className="" placeholder="1,000,000" type="" {...field} />
@@ -191,10 +220,10 @@ export function RainReuseFaciltyInsertForm() {
<div className="col-span-3 pl-6" >
<FormField
control={form.control}
name="name_9765724553"
name="grntchCstSprtYn"
render={({ field }) => (
<FormUi label="인증여부">
<SelectBox selectClass={selectClass} label={""} selectArray={rain.selectYN} onSelectValue={onSelectValue} {...field}/>
<SelectBox className={""} selectClass={selectClass} label={""} selectArray={rain.selectYN} onSelectValue={onSelectValue} {...field}/>
</FormUi>
)}
/>
@@ -202,7 +231,7 @@ export function RainReuseFaciltyInsertForm() {
<div className="col-span-3" >
<FormField
control={form.control}
name="name_9765724553"
name="grntchBdstCertYr"
render={({ field }) => (
<FormUi label="인증년도">
<Input className="" placeholder="2024" type="" {...field} />
@@ -213,7 +242,7 @@ export function RainReuseFaciltyInsertForm() {
<div className="col-span-3 pl-6" >
<FormField
control={form.control}
name="name_9765724553"
name="grntchBdstCertNo"
render={({ field }) => (
<FormUi label="인증번호">
<Input className="" placeholder="ab1234678" type="" {...field} />
@@ -224,7 +253,7 @@ export function RainReuseFaciltyInsertForm() {
<div className="col-span-3" >
<FormField
control={form.control}
name="name_9765724553"
name="grntchBdstCertGrd"
render={({ field }) => (
<FormUi label="인증등급">
<Input className="" placeholder="A" type="" {...field} />
@@ -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<z.infer<typeof formSchema>>({
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() {
<div className="col-span-2">
<FormField
control={form.control}
name="name_0211213336"
name="instlCmptnDt"
render={({ field }) => (
<FormUi label="설치완료일">
<Input className="" placeholder="1,000,000" type="" {...field} />
@@ -74,7 +98,7 @@ export function RswtrReuseFaciltyInsertForm() {
<div className="col-span-2" >
<FormField
control={form.control}
name="name_9765724553"
name="instlCst"
render={({ field }) => (
<FormUi label="설치비">
<Input className="" placeholder="1,000,000" type="" {...field} />
@@ -87,7 +111,7 @@ export function RswtrReuseFaciltyInsertForm() {
<div className="col-span-2">
<FormField
control={form.control}
name="name_0211213336"
name="wtrUsqty"
render={({ field }) => (
<FormUi label="물사용량(m³)">
<Input className="" placeholder="1,000,000" type="" {...field} />
@@ -99,7 +123,7 @@ export function RswtrReuseFaciltyInsertForm() {
<div className="col-span-2" >
<FormField
control={form.control}
name="name_9765724553"
name="oblgTrgtwtrUsqty"
render={({ field }) => (
<FormUi label="의무대상 물사용량(m³)">
<Input className="" placeholder="1,000,000" type="" {...field} />
@@ -118,7 +142,7 @@ export function RswtrReuseFaciltyInsertForm() {
<div className="col-span-5 pl-6" >
<FormField
control={form.control}
name="name_9765724553"
name="rswtrKndCd"
render={({ field }) => (
<FormUi label="필수 종류">
<SelectBox selectClass={selectClass} selectArray={rswt.selectYN} onSelectValue={onSelectValue} {...field}/>
@@ -129,7 +153,7 @@ export function RswtrReuseFaciltyInsertForm() {
<div className="col-span-5" >
<FormField
control={form.control}
name="name_9765724553"
name="rswrtProcs"
render={({ field }) => (
<FormUi label="주요처리공정">
@@ -141,7 +165,7 @@ export function RswtrReuseFaciltyInsertForm() {
<div className="col-span-5 pl-6" >
<FormField
control={form.control}
name="name_9765724553"
name="utztmUsgCd"
render={({ field }) => (
<FormUi label="이용용도">
<SelectBox selectClass={selectClass}label={""} selectArray={rswt.selectYN} onSelectValue={onSelectValue} {...field}/>
@@ -163,7 +187,7 @@ export function RswtrReuseFaciltyInsertForm() {
<div className="col-span-1 pl-6" >
<FormField
control={form.control}
name="name_9765724553"
name="instlCstSprtYn"
render={({ field }) => (
<FormUi label="설치비 지원여부">
<SelectBox selectClass={selectClass} label={""} selectArray={rswt.selectYN} onSelectValue={onSelectValue} {...field}/>
@@ -174,7 +198,7 @@ export function RswtrReuseFaciltyInsertForm() {
<div className="col-span-1" >
<FormField
control={form.control}
name="name_9765724553"
name="instlCstSprtAmt"
render={({ field }) => (
<FormUi label="지원금액(원)">
<Input className="" placeholder="1,000,000" type="" {...field} />
@@ -191,7 +215,7 @@ export function RswtrReuseFaciltyInsertForm() {
<div className="col-span-3 pl-6" >
<FormField
control={form.control}
name="name_9765724553"
name="grntchCstSprtYn"
render={({ field }) => (
<FormUi label="인증여부">
<SelectBox selectClass={selectClass} label={""} selectArray={rswt.selectYN} onSelectValue={onSelectValue} {...field}/>
@@ -202,7 +226,7 @@ export function RswtrReuseFaciltyInsertForm() {
<div className="col-span-3" >
<FormField
control={form.control}
name="name_9765724553"
name="grntchBdstCertYr"
render={({ field }) => (
<FormUi label="인증년도">
<Input className="" placeholder="2024" type="" {...field} />
@@ -213,7 +237,7 @@ export function RswtrReuseFaciltyInsertForm() {
<div className="col-span-3 pl-6" >
<FormField
control={form.control}
name="name_9765724553"
name="grntchBdstCertNo"
render={({ field }) => (
<FormUi label="인증번호">
<Input className="" placeholder="ab1234678" type="" {...field} />
@@ -224,7 +248,7 @@ export function RswtrReuseFaciltyInsertForm() {
<div className="col-span-3" >
<FormField
control={form.control}
name="name_9765724553"
name="grntchBdstCertGrd"
render={({ field }) => (
<FormUi label="인증등급">
<Input className="" placeholder="A" type="" {...field} />
@@ -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(
<>
<FormField
control={form.control}
<>
<FormField
control={form.control}
name="ctpv"
render={({ field }) => (
<FormUi label="시도">
@@ -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";
@@ -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";