From af92a70f136b5f250f5c83155dd379672f7c341f Mon Sep 17 00:00:00 2001 From: leedj312 Date: Mon, 14 Jul 2025 13:55:10 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=8C=EB=93=9C=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/form/coMat/conCostForm/conCostForm.tsx | 41 +- .../ui/form/fcltReg/bdstReg/bdstAdd.tsx | 2 +- .../ui/form/fcltReg/bdstReg/bdstReg.tsx | 41 +- .../ui/form/fcltReg/htdflReg/htdflRegForm.tsx | 2 +- .../fcltReg/pbnstReg/buseReg/bugRegForm.tsx | 384 +++++++++--------- .../fcltReg/pbnstReg/mngReg/mngRegForm.tsx | 13 +- .../ui/form/fcltReg/rainReg/rainRegForm.tsx | 15 +- .../ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx | 2 +- .../ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx | 33 +- .../pbnPrfExcelModal/pbnPrfExcelModal.tsx | 64 +-- .../ui/modal/coMat/constCostFeeTable.tsx | 12 +- .../ui/modal/coMat/drgtDetailModal.tsx | 22 +- .../ui/modal/coMat/rateFeeModal.tsx | 15 +- .../coReg/coRegExcel/coRegExcelModal.tsx | 132 +++--- .../fcltReg/bdstChgModal/bdstChgModal.tsx | 5 +- .../fcltReg/bdstRegModal/bdstRegModal.tsx | 26 +- .../fcOrgwtsRegModal/fcOrgwtsRegModal.tsx | 4 +- .../fcltReg/pbnstRegModal/pbnstRegModal.tsx | 84 +--- 18 files changed, 383 insertions(+), 514 deletions(-) diff --git a/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx b/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx index ee06893c9..a77e6f51f 100644 --- a/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx +++ b/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx @@ -18,7 +18,6 @@ import { Form, FormField, FormUi, - UiModal, UiTable, } from "@common/business_components/ui"; import PopoverUi from "@common/business_components/ui/popover_ui"; @@ -65,30 +64,6 @@ export default function ConCostForm({ }, [selectionVersion]); - const confrirmToast = () => { - - if (checkFinish) { - toast((t) => ( - - 검토완료 변경시 공사비는 변경할수 없습니다. -
- 진행하시겠습니까? - - -
- )); - } else { - - } - }; const zipDowonLoad = () => { fetch(`/2024_constarctFeeProgram.zip`, {}).then(async (response) => { @@ -105,7 +80,6 @@ export default function ConCostForm({ const dmndQtyWatch = form.watch("dmndQty"); const totalConstCost = form.watch("totalConstCost"); const cstrnCst = form.watch("demandCst.cstrnCst"); - const useUsgCdWatch = form.watch("useUsgCd"); const calculateConstCost = useCallback(() => { const usgPrcsProcs = usgPrcsProcsWatch; @@ -372,6 +346,7 @@ export default function ConCostForm({ type="number" step="0.001" onChange={(e) => { + console.log('dmndQty ', e) //field.onChange(Number(e.target.value) * 365 ); }} value={Number(field.value) * 365 || 0} @@ -398,9 +373,7 @@ export default function ConCostForm({ } childrenBody={ <> - {}} - > + } bodyClassName={"w-[40vw] h-full"} @@ -437,9 +410,8 @@ export default function ConCostForm({ } childrenBody={ <> - {}} - > + + } bodyClassName={"w-[22vw]"} @@ -499,7 +471,10 @@ export default function ConCostForm({ className="mt-2" type="number" step="0.01" - onChange={(e) => {}} + onChange={(e) => { + console.log('totalConstCost ', e) + + }} value={field.value ?? 0} readOnly /> diff --git a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstAdd.tsx b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstAdd.tsx index f7b24e628..bafa7566d 100644 --- a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstAdd.tsx +++ b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstAdd.tsx @@ -6,7 +6,7 @@ import { formH1Class } from "@/components/lib/class/comClass"; import { safeDate } from "@/components/lib/func/commom"; import { DatePicker, FormField, FormUi, SelectBox } from "@common/business_components"; import { Button, Checkbox, Input } from "@common/components"; -import { useEffect, useState } from "react"; +import { useState } from "react"; import { useFieldArray } from "react-hook-form"; export default function BdstAdd({ form, readonly }: { form: any; readonly?: boolean; }) { diff --git a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx index c14bd7d48..726f4e689 100644 --- a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx +++ b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx @@ -1,13 +1,6 @@ import { useWrStore } from "@/app/store"; import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import { formH1Class } from "@/components/lib/class/comClass"; -import { - formatCommaNumber, - getCity, - handleCommaNumberChange, - safeDate, -} from "@/components/lib/func/commom"; -import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal"; import { FormField, FormUi, @@ -15,9 +8,8 @@ import { SelectBox, type SelectDataType, } from "@common/business_components"; -import { Button, Checkbox, Input } from "@common/components"; +import { Input } from "@common/components"; import { useEffect, useState } from "react"; -import { useFieldArray } from "react-hook-form"; export default function BdstReg({ form, type }: { form: any; type?: string }) { const { code } = useWrStore((state) => { @@ -28,11 +20,11 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) { const [useCityCd, setUserCityCd] = useState([]) const [useSggCd, setUserSggCd] = useState([]) - const [selectSgg, setSelectSgg] = useState(); - const [objSearch, setObjSearch] = useState({ - sgg: "", - city: "", - }); + // const [selectSgg, setSelectSgg] = useState(); + // const [objSearch, setObjSearch] = useState({ + // sgg: "", + // city: "", + // }); useEffect(() =>{ if(userSiSggCd.length===2 && code.cityCd.length>0){ @@ -58,24 +50,13 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) { } },[form, userSiSggCd, code.cityCd, code.sggCd]) - const getSelCity = (val: string) => { - const data = getCity(val, code.sggCd); - setSelectSgg(data); - const sgg = form.getValues("sggCd"); - setObjSearch({ city: val, sgg: "" }); - }; - const getSgg = (val: string | number) => { - const sgg = form.getValues("sggCd"); - setObjSearch({ ...objSearch, sgg: val != "" ? String(val) : sgg }); - }; - - useEffect(() => { - const city = form.getValues("ctpvCd"); - const sgg = form.getValues("sggCd"); - setObjSearch({ city: city, sgg: sgg }); - }, [selectSgg]); + // useEffect(() => { + // const city = form.getValues("ctpvCd"); + // const sgg = form.getValues("sggCd"); + // setObjSearch({ city: city, sgg: sgg }); + // }, [selectSgg]); useEffect(() => { const subscription = form.form?.watch((value: any) => { diff --git a/apps/wr/components/ui/form/fcltReg/htdflReg/htdflRegForm.tsx b/apps/wr/components/ui/form/fcltReg/htdflReg/htdflRegForm.tsx index 85bb67044..c37ee2c48 100644 --- a/apps/wr/components/ui/form/fcltReg/htdflReg/htdflRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/htdflReg/htdflRegForm.tsx @@ -199,7 +199,7 @@ export default function HtdflRegForm({ selectArray={code.htdPowerMthdCd} onSelectValue={readonly ? () => { } : field.onChange} // value={field.value ?? ""} - value={field.value || code.htdPowerMthdCd[0].val} + value={field.value || (code?.htdPowerMthdCd[0] &&code?.htdPowerMthdCd[0].val)} readOnly={readonly || !isPowerPlant} /> 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 3fdccec53..4a00f525d 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx @@ -22,13 +22,12 @@ import { formTableName, } from "@/components/lib/class/comClass"; import FcOrgwtsRegModal from "@/components/ui/modal/fcltReg/fcOrgwtsRegModal/fcOrgwtsRegModal"; -import RuseMngTable from "@/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable"; import { SelectBox } from "@common/business_components"; import { DatePicker, FormUi, UiModal } from "@common/business_components/ui"; import { Form, FormField } from "@common/business_components/ui/form"; -import { Button, DataTable, Input, Label } from "@common/components"; +import { Button, Input, Label } from "@common/components"; import { useEffect, useRef, useState } from "react"; -import { useFieldArray, useForm, type UseFormReturn } from "react-hook-form"; +import { useFieldArray, type UseFormReturn } from "react-hook-form"; import MngRegFormDetail from "../mngReg/mngRegFormDetail/mngRegFormDetail"; import { formatCommaNumber, @@ -54,7 +53,6 @@ export function PbnstBuseForm({ indexBiz: number; setIndexBiz: (index: number) => void; }) { - const ref = useRef(null); const { code, pbnst, @@ -68,10 +66,10 @@ export function PbnstBuseForm({ control: form.control, name: `items.${indexMng}.fcBizs`, }); - const [ppiSelectList, setPpiSelectList] = - useState<[{ name: string; val: SelectDataType[] }]>(); + const [ppiSelectList, setPpiSelectList] = useState< + { name: string; val: SelectDataType[] }[] | undefined + >(); const [ppiYn, setPpiYn] = useState("Y"); - const [selectBizCycle, setSelectBizCycle] = useState< { text: string; @@ -125,7 +123,6 @@ export function PbnstBuseForm({ useEffect(() => { if (fcOrgwtsNmList && fcOrgwtsNmList.length > 0) { - fcOrgwts?.forEach((item, index) => { const orgwtNm = fcOrgwtsNmList.find( (orgwt) => orgwt.bscFctCd === item.swtrmtFcltFk @@ -175,11 +172,7 @@ export function PbnstBuseForm({ appendBiz(newItem); setIndexBiz(pbnstBizCycle); // 새로 추가된 차수로 포커스 이동 } - const { - fields: fcDemands, - append: appendDemand, - remove: removeDemand, - } = useFieldArray({ + const { fields: fcDemands, append: appendDemand } = useFieldArray({ control: form.control, name: `items.${indexMng}.fcBizs.${indexBiz}.fcDemands`, }); @@ -201,16 +194,7 @@ export function PbnstBuseForm({ prevDemandsLengthRef.current = fcDemands.length; }, [fcDemands.length]); - - const { fields: fcOrgwtFiled } = useFieldArray({ - control: form.control, - name: `items.${indexMng}.fcBizs.${indexBiz}.fcOrgwts`, - }); - const { - fields: pplInstls, - append: appendPpl, - remove: removePpl, - } = useFieldArray({ + const { append: appendPpl, remove: removePpl } = useFieldArray({ control: form.control, name: `items.${indexMng}.fcBizs.${indexBiz}.pplInstls`, }); @@ -286,7 +270,7 @@ export function PbnstBuseForm({ if (code.pplLenght) { ppl.push({ name: "pplQulity", val: code.pplQulity }); } - if (ppl.length > 0) { + if (ppl && ppl.length > 0) { setPpiSelectList(ppl); } else { setPpiSelectList(undefined); @@ -297,7 +281,7 @@ export function PbnstBuseForm({ console.log("form errors:", form.formState.errors); }, [form.formState.errors]); - useEffect(() => { + useEffect(() => { const pplSum = form.watch(`items.${indexMng}.fcBizs.${indexBiz}.pplInstls`); if (!pplSum) return; let sum = 0; @@ -307,10 +291,9 @@ export function PbnstBuseForm({ setSumCpct(sum); }, [form.formState, indexMng, indexBiz]); -useEffect(() =>{ - - console.log('form.formState ', form.formState) -}, [form.formState]); + useEffect(() => { + console.log("form.formState ", form.formState); + }, [form.formState]); const pbnstBiz = form.watch(`items.${indexMng}.fcBizs`); @@ -418,10 +401,11 @@ useEffect(() =>{ { @@ -479,7 +463,7 @@ useEffect(() =>{ form.getValues( `items.${indexMng}.fcBizs.${indexBiz}.pplInstls` ) ?? [] - // pplInstlsWatch||[] + // pplInstlsWatch||[] } headList={pbnst.pplInstlsHeadLisat} code={ppiSelectList ?? []} @@ -532,173 +516,173 @@ useEffect(() =>{
{fcDemands.map((field, index) => ( -
-
- ( - - { - f.onChange(val); - if (val && val.length > 2) { - getDemandCompList(val, 3); + > +
+ ( + + { + f.onChange(val); + if (val && val.length > 2) { + getDemandCompList(val, 3); + } + }} + setRtnData={(valList: any) => { + if (valList) { + form.setValue( + `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.daddr`, + valList.daddr + ); + form.setValue( + `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.useUsgCd`, + valList.useUsgCd + ); + form.setValue( + `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.splyCpct`, + valList.splyCpct + ); + form.setValue( + `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.dmdInfoPk`, + valList.dmdInfoPk?.toString() + ); + } + }} + searchList={demandCompList?.map((item) => { + return { + ...item, + searchNm: item.dmdCoNm, + searchPk: item.dmdInfoPk, + }; + })} + > + + )} + /> +
+
+ ( + + f.onChange(e.target.value)} + value={f.value} + className={selectClass} + /> + + )} + /> +
+
+ ( + + + + )} + /> +
+
+ ( + + + f.onChange(date), + }} + selectClass={"rounded-lg !w-full"} + /> + + )} + /> +
+
+ ( + + + f.onChange(date) } - }} - setRtnData={(valList: any) => { - if (valList) { - form.setValue( - `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.daddr`, - valList.daddr - ); - form.setValue( - `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.useUsgCd`, - valList.useUsgCd - ); - form.setValue( - `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.splyCpct`, - valList.splyCpct - ); - form.setValue( - `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.dmdInfoPk`, - valList.dmdInfoPk?.toString() - ); + field={{ + value: safeDate(f.value) || new Date(), + onChange: (date: Date | undefined) => + f.onChange(date), + }} + selectClass={"rounded-lg !w-full"} + /> + + )} + /> +
+
+ ( + + { + handleCommaNumberChange(e, f.onChange); + }} + value={formatCommaNumber(f.value)} + /> + + )} + /> +
+
+ ( + + + f.onChange(val) } - }} - searchList={demandCompList?.map((item) => { - return { - ...item, - searchNm: item.dmdCoNm, - searchPk: item.dmdInfoPk, - }; - })} - > - - )} - /> + value={f.value ?? code.yn[0]?.val} + /> + + )} + /> +
-
- ( - - f.onChange(e.target.value)} - value={f.value} - className={selectClass} - /> - - )} - /> -
-
- ( - - - - )} - /> -
-
- ( - - - f.onChange(date), - }} - selectClass={"rounded-lg !w-full"} - /> - - )} - /> -
-
- ( - - - f.onChange(date) - } - field={{ - value: safeDate(f.value) || new Date(), - onChange: (date: Date | undefined) => - f.onChange(date), - }} - selectClass={"rounded-lg !w-full"} - /> - - )} - /> -
-
- ( - - { - handleCommaNumberChange(e, f.onChange); - }} - value={formatCommaNumber(f.value)} - /> - - )} - /> -
-
- ( - - - f.onChange(val) - } - value={f.value ?? code.yn[0]?.val} - /> - - )} - /> -
-
))}
@@ -712,9 +696,11 @@ useEffect(() =>{ bodyClass={"w-[70vw] max-w-none max-h-[90vh] overflow-y-auto"} body={ { setIsFcOrgwts(false); }} 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 d132d2bc1..946a58eb8 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx @@ -18,7 +18,6 @@ import { } from "@/components/lib/class/comClass"; import { TusClientUpload } from "@/components/lib/useTus_wr/useTusWr"; import { - type customPbnst, type fcFileType, type PbnstRegArrrayType, type selectLabel, @@ -44,23 +43,17 @@ export function PbnstMngForm({ }: { form: UseFormReturn<{ items: PbnstRegArrrayType }>; formType: string; - firstFcltData?: customPbnst; indexMng: number; setIndexMng: (index: number) => void; }) { const { code, pbnst, fileDelete, fileDownLoad } = useWrStore( (state) => state ); - const { pbnstRes } = pbnst; const fileInitRef = useRef<{ index: number; key: string } | null>(null); const [regFileList, setRegFileList] = useState(null); const [planFiles, setPlanFiles] = useState(null); const [relationfiles, setRelationFiles] = useState(null); const [fcltNm, setFcltNm] = useState(null); - const [opersKey, setOpersKey] = useState(0); - useEffect(() => { - setOpersKey((prev) => prev + 1); - }, [indexMng]); const [mngMtdCode, setMngMtdCode] = useState<{ name: string; val: SelectDataType[] }[]>(); @@ -125,6 +118,7 @@ export function PbnstMngForm({ atflCd: tusFile.atflCd.toString(), file: item, }); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions type === "relation" ? setRelationFiles(setReFiles) : setPlanFiles(setReFiles); @@ -151,6 +145,7 @@ export function PbnstMngForm({ } }); } + // eslint-disable-next-line @typescript-eslint/no-unused-expressions type === "relation" ? setRelationFiles(setReFiles) : setPlanFiles(setReFiles); @@ -517,7 +512,3 @@ export function PbnstMngForm({ ); } -function trigger(arg0: string) { - throw new Error("Function not implemented."); -} - diff --git a/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx b/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx index a454f69c8..58552e7ae 100644 --- a/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx @@ -14,7 +14,7 @@ import { } from "@/components/lib/func/commom"; import { DatePicker, FormUi } from "@common/business_components"; import { Form, FormField, SelectBox } from "@common/business_components/ui"; -import { Button, Checkbox, Input, Label, ScrollArea } from "@common/components/ui"; +import { Button, Input, ScrollArea } from "@common/components/ui"; import { zodResolver } from "@hookform/resolvers/zod"; import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; @@ -35,16 +35,14 @@ export default function RainRegForm({ setIsModal?: (modal: boolean) => void; readonly?: boolean; }) { - const { code, rainBdstReg, rainBdstUpdate, rain } = useWrStore( + const { code, rainBdstReg, rainBdstUpdate } = useWrStore( (state) => state ); const { rainFcltCd } = code; - const defaultValues: z.infer = rainZod.parse({}); const form = useForm>({ resolver: zodResolver(rainZod), // defaultValues: defaultValues, }); - const instlCst = form.watch(`reuseBuilding.0.instlCst`); const { t } = useTranslation('base'); const [grntchBdstCertYn, instlCstSprtYn, filtrTrtmfctYn] = form.watch([ @@ -123,11 +121,6 @@ export default function RainRegForm({ const [regCtpvCd, regSggcd] = form.watch(["ctpvCd", "sggCd"]); - // form 값이 변경될 때마다 로그 출력 - useEffect(() => { - const subscription = form.watch((value) => { }); - return () => subscription.unsubscribe(); - }, [form]); useEffect(() => { console.log("form errors:", form.formState.errors); @@ -411,8 +404,8 @@ export default function RainRegForm({ control={form.control} name="reuseBuilding.0.rainyObj.filtrTrtmfctPrs" render={({ field }) => { - const value = field.value; - const isUnknown = value === null || value === "-"; // 또는 Number(value) === -1 + // const value = field.value; + // const isUnknown = value === null || value === "-"; // 또는 Number(value) === -1 return (
diff --git a/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx b/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx index 34765ae9a..006306a3d 100644 --- a/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx @@ -39,7 +39,7 @@ export default function RswtrRegForm({ setIsModal?: (isModal: boolean) => void; readonly?: boolean; }) { - const { rswt, code, rswtBdstUpdate, rswtBdstReg } = useWrStore( + const { code, rswtBdstUpdate, rswtBdstReg } = useWrStore( (state) => state ); const [divStyle, setDivStyle] = useState("h-[53vh]"); diff --git a/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx b/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx index 7d8883805..71d9dea00 100644 --- a/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx +++ b/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx @@ -24,7 +24,7 @@ import toast from "react-hot-toast"; import type { z } from "zod"; export default function ChkgdExcel({ type,setIsRegExcel ,setYearChange }: { type: string, setIsRegExcel:(open:boolean) =>void ,setYearChange:(year:string)=> void }) { - const { rswtChkgdn, rainChkExcelDataUPload, rswtChkExceDataUpload } = + const { rainChkExcelDataUPload, rswtChkExceDataUpload } = useWrStore((state) => { return state; }); @@ -143,18 +143,18 @@ export default function ChkgdExcel({ type,setIsRegExcel ,setYearChange }: { type } }, [file]); - function findMatchingItems( - arrayA: T[], - arrayB: T[], - keySelector: (item: T) => string, - condition?: (item: T) => boolean - ): T[] { - const bKeySet = new Set(arrayB.map(keySelector)); - return arrayA.filter( - (item) => - (!condition || condition(item)) && bKeySet.has(keySelector(item)) - ); - } + // function findMatchingItems( + // arrayA: T[], + // arrayB: T[], + // keySelector: (item: T) => string, + // condition?: (item: T) => boolean + // ): T[] { + // const bKeySet = new Set(arrayB.map(keySelector)); + // return arrayA.filter( + // (item) => + // (!condition || condition(item)) && bKeySet.has(keySelector(item)) + // ); + // } const onSubmit = (values: z.infer) => { if (values.chckYr === "") { @@ -227,7 +227,6 @@ export default function ChkgdExcel({ type,setIsRegExcel ,setYearChange }: { type )} /> - { + handleFileChange( file) + ////TODO : 폼 을 써야하는 지 확인 필요 + console.log(field.value) + } } accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" />
diff --git a/apps/wr/components/ui/modal/chkgd/pbnPrfExcelModal/pbnPrfExcelModal.tsx b/apps/wr/components/ui/modal/chkgd/pbnPrfExcelModal/pbnPrfExcelModal.tsx index b4b87663e..8b8058a84 100644 --- a/apps/wr/components/ui/modal/chkgd/pbnPrfExcelModal/pbnPrfExcelModal.tsx +++ b/apps/wr/components/ui/modal/chkgd/pbnPrfExcelModal/pbnPrfExcelModal.tsx @@ -1,17 +1,16 @@ -import { useWrStore } from "@/app/store"; import { excelToPbnPrfData } from "@/app/store/prfmncReg/pbnstPrfmncReg/excel"; import { pbnPrfRegExcelZod } from "@/app/store/prfmncReg/pbnstPrfmncReg/headList"; -import type { FcPrfType, PrfType } from "@/app/store/prfmncReg/pbnstPrfmncReg/type"; +import type { + FcPrfType, + PrfType, +} from "@/app/store/prfmncReg/pbnstPrfmncReg/type"; import { yearOptions } from "@/components/lib/func/commom"; -import { ToastFormUi } from "@/components/ui/toast/toastFromUi"; import { - FileUpload, FormField, FormUi, SelectBox, Form, Title, - type SelectDataType, filePicked, } from "@common/business_components/ui"; import { Button, Input } from "@common/components/ui"; @@ -21,9 +20,15 @@ import { useForm } from "react-hook-form"; import toast from "react-hot-toast"; import type { z } from "zod"; -export default function PbnPrfExcelModal({ data ,setIsExcelOPen ,setModalExcelData}: { data: FcPrfType ,setIsExcelOPen:(open:boolean )=>void,setModalExcelData:(excelData :PrfType)=>void }) { - const { prfmnRegData } = useWrStore((state) => state); - +export default function PbnPrfExcelModal({ + data, + setIsExcelOPen, + setModalExcelData, +}: { + data: FcPrfType; + setIsExcelOPen: (open: boolean) => void; + setModalExcelData: (excelData: PrfType) => void; +}) { const [file, setFile] = useState(null); const [excelData, setExcelData] = useState(); const form = useForm>({ @@ -40,15 +45,14 @@ export default function PbnPrfExcelModal({ data ,setIsExcelOPen ,setModalExcelDa } }; const onSubmit = (values: z.infer) => { - if (excelData) { - // prfmnRegData(1,'41', excelData as unknown as PrfType); + ////TODO: 궅이 서브밋을 써야하는 이유가 있는지 ? + console.log("values ", values); + // prfmnRegData(1,'41', excelData as unknown as PrfType); 활성화시 스토어 활성화 칠요 - setModalExcelData(excelData as unknown as PrfType) - setIsExcelOPen(false) + setModalExcelData(excelData as unknown as PrfType); + setIsExcelOPen(false); } - - }; useEffect(() => { if (data && data.bscFctNm) @@ -57,12 +61,11 @@ export default function PbnPrfExcelModal({ data ,setIsExcelOPen ,setModalExcelDa form.setValue("pbnstRuseFcltNm", data.ruseUtztnFcltNm); }, [data]); - useEffect(() => { if (file) { - const isFile = file + const isFile = file; if (form.getValues("ym").length < 1) { - toast.error("파일업로드 이전에 등록년도를 작성해주세요 " ); + toast.error("파일업로드 이전에 등록년도를 작성해주세요 "); setFile(null); return; } @@ -70,7 +73,13 @@ export default function PbnPrfExcelModal({ data ,setIsExcelOPen ,setModalExcelDa if (isFile) { filePicked(isFile, 0).then((res) => { if (res !== undefined) - setExcelData(excelToPbnPrfData(res as unknown as JSON[], form.getValues("ym"), form.getValues('pbnstRuseFcltFk')) as PrfType[]) + setExcelData( + excelToPbnPrfData( + res as unknown as JSON[], + form.getValues("ym"), + form.getValues("pbnstRuseFcltFk") + ) as PrfType[] + ); }); } } @@ -117,7 +126,7 @@ export default function PbnPrfExcelModal({ data ,setIsExcelOPen ,setModalExcelDa @@ -133,7 +142,7 @@ export default function PbnPrfExcelModal({ data ,setIsExcelOPen ,setModalExcelDa @@ -160,13 +169,16 @@ export default function PbnPrfExcelModal({ data ,setIsExcelOPen ,setModalExcelDa > */} -
- + { + console.log(" field. valus", field.value); + if (file) handleFileChange(file); + }} + accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" /> -
+
)} /> diff --git a/apps/wr/components/ui/modal/coMat/constCostFeeTable.tsx b/apps/wr/components/ui/modal/coMat/constCostFeeTable.tsx index efd47c69b..f34e777c7 100644 --- a/apps/wr/components/ui/modal/coMat/constCostFeeTable.tsx +++ b/apps/wr/components/ui/modal/coMat/constCostFeeTable.tsx @@ -9,15 +9,11 @@ import { yearOptions } from "@/components/lib/func/commom"; import { SelectBox, UiTable } from "@common/business_components/ui"; import ListDiv from "@common/business_components/ui/list_div"; -import { Label, ScrollArea } from "@common/components/ui"; -import { useEffect, useRef, useState } from "react"; +import { Label, } from "@common/components/ui"; +import { useEffect, useState } from "react"; -export function ConstCostFeeTable({ - setReturnData, -}: { - setReturnData: (data: any) => void; -}) { - const { coRvw, constCostRes, getConstCostFee } = useWrStore((state) => state); +export function ConstCostFeeTable() { + const { coRvw, constCostRes } = useWrStore((state) => state); const [year, setYear] = useState(String(new Date().getFullYear())); const [constCostData, setConstCostData] = useState([]); diff --git a/apps/wr/components/ui/modal/coMat/drgtDetailModal.tsx b/apps/wr/components/ui/modal/coMat/drgtDetailModal.tsx index 880c789c3..500a0cf40 100644 --- a/apps/wr/components/ui/modal/coMat/drgtDetailModal.tsx +++ b/apps/wr/components/ui/modal/coMat/drgtDetailModal.tsx @@ -11,9 +11,11 @@ import { useEffect, useState } from "react" export default function DrgtDetailModal({ data, }: { - data: customDrgt; + data: customDrgt[]; }) { - const [excelData, setExcelData] = useState(); + + // const [isSggNm, setIsSggNm] = useState('') + const [excelData, setExcelData] = useState(); const excelClick = () => { downloadExcel({ data: excelData ?? [], @@ -30,10 +32,14 @@ export default function DrgtDetailModal({ return { "년": item.year, "월": item.month, - "가뭄상태": item.drgtState, + "가뭄상태": item.drgtState, // Access drgtState directly from the item } }) : []; setExcelData(exData) + // if(data&&data[0].sggNm){ + ////TODO: data.sggNm [0[인지 data.sggNm 인지 사용하는지 확인필요 + // setIsSggNm(data[0].sggNm) + // } }, [data]) return ( @@ -41,7 +47,7 @@ export default function DrgtDetailModal({
- + <Title title={`우리동네가뭄 상세내용 - ${data[0]&&data[0].sggNm ?data[0].sggNm:'' }`} /> <div className="flex flex-row space-x-2"> <Button size={"sm"} @@ -59,11 +65,15 @@ export default function DrgtDetailModal({ <ScrollArea className="h-[63vh]"> <UiTable headName={undefined} - tableData={data} + tableData={data } headlist={drgtDetailHeadListExport} pageSize={10} total={10000} - cellClick={(index: number | undefined, headId: string) => { }} + cellClick={(index: number | undefined, headId: string) => { + console.log(' indx ' , index) + console.log(' headId ' , headId) + + }} onPageChange={() => { }} ></UiTable> </ScrollArea> diff --git a/apps/wr/components/ui/modal/coMat/rateFeeModal.tsx b/apps/wr/components/ui/modal/coMat/rateFeeModal.tsx index ee82420a8..c7403b2b3 100644 --- a/apps/wr/components/ui/modal/coMat/rateFeeModal.tsx +++ b/apps/wr/components/ui/modal/coMat/rateFeeModal.tsx @@ -2,20 +2,13 @@ import { useWrStore } from "@/app/store"; import type { rateFeeType } from "@/app/store/common/searchCode/type"; -import { yearOptions } from "@/components/lib/func/commom"; -import { SelectBox, UiTable } from "@common/business_components/ui"; +import { UiTable } from "@common/business_components/ui"; import ListDiv from "@common/business_components/ui/list_div"; -import { Input, Label, ScrollArea } from "@common/components/ui"; -import { Scroll } from "lucide-react"; +import { Input, Label } from "@common/components/ui"; import { useEffect, useState } from "react"; -export function RateFeeTableModal({ - setReturnData, -}: { - setReturnData: (data: any) => void; -}) { - const { code, coRvw, rateFeeRes } = useWrStore((state) => state); - const [year, setYear] = useState<string>(String(new Date().getFullYear())); +export function RateFeeTableModal() { + const { coRvw, rateFeeRes } = useWrStore((state) => state); const [reateFeeTable, setRateFeeTable] = useState<rateFeeType[]>([]); const gubunLabelMap: Record<number, string> = { diff --git a/apps/wr/components/ui/modal/coReg/coRegExcel/coRegExcelModal.tsx b/apps/wr/components/ui/modal/coReg/coRegExcel/coRegExcelModal.tsx index 24fef023c..66fdf91d0 100644 --- a/apps/wr/components/ui/modal/coReg/coRegExcel/coRegExcelModal.tsx +++ b/apps/wr/components/ui/modal/coReg/coRegExcel/coRegExcelModal.tsx @@ -1,76 +1,80 @@ import { useWrStore } from "@/app/store"; import { coRegExcel } from "@/app/store/matDmd/coSttn/headList"; -import type { customLdrmnt } from "@/app/store/matDmd/ldrmntCoSttn"; import { names } from "@/app/store/matDmd/ldrmntCoSttn/excel"; -import { filePicked, FileUpload, FormUi, Title } from "@common/business_components/ui"; -import { Form, FormField } from "@common/business_components/ui/form"; +import { filePicked, Title } from "@common/business_components/ui"; +import { Form } from "@common/business_components/ui/form"; import LoadingOverlay from "@common/business_components/ui/loadingBar"; -import { Button, Input, Progress } from "@common/components/ui"; +import { Button, Input } from "@common/components/ui"; import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect, useState } from "react"; +import { useState } from "react"; import { useForm } from "react-hook-form"; import toast from "react-hot-toast"; import type { z } from "zod"; -export default function CoRegExcel({ isModal }: { isModal: (open: boolean) => void }) { +export default function CoRegExcel({ + isModal, +}: { + isModal: (open: boolean) => void; +}) { const { ldrmnt, loadingOpen } = useWrStore((state) => state); const { isLoading } = ldrmnt; const form = useForm<z.infer<typeof coRegExcel>>({ resolver: zodResolver(coRegExcel), }); - const { ldrmntRegData, ldrmntDelete } = useWrStore((state) => state); - const [excelData, setExcelData] = useState<customLdrmnt[]>(); + const { ldrmntRegData } = useWrStore((state) => state); const [file, setFiles] = useState<File | undefined>(); - const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => { - const selectedFile = e.target.files?.[0]; - if (selectedFile) { - setFiles(selectedFile); - } - }; + // const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => { + // const selectedFile = e.target.files?.[0]; + // if (selectedFile) { + // setFiles(selectedFile); + // } + // }; - const onSubmit = (values: z.infer<typeof coRegExcel>) => { + //TODO:Onsubmit을 써야하는지 + const onSubmit = () => { loadingOpen(true); if (file) { - filePicked(file, 0).then(async (res) => { + filePicked(file, 0) + .then(async (res) => { + try { + const array: { [key: string]: string | number }[] = []; + if (Array.isArray(res)) { + res.some((item) => { + const object: { [key: string]: string | number } = {}; + Object.keys(names).some((key) => { + if (item && names[key] !== undefined) { + // if (key === "공장관리번호") { + // item[key] = String(item[key]) + // } else { + object[names[key] as string] = item[key]; + // } + } + return false; + }); + + array.push(object); - try { - let array: { [key: string]: string | number }[] = [] - if (Array.isArray(res)) { - res.some((item, index) => { - let object: { [key: string]: string | number } = {} - Object.keys(names).some((key) => { - if (item && names[key] !== undefined) { - // if (key === "공장관리번호") { - // item[key] = String(item[key]) - // } else { - object[names[key] as string] = item[key]; - // } - } return false; - }) - - array.push(object) - - return false; - }) + }); + } + await ldrmntRegData(array); + isModal(false); + loadingOpen(false); + toast.success(`잠재수요처 등록이 완료되었습니다.`); + } catch (e) { + console.log(e); + loadingOpen(false); + alert(e); + return true; } - await ldrmntRegData(array); - isModal(false); - loadingOpen(false); - toast.success(`잠재수요처 등록이 완료되었습니다.`); - } catch (e) { - console.log(e) - loadingOpen(false); - alert(e) - return true; - } - }).catch((e) => { - console.log("file", e); - }); - }; - } + }) + .catch((e) => { + console.log("file", e); + }); + } + }; return ( <> @@ -85,28 +89,22 @@ export default function CoRegExcel({ isModal }: { isModal: (open: boolean) => vo <h3 className="text-2xl font-bold text-gray-900 mt-1 ml-7"> {"잠재수요처 파일"} </h3> - - <Button className="" type="submit" size={"sm"}> + <Button className="" type="submit" size={"sm"} onClick={onSubmit}> 저장 </Button> </div> <div> - <FormField - control={form.control} - name="file" - render={({ field }) => ( - <FormUi label=""> - <div className="space-y-4 p-4"> - <Input - type="file" - onChange={handleFileChange} - accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" - /> - </div> - </FormUi> - )} - /> + <div className="space-y-4 p-4"> + <Input + type="file" + onChange={(e) => { + const selectedFile = e.target.files?.[0]; + if (selectedFile) setFiles(selectedFile); + }} + accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" + /> + </div> </div> </form> </Form> diff --git a/apps/wr/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal.tsx b/apps/wr/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal.tsx index 0b071aa91..09f66ed2a 100644 --- a/apps/wr/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal.tsx +++ b/apps/wr/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal.tsx @@ -1,8 +1,6 @@ import { useWrStore } from "@/app/store"; import { UiTable } from "@common/business_components/ui"; import ListDiv from "@common/business_components/ui/list_div"; -import { useEffect } from "react"; - import type { @@ -10,7 +8,7 @@ import type { } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; export default function BdstChgModal({ chgBuilding }: { chgBuilding:chgBuilding[] }) { -const {bdst,rain} = useWrStore((state) => { +const {bdst} = useWrStore((state) => { return state; }); const { bdstChgHeadList } = bdst; @@ -26,7 +24,6 @@ const { bdstChgHeadList } = bdst; onPageChange={() => {}} headName={"○건축물 변경 이력"} tableData={chgBuilding} - children={undefined} cellClick={undefined} /> </ListDiv> diff --git a/apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx b/apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx index a049772e8..c087096f3 100644 --- a/apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx +++ b/apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx @@ -12,7 +12,7 @@ import { } from "@common/business_components"; import { Button, Input, Label } from "@common/components"; import { useEffect, useState } from "react"; -import { getCity, tableData } from "@/components/lib/func/commom"; +import { tableData } from "@/components/lib/func/commom"; import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg"; import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg"; import RainRegForm from "@/components/ui/form/fcltReg/rainReg/rainRegForm"; @@ -35,17 +35,15 @@ type BdstTypeMap = { interface BdstRegProps<T extends MoType> { moType: T; isModal: boolean; - siSggCode?: string; setIsModal?: (open: boolean) => void; } export function BdstReg<T extends MoType>({ moType, setIsModal, - siSggCode, isModal, }: BdstRegProps<T>) { - const { rain, code, bdst, findBdst } = useWrStore((state) => { + const { code, bdst, findBdst } = useWrStore((state) => { return state; }); @@ -56,14 +54,12 @@ export function BdstReg<T extends MoType>({ {} as BdstTypeMap[T] ); const [searchTxt, setSearchTxt] = useState<string>(); - const [selectSgg, setSelectSgg] = useState<SelectDataType[] | []>(); const [objSearch, setObjSearch] = useState<objSearchType>({ sgg: "", city: "", }); const [useCityCd, setUserCityCd] = useState<SelectDataType[]>([]); const [useSggCd, setUserSggCd] = useState<SelectDataType[]>([]); - const [dataCode, setDataCode] = useState<string>(); const searchBdst = (searchTxt: string | undefined) => { let data = objSearch.city; @@ -78,7 +74,7 @@ export function BdstReg<T extends MoType>({ useEffect(() => { if (code.sggCd.length > 0) { const bdstData = bdst.bdstBase.map((bdst) => { - let archArea = + const archArea = bdst?.archArea.split(".")[0] !== "-1" ? bdst?.archArea.split(".")[0] : "확인불가"; @@ -117,8 +113,7 @@ export function BdstReg<T extends MoType>({ }, [userSiSggCd, code.cityCd, code.sggCd]); const tableClick: (val: number | undefined, headId: string) => void = ( - val, - headId + val ) => { if (val !== undefined && bdst?.bdstBase.length > 0) { const data: BdstTypeMap[T] = bdst?.bdstBase[val]; @@ -195,6 +190,7 @@ export function BdstReg<T extends MoType>({ cellClick={(idx, headId) => tableClick(idx, headId || "")} onPageChange={function (page: number): void { throw new Error("Function not implemented."); + console.log("page ", page); }} ></UiTable> </div> @@ -212,16 +208,20 @@ export function BdstReg<T extends MoType>({ <RswtrRegForm rswtForm={rainBdstForm as customRswtBdst} isModal={isModal} - setIsModal={(open) => { - setIsModal && setIsModal(open); + setIsModal={(open?: boolean) => { + if (setIsModal && open) { + setIsModal(open); + } }} ></RswtrRegForm> ) : ( <HtdflRegForm htdflForm={rainBdstForm as unknown as customHtdflBdst} isModal={true} - setIsModal={(open) => { - setIsModal && setIsModal(open); + setIsModal={(open?: boolean) => { + if (setIsModal && open) { + setIsModal(open); + } }} ></HtdflRegForm> )} diff --git a/apps/wr/components/ui/modal/fcltReg/fcOrgwtsRegModal/fcOrgwtsRegModal.tsx b/apps/wr/components/ui/modal/fcltReg/fcOrgwtsRegModal/fcOrgwtsRegModal.tsx index 5b1a6f0f6..1f2ea4a52 100644 --- a/apps/wr/components/ui/modal/fcltReg/fcOrgwtsRegModal/fcOrgwtsRegModal.tsx +++ b/apps/wr/components/ui/modal/fcltReg/fcOrgwtsRegModal/fcOrgwtsRegModal.tsx @@ -2,13 +2,11 @@ import { useWrStore } from "@/app/store"; import type { pubHasuType, - fcBizType, fcOrgwtType, } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type"; -import type { TableUpperProps } from "@/app/store/common/type/header"; import { tableData } from "@/components/lib/func/commom"; import RuseMngTable from "@/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable"; -import { Title, UiTable } from "@common/business_components/ui"; +import { Title } from "@common/business_components/ui"; import { Label } from "@common/business_components/ui/form/lib/label"; import { Button } from "@common/business_components/ui/table/lib/button"; import { Input } from "@common/components/ui"; diff --git a/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx b/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx index f658fa485..69ba1fb68 100644 --- a/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx +++ b/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx @@ -1,10 +1,8 @@ "use client"; -import { useWrStore } from "@/app/store"; import { pbnstRegZod, type customPbnst, type PbnstRegArrrayType, - type pubHasuType, } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type"; import { PbnstMngForm } from "@/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm"; import { ScrollArea } from "@common/business_components"; @@ -18,12 +16,10 @@ import { import { useEffect, useState } from "react"; import { PbnstBuseForm } from "@/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm"; import { - useFieldArray, type FieldErrors, type UseFormReturn, } from "react-hook-form"; import { writeRgtrAndMdfr } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg"; -import toast from "react-hot-toast"; import type { z } from "zod"; export function PbnstRegModal({ @@ -36,10 +32,13 @@ export function PbnstRegModal({ onInvalid:(errors: FieldErrors<{ items: z.infer<typeof pbnstRegZod>[] }>) => void }) { - const [pbnstBdstForm, setPbnstBdstForm] = useState<customPbnst>( - {} as customPbnst - ); - const [currentTab, setCurrentTab] = useState<string>("mng"); + // const [pbnstBdstForm, setPbnstBdstForm] = useState<customPbnst>( + // {} as customPbnst + // ); + + //TODO: 유즈 스테이트에 set만해도 되나? + const [, setCurrentTab] = useState<string>("mng"); + //const setCurrentTab = "mng" const [indexMng, setIndexMng] = useState<number>(0); const [indexBiz, setIndexBiz] = useState<number>(0); @@ -51,70 +50,7 @@ export function PbnstRegModal({ setPbnstInsert(data[0]); } }; - // const onInvalid = ( - // errors: FieldErrors<{ items: z.infer<typeof pbnstRegZod>[] }> - // ) => { - // // 재귀 함수를 사용해 중첩된 에러 객체에서 모든 에러 메시지와 경로를 찾습니다. - - - // const findAllErrors = ( - // errorObject: any, - // path: (string | number)[] = [] - // ): { message: string; path: (string | number)[] }[] => { - // if (!errorObject) return []; - - // return Object.keys(errorObject).flatMap((key) => { - // const value = errorObject[key]; - // const currentKey = !isNaN(parseInt(key)) ? parseInt(key) : key; - // const newPath = [...path, currentKey]; - // if (value && typeof value === "object") { - // if (typeof value.message === "string") { - // return [{ message: value.message, path: newPath }]; // 에러 메시지와 경로 반환 - // } - // return findAllErrors(value, newPath); - // } - // return []; - // }); - // }; - - - // const errorList = findAllErrors(errors); - - - // if (errorList.length > 0) { - // errorList.forEach((errorInfo) => { - // const { message, path } = errorInfo; - // let prefix = ""; - // const itemsIndex = path.indexOf("items"); - - - // if (itemsIndex > -1 && path.length > itemsIndex + 1) { - // const itemIdx = path[itemsIndex + 1] as number; - // const facilityName = form.getValues( - // `items.${itemIdx}.ruseUtztnFcltNm` - // ); - // if (facilityName) { - // prefix += `[${facilityName}] `; - // } - - // const fcBizsIndex = path.indexOf("fcBizs"); - // if (fcBizsIndex > -1 && path.length > fcBizsIndex + 1) { - // const bizIdx = path[fcBizsIndex + 1] as number; - // const cycle = form.getValues( - // `items.${itemIdx}.fcBizs.${bizIdx}.cycl` - // ); - // if (cycle) { - // prefix += `[${cycle}차수] `; - // } - // } - // } - - - // toast.error(`${prefix}${message}`); - // }); - // } - // }; - + const handleTabChange = (value: string) => { setCurrentTab(value); }; @@ -158,7 +94,7 @@ export function PbnstRegModal({ <PbnstMngForm form={form} formType={"reg"} - firstFcltData={pbnstBdstForm} + // firstFcltData={pbnstBdstForm} indexMng={indexMng} setIndexMng={setIndexMng} /> @@ -170,7 +106,7 @@ export function PbnstRegModal({ indexBiz={indexBiz} setIndexBiz={setIndexBiz} formType={"reg"} - firstBizData={pbnstBdstForm.fcBizs} + // firstBizData={pbnstBdstForm.fcBizs} /> </TabsContent> </Tabs>