feat: 카테고리 컴포넌트 메뉴 스코프 전환 완료

- 형제 메뉴의 카테고리 컬럼 조회 API 구현
- column_labels 테이블에서 컬럼 라벨 조회
- table_labels 테이블에서 테이블 라벨 조회
- 프론트엔드: 테이블명 대신 테이블 라벨 표시
- 카테고리 값 조회/추가 시 menuObjid 전달
This commit is contained in:
kjs
2025-11-11 15:00:03 +09:00
parent abdb6b17f8
commit 6ebe551caa
2 changed files with 25 additions and 11 deletions

View File

@@ -1655,20 +1655,32 @@ export async function getCategoryColumnsByMenu(
});
}
// 3. 테이블들의 카테고리 타입 컬럼 조회
// 3. 테이블들의 카테고리 타입 컬럼 조회 (테이블 라벨 포함)
logger.info("🔍 카테고리 컬럼 쿼리 준비", { tableNames, companyCode });
const columnsQuery = `
SELECT
table_name AS "tableName",
column_name AS "columnName",
column_label AS "columnLabel",
input_type AS "inputType"
FROM table_type_columns
WHERE table_name = ANY($1)
AND company_code = $2
AND input_type = 'category'
ORDER BY table_name, column_name
ttc.table_name AS "tableName",
COALESCE(
tl.table_label,
initcap(replace(ttc.table_name, '_', ' '))
) AS "tableLabel",
ttc.column_name AS "columnName",
COALESCE(
cl.column_label,
initcap(replace(ttc.column_name, '_', ' '))
) AS "columnLabel",
ttc.input_type AS "inputType"
FROM table_type_columns ttc
LEFT JOIN column_labels cl
ON ttc.table_name = cl.table_name
AND ttc.column_name = cl.column_name
LEFT JOIN table_labels tl
ON ttc.table_name = tl.table_name
WHERE ttc.table_name = ANY($1)
AND ttc.company_code = $2
AND ttc.input_type = 'category'
ORDER BY ttc.table_name, ttc.column_name
`;
logger.info("🔍 카테고리 컬럼 쿼리 실행 중...");