diff --git a/frontend/lib/registry/components/customer-item-mapping/CustomerItemMappingComponent.tsx b/frontend/lib/registry/components/customer-item-mapping/CustomerItemMappingComponent.tsx index 588c2ed6..a1cd73e5 100644 --- a/frontend/lib/registry/components/customer-item-mapping/CustomerItemMappingComponent.tsx +++ b/frontend/lib/registry/components/customer-item-mapping/CustomerItemMappingComponent.tsx @@ -103,42 +103,48 @@ export const CustomerItemMappingComponent: React.FC

품목 추가 - {finalConfig.selectedTable || "[테이블 선택]"} + {finalConfig.showCompanyName && finalConfig.companyNameColumn && ( + + | {finalConfig.companyNameColumn} + + )}

- {/* 검색/카테고리 영역 - 회색 배경 */} + {/* 검색/카테고리 영역 */} {finalConfig.showSearchArea && ( -
-
-
-
- - - +
+
+ {/* 검색 입력 */} +
+
+
-

- 검색 및 카테고리 필터 영역 -

-

- 나중에 구현 예정 -

+ + {/* 카테고리 필터 */} + {finalConfig.enableCategoryFilter && ( +
+ +
+ )}
)} diff --git a/frontend/lib/registry/components/customer-item-mapping/CustomerItemMappingConfigPanel.tsx b/frontend/lib/registry/components/customer-item-mapping/CustomerItemMappingConfigPanel.tsx index 555d4f57..5aead062 100644 --- a/frontend/lib/registry/components/customer-item-mapping/CustomerItemMappingConfigPanel.tsx +++ b/frontend/lib/registry/components/customer-item-mapping/CustomerItemMappingConfigPanel.tsx @@ -19,11 +19,33 @@ import { Plus, X } from "lucide-react"; export interface CustomerItemMappingConfigPanelProps { config: CustomerItemMappingConfig; onChange: (config: CustomerItemMappingConfig) => void; + onConfigChange?: (config: CustomerItemMappingConfig) => void; + screenTableName?: string; + tableColumns?: any[]; + tables?: any[]; + allTables?: any[]; + onTableChange?: (tableName: string) => void; + menuObjid?: number; } export const CustomerItemMappingConfigPanel: React.FC< CustomerItemMappingConfigPanelProps -> = ({ config, onChange }) => { +> = ({ + config, + onChange, + onConfigChange, + screenTableName, + tableColumns: propTableColumns, + tables: propTables, + allTables, + onTableChange: propOnTableChange, + menuObjid, +}) => { + // onChange와 onConfigChange를 통합 + const handleChange = (newConfig: CustomerItemMappingConfig) => { + onChange?.(newConfig); + onConfigChange?.(newConfig); + }; const [tables, setTables] = useState([]); const [availableColumns, setAvailableColumns] = useState([]); @@ -56,16 +78,18 @@ export const CustomerItemMappingConfigPanel: React.FC< }, [config.selectedTable]); const handleTableChange = (tableName: string) => { - onChange({ + const newConfig = { ...config, selectedTable: tableName, columns: [], // 테이블 변경 시 컬럼 초기화 - }); + }; + handleChange(newConfig); + propOnTableChange?.(tableName); }; const handleAddColumn = (columnName: string) => { if (!config.columns.includes(columnName)) { - onChange({ + handleChange({ ...config, columns: [...config.columns, columnName], }); @@ -73,7 +97,7 @@ export const CustomerItemMappingConfigPanel: React.FC< }; const handleRemoveColumn = (columnName: string) => { - onChange({ + handleChange({ ...config, columns: config.columns.filter((col) => col !== columnName), }); @@ -152,7 +176,7 @@ export const CustomerItemMappingConfigPanel: React.FC< - onChange({ + handleChange({ ...config, checkbox: { ...config.checkbox, @@ -168,7 +192,7 @@ export const CustomerItemMappingConfigPanel: React.FC< - onChange({ + handleChange({ ...config, checkbox: { ...config.checkbox, @@ -184,7 +208,7 @@ export const CustomerItemMappingConfigPanel: React.FC< - onChange({ + handleChange({ ...config, checkbox: { ...config.checkbox, @@ -198,6 +222,52 @@ export const CustomerItemMappingConfigPanel: React.FC<
+ {/* 헤더 설정 */} +
+ + + + {config.showCompanyName && availableColumns.length > 0 && ( +
+ + +

+ 헤더에 표시할 회사명 데이터가 있는 컬럼을 선택하세요 +

+
+ )} +
+ {/* 검색 영역 설정 */}
@@ -206,7 +276,7 @@ export const CustomerItemMappingConfigPanel: React.FC< - onChange({ + handleChange({ ...config, showSearchArea: checked as boolean, }) @@ -218,24 +288,83 @@ export const CustomerItemMappingConfigPanel: React.FC< {config.showSearchArea && ( -
- - - onChange({ - ...config, - searchAreaHeight: parseInt(e.target.value) || 80, - }) - } - min={60} - max={200} - className="h-8 text-xs" - /> -

- 권장: 80-120px (나중에 검색창과 카테고리 필터 추가 예정) -

+
+
+ + + handleChange({ + ...config, + searchPlaceholder: e.target.value, + }) + } + placeholder="품목코드, 품목명, 규격 검색" + className="h-8 text-xs" + /> +
+ + {/* 카테고리 필터 설정 */} +
+ + + {config.enableCategoryFilter && ( +
+ + + handleChange({ + ...config, + categories: e.target.value.split(",").map((c) => c.trim()).filter(Boolean), + }) + } + placeholder="전체, 원자재, 반도체, 완제품" + className="h-8 text-xs" + /> +

+ 예: 전체, 원자재, 반도체, 완제품 +

+ + {availableColumns.length > 0 && ( + <> + + + + )} +
+ )} +
)}
@@ -246,7 +375,7 @@ export const CustomerItemMappingConfigPanel: React.FC< - onChange({ ...config, emptyMessage: e.target.value }) + handleChange({ ...config, emptyMessage: e.target.value }) } placeholder="데이터가 없습니다" /> @@ -257,7 +386,7 @@ export const CustomerItemMappingConfigPanel: React.FC< - onChange({ ...config, emptyDescription: e.target.value }) + handleChange({ ...config, emptyDescription: e.target.value }) } placeholder="품목 데이터가 추가되면 여기에 표시됩니다" /> diff --git a/frontend/lib/registry/components/customer-item-mapping/index.ts b/frontend/lib/registry/components/customer-item-mapping/index.ts index 1de07a05..a0d9d6c9 100644 --- a/frontend/lib/registry/components/customer-item-mapping/index.ts +++ b/frontend/lib/registry/components/customer-item-mapping/index.ts @@ -23,8 +23,14 @@ export const CustomerItemMappingDefinition = createComponentDefinition({ multiple: true, selectAll: true, }, - showSearchArea: false, + showSearchArea: true, // 기본적으로 검색 영역 표시 searchAreaHeight: 80, + searchPlaceholder: "품목코드, 품목명, 규격 검색", + enableCategoryFilter: true, // 기본적으로 카테고리 필터 표시 + categoryColumn: undefined, + categories: ["전체", "원자재", "반도체", "완제품"], + showCompanyName: false, + companyNameColumn: undefined, emptyMessage: "데이터가 없습니다", emptyDescription: "품목 데이터가 추가되면 여기에 표시됩니다", } as CustomerItemMappingConfig, diff --git a/frontend/lib/registry/components/customer-item-mapping/types.ts b/frontend/lib/registry/components/customer-item-mapping/types.ts index 976bb568..68382623 100644 --- a/frontend/lib/registry/components/customer-item-mapping/types.ts +++ b/frontend/lib/registry/components/customer-item-mapping/types.ts @@ -12,9 +12,19 @@ export interface CustomerItemMappingConfig { selectAll: boolean; }; - // 검색/필터 영역 (나중에 추가할 공간) + // 검색/필터 영역 showSearchArea?: boolean; searchAreaHeight?: number; + searchPlaceholder?: string; // 검색 플레이스홀더 + + // 카테고리 필터 + enableCategoryFilter?: boolean; // 카테고리 필터 활성화 + categoryColumn?: string; // 카테고리 데이터 컬럼명 + categories?: string[]; // 카테고리 목록 (예: ["전체", "원자재", "반도체", "완제품"]) + + // 헤더 설정 + showCompanyName?: boolean; // 회사명 표시 여부 + companyNameColumn?: string; // 회사명을 가져올 컬럼명 // 빈 데이터 메시지 emptyMessage?: string;