feat: Enhance category column handling and data mapping

- Updated the `getCategoryColumnsByCompany` and `getCategoryColumnsByMenu` functions to exclude reference columns from category column queries, improving data integrity.
- Modified the `TableManagementService` to include `category_ref` in the column management logic, ensuring proper handling of category references during data operations.
- Enhanced the frontend components to support category reference mapping, allowing for better data representation and user interaction.
- Implemented category label conversion in various components to improve the display of category data, ensuring a seamless user experience.
This commit is contained in:
kjs
2026-02-26 11:31:49 +09:00
parent 863ec614f4
commit eb27f01616
16 changed files with 1269 additions and 485 deletions

View File

@@ -897,11 +897,30 @@ export const ButtonPrimaryComponent: React.FC<ButtonPrimaryComponentProps> = ({
}
}
// 4. 매핑 규칙 적용 + 추가 데이터 병합
const mappedData = sourceData.map((row) => {
const mappedRow = applyMappingRules(row, dataTransferConfig.mappingRules || []);
// 4. 매핑 규칙 결정: 멀티 테이블 매핑 또는 레거시 단일 매핑
let effectiveMappingRules: any[] = dataTransferConfig.mappingRules || [];
const sourceTableName = sourceProvider?.tableName;
const multiTableMappings: Array<{ sourceTable: string; mappingRules: any[] }> =
dataTransferConfig.multiTableMappings || [];
if (multiTableMappings.length > 0 && sourceTableName) {
const matchedGroup = multiTableMappings.find((g) => g.sourceTable === sourceTableName);
if (matchedGroup) {
effectiveMappingRules = matchedGroup.mappingRules || [];
console.log(`✅ [ButtonPrimary] 멀티 테이블 매핑 적용: ${sourceTableName}`, effectiveMappingRules);
} else {
console.log(`⚠️ [ButtonPrimary] 소스 테이블 ${sourceTableName}에 대한 매핑 없음, 동일 필드명 자동 매핑`);
effectiveMappingRules = [];
}
} else if (multiTableMappings.length > 0 && !sourceTableName) {
console.log("⚠️ [ButtonPrimary] 소스 테이블 미감지, 첫 번째 매핑 그룹 사용");
effectiveMappingRules = multiTableMappings[0]?.mappingRules || [];
}
const mappedData = sourceData.map((row) => {
const mappedRow = applyMappingRules(row, effectiveMappingRules);
// 추가 데이터를 모든 행에 포함
return {
...mappedRow,
...additionalData,