diff --git a/frontend/components/screen/InteractiveDataTable.tsx b/frontend/components/screen/InteractiveDataTable.tsx index d5c96785..1a6b4991 100644 --- a/frontend/components/screen/InteractiveDataTable.tsx +++ b/frontend/components/screen/InteractiveDataTable.tsx @@ -1775,12 +1775,6 @@ export const InteractiveDataTable: React.FC = ({ case "number": case "decimal": - console.log(`๐Ÿ”ข ์ˆซ์ž ์ปฌ๋Ÿผ ํฌ๋งทํŒ…:`, { - columnName: column.columnName, - widgetType: column.widgetType, - value, - valueType: typeof value, - }); if (value !== null && value !== undefined && value !== "") { const numValue = typeof value === "string" ? parseFloat(value) : value; if (!isNaN(numValue)) { diff --git a/frontend/lib/api/screen.ts b/frontend/lib/api/screen.ts index 695e5a51..3c885a8b 100644 --- a/frontend/lib/api/screen.ts +++ b/frontend/lib/api/screen.ts @@ -242,6 +242,12 @@ export const tableTypeApi = { return data.columns || data || []; }, + // ์ปฌ๋Ÿผ ์ž…๋ ฅ ํƒ€์ž… ์ •๋ณด ์กฐํšŒ + getColumnInputTypes: async (tableName: string): Promise => { + const response = await apiClient.get(`/table-management/tables/${tableName}/web-types`); + return response.data.data || []; + }, + // ์ปฌ๋Ÿผ ์›น ํƒ€์ž… ์„ค์ • setColumnWebType: async ( tableName: string, diff --git a/frontend/lib/registry/components/table-list/TableListComponent.tsx b/frontend/lib/registry/components/table-list/TableListComponent.tsx index 02705896..35920020 100644 --- a/frontend/lib/registry/components/table-list/TableListComponent.tsx +++ b/frontend/lib/registry/components/table-list/TableListComponent.tsx @@ -284,20 +284,29 @@ export const TableListComponent: React.FC = ({ } const columns = await tableTypeApi.getColumns(tableConfig.selectedTable); + + // ์ปฌ๋Ÿผ ์ž…๋ ฅ ํƒ€์ž… ์ •๋ณด ๊ฐ€์ ธ์˜ค๊ธฐ + const inputTypes = await tableTypeApi.getColumnInputTypes(tableConfig.selectedTable); + const inputTypeMap: Record = {}; + inputTypes.forEach((col: any) => { + inputTypeMap[col.columnName] = col.inputType; + }); tableColumnCache.set(cacheKey, { columns, + inputTypes, timestamp: Date.now(), }); const labels: Record = {}; - const meta: Record = {}; + const meta: Record = {}; columns.forEach((col: any) => { labels[col.columnName] = col.displayName || col.comment || col.columnName; meta[col.columnName] = { webType: col.webType, codeCategory: col.codeCategory, + inputType: inputTypeMap[col.columnName], }; }); @@ -619,17 +628,6 @@ export const TableListComponent: React.FC = ({ const formatCellValue = useCallback( (value: any, column: ColumnConfig, rowData?: Record) => { - // ๋””๋ฒ„๊ทธ: ์ฒซ ๋ฒˆ์งธ ๋ฐ์ดํ„ฐ ํ–‰์—์„œ๋งŒ ๋กœ๊ทธ ์ถœ๋ ฅ - if (rowData && Object.keys(rowData)[0]) { - console.log(`๐Ÿ” formatCellValue ํ˜ธ์ถœ:`, { - columnName: column.columnName, - inputType: column.inputType, - format: column.format, - value, - valueType: typeof value, - }); - } - if (value === null || value === undefined) return "-"; // ๐ŸŽฏ ์—”ํ‹ฐํ‹ฐ ์ปฌ๋Ÿผ ํ‘œ์‹œ ์„ค์ •์ด ์žˆ๋Š” ๊ฒฝ์šฐ @@ -658,8 +656,9 @@ export const TableListComponent: React.FC = ({ if (convertedValue !== value) return convertedValue; } - // inputType ๊ธฐ๋ฐ˜ ํฌ๋งทํŒ… (์šฐ์„ ์ˆœ์œ„) - if (column.inputType === "number" || column.inputType === "decimal") { + // inputType ๊ธฐ๋ฐ˜ ํฌ๋งทํŒ… (columnMeta์—์„œ ๊ฐ€์ ธ์˜จ inputType ์šฐ์„ ) + const inputType = meta?.inputType || column.inputType; + if (inputType === "number" || inputType === "decimal") { if (value !== null && value !== undefined && value !== "") { const numValue = typeof value === "string" ? parseFloat(value) : value; if (!isNaN(numValue)) { @@ -670,6 +669,14 @@ export const TableListComponent: React.FC = ({ } switch (column.format) { + case "number": + if (value !== null && value !== undefined && value !== "") { + const numValue = typeof value === "string" ? parseFloat(value) : value; + if (!isNaN(numValue)) { + return numValue.toLocaleString("ko-KR"); + } + } + return String(value); case "date": if (value) { try {