집계 위젯 구성 패널 개선: AggregationWidgetConfigPanel에서 컬럼 상태를 업데이트하여 inputType 및 webType을 추가하였습니다. 숫자형 컬럼 필터링 로직을 입력 타입에 기반하여 개선하여, 다양한 숫자형 데이터 타입을 지원하도록 하였습니다.
This commit is contained in:
parent
0658ce41f9
commit
901cb04a88
|
|
@ -34,7 +34,7 @@ export function AggregationWidgetConfigPanel({
|
|||
onChange,
|
||||
screenTableName,
|
||||
}: AggregationWidgetConfigPanelProps) {
|
||||
const [columns, setColumns] = useState<Array<{ columnName: string; label?: string; dataType?: string }>>([]);
|
||||
const [columns, setColumns] = useState<Array<{ columnName: string; label?: string; dataType?: string; inputType?: string; webType?: string }>>([]);
|
||||
const [loadingColumns, setLoadingColumns] = useState(false);
|
||||
const [availableTables, setAvailableTables] = useState<Array<{ tableName: string; displayName?: string }>>([]);
|
||||
const [loadingTables, setLoadingTables] = useState(false);
|
||||
|
|
@ -93,6 +93,8 @@ export function AggregationWidgetConfigPanel({
|
|||
columnName: col.columnName || col.column_name,
|
||||
label: col.displayName || col.columnLabel || col.column_label || col.label || col.columnName || col.column_name,
|
||||
dataType: col.dataType || col.data_type,
|
||||
inputType: col.inputType || col.input_type,
|
||||
webType: col.webType || col.web_type,
|
||||
}))
|
||||
);
|
||||
} else {
|
||||
|
|
@ -140,15 +142,19 @@ export function AggregationWidgetConfigPanel({
|
|||
});
|
||||
};
|
||||
|
||||
// 숫자형 컬럼만 필터링 (count 제외)
|
||||
const numericColumns = columns.filter(
|
||||
(col) =>
|
||||
col.dataType?.toLowerCase().includes("int") ||
|
||||
col.dataType?.toLowerCase().includes("numeric") ||
|
||||
col.dataType?.toLowerCase().includes("decimal") ||
|
||||
col.dataType?.toLowerCase().includes("float") ||
|
||||
col.dataType?.toLowerCase().includes("double")
|
||||
);
|
||||
// 숫자형 컬럼만 필터링 (count 제외) - 입력 타입(inputType/webType)으로만 확인
|
||||
const numericColumns = columns.filter((col) => {
|
||||
const inputType = (col.inputType || col.webType || "")?.toLowerCase();
|
||||
|
||||
return (
|
||||
inputType === "number" ||
|
||||
inputType === "decimal" ||
|
||||
inputType === "integer" ||
|
||||
inputType === "float" ||
|
||||
inputType === "currency" ||
|
||||
inputType === "percent"
|
||||
);
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
|
|
|
|||
Loading…
Reference in New Issue