From 969c25b56f6d29d7ffa4bc2ce04c5fb4e5846b34 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Thu, 14 Aug 2025 11:54:47 +0000 Subject: (대표님) 정규벤더등록, 벤더문서관리, 벤더데이터입력, 첨부파일관리 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/vendor-data/vendor-data-container.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'components/vendor-data/vendor-data-container.tsx') diff --git a/components/vendor-data/vendor-data-container.tsx b/components/vendor-data/vendor-data-container.tsx index 47397c72..a549594c 100644 --- a/components/vendor-data/vendor-data-container.tsx +++ b/components/vendor-data/vendor-data-container.tsx @@ -6,7 +6,7 @@ import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@/componen import { cn } from "@/lib/utils" import { ProjectSwitcher } from "./project-swicher" import { Sidebar } from "./sidebar" -import { usePathname, useRouter, useSearchParams } from "next/navigation" +import { usePathname, useRouter, useSearchParams, useParams } from "next/navigation" import { getFormsByContractItemId, type FormInfo } from "@/lib/forms/services" import { Separator } from "@/components/ui/separator" import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs" @@ -68,6 +68,8 @@ export function VendorDataContainer({ const pathname = usePathname() const router = useRouter() const searchParams = useSearchParams() + const params = useParams() + const currentLng = params?.lng as string || 'en' const tagIdNumber = getTagIdFromPathname(pathname) @@ -127,6 +129,7 @@ export function VendorDataContainer({ return pathname ? getCurrentFormCode(pathname) : null }, [pathname]) + // URL에서 모드가 변경되면 상태도 업데이트 (ship 프로젝트가 아닐 때만) React.useEffect(() => { if (!isShipProject) { @@ -238,7 +241,7 @@ const handleModeChange = async (mode: "IM" | "ENG") => { if (mode === "IM") { // IM 모드: 첫 번째 패키지로 이동 const baseSegments = pathname?.split("/").filter(Boolean).slice(0, pathname.split("/").filter(Boolean).indexOf("vendor-data") + 1).join("/"); - router.push(`/${baseSegments}/tag/${firstPackageId}?mode=${mode}`); + router.push(`/${currentLng}/${baseSegments}/tag/${firstPackageId}?mode=${mode}`); } else { // ENG 모드: 폼 목록을 먼저 로드 setIsLoadingForms(true); @@ -252,11 +255,11 @@ const handleModeChange = async (mode: "IM" | "ENG") => { setSelectedFormCode(firstForm.formCode); const baseSegments = pathname?.split("/").filter(Boolean).slice(0, pathname.split("/").filter(Boolean).indexOf("vendor-data") + 1).join("/"); - router.push(`/${baseSegments}/form/0/${firstForm.formCode}/${selectedProjectId}/${selectedContractId}?mode=${mode}`); + router.push(`/${currentLng}/${baseSegments}/form/0/${firstForm.formCode}/${selectedProjectId}/${selectedContractId}?mode=${mode}`); } else { // 폼이 없으면 모드만 변경 const baseSegments = pathname?.split("/").filter(Boolean).slice(0, pathname.split("/").filter(Boolean).indexOf("vendor-data") + 1).join("/"); - router.push(`/${baseSegments}/form/0/0/${selectedProjectId}/${selectedContractId}?mode=${mode}`); + router.push(`/${currentLng}/${baseSegments}/form/0/0/${selectedProjectId}/${selectedContractId}?mode=${mode}`); } } catch (error) { console.error(`폼 로딩 오류 (${mode} 모드):`, error); -- cgit v1.2.3