From 3c5d37cc6c5c35d0ac502483e8d43dca5ca4c9e4 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 17 Sep 2025 17:00:02 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=A8=EB=B0=B0=EC=88=98=20=EC=8B=9C?= =?UTF-8?q?=EC=84=A4=20=EC=88=98=EC=A0=95=20,=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruseFcltMng/fcltReg/htdflReg/page.tsx | 19 ++- apps/wr/app/store/common/code/index.ts | 130 ++++++++---------- apps/wr/app/store/store.tsx | 2 +- .../ui/form/fcltReg/bdstReg/bdstReg.tsx | 72 ++++++---- .../ui/form/fcltReg/htdflReg/htdflRegForm.tsx | 99 +++++-------- .../ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx | 16 --- 6 files changed, 151 insertions(+), 187 deletions(-) diff --git a/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/htdflReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/htdflReg/page.tsx index c434f922d..24529c1b3 100644 --- a/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/htdflReg/page.tsx +++ b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/htdflReg/page.tsx @@ -74,15 +74,12 @@ export default function Home() { } }, [code, htdflRes]); - const cellClick: (val: number | undefined, headId: string) => void = ( - val - ) => { - if ((bdstTable ?? []).length > 0 && val !== undefined) { - { - setHtdflForm(htdflRes[val]); - } - } - }; +const cellClick: (val: number, headId: string) => void = (val) => { + if (!htdflRes || !Array.isArray(htdflRes)) return; + const idx = Number(val); + console.log('htdflRes[idx]', htdflRes[idx]); + setHtdflForm(htdflRes[idx]); +}; useEffect(() => { getHtdflBdstData(pageNation, "0"); @@ -142,7 +139,9 @@ export default function Home() { total={htdflResCount} headName={"시설물 목록"} cellClick={(val, headId) => { - cellClick(val || undefined, headId); + if (val !== null && val !== undefined) { + cellClick(val, headId); + } }} onPageChange={setPageNation} > diff --git a/apps/wr/app/store/common/code/index.ts b/apps/wr/app/store/common/code/index.ts index 1b17db52a..0601c5e41 100644 --- a/apps/wr/app/store/common/code/index.ts +++ b/apps/wr/app/store/common/code/index.ts @@ -16,8 +16,6 @@ export const btnClass = "p-4 m-2 text-white rounded-sm text-lg font-medium "; const laeSecd = "41"; export const lwCds: Record = {}; - - const codeMApping = { WR001: "bdstUsgCd", WR002: "rswtBdstType", @@ -27,73 +25,72 @@ const codeMApping = { WR006: "orgwtKndCd", //작업 완ㅛ WR007: "ruseMngMtd", // 작업완료 WR008: "rusePrcsMthdCd", //w작업완료 - WR009: "erctUswtrPrcsMeth",//w작업완료 - WR010: "ruseFcltSpot",// inout은 yn 만 사용해야 함으로 해당 코드는 사용안함. + WR009: "erctUswtrPrcsMeth", //w작업완료 + WR010: "ruseFcltSpot", // inout은 yn 만 사용해야 함으로 해당 코드는 사용안함. WR011: "pplQulity", WR012: "pplLenght", WR013: "bdstFilterYn", // 사용 불가 yn만 사용해야함으로 해당코드 사용 안함 - WR014: "rainRswtMng", // 지도점검 등록 시변경 - WR015: "rainFcltFlowRate", //지도점검 등록 시변경 - WR016: "dmdUszCd", // 지도점검 등록 시변경 + WR014: "rainRswtMng", // 지도점검 등록 시변경 + WR015: "rainFcltFlowRate", //지도점검 등록 시변경 + WR016: "dmdUszCd", // 지도점검 등록 시변경 WR017: "sewageInFcltUse", //하수재이용 장내 WR018: "sewageOutFclttUse", // 하수재이용 장외 WR019: "htdPowerMthdCd", WR020: "htdUtztnUsgCd", }; -export const getCommonUpCd = async (set:any) => { - +export const getCommonUpCd = async (set: any) => { try { - let lwCdCode :Record = {}; + let lwCdCode: Record = {}; const upCd = await getFetchWithCount( fetchType.LOCAL, "/cms-service/api/v1/up-codes?keyword=&upCd=&cdSe=&useYn=Y&siteId=WR&page=0&size=100&sort=string" ); - + const upWrCode: string[] = upCd.content .filter((item: any) => item.upCd.slice(0, 2) === "WR") .map((cd: any) => cd.upCd); - + await Promise.all( upWrCode.map(async (cd) => { const mapping = codeMApping[cd as keyof typeof codeMApping]; if (!mapping) return; - + const lwCd = await getFetchWithCount( fetchType.LOCAL, `/cms-service/api/v1/lwpo-cds/up-cd/${cd}` ); - - const list = Array.isArray(lwCd) ? lwCd : lwCd.content ?? []; - lwCds[mapping] = list.map((it: any) => ({ - text: it.lwpoCdNm, - val: it.lwpoCd, - })); + + const list = Array.isArray(lwCd) ? lwCd : (lwCd.content ?? []); + lwCds[mapping] = list.map((it: any) => ({ + text: it.lwpoCdNm, + val: it.lwpoCd, + })); }) ); - lwCdCode=lwCds + lwCdCode = lwCds; set((state: comCodeState) => ({ code: { ...state.code, - rainFcltCd: lwCdCode['rainFcltCd']??[], - bdstUsgCd: lwCdCode['bdstUsgCd']??[], - orgwtKndCd: lwCdCode['orgwtKndCd']??[] , - pplQulity: lwCdCode['pplQulity']??[] , - pplLenght: lwCdCode['pplLenght']??[] , - dmdUszCd: lwCdCode['dmdUszCd']??[] , - ruseMngMtd: lwCdCode['ruseMngMtd']??[], - rusePrcsMthdCd: lwCdCode['rusePrcsMthdCd']??[], - erctUswtrPrcsMeth: lwCdCode['erctUswtrPrcsMeth']??[], - bdstGrntchClass: lwCdCode['bdstGrntchClass']??[], - htdPowerMthdCd: lwCdCode['htdPowerMthdCd']??[], - htdUtztnUsgCd: lwCdCode['htdUtztnUsgCd']??[], - rswtBdstType:lwCdCode['rswtBdstType']??[] , - bdstTotalUsgType:lwCdCode['bdstUsgCd']?.concat(lwCdCode['rswtBdstType'] || [])??[] + rainFcltCd: lwCdCode["rainFcltCd"] ?? [], + bdstUsgCd: lwCdCode["bdstUsgCd"] ?? [], + orgwtKndCd: lwCdCode["orgwtKndCd"] ?? [], + pplQulity: lwCdCode["pplQulity"] ?? [], + pplLenght: lwCdCode["pplLenght"] ?? [], + dmdUszCd: lwCdCode["dmdUszCd"] ?? [], + ruseMngMtd: lwCdCode["ruseMngMtd"] ?? [], + rusePrcsMthdCd: lwCdCode["rusePrcsMthdCd"] ?? [], + erctUswtrPrcsMeth: lwCdCode["erctUswtrPrcsMeth"] ?? [], + bdstGrntchClass: lwCdCode["bdstGrntchClass"] ?? [], + htdPowerMthdCd: lwCdCode["htdPowerMthdCd"] ?? [], + htdUtztnUsgCd: lwCdCode["htdUtztnUsgCd"] ?? [], + rswtBdstType: lwCdCode["rswtBdstType"] ?? [], + bdstTotalUsgType: + lwCdCode["bdstUsgCd"]?.concat(lwCdCode["rswtBdstType"] || []) ?? [], }, })); - }catch(e){ - console.log('com code error ', e) + } catch (e) { + console.log("com code error ", e); } - }; //물재이용 주소 코드: devU01TX0FVVEgyMDI1MDgyNTEwMzkwNDExNjEwNTM= export const buildingType = { @@ -219,9 +216,6 @@ export const getEnvPartCd = async (set: any) => { } }; - - - export type comCodeState = { code: { isInit: boolean; @@ -252,11 +246,11 @@ export type comCodeState = { bdstFilterYn: SelectDataType[]; bdstIncenYn: SelectDataType[]; bdstGrntchClass: SelectDataType[]; - // rswtPrscCdMthdCd: SelectDataType[]; + // rswtPrscCdMthdCd: SelectDataType[]; htdPowerMthdCd: SelectDataType[]; htdUtztnUsgCd: SelectDataType[]; - rswtBdstType:SelectDataType[]; - bdstTotalUsgType:SelectDataType[] + rswtBdstType: SelectDataType[]; + bdstTotalUsgType: SelectDataType[]; userSiSggCd: string; }; }; @@ -266,60 +260,56 @@ export type comCodeType = comCodeState & comCodeActions; export const comCodeStateExport: comCodeState = { code: { isInit: false, - rainFcltCd: lwCds['rainFcltCd']??[], - bdstUsgCd: lwCds['bdstUsgCd']??[] , + rainFcltCd: lwCds["rainFcltCd"] ?? [], + bdstUsgCd: lwCds["bdstUsgCd"] ?? [], chBuCd: chBuCd, - orgwtKndCd: lwCds['orgwtKndCd']??[] , + orgwtKndCd: lwCds["orgwtKndCd"] ?? [], cityCd: [], sggCd: [], rvbsnCd: [], mdmbsnCd: [], lgbsnCd: [], lclgvrnmntCd: [], - pplQulity: lwCds['pplQulity']??[] , - pplLenght: lwCds['pplLenght']??[] , + pplQulity: lwCds["pplQulity"] ?? [], + pplLenght: lwCds["pplLenght"] ?? [], yn: yn, - dmdUszCd: lwCds['dmdUszCd']??[] , + dmdUszCd: lwCds["dmdUszCd"] ?? [], buildingType: buildingType, - ruseMngMtd: lwCds['ruseMngMtd']??[], + ruseMngMtd: lwCds["ruseMngMtd"] ?? [], ruseSeCd: ruseSeCd, ruseBizMthdCd: ruseBizMthdCd, - rusePrcsMthdCd: lwCds['rusePrcsMthdCd']??[], - erctUswtrPrcsMeth: lwCds['erctUswtrPrcsMeth']??[], + rusePrcsMthdCd: lwCds["rusePrcsMthdCd"] ?? [], + erctUswtrPrcsMeth: lwCds["erctUswtrPrcsMeth"] ?? [], bdstFilterYn: bdstFilterYn, bdstIncenYn: bdstIncenYn, - bdstGrntchClass: lwCds['bdstGrntchClass']??[], - // rswtPrscCdMthdCd: rswtPrscCdMthdCd, // 공단연락오면 바꿔야함 - htdPowerMthdCd: lwCds['htdPowerMthdCd']??[], - htdUtztnUsgCd: lwCds['htdUtztnUsgCd']??[], + bdstGrntchClass: lwCds["bdstGrntchClass"] ?? [], + // rswtPrscCdMthdCd: rswtPrscCdMthdCd, // 공단연락오면 바꿔야함 + htdPowerMthdCd: lwCds["htdPowerMthdCd"] ?? [], + htdUtztnUsgCd: lwCds["htdUtztnUsgCd"] ?? [], userSiSggCd: laeSecd, - rswtBdstType:lwCds['rswtBdstType']??[] , - bdstTotalUsgType:lwCds['bdstTotalUsgType']??[] + rswtBdstType: lwCds["rswtBdstType"] ?? [], + bdstTotalUsgType: lwCds["bdstTotalUsgType"] ?? [], }, }; export type comCodeActions = { returnCodeText: (val: string, codeName: string) => string; - returnTextCode: (text: string, codeName: string) => string; + returnTextCode: (text: string, codeName: string) => string; }; -export const codeActionExport: (set: any) => comCodeActions = (set: any) => { +export const codeActionExport: (set: any, get:any) => comCodeActions = (set: any, get:any) => { return { returnCodeText: (val: string, codeName: string) => { - return set((state: comCodeState) => { - const codeList = state.code[codeName] || []; - const found = codeList.find((item) => item.val === val); - return found ? found.text : val; - } - ); + + const codeList = get().code[codeName] || []; + const found = codeList.find((item) => item.val === val); + + return found ? found.text : val; }, returnTextCode: (text: string, codeName: string) => { - return set((state: comCodeState) => { - const codeList = state.code[codeName] || []; + const codeList = get().code[codeName] || []; const found = codeList.find((item) => item.text === text); return found ? found.val : text; - } - ); }, }; }; diff --git a/apps/wr/app/store/store.tsx b/apps/wr/app/store/store.tsx index 01d0b50b4..fbb3434d9 100644 --- a/apps/wr/app/store/store.tsx +++ b/apps/wr/app/store/store.tsx @@ -351,7 +351,7 @@ export const StoreZus = ( ...rswtFacActionsExport(set), ...matDmdActionsExport(set), ...htdflFacActionsExport(set), - ...codeActionExport(set), + ...codeActionExport(set,get), ...bdstActionsExport(set), ...rainChkgdnActionsExport(set), ...rswtChkgdnActionsExport(set), diff --git a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx index 0b7be34fa..91a2c5379 100644 --- a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx +++ b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx @@ -9,19 +9,16 @@ import { SelectBox, type SelectDataType, } from "@common/business_components"; -import SearchInputAddress from "@common/business_components/ui/search_input_address"; -import type { addressType } from "@common/business_components/ui/search_input_address/findAddress"; import { Input } from "@common/components"; import { useEffect, useState } from "react"; export default function BdstReg({ form, type }: { form: any; type?: string }) { - const { code } = useWrStore((state) => { + const { code, returnCodeText } = useWrStore((state) => { return state; }); const { userSiSggCd } = code; const [useCityCd, setUserCityCd] = useState([]); const [useSggCd, setUserSggCd] = useState([]); - const [initDaddr, setInitDaddr] = useState(); useEffect(() => { if (userSiSggCd.length === 2 && code.cityCd.length > 0) { @@ -56,10 +53,8 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) { form.setValue("ctpvCd", Number(city[0]?.val)); form.setValue("sggCd", Number(sgg[0]?.val)); } - }, [form, userSiSggCd, code.cityCd, code.sggCd]); - useEffect(() => { const subscription = form.form?.watch((value: any) => { console.log("vale", value); @@ -72,12 +67,40 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) { // console.log("form ", form.watch()); // }, [form.formState]); + useEffect(() => { + const bdstInfoSn = form.getValues("bdstInfoSn"); + if (bdstInfoSn && bdstInfoSn > 0) form.setValue("daddr", bdstInfoSn); + }, [form.getValues("bdstInfoSn")]); + + const userCtpvCd = form.watch("ctpvCd"); + const userSggCd = form.watch("sggCd"); useEffect(() => { - const bdstInfoSn = form.getValues("bdstInfoSn"); - if(bdstInfoSn&&bdstInfoSn>0) - setInitDaddr(form.getValues("daddr")); - }, [form.getValues("bdstInfoSn")]); + const strCtpvCd = String(userCtpvCd); + + if (strCtpvCd && strCtpvCd !== "0") { + const city = returnCodeText(strCtpvCd, "cityCd"); + form?.setValue("daddr", city); + } else if (strCtpvCd === "0") { + form?.setValue("daddr", ""); + } + }, [userCtpvCd]); + + useEffect(() => { + const strSggCd = String(userSggCd); + if (strSggCd && strSggCd !== "0") { + const city = returnCodeText(strSggCd.slice(0, 2), "cityCd"); + const sgg = returnCodeText(strSggCd, "sggCd"); + + form?.setValue("daddr", city + " " + sgg); + } else if (strSggCd === "0") { + const ctpvCdText = returnCodeText( + String(form.getValues("ctpvCd")), + "cityCd" + ); + form?.setValue("daddr", ctpvCdText); + } + }, [userSggCd]); return ( <> @@ -162,24 +185,17 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) { name="daddr" render={({ field }) => ( - {/* { - field.onChange(e.target.value) - }} - value={field.value || ''} - maxLength={50} - /> */}
- { - console.log("rtnData", rtnData); - field.onChange(rtnData.roadAddrPart1); + { + field.onChange(e.target.value); }} - > + value={field.value || ""} + maxLength={50} + />
)} @@ -222,9 +238,9 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) { className={""} selectClass={selectClass} label={""} - selectArray={code.bdstUsgCd} + selectArray={ type ==='RNB'?code.bdstUsgCd:code.rswtBdstType} onSelectValue={(val) => { - field.onChange(Number(val)); + field.onChange(val); }} value={field.value ?? code.bdstUsgCd[0]?.val} /> diff --git a/apps/wr/components/ui/form/fcltReg/htdflReg/htdflRegForm.tsx b/apps/wr/components/ui/form/fcltReg/htdflReg/htdflRegForm.tsx index b8bc62093..192a65397 100644 --- a/apps/wr/components/ui/form/fcltReg/htdflReg/htdflRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/htdflReg/htdflRegForm.tsx @@ -34,7 +34,7 @@ export default function HtdflRegForm({ isModal, readonly = false, setIsModal, - isMap + isMap, }: { htdflForm: customHtdflBdst; isModal: boolean; @@ -79,9 +79,29 @@ export default function HtdflRegForm({ const cleanHtdflData = (raw: any): z.infer => { const buildings = - raw?.reuseBuilding && raw.reuseBuilding.length > 0 - ? raw.reuseBuilding - : [{}]; + raw?.reuseBuilding && raw.reuseBuilding.length > 0 + ? raw.reuseBuilding + : [{}]; + + if (htdflForm.reuseBuilding && htdflForm.reuseBuilding[0]?.htdflObj.ph) { + const htdflPH = htdflForm.reuseBuilding[0]?.htdflObj.ph; + if (htdflPH && String(htdflPH).includes("~")) { + const [frontPH, backPH] = htdflPH.split("~"); + if (frontPH) { + setFrontPHdata(frontPH); + } + if (backPH) { + setBackPHdata(backPH); + } + } else { + setFrontPHdata(""); + setBackPHdata(""); + } + } else { + setFrontPHdata(""); + setBackPHdata(""); + } + return { ...raw, frstArchPrmsnDt: new Date(raw?.frstArchPrmsnDt || null), @@ -96,7 +116,7 @@ export default function HtdflRegForm({ : new Date(item?.archChgPrmsnDt), bdstChgNm: item?.bdstChgNm ?? "", // null → "" })), - reuseBuilding:buildings.map((item: any) => ({ + reuseBuilding: buildings.map((item: any) => ({ ...item, instlCmptnDt: new Date(item?.instlCmptnDt), htdflObj: { @@ -146,16 +166,16 @@ export default function HtdflRegForm({ const [divStyle, setDivStyle] = useState("h-[53vh]"); useEffect(() => { - if(isMap){ - setDivStyle("h-[100vh]") - }else if (isModal === true) { - setDivStyle("h-[53vh] max-h-[37vh]") + if (isMap) { + setDivStyle("h-[100vh]"); + } else if (isModal === true) { + setDivStyle("h-[53vh] max-h-[37vh]"); } else if (readonly === true) { - setDivStyle("h-[62vh]") + setDivStyle("h-[62vh]"); } else { - setDivStyle("h-[57vh]") + setDivStyle("h-[57vh]"); } - }, [isModal, readonly ,isMap]); + }, [isModal, readonly, isMap]); useEffect(() => { console.log("form errors:", form.formState.errors); @@ -164,25 +184,9 @@ export default function HtdflRegForm({ // form.reset은 비동기로 동작할 수 있어, useEffect 하나로 관리하여 의도치 않은 초기화를 방지합니다. useEffect(() => { // Case 1: 수정 또는 '복사하여 등록' 등 데이터가 주입되는 경우 - if (htdflForm && Object.keys(htdflForm).length > 0) { - - const htdflPH = htdflForm.reuseBuilding[0]?.htdflObj.ph - if(htdflPH && String(htdflPH).includes("~")){ - const [frontPH, backPH] = htdflPH.split("~"); - if (frontPH) { - setFrontPHdata(frontPH); - } - if (backPH) { - setBackPHdata(backPH); - } - } else { - setFrontPHdata(""); - setBackPHdata(""); - } - - + if (htdflForm) { form.reset(cleanHtdflData(htdflForm)); - }else{ + } else { form.reset(); } // Case 2: 데이터가 없는 순수 신규 등록 모드인 경우 @@ -227,37 +231,12 @@ export default function HtdflRegForm({ if (!isPowerPlant) { form.setValue( "reuseBuilding.0.htdflObj.etgtType", - "해당없음", // 빈 문자열로 초기화 + "01", // 빈 문자열로 초기화 { shouldDirty: true } // dirty 상태로 남길지 여부는 취사선택 ); } }, [isPowerPlant, form]); - -// useEffect(() => { -// const watchPH = form.getValues(`items.${indexMng}.fcBizs.${indexBiz}.ph`); -// const checkPkAndCycle = -// form.getValues(`items.${indexMng}.pbnstRuseFcltId`) + -// String(form.getValues(`items.${indexMng}.fcBizs.${indexBiz}.cycl`)); - -// console.log("checkPkAndCycle ", checkPkAndCycle); -// if (chekcPk !== checkPkAndCycle) { -// if (watchPH && watchPH !== undefined) { -// const [frontPH, backPH] = watchPH.split("~"); -// if (frontPH) { -// setFrontPHdata(frontPH); -// } -// if (backPH) { -// setBackPHdata(backPH); -// } -// } else { -// setFrontPHdata("0"); -// setBackPHdata("0"); -// } -// setCheakPk(checkPkAndCycle); -// } -// }, [form.getValues(`items.${indexMng}.fcBizs.${indexBiz}.ph`), chekcPk]); - return (
@@ -310,12 +289,8 @@ export default function HtdflRegForm({ selectArray={code.htdPowerMthdCd} onSelectValue={readonly ? () => {} : field.onChange} // value={field.value ?? ""} - value={ - field.value || - (code?.htdPowerMthdCd[0] && - code?.htdPowerMthdCd[0].val) - } - readOnly={readonly || !isPowerPlant} + value={field.value} + readOnly={readonly} /> )} diff --git a/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx b/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx index 08a946a9f..522c9b4fe 100644 --- a/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx @@ -77,9 +77,6 @@ export default function RswtrRegForm({ } }; - const filtrTrtmfctCpct = form.watch( - "reuseBuilding.0.rswtrObj.filtrTrtmfctCpct" - ); const cleanRswtData = (raw: any): z.infer => { const buildings = raw?.reuseBuilding && raw.reuseBuilding.length > 0 @@ -113,12 +110,6 @@ export default function RswtrRegForm({ })), }; }; - // useEffect(() =>{ - // console.log(' formform ', form.watch()) - // },[form.formState]) - useEffect(() => { - console.log(" filtrTrtmfctCpct ", filtrTrtmfctCpct); - }, [filtrTrtmfctCpct]); useEffect(() => { console.log("form errors:", form.formState.errors); @@ -146,12 +137,6 @@ export default function RswtrRegForm({ }, [rswtForm, form]); - useEffect(() =>{ - console.log('code orgin ', code) - - console.log('code ', code.orgwtKndCd) - },[code]) - return (
@@ -269,7 +254,6 @@ export default function RswtrRegForm({ onFocus={() => { // 입력 시 자동으로 확인불가 해제 if (isUnknown && !readonly) { - console.log("value"); field.onChange(""); // 초기화 } }}