From d0d2eaa2de58a0c33e9a21604b126961403cd69e Mon Sep 17 00:00:00 2001 From: dujinkim Date: Wed, 14 May 2025 06:12:13 +0000 Subject: (최겸) 기술영업 조선, 해양Top, 해양 Hull 아이템 리스트 개발(CRUD, excel import/export/template) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/[lng]/evcp/(evcp)/items-ship/page.tsx | 72 ----------------------------- app/[lng]/evcp/(evcp)/items-tech/layout.tsx | 25 ++++++++++ app/[lng]/evcp/(evcp)/items-tech/page.tsx | 72 +++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+), 72 deletions(-) delete mode 100644 app/[lng]/evcp/(evcp)/items-ship/page.tsx create mode 100644 app/[lng]/evcp/(evcp)/items-tech/layout.tsx create mode 100644 app/[lng]/evcp/(evcp)/items-tech/page.tsx (limited to 'app') diff --git a/app/[lng]/evcp/(evcp)/items-ship/page.tsx b/app/[lng]/evcp/(evcp)/items-ship/page.tsx deleted file mode 100644 index fb6ee965..00000000 --- a/app/[lng]/evcp/(evcp)/items-ship/page.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import * as React from "react" -import { type SearchParams } from "@/types/table" - -import { getValidFilters } from "@/lib/data-table" -import { Skeleton } from "@/components/ui/skeleton" -import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton" -import { Shell } from "@/components/shell" -import { searchParamsCache } from "@/lib/items-ship/validations" -import { getShipbuildingItems } from "@/lib/items-ship/service" -import { ItemsShipTable } from "@/lib/items-ship/table/Items-ship-table" - -interface IndexPageProps { - searchParams: Promise -} - -export default async function IndexPage(props: IndexPageProps) { - const searchParams = await props.searchParams - const search = searchParamsCache.parse(searchParams) - const validFilters = getValidFilters(search.filters) - - // 아이템 타입별 서비스 함수 호출 - - const promises = Promise.all([ - getShipbuildingItems({ - ...search, - filters: validFilters, - }), - ]).then(([result]) => result) - return ( - -
-
-
-

- 조선 아이템 매트릭스 -

-

- Item을 등록하고 관리할 수 있습니다.{" "} - {/* - - 버튼 - - 을 통해 담당자 연락처, 입찰 이력, 계약 이력, 패키지 내용 등을 확인 할 수 있습니다. */} -

-
-
-
- - }> - {/* */} - - - } - > - - -
- ) -} diff --git a/app/[lng]/evcp/(evcp)/items-tech/layout.tsx b/app/[lng]/evcp/(evcp)/items-tech/layout.tsx new file mode 100644 index 00000000..5eb88325 --- /dev/null +++ b/app/[lng]/evcp/(evcp)/items-tech/layout.tsx @@ -0,0 +1,25 @@ +import * as React from "react" +import { ItemTechContainer } from "@/components/items-tech/item-tech-container" +import { Shell } from "@/components/shell" + +// Layout 컴포넌트는 서버 컴포넌트입니다 +export default function ItemsShipLayout({ + children, +}: { + children: React.ReactNode +}) { + // 아이템 타입 정의 + const itemTypes = [ + { id: "ship", name: "조선 아이템" }, + { id: "top", name: "해양 TOP" }, + { id: "hull", name: "해양 HULL" }, + ] + + return ( + + + {children} + + + ) +} diff --git a/app/[lng]/evcp/(evcp)/items-tech/page.tsx b/app/[lng]/evcp/(evcp)/items-tech/page.tsx new file mode 100644 index 00000000..0680f78b --- /dev/null +++ b/app/[lng]/evcp/(evcp)/items-tech/page.tsx @@ -0,0 +1,72 @@ +import * as React from "react" +import { type SearchParams } from "@/types/table" + +import { getValidFilters } from "@/lib/data-table" +import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton" +import { searchParamsCache } from "@/lib/items-tech/validations" +import { getShipbuildingItems, getOffshoreTopItems, getOffshoreHullItems } from "@/lib/items-tech/service" +import { OffshoreTopTable } from "@/lib/items-tech/table/top/offshore-top-table" +import { OffshoreHullTable } from "@/lib/items-tech/table/hull/offshore-hull-table" + +// 대소문자 문제 해결 - 실제 파일명에 맞게 import +import { ItemsShipTable } from "@/lib/items-tech/table/ship/Items-ship-table" + +interface IndexPageProps { + searchParams: Promise +} + +export default async function IndexPage(props: IndexPageProps) { + const searchParams = await props.searchParams + const search = searchParamsCache.parse(searchParams) + const validFilters = getValidFilters(search.filters) + + // URL에서 아이템 타입 가져오기 + const itemType = searchParams.type || "ship" + + return ( + + } + > + {itemType === "ship" && ( + result)} + /> + )} + + {itemType === "top" && ( + result)} + /> + )} + + {itemType === "hull" && ( + result)} + /> + )} + + ) +} -- cgit v1.2.3