diff --git a/apps/wr/app/matMng/matDmd/page.tsx b/apps/wr/app/matMng/matDmd/page.tsx index b688fc2f2..6487b3e6f 100644 --- a/apps/wr/app/matMng/matDmd/page.tsx +++ b/apps/wr/app/matMng/matDmd/page.tsx @@ -1,8 +1,6 @@ "use client" -import { - toast -} from "sonner" + import { useForm } from "react-hook-form" @@ -10,15 +8,14 @@ import { zodResolver } from "@hookform/resolvers/zod" import * as z from "zod" -import { - format -} from "date-fns" import { Calendar as CalendarIcon } from "lucide-react" -import { Form, FormField, FormUi, SelectBox } from "@common/business_components/ui" +import { Form, FormField, FormUi, ScrollArea, SelectBox } from "@common/business_components/ui" import { Button, Input } from "@common/components/ui" +import { BaseForm } from "@/components/ui/matDmd/baseForm/component" +import { WqForm } from "@/components/ui/matDmd/wqForm/component" const formSchema = z.object({ ctpv: z.string(), @@ -58,25 +55,42 @@ export default function MyForm() { function onSubmit(values: z.infer < typeof formSchema > ) { try { console.log(values); + /* toast(
           {JSON.stringify(values, null, 2)}
         
- ); + );*/ } catch (error) { console.error("Form submission error", error); - toast.error("Failed to submit the form. Please try again."); + // toast.error("Failed to submit the form. Please try again."); } } return ( + <> +
+

수요처 정보 등록

+
+ +
+
+

정보입력

+
+ + + {form} - + + {form} +
+
+ ) } \ No newline at end of file diff --git a/apps/wr/app/page.tsx b/apps/wr/app/page.tsx index 0e6fd2c8a..8ba60d197 100644 --- a/apps/wr/app/page.tsx +++ b/apps/wr/app/page.tsx @@ -16,6 +16,10 @@ export default function Home() { + + ); diff --git a/apps/wr/components/ui/matDmd/baseForm/component.tsx b/apps/wr/components/ui/matDmd/baseForm/component.tsx index 6c1de2afa..5a94fec62 100644 --- a/apps/wr/components/ui/matDmd/baseForm/component.tsx +++ b/apps/wr/components/ui/matDmd/baseForm/component.tsx @@ -1,8 +1,10 @@ -import { FormField, FormUi, SelectBox } from "@common/business_components"; -import { Input } from "@common/components"; +import { useWrStore } from "@/app/store"; +import { FormField, FormItem, FormLabel, FormUi, SelectBox } from "@common/business_components"; +import { DatePicker, Input } from "@common/components"; -export function baseFrom(form:any){ +export function BaseForm(form:any){ + const { dmd } = useWrStore((state) => state); return( @@ -12,7 +14,7 @@ export function baseFrom(form:any){ name="ctpv" render={({ field }) => ( - + )} @@ -23,7 +25,7 @@ export function baseFrom(form:any){ name="sgg" render={({ field }) => ( - + )} @@ -102,34 +104,7 @@ export function baseFrom(form:any){ render={({ field }) => ( 요구시기 - - - - - - - - - - + )} /> @@ -154,7 +129,7 @@ export function baseFrom(form:any){ name="useUsgCd" render={({ field }) => ( - + )} diff --git a/apps/wr/components/ui/matDmd/wqForm/component.tsx b/apps/wr/components/ui/matDmd/wqForm/component.tsx index b2e689759..e246071b9 100644 --- a/apps/wr/components/ui/matDmd/wqForm/component.tsx +++ b/apps/wr/components/ui/matDmd/wqForm/component.tsx @@ -1,7 +1,7 @@ import { FormField, FormUi } from "@common/business_components"; import { Input } from "@common/components"; -export function WqFrom(form: any) { +export function WqForm(form: any) { return ( <>
diff --git a/packages/common/business_components/src/ui/select/index.tsx b/packages/common/business_components/src/ui/select/index.tsx index d039c2c2a..a3b397606 100644 --- a/packages/common/business_components/src/ui/select/index.tsx +++ b/packages/common/business_components/src/ui/select/index.tsx @@ -11,15 +11,15 @@ interface SelectBox1 { const SelectBox = React.forwardRef< HTMLDivElement, - React.HTMLAttributes & {label:string, className:string, selectArray:SelectBox1[], onSelectValue:(val:string)=>void} ->(({ label, className, selectArray, onSelectValue }, ref)=>{ + React.HTMLAttributes & {label:string, selectClass:string|undefined, className:string, selectArray:SelectBox1[], onSelectValue:(val:string)=>void} +>(({ label, className, selectClass, selectArray, onSelectValue }, ref)=>{ const placeHolder = selectArray?.[0]?.text ?? ""; return (
{label && }