라벨명 표시기능
This commit is contained in:
@@ -564,12 +564,17 @@ export default function ScreenDesigner({ selectedScreen, onBackToList }: ScreenD
|
||||
const loadTable = async () => {
|
||||
try {
|
||||
// 선택된 화면의 특정 테이블 정보만 조회 (성능 최적화)
|
||||
const columnsResponse = await tableTypeApi.getColumns(selectedScreen.tableName);
|
||||
const [columnsResponse, tableLabelResponse] = await Promise.all([
|
||||
tableTypeApi.getColumns(selectedScreen.tableName),
|
||||
tableTypeApi.getTableLabel(selectedScreen.tableName),
|
||||
]);
|
||||
|
||||
const columns: ColumnInfo[] = (columnsResponse || []).map((col: any) => ({
|
||||
tableName: col.tableName || selectedScreen.tableName,
|
||||
columnName: col.columnName || col.column_name,
|
||||
columnLabel: col.columnLabel || col.column_label || col.columnName || col.column_name,
|
||||
dataType: col.dataType || col.data_type,
|
||||
// 우선순위: displayName(라벨) > columnLabel > column_label > columnName > column_name
|
||||
columnLabel: col.displayName || col.columnLabel || col.column_label || col.columnName || col.column_name,
|
||||
dataType: col.dataType || col.data_type || col.dbType,
|
||||
webType: col.webType || col.web_type,
|
||||
widgetType: col.widgetType || col.widget_type || col.webType || col.web_type,
|
||||
isNullable: col.isNullable || col.is_nullable,
|
||||
@@ -580,7 +585,8 @@ export default function ScreenDesigner({ selectedScreen, onBackToList }: ScreenD
|
||||
|
||||
const tableInfo: TableInfo = {
|
||||
tableName: selectedScreen.tableName,
|
||||
tableLabel: selectedScreen.tableName, // 필요시 별도 API로 displayName 조회
|
||||
// 테이블 라벨이 있으면 우선 표시, 없으면 테이블명 그대로
|
||||
tableLabel: tableLabelResponse.tableLabel || selectedScreen.tableName,
|
||||
columns: columns,
|
||||
};
|
||||
setTables([tableInfo]); // 단일 테이블 정보만 설정
|
||||
|
||||
Reference in New Issue
Block a user