From 109380b9e5ea1b19936c0cb2fce18b51518f9d59 Mon Sep 17 00:00:00 2001 From: leeheejin Date: Mon, 15 Dec 2025 17:01:04 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EC=9D=B4=EC=A0=9C=20=EB=94=94=EB=B9=84?= =?UTF-8?q?=EC=97=90=20=ED=95=9C=EA=B8=80=EB=A1=9C=20=EC=B6=9C=EB=B0=9C?= =?UTF-8?q?=EC=A7=80=20=EB=AA=A9=EC=A0=81=EC=A7=80=20=EC=A0=80=EC=9E=A5?= =?UTF-8?q?=EB=90=98=EB=8F=84=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LocationSwapSelectorComponent.tsx | 6 +++--- .../lib/registry/components/location-swap-selector/index.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/lib/registry/components/location-swap-selector/LocationSwapSelectorComponent.tsx b/frontend/lib/registry/components/location-swap-selector/LocationSwapSelectorComponent.tsx index 7a693ad5..88e9002a 100644 --- a/frontend/lib/registry/components/location-swap-selector/LocationSwapSelectorComponent.tsx +++ b/frontend/lib/registry/components/location-swap-selector/LocationSwapSelectorComponent.tsx @@ -107,10 +107,10 @@ export function LocationSwapSelectorComponent(props: LocationSwapSelectorProps) const dbTableName = config.dbTableName || "vehicles"; const dbKeyField = config.dbKeyField || "user_id"; - // 기본 옵션 (포항/광양) + // 기본 옵션 (포항/광양) - 한글로 저장 const DEFAULT_OPTIONS: LocationOption[] = [ - { value: "pohang", label: "포항" }, - { value: "gwangyang", label: "광양" }, + { value: "포항", label: "포항" }, + { value: "광양", label: "광양" }, ]; // 상태 diff --git a/frontend/lib/registry/components/location-swap-selector/index.ts b/frontend/lib/registry/components/location-swap-selector/index.ts index c4c30418..7f7447cf 100644 --- a/frontend/lib/registry/components/location-swap-selector/index.ts +++ b/frontend/lib/registry/components/location-swap-selector/index.ts @@ -26,9 +26,9 @@ export const LocationSwapSelectorDefinition = createComponentDefinition({ labelField: "location_name", // 표시 필드 codeCategory: "", // 코드 관리 카테고리 (type이 "code"일 때) staticOptions: [ - { value: "pohang", label: "포항" }, - { value: "gwangyang", label: "광양" }, - ], // 정적 옵션 (type이 "static"일 때) + { value: "포항", label: "포항" }, + { value: "광양", label: "광양" }, + ], // 정적 옵션 (type이 "static"일 때) - 한글로 저장 }, // 필드 매핑 departureField: "departure", // 출발지 저장 필드 From 6ae0778b4cc8cf46c8940e33005954c2eb90c3a4 Mon Sep 17 00:00:00 2001 From: leeheejin Date: Tue, 6 Jan 2026 14:43:57 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=ED=95=84=ED=84=B0=EC=9D=98=20=EB=9D=BC?= =?UTF-8?q?=EB=B2=A8=EB=8F=84=20=EC=BD=94=EB=93=9C=EB=A7=90=EA=B3=A0=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=ED=95=9C=EA=B1=B8=EB=A1=9C=20=EB=82=98?= =?UTF-8?q?=EC=98=A4=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table-list/TableListComponent.tsx | 38 ++++++++++++++----- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/frontend/lib/registry/components/table-list/TableListComponent.tsx b/frontend/lib/registry/components/table-list/TableListComponent.tsx index 7ac521af..5f3f7c8d 100644 --- a/frontend/lib/registry/components/table-list/TableListComponent.tsx +++ b/frontend/lib/registry/components/table-list/TableListComponent.tsx @@ -2250,9 +2250,9 @@ export const TableListComponent: React.FC = ({ // 🆕 편집 모드 진입 placeholder (실제 구현은 visibleColumns 정의 후) const startEditingRef = useRef<() => void>(() => {}); - // 🆕 각 컬럼의 고유값 목록 계산 + // 🆕 각 컬럼의 고유값 목록 계산 (라벨 포함) const columnUniqueValues = useMemo(() => { - const result: Record = {}; + const result: Record> = {}; if (data.length === 0) return result; @@ -2260,16 +2260,34 @@ export const TableListComponent: React.FC = ({ if (column.columnName === "__checkbox__") return; const mappedColumnName = joinColumnMapping[column.columnName] || column.columnName; - const values = new Set(); + // 라벨 컬럼 후보들 (백엔드에서 _name, _label, _value_label 등으로 반환할 수 있음) + const labelColumnCandidates = [ + `${column.columnName}_name`, // 예: division_name + `${column.columnName}_label`, // 예: division_label + `${column.columnName}_value_label`, // 예: division_value_label + ]; + const valuesMap = new Map(); // value -> label data.forEach((row) => { const val = row[mappedColumnName]; if (val !== null && val !== undefined && val !== "") { - values.add(String(val)); + const valueStr = String(val); + // 라벨 컬럼 후보들 중 값이 있는 것 사용, 없으면 원본 값 사용 + let label = valueStr; + for (const labelCol of labelColumnCandidates) { + if (row[labelCol] && row[labelCol] !== "") { + label = String(row[labelCol]); + break; + } + } + valuesMap.set(valueStr, label); } }); - result[column.columnName] = Array.from(values).sort(); + // value-label 쌍으로 저장하고 라벨 기준 정렬 + result[column.columnName] = Array.from(valuesMap.entries()) + .map(([value, label]) => ({ value, label })) + .sort((a, b) => a.label.localeCompare(b.label)); }); return result; @@ -5758,16 +5776,16 @@ export const TableListComponent: React.FC = ({ )}
- {columnUniqueValues[column.columnName]?.slice(0, 50).map((val) => { - const isSelected = headerFilters[column.columnName]?.has(val); + {columnUniqueValues[column.columnName]?.slice(0, 50).map((item) => { + const isSelected = headerFilters[column.columnName]?.has(item.value); return (
toggleHeaderFilter(column.columnName, val)} + onClick={() => toggleHeaderFilter(column.columnName, item.value)} >
= ({ > {isSelected && }
- {val || "(빈 값)"} + {item.label || "(빈 값)"}
); })}