From b46ce583ad9f246eb48108f4b904e8d42a259c9b Mon Sep 17 00:00:00 2001 From: ysCha Date: Fri, 4 Jul 2025 11:08:44 +0900 Subject: [PATCH] =?UTF-8?q?[1165]=20=EB=8F=84=EB=A9=B4=EC=9D=84=20?= =?UTF-8?q?=EC=97=B4=EA=B3=A0=20=EC=9E=88=EC=9D=84=20=EB=95=8C,=20?= =?UTF-8?q?=EC=83=81=EB=B6=80=20=EB=A9=94=EB=89=B4=EB=A5=BC=20=EB=88=8C?= =?UTF-8?q?=EB=A0=80=EC=9D=84=20=EB=95=8C=EC=9D=98=20=EA=B1=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/header/Header.jsx | 55 +++++++++++++++++++++++++++----- src/locales/ja.json | 1 + src/locales/ko.json | 1 + 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/src/components/header/Header.jsx b/src/components/header/Header.jsx index ef7dfa6c..2e9f297c 100644 --- a/src/components/header/Header.jsx +++ b/src/components/header/Header.jsx @@ -25,6 +25,7 @@ import { isObjectNotEmpty } from '@/util/common-utils' import { roofMaterialsAtom } from '@/store/settingAtom' import { useMasterController } from '@/hooks/common/useMasterController' import { ROOF_MATERIAL_LAYOUT } from '@/components/floor-plan/modal/placementShape/PlacementShapeSetting' +import { useSwal } from '@/hooks/useSwal' export const ToggleonMouse = (e, act, target) => { const listWrap = e.target.closest(target) @@ -75,6 +76,8 @@ export default function Header(props) { const [commonCode, setCommonCode] = useRecoilState(commonCodeState) const { promiseGet } = useAxios() + const { swalFire } = useSwal() + /** * 지붕재 목록 Header에서 조회 */ @@ -232,11 +235,32 @@ export default function Header(props) { key={`${menu.id}`} href={menu.url} replace={true} - onClick={() => { - // moveHome() - removeStuffRecoil(menu) - if (pathName === '/' && menu.id !== 8) { - window.location.reload() + onClick={(e) => { + + if(pathName === '/floor-plan') { + e.preventDefault() // 기본 네비게이션 방지 + e.stopPropagation() // 이벤트 전파 방지 + swalFire({ + text : getMessage(common.link.confirm), // 적절한 확인 메시지 + type : 'confirm', + confirmFn: () => { + // 확인 버튼 클릭 시 실행 + removeStuffRecoil(menu) + if (pathName === '/' && menu.id !== 8) { + window.location.reload() + } else { + router.push(menu.url) + } + router.push(menu.url) + } + }) + } else { + removeStuffRecoil(menu) + if (pathName === '/' && menu.id !== 8) { + window.location.reload() + } else { + router.push(menu.url) + } } }} > @@ -258,9 +282,24 @@ export default function Header(props) { scroll={false} href={m.url} replace={true} - onClick={() => { - removeStuffRecoil(m) - }} + onClick={(e) => { + if(pathName === '/floor-plan') { + e.preventDefault() // 기본 네비게이션 방지 + e.stopPropagation() // 이벤트 전파 방지 + swalFire({ + text: getMessage('common.link.confirm'), // 적절한 확인 메시지 + type: 'confirm', + confirmFn: () => { + // 확인 버튼 클릭 시 기존 로직 실행 + removeStuffRecoil(m) + router.push(m.url) + } + }) + } else { + removeStuffRecoil(m) + } + } + } > {getMessage(m.name)} diff --git a/src/locales/ja.json b/src/locales/ja.json index 8629e287..f27b8d7f 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -565,6 +565,7 @@ "commons.north": "北", "commons.none": "選択しない", "common.type": "分類", + "common.link.confirm": "移動しますか?", "font.style.normal": "通常", "font.style.italic": "イタリック体", "font.style.bold": "太字", diff --git a/src/locales/ko.json b/src/locales/ko.json index 62b60350..3dd00617 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -565,6 +565,7 @@ "commons.north": "북", "commons.none": "선택안함", "common.type": "분류", + "common.link.confirm": "이동 하시겠습니까?", "font.style.normal": "보통", "font.style.italic": "기울임꼴", "font.style.bold": "굵게",