feat: 카테고리 컴포넌트 메뉴 스코프 전환 완료
- 형제 메뉴의 카테고리 컬럼 조회 API 구현 - column_labels 테이블에서 컬럼 라벨 조회 - table_labels 테이블에서 테이블 라벨 조회 - 프론트엔드: 테이블명 대신 테이블 라벨 표시 - 카테고리 값 조회/추가 시 menuObjid 전달
This commit is contained in:
parent
abdb6b17f8
commit
6ebe551caa
|
|
@ -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("🔍 카테고리 컬럼 쿼리 실행 중...");
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { FolderTree, Loader2 } from "lucide-react";
|
|||
|
||||
interface CategoryColumn {
|
||||
tableName: string;
|
||||
tableLabel?: string; // 테이블 라벨 추가
|
||||
columnName: string;
|
||||
columnLabel: string;
|
||||
inputType: string;
|
||||
|
|
@ -89,6 +90,7 @@ export function CategoryColumnList({ tableName, selectedColumn, onColumnSelect,
|
|||
|
||||
return {
|
||||
tableName: colTable,
|
||||
tableLabel: col.tableLabel || colTable, // 테이블 라벨 추가
|
||||
columnName: colName,
|
||||
columnLabel: colLabel,
|
||||
inputType: col.inputType,
|
||||
|
|
@ -159,7 +161,7 @@ export function CategoryColumnList({ tableName, selectedColumn, onColumnSelect,
|
|||
/>
|
||||
<div className="flex-1">
|
||||
<h4 className="text-sm font-semibold">{column.columnLabel || column.columnName}</h4>
|
||||
<p className="text-muted-foreground text-xs">{column.tableName}</p>
|
||||
<p className="text-muted-foreground text-xs">{column.tableLabel || column.tableName}</p>
|
||||
</div>
|
||||
<span className="text-muted-foreground text-xs font-medium">
|
||||
{column.valueCount !== undefined ? `${column.valueCount}개` : "..."}
|
||||
|
|
|
|||
Loading…
Reference in New Issue