From df7a66b2c750d549f256edd4685b80f293624fdc Mon Sep 17 00:00:00 2001 From: jsyang Date: Wed, 1 Apr 2026 15:31:37 +0900 Subject: [PATCH] =?UTF-8?q?=ED=9B=84=EB=B3=B4=EC=A7=80=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20=ED=9B=84=20=EC=88=98=EC=9A=94=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=EC=97=90=20=EC=9E=85=EB=A0=A5,=20=EC=A0=80=EC=9E=A5=20?= =?UTF-8?q?=EC=8B=9C=20=EB=84=98=EC=96=B4=EA=B0=80=EB=8A=94=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=ED=95=84?= =?UTF-8?q?=EC=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/(with-layout)/apply/register/page.tsx | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/apps/dm_new/app/(with-layout)/apply/register/page.tsx b/apps/dm_new/app/(with-layout)/apply/register/page.tsx index a82b89726..0b3d24999 100644 --- a/apps/dm_new/app/(with-layout)/apply/register/page.tsx +++ b/apps/dm_new/app/(with-layout)/apply/register/page.tsx @@ -15,6 +15,7 @@ import CandidateSiteModal, { type CandidateSite } from "@/components/CandidateSi import { useDmStore} from "@/app/store"; import type { SdmInfoFormData } from "@/app/store/sdmMng"; import SimilarCaseModal, { type SimilarCaseDetail, type SimilarCaseRow } from "@/app/(landing)/reuse/apply/modal/SimilarCaseModal"; +import type { SubsInfo } from "@/app/store/map/type"; type PHRange = { min: string; max: string }; @@ -58,6 +59,7 @@ export default function DemandRegisterPage() { const [cand1, setCand1] = useState(""); const [cand2, setCand2] = useState(""); const [cand3, setCand3] = useState(""); + const [candidateList, setCandidateList] = useState([]); const useTypesData = useDmStore((state) => state.Sdm.useTypesData); const getUseTypesData = useDmStore((state) => state.getUseTypesData); @@ -76,6 +78,28 @@ export default function DemandRegisterPage() { getUseTypesData(); }, [getUseTypesData]); + useEffect(() => { + const handler = (event: MessageEvent) => { + if (!event.data) return; + + if (event.data.type === "SET_SUBS_INFO") { + const list = event.data.payload || []; + + // 최대 3개 + setCand1(list[0]?.ruseUtztnFcltNm || ""); + setCand2(list[1]?.ruseUtztnFcltNm || ""); + setCand3(list[2]?.ruseUtztnFcltNm || ""); + setCandidateList(list); + } + }; + + window.addEventListener("message", handler); + + return () => { + window.removeEventListener("message", handler); + }; + }, []); + // option // 'req':필수 / 'num' : 숫자 / 'num+[숫자] : 자릿수 const validation = (val, text, option :string[]=[] ) => { @@ -226,7 +250,8 @@ export default function DemandRegisterPage() { smll : odor, cdtnv : Number(ec)||null, crmty : Number(color)||null, - rmrk : remark + rmrk : remark, + splyCndtList : candidateList } insertSdmInfoData(payload); }