summaryrefslogtreecommitdiff
path: root/lib/items-tech/table/hull
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-07-17 10:50:52 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-07-17 10:50:52 +0000
commit2ef02e27dbe639876fa3b90c30307dda183545ec (patch)
treee132ae7f3dd774e1ce767291c2849be4a63ae762 /lib/items-tech/table/hull
parentfb276ed3db86fe4fc0c0fcd870fd3d085b034be0 (diff)
(최겸) 기술영업 변경사항 적용
Diffstat (limited to 'lib/items-tech/table/hull')
-rw-r--r--lib/items-tech/table/hull/import-item-handler.tsx10
-rw-r--r--lib/items-tech/table/hull/item-excel-template.tsx10
-rw-r--r--lib/items-tech/table/hull/offshore-hull-table-columns.tsx4
-rw-r--r--lib/items-tech/table/hull/offshore-hull-table-toolbar-actions.tsx8
4 files changed, 10 insertions, 22 deletions
diff --git a/lib/items-tech/table/hull/import-item-handler.tsx b/lib/items-tech/table/hull/import-item-handler.tsx
index aa0c7992..8c8fc57d 100644
--- a/lib/items-tech/table/hull/import-item-handler.tsx
+++ b/lib/items-tech/table/hull/import-item-handler.tsx
@@ -4,11 +4,11 @@ import { z } from "zod"
import { createOffshoreHullItem } from "../../service"
// 해양 HULL 기능(공종) 유형 enum
-const HULL_WORK_TYPES = ["HA", "HE", "HH", "HM", "NC"] as const;
+const HULL_WORK_TYPES = ["HA", "HE", "HH", "HM", "HO", "HP", "NC"] as const;
// 아이템 데이터 검증을 위한 Zod 스키마
const itemSchema = z.object({
- itemCode: z.string().min(1, "아이템 코드는 필수입니다"),
+ itemCode: z.string().optional(),
workType: z.enum(HULL_WORK_TYPES, {
required_error: "기능(공종)은 필수입니다",
}),
@@ -19,7 +19,7 @@ const itemSchema = z.object({
interface ProcessResult {
successCount: number;
errorCount: number;
- errors?: Array<{ row: number; message: string }>;
+ errors: Array<{ row: number; message: string; itemCode?: string; workType?: string }>;
}
/**
@@ -45,7 +45,7 @@ export async function processHullFileImport(
// 데이터 행이 없으면 빈 결과 반환
if (dataRows.length === 0) {
- return { successCount: 0, errorCount: 0 };
+ return { successCount: 0, errorCount: 0, errors: [] };
}
// 각 행에 대해 처리
@@ -89,7 +89,7 @@ export async function processHullFileImport(
// 해양 HULL 아이템 생성
const result = await createOffshoreHullItem({
itemCode: cleanedRow.itemCode,
- workType: cleanedRow.workType as "HA" | "HE" | "HH" | "HM" | "NC",
+ workType: cleanedRow.workType as "HA" | "HE" | "HH" | "HM" | "HO" | "HP" | "NC",
itemList: cleanedRow.itemList,
subItemList: cleanedRow.subItemList,
});
diff --git a/lib/items-tech/table/hull/item-excel-template.tsx b/lib/items-tech/table/hull/item-excel-template.tsx
index 13ec1973..79512b9b 100644
--- a/lib/items-tech/table/hull/item-excel-template.tsx
+++ b/lib/items-tech/table/hull/item-excel-template.tsx
@@ -1,9 +1,6 @@
import * as ExcelJS from 'exceljs';
import { saveAs } from "file-saver";
-// 해양 HULL 기능(공종) 유형
-const HULL_WORK_TYPES = ["HA", "HE", "HH", "HM", "NC"] as const;
-
/**
* 해양 HULL 아이템 데이터 가져오기를 위한 Excel 템플릿 파일 생성 및 다운로드
*/
@@ -79,13 +76,6 @@ export async function exportHullItemTemplate() {
}
});
- // 워크시트에 공종 유형 관련 메모 추가
- const infoRow = worksheet.addRow(['공종 유형 안내: ' + HULL_WORK_TYPES.join(', ')]);
- infoRow.font = { bold: true, color: { argb: 'FF0000FF' } };
- worksheet.mergeCells(`A${infoRow.number}:F${infoRow.number}`);
-
-
-
// 워크시트 보호 (선택적)
worksheet.protect('', {
selectLockedCells: true,
diff --git a/lib/items-tech/table/hull/offshore-hull-table-columns.tsx b/lib/items-tech/table/hull/offshore-hull-table-columns.tsx
index 19782c42..efc6c583 100644
--- a/lib/items-tech/table/hull/offshore-hull-table-columns.tsx
+++ b/lib/items-tech/table/hull/offshore-hull-table-columns.tsx
@@ -162,7 +162,7 @@ export function getOffshoreHullColumns({ setRowAction }: GetColumnsProps): Colum
header: ({ column }) => (
<DataTableColumnHeaderSimple column={column} title="생성일" />
),
- cell: ({ row }) => formatDate(row.original.createdAt, "KR"),
+ cell: ({ row }) => formatDate(row.original.createdAt),
enableSorting: true,
enableHiding: true,
meta: {
@@ -174,7 +174,7 @@ export function getOffshoreHullColumns({ setRowAction }: GetColumnsProps): Colum
header: ({ column }) => (
<DataTableColumnHeaderSimple column={column} title="수정일" />
),
- cell: ({ row }) => formatDate(row.original.updatedAt, "KR"),
+ cell: ({ row }) => formatDate(row.original.updatedAt),
enableSorting: true,
enableHiding: true,
meta: {
diff --git a/lib/items-tech/table/hull/offshore-hull-table-toolbar-actions.tsx b/lib/items-tech/table/hull/offshore-hull-table-toolbar-actions.tsx
index ad6f86b2..642dfea7 100644
--- a/lib/items-tech/table/hull/offshore-hull-table-toolbar-actions.tsx
+++ b/lib/items-tech/table/hull/offshore-hull-table-toolbar-actions.tsx
@@ -70,12 +70,10 @@ export function OffshoreHullTableToolbarActions({ table }: OffshoreHullTableTool
// 필요한 헤더 직접 정의 (필터링 문제 해결)
const headers = [
- { key: 'itemCode', header: '아이템 코드' },
- { key: 'itemName', header: '아이템 명' },
- { key: 'description', header: '설명' },
+ { key: 'itemCode', header: '자재 그룹' },
{ key: 'workType', header: '기능(공종)' },
- { key: 'itemList', header: '아이템 리스트' },
- { key: 'subItemList', header: '서브 아이템 리스트' },
+ { key: 'itemList', header: '자재명' },
+ { key: 'subItemList', header: '자재명(상세)' },
].filter(header => !excludeColumns.includes(header.key));
console.log("내보내기 헤더:", headers);