테이블 데이터 필터링 기능 및 textarea컴포넌트 자동 매핑 삭제
This commit is contained in:
@@ -852,6 +852,7 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
search: filters,
|
||||
enableEntityJoin: true,
|
||||
additionalJoinColumns: entityJoinColumns.length > 0 ? entityJoinColumns : undefined,
|
||||
dataFilter: tableConfig.dataFilter, // 🆕 데이터 필터 전달
|
||||
});
|
||||
|
||||
// 실제 데이터의 item_number만 추출하여 중복 확인
|
||||
|
||||
@@ -13,6 +13,7 @@ import { Plus, Trash2, ArrowUp, ArrowDown, ChevronsUpDown, Check } from "lucide-
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
||||
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { DataFilterConfigPanel } from "@/components/screen/config-panels/DataFilterConfigPanel";
|
||||
|
||||
export interface TableListConfigPanelProps {
|
||||
config: TableListConfig;
|
||||
@@ -47,7 +48,7 @@ export const TableListConfigPanel: React.FC<TableListConfigPanelProps> = ({
|
||||
const [availableTables, setAvailableTables] = useState<Array<{ tableName: string; displayName: string }>>([]);
|
||||
const [loadingTables, setLoadingTables] = useState(false);
|
||||
const [availableColumns, setAvailableColumns] = useState<
|
||||
Array<{ columnName: string; dataType: string; label?: string }>
|
||||
Array<{ columnName: string; dataType: string; label?: string; input_type?: string }>
|
||||
>([]);
|
||||
const [entityJoinColumns, setEntityJoinColumns] = useState<{
|
||||
availableColumns: Array<{
|
||||
@@ -157,6 +158,7 @@ export const TableListConfigPanel: React.FC<TableListConfigPanelProps> = ({
|
||||
columnName: column.columnName || column.name,
|
||||
dataType: column.dataType || column.type || "text",
|
||||
label: column.label || column.displayName || column.columnLabel || column.columnName || column.name,
|
||||
input_type: column.input_type || column.inputType, // 🆕 input_type 추가
|
||||
}));
|
||||
setAvailableColumns(mappedColumns);
|
||||
|
||||
@@ -189,6 +191,7 @@ export const TableListConfigPanel: React.FC<TableListConfigPanelProps> = ({
|
||||
columnName: col.columnName,
|
||||
dataType: col.dataType,
|
||||
label: col.displayName || col.columnName,
|
||||
input_type: col.input_type || col.inputType, // 🆕 input_type 추가
|
||||
})),
|
||||
);
|
||||
}
|
||||
@@ -1140,6 +1143,28 @@ export const TableListConfigPanel: React.FC<TableListConfigPanelProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 🆕 데이터 필터링 설정 */}
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<h3 className="text-sm font-semibold">데이터 필터링</h3>
|
||||
<p className="text-xs text-muted-foreground mt-1">
|
||||
특정 컬럼 값으로 데이터를 필터링합니다
|
||||
</p>
|
||||
</div>
|
||||
<hr className="border-border" />
|
||||
<DataFilterConfigPanel
|
||||
tableName={config.selectedTable || screenTableName}
|
||||
columns={availableColumns.map((col) => ({
|
||||
columnName: col.columnName,
|
||||
columnLabel: col.label || col.columnName,
|
||||
dataType: col.dataType,
|
||||
input_type: col.input_type, // 🆕 실제 input_type 전달
|
||||
} as any))}
|
||||
config={config.dataFilter}
|
||||
onConfigChange={(dataFilter) => handleChange("dataFilter", dataFilter)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -173,6 +173,9 @@ export interface CheckboxConfig {
|
||||
/**
|
||||
* TableList 컴포넌트 설정 타입
|
||||
*/
|
||||
|
||||
import { DataFilterConfig } from "@/types/screen-management";
|
||||
|
||||
export interface TableListConfig extends ComponentConfig {
|
||||
// 표시 모드 설정
|
||||
displayMode?: "table" | "card"; // 기본: "table"
|
||||
@@ -225,6 +228,9 @@ export interface TableListConfig extends ComponentConfig {
|
||||
autoLoad: boolean;
|
||||
refreshInterval?: number; // 초 단위
|
||||
|
||||
// 🆕 컬럼 값 기반 데이터 필터링
|
||||
dataFilter?: DataFilterConfig;
|
||||
|
||||
// 이벤트 핸들러
|
||||
onRowClick?: (row: any) => void;
|
||||
onRowDoubleClick?: (row: any) => void;
|
||||
|
||||
Reference in New Issue
Block a user