2025-12-19 15:44:38 +09:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
/**
|
2026-01-28 17:36:19 +09:00
|
|
|
* V2Select 설정 패널
|
2025-12-19 15:44:38 +09:00
|
|
|
* 통합 선택 컴포넌트의 세부 설정을 관리합니다.
|
|
|
|
|
*/
|
|
|
|
|
|
2026-02-26 16:07:15 +09:00
|
|
|
import React, { useState, useEffect, useCallback, useMemo } from "react";
|
2025-12-19 15:44:38 +09:00
|
|
|
import { Label } from "@/components/ui/label";
|
|
|
|
|
import { Input } from "@/components/ui/input";
|
|
|
|
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
|
|
|
|
import { Separator } from "@/components/ui/separator";
|
|
|
|
|
import { Checkbox } from "@/components/ui/checkbox";
|
|
|
|
|
import { Button } from "@/components/ui/button";
|
2026-02-26 16:07:15 +09:00
|
|
|
import { Plus, Trash2, Loader2, Filter } from "lucide-react";
|
2025-12-19 15:44:38 +09:00
|
|
|
import { apiClient } from "@/lib/api/client";
|
2026-02-26 16:07:15 +09:00
|
|
|
import type { V2SelectFilter } from "@/types/v2-components";
|
2025-12-19 15:44:38 +09:00
|
|
|
|
|
|
|
|
interface ColumnOption {
|
|
|
|
|
columnName: string;
|
|
|
|
|
columnLabel: string;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-26 13:45:56 +09:00
|
|
|
interface CategoryValueOption {
|
|
|
|
|
valueCode: string;
|
|
|
|
|
valueLabel: string;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-26 16:07:15 +09:00
|
|
|
const OPERATOR_OPTIONS = [
|
|
|
|
|
{ value: "=", label: "같음 (=)" },
|
|
|
|
|
{ value: "!=", label: "다름 (!=)" },
|
|
|
|
|
{ value: ">", label: "초과 (>)" },
|
|
|
|
|
{ value: "<", label: "미만 (<)" },
|
|
|
|
|
{ value: ">=", label: "이상 (>=)" },
|
|
|
|
|
{ value: "<=", label: "이하 (<=)" },
|
|
|
|
|
{ value: "in", label: "포함 (IN)" },
|
|
|
|
|
{ value: "notIn", label: "미포함 (NOT IN)" },
|
|
|
|
|
{ value: "like", label: "유사 (LIKE)" },
|
|
|
|
|
{ value: "isNull", label: "NULL" },
|
|
|
|
|
{ value: "isNotNull", label: "NOT NULL" },
|
|
|
|
|
] as const;
|
|
|
|
|
|
|
|
|
|
const VALUE_TYPE_OPTIONS = [
|
|
|
|
|
{ value: "static", label: "고정값" },
|
|
|
|
|
{ value: "field", label: "폼 필드 참조" },
|
|
|
|
|
{ value: "user", label: "로그인 사용자" },
|
|
|
|
|
] as const;
|
|
|
|
|
|
|
|
|
|
const USER_FIELD_OPTIONS = [
|
|
|
|
|
{ value: "companyCode", label: "회사코드" },
|
|
|
|
|
{ value: "userId", label: "사용자ID" },
|
|
|
|
|
{ value: "deptCode", label: "부서코드" },
|
|
|
|
|
{ value: "userName", label: "사용자명" },
|
|
|
|
|
] as const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 필터 조건 설정 서브 컴포넌트
|
|
|
|
|
*/
|
|
|
|
|
const FilterConditionsSection: React.FC<{
|
|
|
|
|
filters: V2SelectFilter[];
|
|
|
|
|
columns: ColumnOption[];
|
|
|
|
|
loadingColumns: boolean;
|
|
|
|
|
targetTable: string;
|
|
|
|
|
onFiltersChange: (filters: V2SelectFilter[]) => void;
|
|
|
|
|
}> = ({ filters, columns, loadingColumns, targetTable, onFiltersChange }) => {
|
|
|
|
|
|
|
|
|
|
const addFilter = () => {
|
|
|
|
|
onFiltersChange([
|
|
|
|
|
...filters,
|
|
|
|
|
{ column: "", operator: "=", valueType: "static", value: "" },
|
|
|
|
|
]);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const updateFilter = (index: number, patch: Partial<V2SelectFilter>) => {
|
|
|
|
|
const updated = [...filters];
|
|
|
|
|
updated[index] = { ...updated[index], ...patch };
|
|
|
|
|
|
|
|
|
|
// valueType 변경 시 관련 필드 초기화
|
|
|
|
|
if (patch.valueType) {
|
|
|
|
|
if (patch.valueType === "static") {
|
|
|
|
|
updated[index].fieldRef = undefined;
|
|
|
|
|
updated[index].userField = undefined;
|
|
|
|
|
} else if (patch.valueType === "field") {
|
|
|
|
|
updated[index].value = undefined;
|
|
|
|
|
updated[index].userField = undefined;
|
|
|
|
|
} else if (patch.valueType === "user") {
|
|
|
|
|
updated[index].value = undefined;
|
|
|
|
|
updated[index].fieldRef = undefined;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// isNull/isNotNull 연산자는 값 불필요
|
|
|
|
|
if (patch.operator === "isNull" || patch.operator === "isNotNull") {
|
|
|
|
|
updated[index].value = undefined;
|
|
|
|
|
updated[index].fieldRef = undefined;
|
|
|
|
|
updated[index].userField = undefined;
|
|
|
|
|
updated[index].valueType = "static";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onFiltersChange(updated);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const removeFilter = (index: number) => {
|
|
|
|
|
onFiltersChange(filters.filter((_, i) => i !== index));
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const needsValue = (op: string) => op !== "isNull" && op !== "isNotNull";
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="space-y-3">
|
|
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
<div className="flex items-center gap-1.5">
|
|
|
|
|
<Filter className="h-3.5 w-3.5 text-muted-foreground" />
|
|
|
|
|
<Label className="text-xs font-medium">데이터 필터 조건</Label>
|
|
|
|
|
</div>
|
|
|
|
|
<Button
|
|
|
|
|
type="button"
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="sm"
|
|
|
|
|
onClick={addFilter}
|
|
|
|
|
className="h-6 px-2 text-xs"
|
|
|
|
|
>
|
|
|
|
|
<Plus className="mr-1 h-3 w-3" />
|
|
|
|
|
추가
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<p className="text-muted-foreground text-[10px]">
|
|
|
|
|
{targetTable} 테이블에서 옵션을 불러올 때 적용할 조건
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
{loadingColumns && (
|
|
|
|
|
<div className="text-muted-foreground flex items-center gap-2 text-xs">
|
|
|
|
|
<Loader2 className="h-3 w-3 animate-spin" />
|
|
|
|
|
컬럼 목록 로딩 중...
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{filters.length === 0 && (
|
|
|
|
|
<p className="text-muted-foreground py-2 text-center text-xs">
|
|
|
|
|
필터 조건이 없습니다
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<div className="space-y-3">
|
|
|
|
|
{filters.map((filter, index) => (
|
|
|
|
|
<div key={index} className="space-y-1.5 rounded-md border p-2">
|
|
|
|
|
{/* 행 1: 컬럼 + 연산자 + 삭제 */}
|
|
|
|
|
<div className="flex items-center gap-1.5">
|
|
|
|
|
{/* 컬럼 선택 */}
|
|
|
|
|
<Select
|
|
|
|
|
value={filter.column || ""}
|
|
|
|
|
onValueChange={(v) => updateFilter(index, { column: v })}
|
|
|
|
|
>
|
|
|
|
|
<SelectTrigger className="h-7 flex-1 text-[11px]">
|
|
|
|
|
<SelectValue placeholder="컬럼" />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
{columns.map((col) => (
|
|
|
|
|
<SelectItem key={col.columnName} value={col.columnName}>
|
|
|
|
|
{col.columnLabel}
|
|
|
|
|
</SelectItem>
|
|
|
|
|
))}
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
|
|
|
|
|
|
|
|
|
{/* 연산자 선택 */}
|
|
|
|
|
<Select
|
|
|
|
|
value={filter.operator || "="}
|
|
|
|
|
onValueChange={(v) => updateFilter(index, { operator: v as V2SelectFilter["operator"] })}
|
|
|
|
|
>
|
|
|
|
|
<SelectTrigger className="h-7 w-[90px] shrink-0 text-[11px]">
|
|
|
|
|
<SelectValue />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
{OPERATOR_OPTIONS.map((op) => (
|
|
|
|
|
<SelectItem key={op.value} value={op.value}>
|
|
|
|
|
{op.label}
|
|
|
|
|
</SelectItem>
|
|
|
|
|
))}
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
|
|
|
|
|
|
|
|
|
{/* 삭제 버튼 */}
|
|
|
|
|
<Button
|
|
|
|
|
type="button"
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="sm"
|
|
|
|
|
onClick={() => removeFilter(index)}
|
|
|
|
|
className="text-destructive h-7 w-7 shrink-0 p-0"
|
|
|
|
|
>
|
|
|
|
|
<Trash2 className="h-3 w-3" />
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* 행 2: 값 유형 + 값 입력 (isNull/isNotNull 제외) */}
|
|
|
|
|
{needsValue(filter.operator) && (
|
|
|
|
|
<div className="flex items-center gap-1.5">
|
|
|
|
|
{/* 값 유형 */}
|
|
|
|
|
<Select
|
|
|
|
|
value={filter.valueType || "static"}
|
|
|
|
|
onValueChange={(v) => updateFilter(index, { valueType: v as V2SelectFilter["valueType"] })}
|
|
|
|
|
>
|
|
|
|
|
<SelectTrigger className="h-7 w-[100px] shrink-0 text-[11px]">
|
|
|
|
|
<SelectValue />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
{VALUE_TYPE_OPTIONS.map((vt) => (
|
|
|
|
|
<SelectItem key={vt.value} value={vt.value}>
|
|
|
|
|
{vt.label}
|
|
|
|
|
</SelectItem>
|
|
|
|
|
))}
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
|
|
|
|
|
|
|
|
|
{/* 값 입력 영역 */}
|
|
|
|
|
{(filter.valueType || "static") === "static" && (
|
|
|
|
|
<Input
|
|
|
|
|
value={String(filter.value ?? "")}
|
|
|
|
|
onChange={(e) => updateFilter(index, { value: e.target.value })}
|
|
|
|
|
placeholder={filter.operator === "in" || filter.operator === "notIn" ? "값1, 값2, ..." : "값 입력"}
|
|
|
|
|
className="h-7 flex-1 text-[11px]"
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{filter.valueType === "field" && (
|
|
|
|
|
<Input
|
|
|
|
|
value={filter.fieldRef || ""}
|
|
|
|
|
onChange={(e) => updateFilter(index, { fieldRef: e.target.value })}
|
|
|
|
|
placeholder="참조할 필드명 (columnName)"
|
|
|
|
|
className="h-7 flex-1 text-[11px]"
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{filter.valueType === "user" && (
|
|
|
|
|
<Select
|
|
|
|
|
value={filter.userField || ""}
|
|
|
|
|
onValueChange={(v) => updateFilter(index, { userField: v as V2SelectFilter["userField"] })}
|
|
|
|
|
>
|
|
|
|
|
<SelectTrigger className="h-7 flex-1 text-[11px]">
|
|
|
|
|
<SelectValue placeholder="사용자 필드" />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
{USER_FIELD_OPTIONS.map((uf) => (
|
|
|
|
|
<SelectItem key={uf.value} value={uf.value}>
|
|
|
|
|
{uf.label}
|
|
|
|
|
</SelectItem>
|
|
|
|
|
))}
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2026-01-28 17:36:19 +09:00
|
|
|
interface V2SelectConfigPanelProps {
|
2025-12-19 15:44:38 +09:00
|
|
|
config: Record<string, any>;
|
|
|
|
|
onChange: (config: Record<string, any>) => void;
|
2026-02-26 13:45:56 +09:00
|
|
|
/** 컬럼의 inputType (entity/category 타입 확인용) */
|
2025-12-23 10:49:28 +09:00
|
|
|
inputType?: string;
|
2026-02-26 13:45:56 +09:00
|
|
|
/** 현재 테이블명 (카테고리 값 조회용) */
|
|
|
|
|
tableName?: string;
|
|
|
|
|
/** 현재 컬럼명 (카테고리 값 조회용) */
|
|
|
|
|
columnName?: string;
|
2025-12-19 15:44:38 +09:00
|
|
|
}
|
|
|
|
|
|
2026-02-26 13:45:56 +09:00
|
|
|
export const V2SelectConfigPanel: React.FC<V2SelectConfigPanelProps> = ({
|
|
|
|
|
config,
|
|
|
|
|
onChange,
|
|
|
|
|
inputType,
|
|
|
|
|
tableName,
|
|
|
|
|
columnName,
|
|
|
|
|
}) => {
|
2025-12-23 10:49:28 +09:00
|
|
|
const isEntityType = inputType === "entity";
|
2026-02-26 13:45:56 +09:00
|
|
|
const isCategoryType = inputType === "category";
|
|
|
|
|
|
2025-12-19 15:44:38 +09:00
|
|
|
const [entityColumns, setEntityColumns] = useState<ColumnOption[]>([]);
|
|
|
|
|
const [loadingColumns, setLoadingColumns] = useState(false);
|
|
|
|
|
|
2026-02-26 13:45:56 +09:00
|
|
|
// 카테고리 값 목록
|
|
|
|
|
const [categoryValues, setCategoryValues] = useState<CategoryValueOption[]>([]);
|
|
|
|
|
const [loadingCategoryValues, setLoadingCategoryValues] = useState(false);
|
|
|
|
|
|
2026-02-26 16:07:15 +09:00
|
|
|
// 필터용 컬럼 목록 (옵션 데이터 소스 테이블의 컬럼)
|
|
|
|
|
const [filterColumns, setFilterColumns] = useState<ColumnOption[]>([]);
|
|
|
|
|
const [loadingFilterColumns, setLoadingFilterColumns] = useState(false);
|
|
|
|
|
|
2025-12-19 15:44:38 +09:00
|
|
|
const updateConfig = (field: string, value: any) => {
|
|
|
|
|
onChange({ ...config, [field]: value });
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-26 16:07:15 +09:00
|
|
|
// 필터 대상 테이블 결정
|
|
|
|
|
const filterTargetTable = useMemo(() => {
|
|
|
|
|
const src = config.source || "static";
|
|
|
|
|
if (src === "entity") return config.entityTable;
|
|
|
|
|
if (src === "db") return config.table;
|
|
|
|
|
if (src === "distinct" || src === "select") return tableName;
|
|
|
|
|
return null;
|
|
|
|
|
}, [config.source, config.entityTable, config.table, tableName]);
|
|
|
|
|
|
|
|
|
|
// 필터 대상 테이블의 컬럼 로드
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (!filterTargetTable) {
|
|
|
|
|
setFilterColumns([]);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const loadFilterColumns = async () => {
|
|
|
|
|
setLoadingFilterColumns(true);
|
|
|
|
|
try {
|
|
|
|
|
const response = await apiClient.get(`/table-management/tables/${filterTargetTable}/columns?size=500`);
|
|
|
|
|
const data = response.data.data || response.data;
|
|
|
|
|
const columns = data.columns || data || [];
|
|
|
|
|
setFilterColumns(
|
|
|
|
|
columns.map((col: any) => ({
|
|
|
|
|
columnName: col.columnName || col.column_name || col.name,
|
|
|
|
|
columnLabel: col.displayName || col.display_name || col.columnLabel || col.column_label || col.columnName || col.column_name || col.name,
|
|
|
|
|
}))
|
|
|
|
|
);
|
|
|
|
|
} catch {
|
|
|
|
|
setFilterColumns([]);
|
|
|
|
|
} finally {
|
|
|
|
|
setLoadingFilterColumns(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
loadFilterColumns();
|
|
|
|
|
}, [filterTargetTable]);
|
|
|
|
|
|
2026-02-26 13:45:56 +09:00
|
|
|
// 카테고리 타입이면 source를 자동으로 category로 설정
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (isCategoryType && config.source !== "category") {
|
|
|
|
|
onChange({ ...config, source: "category" });
|
|
|
|
|
}
|
|
|
|
|
}, [isCategoryType]);
|
|
|
|
|
|
|
|
|
|
// 카테고리 값 로드
|
|
|
|
|
const loadCategoryValues = useCallback(async (catTable: string, catColumn: string) => {
|
|
|
|
|
if (!catTable || !catColumn) {
|
|
|
|
|
setCategoryValues([]);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setLoadingCategoryValues(true);
|
|
|
|
|
try {
|
|
|
|
|
const response = await apiClient.get(`/table-categories/${catTable}/${catColumn}/values`);
|
|
|
|
|
const data = response.data;
|
|
|
|
|
if (data.success && data.data) {
|
|
|
|
|
const flattenTree = (items: any[], depth: number = 0): CategoryValueOption[] => {
|
|
|
|
|
const result: CategoryValueOption[] = [];
|
|
|
|
|
for (const item of items) {
|
|
|
|
|
result.push({
|
|
|
|
|
valueCode: item.valueCode,
|
|
|
|
|
valueLabel: depth > 0 ? `${" ".repeat(depth)}${item.valueLabel}` : item.valueLabel,
|
|
|
|
|
});
|
|
|
|
|
if (item.children && item.children.length > 0) {
|
|
|
|
|
result.push(...flattenTree(item.children, depth + 1));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
};
|
|
|
|
|
setCategoryValues(flattenTree(data.data));
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error("카테고리 값 조회 실패:", error);
|
|
|
|
|
setCategoryValues([]);
|
|
|
|
|
} finally {
|
|
|
|
|
setLoadingCategoryValues(false);
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
// 카테고리 소스일 때 값 로드
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (config.source === "category") {
|
|
|
|
|
const catTable = config.categoryTable || tableName;
|
|
|
|
|
const catColumn = config.categoryColumn || columnName;
|
|
|
|
|
if (catTable && catColumn) {
|
|
|
|
|
loadCategoryValues(catTable, catColumn);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, [config.source, config.categoryTable, config.categoryColumn, tableName, columnName, loadCategoryValues]);
|
|
|
|
|
|
2025-12-19 15:44:38 +09:00
|
|
|
// 엔티티 테이블 변경 시 컬럼 목록 조회
|
2026-02-26 13:45:56 +09:00
|
|
|
const loadEntityColumns = useCallback(async (tblName: string) => {
|
|
|
|
|
if (!tblName) {
|
2025-12-19 15:44:38 +09:00
|
|
|
setEntityColumns([]);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setLoadingColumns(true);
|
|
|
|
|
try {
|
2026-02-26 13:45:56 +09:00
|
|
|
const response = await apiClient.get(`/table-management/tables/${tblName}/columns?size=500`);
|
2025-12-19 15:44:38 +09:00
|
|
|
const data = response.data.data || response.data;
|
|
|
|
|
const columns = data.columns || data || [];
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
|
2025-12-19 15:44:38 +09:00
|
|
|
const columnOptions: ColumnOption[] = columns.map((col: any) => {
|
|
|
|
|
const name = col.columnName || col.column_name || col.name;
|
|
|
|
|
const label = col.displayName || col.display_name || col.columnLabel || col.column_label || name;
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
|
2025-12-19 15:44:38 +09:00
|
|
|
return {
|
|
|
|
|
columnName: name,
|
|
|
|
|
columnLabel: label,
|
|
|
|
|
};
|
|
|
|
|
});
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
|
2025-12-19 15:44:38 +09:00
|
|
|
setEntityColumns(columnOptions);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error("컬럼 목록 조회 실패:", error);
|
|
|
|
|
setEntityColumns([]);
|
|
|
|
|
} finally {
|
|
|
|
|
setLoadingColumns(false);
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (config.source === "entity" && config.entityTable) {
|
|
|
|
|
loadEntityColumns(config.entityTable);
|
|
|
|
|
}
|
|
|
|
|
}, [config.source, config.entityTable, loadEntityColumns]);
|
|
|
|
|
|
|
|
|
|
// 정적 옵션 관리
|
|
|
|
|
const options = config.options || [];
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
|
2025-12-19 15:44:38 +09:00
|
|
|
const addOption = () => {
|
|
|
|
|
const newOptions = [...options, { value: "", label: "" }];
|
|
|
|
|
updateConfig("options", newOptions);
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-09 17:13:26 +09:00
|
|
|
const updateOptionValue = (index: number, value: string) => {
|
2025-12-19 15:44:38 +09:00
|
|
|
const newOptions = [...options];
|
2026-02-09 17:13:26 +09:00
|
|
|
newOptions[index] = { ...newOptions[index], value, label: value };
|
2025-12-19 15:44:38 +09:00
|
|
|
updateConfig("options", newOptions);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const removeOption = (index: number) => {
|
|
|
|
|
const newOptions = options.filter((_: any, i: number) => i !== index);
|
|
|
|
|
updateConfig("options", newOptions);
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-26 13:45:56 +09:00
|
|
|
// 현재 source 결정 (카테고리 타입이면 강제 category)
|
|
|
|
|
const effectiveSource = isCategoryType ? "category" : config.source || "static";
|
|
|
|
|
|
2025-12-19 15:44:38 +09:00
|
|
|
return (
|
|
|
|
|
<div className="space-y-4">
|
|
|
|
|
{/* 선택 모드 */}
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-xs font-medium">선택 모드</Label>
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<Select value={config.mode || "dropdown"} onValueChange={(value) => updateConfig("mode", value)}>
|
2025-12-19 15:44:38 +09:00
|
|
|
<SelectTrigger className="h-8 text-xs">
|
|
|
|
|
<SelectValue placeholder="모드 선택" />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
<SelectItem value="dropdown">드롭다운</SelectItem>
|
2026-02-06 09:15:50 +09:00
|
|
|
<SelectItem value="combobox">콤보박스 (검색)</SelectItem>
|
2025-12-19 15:44:38 +09:00
|
|
|
<SelectItem value="radio">라디오 버튼</SelectItem>
|
|
|
|
|
<SelectItem value="check">체크박스</SelectItem>
|
|
|
|
|
<SelectItem value="tag">태그 선택</SelectItem>
|
2026-02-06 09:15:50 +09:00
|
|
|
<SelectItem value="tagbox">태그박스 (태그+드롭다운)</SelectItem>
|
2025-12-19 15:44:38 +09:00
|
|
|
<SelectItem value="toggle">토글 스위치</SelectItem>
|
|
|
|
|
<SelectItem value="swap">스왑 선택</SelectItem>
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Separator />
|
|
|
|
|
|
|
|
|
|
{/* 데이터 소스 */}
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-xs font-medium">데이터 소스</Label>
|
2026-02-26 13:45:56 +09:00
|
|
|
{isCategoryType ? (
|
|
|
|
|
<div className="bg-muted flex h-8 items-center rounded-md px-3">
|
|
|
|
|
<span className="text-xs font-medium text-emerald-600">카테고리 (자동 설정)</span>
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<Select value={config.source || "static"} onValueChange={(value) => updateConfig("source", value)}>
|
|
|
|
|
<SelectTrigger className="h-8 text-xs">
|
|
|
|
|
<SelectValue placeholder="소스 선택" />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
<SelectItem value="static">정적 옵션</SelectItem>
|
|
|
|
|
<SelectItem value="code">공통 코드</SelectItem>
|
|
|
|
|
<SelectItem value="category">카테고리</SelectItem>
|
|
|
|
|
{isEntityType && <SelectItem value="entity">엔티티</SelectItem>}
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
|
|
|
|
)}
|
2025-12-19 15:44:38 +09:00
|
|
|
</div>
|
|
|
|
|
|
2026-02-26 13:45:56 +09:00
|
|
|
{/* 카테고리 설정 */}
|
|
|
|
|
{effectiveSource === "category" && (
|
|
|
|
|
<div className="space-y-3">
|
|
|
|
|
<div className="space-y-1">
|
|
|
|
|
<Label className="text-xs font-medium">카테고리 정보</Label>
|
|
|
|
|
<div className="bg-muted rounded-md p-2">
|
|
|
|
|
<div className="grid grid-cols-2 gap-2">
|
|
|
|
|
<div>
|
|
|
|
|
<p className="text-muted-foreground text-[10px]">테이블</p>
|
|
|
|
|
<p className="text-xs font-medium">{config.categoryTable || tableName || "-"}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<p className="text-muted-foreground text-[10px]">컬럼</p>
|
|
|
|
|
<p className="text-xs font-medium">{config.categoryColumn || columnName || "-"}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* 카테고리 값 로딩 중 */}
|
|
|
|
|
{loadingCategoryValues && (
|
|
|
|
|
<div className="text-muted-foreground flex items-center gap-2 text-xs">
|
|
|
|
|
<Loader2 className="h-3 w-3 animate-spin" />
|
|
|
|
|
카테고리 값 로딩 중...
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{/* 카테고리 값 목록 표시 */}
|
|
|
|
|
{categoryValues.length > 0 && (
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-xs font-medium">카테고리 값 ({categoryValues.length}개)</Label>
|
|
|
|
|
<div className="bg-muted max-h-32 space-y-0.5 overflow-y-auto rounded-md p-1.5">
|
|
|
|
|
{categoryValues.map((cv) => (
|
|
|
|
|
<div key={cv.valueCode} className="flex items-center gap-2 px-1.5 py-0.5">
|
|
|
|
|
<span className="text-muted-foreground shrink-0 font-mono text-[10px]">{cv.valueCode}</span>
|
|
|
|
|
<span className="truncate text-xs">{cv.valueLabel}</span>
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{/* 기본값 설정 */}
|
|
|
|
|
{categoryValues.length > 0 && (
|
|
|
|
|
<div className="border-t pt-2">
|
|
|
|
|
<Label className="text-xs font-medium">기본값</Label>
|
|
|
|
|
<Select
|
|
|
|
|
value={config.defaultValue || "_none_"}
|
|
|
|
|
onValueChange={(value) => updateConfig("defaultValue", value === "_none_" ? "" : value)}
|
|
|
|
|
>
|
|
|
|
|
<SelectTrigger className="mt-1 h-8 text-xs">
|
|
|
|
|
<SelectValue placeholder="기본값 선택" />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
<SelectItem value="_none_">선택 안함</SelectItem>
|
|
|
|
|
{categoryValues.map((cv) => (
|
|
|
|
|
<SelectItem key={cv.valueCode} value={cv.valueCode}>
|
|
|
|
|
{cv.valueLabel}
|
|
|
|
|
</SelectItem>
|
|
|
|
|
))}
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
|
|
|
|
<p className="text-muted-foreground mt-1 text-[10px]">화면 로드 시 자동 선택될 카테고리 값</p>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{/* 카테고리 값 없음 안내 */}
|
|
|
|
|
{!loadingCategoryValues && categoryValues.length === 0 && (
|
|
|
|
|
<p className="text-[10px] text-amber-600">
|
|
|
|
|
카테고리 값이 없습니다. 테이블 카테고리 관리에서 값을 추가해주세요.
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
2025-12-19 15:44:38 +09:00
|
|
|
{/* 정적 옵션 관리 */}
|
2026-02-26 13:45:56 +09:00
|
|
|
{effectiveSource === "static" && (
|
2025-12-19 15:44:38 +09:00
|
|
|
<div className="space-y-2">
|
|
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
<Label className="text-xs font-medium">옵션 목록</Label>
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<Button type="button" variant="ghost" size="sm" onClick={addOption} className="h-6 px-2 text-xs">
|
|
|
|
|
<Plus className="mr-1 h-3 w-3" />
|
2025-12-19 15:44:38 +09:00
|
|
|
추가
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
2026-02-09 17:13:26 +09:00
|
|
|
<div className="max-h-40 space-y-1.5 overflow-y-auto">
|
2025-12-19 15:44:38 +09:00
|
|
|
{options.map((option: any, index: number) => (
|
2026-02-09 17:13:26 +09:00
|
|
|
<div key={index} className="flex items-center gap-1.5">
|
2025-12-19 15:44:38 +09:00
|
|
|
<Input
|
|
|
|
|
value={option.value || ""}
|
2026-02-09 17:13:26 +09:00
|
|
|
onChange={(e) => updateOptionValue(index, e.target.value)}
|
|
|
|
|
placeholder={`옵션 ${index + 1}`}
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
className="h-7 flex-1 text-xs"
|
2025-12-19 15:44:38 +09:00
|
|
|
/>
|
|
|
|
|
<Button
|
|
|
|
|
type="button"
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="sm"
|
|
|
|
|
onClick={() => removeOption(index)}
|
2026-02-09 17:13:26 +09:00
|
|
|
className="text-destructive h-7 w-7 shrink-0 p-0"
|
2025-12-19 15:44:38 +09:00
|
|
|
>
|
|
|
|
|
<Trash2 className="h-3 w-3" />
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
{options.length === 0 && (
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<p className="text-muted-foreground py-2 text-center text-xs">옵션을 추가해주세요</p>
|
2025-12-19 15:44:38 +09:00
|
|
|
)}
|
|
|
|
|
</div>
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
|
2026-02-04 09:28:16 +09:00
|
|
|
{/* 기본값 설정 */}
|
|
|
|
|
{options.length > 0 && (
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<div className="mt-3 border-t pt-2">
|
2026-02-04 09:28:16 +09:00
|
|
|
<Label className="text-xs font-medium">기본값</Label>
|
|
|
|
|
<Select
|
|
|
|
|
value={config.defaultValue || "_none_"}
|
|
|
|
|
onValueChange={(value) => updateConfig("defaultValue", value === "_none_" ? "" : value)}
|
|
|
|
|
>
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<SelectTrigger className="mt-1 h-8 text-xs">
|
2026-02-04 09:28:16 +09:00
|
|
|
<SelectValue placeholder="기본값 선택" />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
<SelectItem value="_none_">선택 안함</SelectItem>
|
|
|
|
|
{options.map((option: any, index: number) => (
|
|
|
|
|
<SelectItem key={`default-${index}`} value={option.value || `_idx_${index}`}>
|
|
|
|
|
{option.label || option.value || `옵션 ${index + 1}`}
|
|
|
|
|
</SelectItem>
|
|
|
|
|
))}
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<p className="text-muted-foreground mt-1 text-[10px]">화면 로드 시 자동 선택될 값</p>
|
2026-02-04 09:28:16 +09:00
|
|
|
</div>
|
|
|
|
|
)}
|
2025-12-19 15:44:38 +09:00
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-02-26 13:45:56 +09:00
|
|
|
{/* 공통 코드 설정 */}
|
|
|
|
|
{effectiveSource === "code" && (
|
2025-12-23 10:49:28 +09:00
|
|
|
<div className="space-y-1">
|
2025-12-19 15:44:38 +09:00
|
|
|
<Label className="text-xs font-medium">코드 그룹</Label>
|
2025-12-23 10:49:28 +09:00
|
|
|
{config.codeGroup ? (
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<p className="text-foreground text-sm font-medium">{config.codeGroup}</p>
|
2025-12-23 10:49:28 +09:00
|
|
|
) : (
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<p className="text-xs text-amber-600">테이블 타입 관리에서 코드 그룹을 설정해주세요</p>
|
2025-12-23 10:49:28 +09:00
|
|
|
)}
|
2025-12-19 15:44:38 +09:00
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{/* 엔티티(참조 테이블) 설정 */}
|
2026-02-26 13:45:56 +09:00
|
|
|
{effectiveSource === "entity" && (
|
2025-12-19 15:44:38 +09:00
|
|
|
<div className="space-y-3">
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-xs font-medium">참조 테이블</Label>
|
|
|
|
|
<Input
|
|
|
|
|
value={config.entityTable || ""}
|
|
|
|
|
readOnly
|
|
|
|
|
disabled
|
|
|
|
|
placeholder="테이블 타입 관리에서 설정"
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
className="bg-muted h-8 text-xs"
|
2025-12-19 15:44:38 +09:00
|
|
|
/>
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<p className="text-muted-foreground text-[10px]">
|
2025-12-19 15:44:38 +09:00
|
|
|
조인할 테이블명 (테이블 타입 관리에서 설정된 경우 자동 입력됨)
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{loadingColumns && (
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<div className="text-muted-foreground flex items-center gap-2 text-xs">
|
2025-12-19 15:44:38 +09:00
|
|
|
<Loader2 className="h-3 w-3 animate-spin" />
|
|
|
|
|
컬럼 목록 로딩 중...
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<div className="grid grid-cols-2 gap-2">
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-xs font-medium">값 컬럼 (코드)</Label>
|
|
|
|
|
{entityColumns.length > 0 ? (
|
|
|
|
|
<Select
|
|
|
|
|
value={config.entityValueColumn || ""}
|
|
|
|
|
onValueChange={(value) => updateConfig("entityValueColumn", value)}
|
|
|
|
|
>
|
|
|
|
|
<SelectTrigger className="h-8 text-xs">
|
|
|
|
|
<SelectValue placeholder="컬럼 선택" />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
{entityColumns.map((col) => (
|
|
|
|
|
<SelectItem key={col.columnName} value={col.columnName}>
|
|
|
|
|
{col.columnLabel || col.columnName}
|
|
|
|
|
</SelectItem>
|
|
|
|
|
))}
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
|
|
|
|
) : (
|
|
|
|
|
<Input
|
|
|
|
|
value={config.entityValueColumn || ""}
|
|
|
|
|
onChange={(e) => updateConfig("entityValueColumn", e.target.value)}
|
|
|
|
|
placeholder="id"
|
|
|
|
|
className="h-8 text-xs"
|
|
|
|
|
/>
|
|
|
|
|
)}
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<p className="text-muted-foreground text-[10px]">저장될 값</p>
|
2025-12-19 15:44:38 +09:00
|
|
|
</div>
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-xs font-medium">표시 컬럼</Label>
|
|
|
|
|
{entityColumns.length > 0 ? (
|
|
|
|
|
<Select
|
|
|
|
|
value={config.entityLabelColumn || ""}
|
|
|
|
|
onValueChange={(value) => updateConfig("entityLabelColumn", value)}
|
|
|
|
|
>
|
|
|
|
|
<SelectTrigger className="h-8 text-xs">
|
|
|
|
|
<SelectValue placeholder="컬럼 선택" />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
{entityColumns.map((col) => (
|
|
|
|
|
<SelectItem key={col.columnName} value={col.columnName}>
|
|
|
|
|
{col.columnLabel || col.columnName}
|
|
|
|
|
</SelectItem>
|
|
|
|
|
))}
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
|
|
|
|
) : (
|
|
|
|
|
<Input
|
|
|
|
|
value={config.entityLabelColumn || ""}
|
|
|
|
|
onChange={(e) => updateConfig("entityLabelColumn", e.target.value)}
|
|
|
|
|
placeholder="name"
|
|
|
|
|
className="h-8 text-xs"
|
|
|
|
|
/>
|
|
|
|
|
)}
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<p className="text-muted-foreground text-[10px]">화면에 표시될 값</p>
|
2025-12-19 15:44:38 +09:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{config.entityTable && !loadingColumns && entityColumns.length === 0 && (
|
|
|
|
|
<p className="text-[10px] text-amber-600">
|
|
|
|
|
테이블 컬럼을 조회할 수 없습니다. 테이블 타입 관리에서 참조 테이블을 설정해주세요.
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
2026-02-25 11:45:28 +09:00
|
|
|
|
|
|
|
|
{config.entityTable && entityColumns.length > 0 && (
|
|
|
|
|
<div className="border-t pt-3">
|
|
|
|
|
<p className="text-muted-foreground text-[10px]">
|
2026-02-26 13:45:56 +09:00
|
|
|
같은 폼에 참조 테이블({config.entityTable})의 컬럼이 배치되어 있으면, 엔티티 선택 시 해당 필드가 자동으로
|
|
|
|
|
채워집니다.
|
2026-02-25 11:45:28 +09:00
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2025-12-19 15:44:38 +09:00
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<Separator />
|
|
|
|
|
|
|
|
|
|
{/* 추가 옵션 */}
|
|
|
|
|
<div className="space-y-3">
|
|
|
|
|
<Label className="text-xs font-medium">추가 옵션</Label>
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
|
2025-12-19 15:44:38 +09:00
|
|
|
<div className="flex items-center space-x-2">
|
|
|
|
|
<Checkbox
|
|
|
|
|
id="multiple"
|
|
|
|
|
checked={config.multiple || false}
|
|
|
|
|
onCheckedChange={(checked) => updateConfig("multiple", checked)}
|
|
|
|
|
/>
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<label htmlFor="multiple" className="text-xs">
|
|
|
|
|
다중 선택 허용
|
|
|
|
|
</label>
|
2025-12-19 15:44:38 +09:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="flex items-center space-x-2">
|
|
|
|
|
<Checkbox
|
|
|
|
|
id="searchable"
|
|
|
|
|
checked={config.searchable || false}
|
|
|
|
|
onCheckedChange={(checked) => updateConfig("searchable", checked)}
|
|
|
|
|
/>
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<label htmlFor="searchable" className="text-xs">
|
|
|
|
|
검색 기능
|
|
|
|
|
</label>
|
2025-12-19 15:44:38 +09:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="flex items-center space-x-2">
|
|
|
|
|
<Checkbox
|
|
|
|
|
id="allowClear"
|
|
|
|
|
checked={config.allowClear !== false}
|
|
|
|
|
onCheckedChange={(checked) => updateConfig("allowClear", checked)}
|
|
|
|
|
/>
|
refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다.
- v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다.
- page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다.
- 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
2026-02-05 17:35:13 +09:00
|
|
|
<label htmlFor="allowClear" className="text-xs">
|
|
|
|
|
값 초기화 허용
|
|
|
|
|
</label>
|
2025-12-19 15:44:38 +09:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* 다중 선택 시 최대 개수 */}
|
|
|
|
|
{config.multiple && (
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-xs font-medium">최대 선택 개수</Label>
|
|
|
|
|
<Input
|
|
|
|
|
type="number"
|
|
|
|
|
value={config.maxSelect ?? ""}
|
|
|
|
|
onChange={(e) => updateConfig("maxSelect", e.target.value ? Number(e.target.value) : undefined)}
|
|
|
|
|
placeholder="제한 없음"
|
|
|
|
|
min="1"
|
|
|
|
|
className="h-8 text-xs"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2026-02-26 16:07:15 +09:00
|
|
|
|
|
|
|
|
{/* 데이터 필터 조건 - static 소스 외 모든 소스에서 사용 */}
|
|
|
|
|
{effectiveSource !== "static" && filterTargetTable && (
|
|
|
|
|
<>
|
|
|
|
|
<Separator />
|
|
|
|
|
<FilterConditionsSection
|
|
|
|
|
filters={(config.filters as V2SelectFilter[]) || []}
|
|
|
|
|
columns={filterColumns}
|
|
|
|
|
loadingColumns={loadingFilterColumns}
|
|
|
|
|
targetTable={filterTargetTable}
|
|
|
|
|
onFiltersChange={(filters) => updateConfig("filters", filters)}
|
|
|
|
|
/>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
2025-12-19 15:44:38 +09:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2026-01-28 17:36:19 +09:00
|
|
|
V2SelectConfigPanel.displayName = "V2SelectConfigPanel";
|
2025-12-19 15:44:38 +09:00
|
|
|
|
2026-01-28 17:36:19 +09:00
|
|
|
export default V2SelectConfigPanel;
|