From 244c597ac9c46d7afd083d05b673defbc556e63e Mon Sep 17 00:00:00 2001 From: SeongHyun Kim Date: Thu, 27 Nov 2025 12:22:39 +0900 Subject: [PATCH] =?UTF-8?q?refactor(admin):=20=ED=85=8C=EC=9D=B4=EB=B8=94?= =?UTF-8?q?=20=ED=83=80=EC=9E=85=20=EA=B4=80=EB=A6=AC=20Entity=20=EC=A1=B0?= =?UTF-8?q?=EC=9D=B8=20UI=20=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Flexbox에서 Grid 레이아웃으로 변경 (160px 200px 250px 1fr) - "상세 설정" 컬럼 제거하고 4개 컬럼 구조로 단순화 - Entity 조인 설정(참조/조인/표시 컬럼)을 입력 타입 컬럼 내 세로 배치 - Select 박스 너비를 192px (w-48)로 통일 - UI 겹침 현상 해결 및 순차적 설정 흐름 개선 --- frontend/app/(main)/admin/tableMng/page.tsx | 246 +++++++++--------- .../text-input/TextInputComponent.tsx | 2 +- 2 files changed, 119 insertions(+), 129 deletions(-) diff --git a/frontend/app/(main)/admin/tableMng/page.tsx b/frontend/app/(main)/admin/tableMng/page.tsx index 2fb83df4..290109f3 100644 --- a/frontend/app/(main)/admin/tableMng/page.tsx +++ b/frontend/app/(main)/admin/tableMng/page.tsx @@ -1108,14 +1108,11 @@ export default function TableManagementPage() { ) : (
{/* 컬럼 헤더 */} -
-
컬럼명
-
라벨
-
입력 타입
-
- 상세 설정 -
-
설명
+
+
컬럼명
+
라벨
+
입력 타입
+
설명
{/* 컬럼 리스트 */} @@ -1132,12 +1129,13 @@ export default function TableManagementPage() { {columns.map((column, index) => (
-
+
{column.columnName}
-
+
handleLabelChange(column.columnName, e.target.value)} @@ -1145,107 +1143,106 @@ export default function TableManagementPage() { className="h-8 text-xs" />
-
- -
-
- {/* 입력 타입이 'code'인 경우 공통코드 선택 */} - {column.inputType === "code" && ( +
+
+ {/* 입력 타입 선택 */} - )} - {/* 입력 타입이 'category'인 경우 2레벨 메뉴 다중 선택 */} - {column.inputType === "category" && ( -
- -
- {secondLevelMenus.length === 0 ? ( -

- 2레벨 메뉴가 없습니다. 메뉴를 선택하지 않으면 모든 메뉴에서 사용 가능합니다. -

- ) : ( - secondLevelMenus.map((menu) => { - // menuObjid를 숫자로 변환하여 비교 - const menuObjidNum = Number(menu.menuObjid); - const isChecked = (column.categoryMenus || []).includes(menuObjidNum); - - return ( -
- { - const currentMenus = column.categoryMenus || []; - const newMenus = e.target.checked - ? [...currentMenus, menuObjidNum] - : currentMenus.filter((id) => id !== menuObjidNum); + {/* 입력 타입이 'code'인 경우 공통코드 선택 */} + {column.inputType === "code" && ( + + )} + {/* 입력 타입이 'category'인 경우 2레벨 메뉴 다중 선택 */} + {column.inputType === "category" && ( +
+ +
+ {secondLevelMenus.length === 0 ? ( +

+ 2레벨 메뉴가 없습니다. 메뉴를 선택하지 않으면 모든 메뉴에서 사용 가능합니다. +

+ ) : ( + secondLevelMenus.map((menu) => { + // menuObjid를 숫자로 변환하여 비교 + const menuObjidNum = Number(menu.menuObjid); + const isChecked = (column.categoryMenus || []).includes(menuObjidNum); + + return ( +
+ { + const currentMenus = column.categoryMenus || []; + const newMenus = e.target.checked + ? [...currentMenus, menuObjidNum] + : currentMenus.filter((id) => id !== menuObjidNum); - setColumns((prev) => - prev.map((col) => - col.columnName === column.columnName - ? { ...col, categoryMenus: newMenus } - : col - ) - ); - }} - className="h-4 w-4 rounded border-gray-300 text-primary focus:ring-2 focus:ring-ring" - /> - -
- ); - }) + setColumns((prev) => + prev.map((col) => + col.columnName === column.columnName + ? { ...col, categoryMenus: newMenus } + : col + ) + ); + }} + className="h-4 w-4 rounded border-gray-300 text-primary focus:ring-2 focus:ring-ring" + /> + +
+ ); + }) + )} +
+ {column.categoryMenus && column.categoryMenus.length > 0 && ( +

+ {column.categoryMenus.length}개 메뉴 선택됨 +

)}
- {column.categoryMenus && column.categoryMenus.length > 0 && ( -

- {column.categoryMenus.length}개 메뉴 선택됨 -

- )} -
- )} - {/* 입력 타입이 'entity'인 경우 참조 테이블 선택 */} - {column.inputType === "entity" && ( -
-
+ )} + {/* 입력 타입이 'entity'인 경우 참조 테이블 선택 */} + {column.inputType === "entity" && ( + <> {/* 참조 테이블 */} -
+
@@ -1255,7 +1252,7 @@ export default function TableManagementPage() { handleDetailSettingsChange(column.columnName, "entity", value) } > - + @@ -1278,7 +1275,7 @@ export default function TableManagementPage() { {/* 조인 컬럼 */} {column.referenceTable && column.referenceTable !== "none" && ( -
+
@@ -1292,7 +1289,7 @@ export default function TableManagementPage() { ) } > - + @@ -1324,7 +1321,7 @@ export default function TableManagementPage() { column.referenceTable !== "none" && column.referenceColumn && column.referenceColumn !== "none" && ( -
+
@@ -1338,7 +1335,7 @@ export default function TableManagementPage() { ) } > - + @@ -1364,37 +1361,29 @@ export default function TableManagementPage() {
)} -
- {/* 설정 완료 표시 */} - {column.referenceTable && - column.referenceTable !== "none" && - column.referenceColumn && - column.referenceColumn !== "none" && - column.displayColumn && - column.displayColumn !== "none" && ( -
- - - {column.columnName} → {column.referenceTable}.{column.displayColumn} - -
- )} -
- )} - {/* 다른 입력 타입인 경우 빈 공간 */} - {column.inputType !== "code" && column.inputType !== "category" && column.inputType !== "entity" && ( -
- - -
- )} + {/* 설정 완료 표시 */} + {column.referenceTable && + column.referenceTable !== "none" && + column.referenceColumn && + column.referenceColumn !== "none" && + column.displayColumn && + column.displayColumn !== "none" && ( +
+ + 설정 완료 +
+ )} + + )} +
-
+
handleColumnChange(index, "description", e.target.value)} placeholder="설명" - className="h-8 text-xs" + className="h-8 w-full text-xs" />
@@ -1585,3 +1574,4 @@ export default function TableManagementPage() {
); } + diff --git a/frontend/lib/registry/components/text-input/TextInputComponent.tsx b/frontend/lib/registry/components/text-input/TextInputComponent.tsx index 4588189b..83b6548e 100644 --- a/frontend/lib/registry/components/text-input/TextInputComponent.tsx +++ b/frontend/lib/registry/components/text-input/TextInputComponent.tsx @@ -734,7 +734,7 @@ export const TextInputComponent: React.FC = ({ ? "전화번호 형식: 010-1234-5678" : isManualMode ? `${component.label} (수동 입력 모드 - 채번 규칙 미적용)` - : component.label + : component.label ? `${component.label}${component.columnName ? ` (${component.columnName})` : ""}` : component.columnName || undefined }