등록 작업중
This commit is contained in:
@@ -25,16 +25,6 @@ import { TusClientUpload } from "@/components/lib/useTus_wr/useTusWr";
|
||||
import type { Upload } from "tus-js-client";
|
||||
import { pbnstRegZod, type customPbnst, type fcltOperInfoType, type operType, type ruseFcltType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
|
||||
const formSchema = z.object({
|
||||
fcltNm: z.string().min(2).max(50),
|
||||
psysScdg: z.string(),
|
||||
designScdg: z.string(),
|
||||
fcltCpct: z.number(),
|
||||
swtrmtCpct: z.number(),
|
||||
ruseCpct: z.number(),
|
||||
splyExtraCpct: z.number(),
|
||||
});
|
||||
|
||||
export function PbnstMngForm({ data }: { data: customPbnst }) {
|
||||
const { pbnst, pbnstUpdate } = useWrStore((state) => state);
|
||||
const { pbnstMngUpHeadList} = pbnst;
|
||||
@@ -54,7 +44,7 @@ export function PbnstMngForm({ data }: { data: customPbnst }) {
|
||||
|
||||
const form = useForm<z.infer<typeof pbnstRegZod>>({
|
||||
resolver: zodResolver(pbnstRegZod),
|
||||
defaultValues: {...data},
|
||||
defaultValues: pbnstRegZod.parse({}),
|
||||
});
|
||||
|
||||
const { fields: fcOpersField } = useFieldArray({
|
||||
@@ -71,7 +61,10 @@ export function PbnstMngForm({ data }: { data: customPbnst }) {
|
||||
|
||||
// 2. Define a submit handler.
|
||||
function onSubmit(values: z.infer<typeof pbnstRegZod>) {
|
||||
console.log(values);
|
||||
|
||||
|
||||
console.log("onSubmit values", values);
|
||||
console.log( ' 212 ', values);
|
||||
|
||||
pbnstUpdate(values);
|
||||
}
|
||||
@@ -93,6 +86,9 @@ export function PbnstMngForm({ data }: { data: customPbnst }) {
|
||||
},
|
||||
});
|
||||
};
|
||||
useEffect(() => {
|
||||
console.log("form errors:", form.formState.errors);
|
||||
}, [form.formState.errors]);
|
||||
|
||||
useEffect(() => {
|
||||
if (relationfiles && relationfiles[0])
|
||||
@@ -120,7 +116,7 @@ export function PbnstMngForm({ data }: { data: customPbnst }) {
|
||||
<span className="mt-4 ml-2">{form.getValues("ruseUtztnFcltNm") ? ": " + form.getValues("ruseUtztnFcltNm") : ""}</span>
|
||||
</div>
|
||||
|
||||
<Button size={commonButonSize}>저장</Button>
|
||||
<Button type="submit" size={commonButonSize}>저장</Button>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user