feat(pop): POP 화면 관리 시스템 구현

Backend:
- screen_layouts_pop 테이블용 CRUD API 추가 (getLayoutPop, saveLayoutPop, deleteLayoutPop, getScreenIdsWithPopLayout)
- 멀티테넌시 권한 체크 포함

Frontend API:
- screenApi에 POP 레이아웃 함수 4개 추가

POP 관리 페이지:
- popScreenMngList 신규 생성
- isPop prop으로 미리보기 URL 분기 (/pop/screens/{id})
- CreateScreenModal에서 POP 화면 생성 시 빈 레이아웃 자동 생성

POP 디자이너:
- PopDesigner, PopCanvas, PopPanel, SectionGrid 컴포넌트 구현
- react-dnd로 팔레트→캔버스 드래그앤드롭
- react-grid-layout으로 컴포넌트 자유 배치/리사이즈
- 그리드 단순화: 고정 셀 크기(40px) 기반 자동 계산, 그리드 점 제거
- onLayoutChange를 onDragStop/onResizeStop으로 변경하여 드롭 시 크기 유지
This commit is contained in:
SeongHyun Kim
2026-02-02 15:15:01 +09:00
parent 3fca677f3d
commit 8c045acab3
29 changed files with 5611 additions and 62 deletions

View File

@@ -732,6 +732,90 @@ export const saveLayoutV2 = async (req: AuthenticatedRequest, res: Response) =>
}
};
// ========================================
// POP 레이아웃 관리 (모바일/태블릿)
// ========================================
// POP 레이아웃 조회
export const getLayoutPop = async (req: AuthenticatedRequest, res: Response) => {
try {
const { screenId } = req.params;
const { companyCode, userType } = req.user as any;
const layout = await screenManagementService.getLayoutPop(
parseInt(screenId),
companyCode,
userType
);
res.json({ success: true, data: layout });
} catch (error) {
console.error("POP 레이아웃 조회 실패:", error);
res
.status(500)
.json({ success: false, message: "POP 레이아웃 조회에 실패했습니다." });
}
};
// POP 레이아웃 저장
export const saveLayoutPop = async (req: AuthenticatedRequest, res: Response) => {
try {
const { screenId } = req.params;
const { companyCode, userId } = req.user as any;
const layoutData = req.body;
await screenManagementService.saveLayoutPop(
parseInt(screenId),
layoutData,
companyCode,
userId
);
res.json({ success: true, message: "POP 레이아웃이 저장되었습니다." });
} catch (error) {
console.error("POP 레이아웃 저장 실패:", error);
res
.status(500)
.json({ success: false, message: "POP 레이아웃 저장에 실패했습니다." });
}
};
// POP 레이아웃 삭제
export const deleteLayoutPop = async (req: AuthenticatedRequest, res: Response) => {
try {
const { screenId } = req.params;
const { companyCode } = req.user as any;
await screenManagementService.deleteLayoutPop(
parseInt(screenId),
companyCode
);
res.json({ success: true, message: "POP 레이아웃이 삭제되었습니다." });
} catch (error) {
console.error("POP 레이아웃 삭제 실패:", error);
res
.status(500)
.json({ success: false, message: "POP 레이아웃 삭제에 실패했습니다." });
}
};
// POP 레이아웃 존재하는 화면 ID 목록 조회
export const getScreenIdsWithPopLayout = async (req: AuthenticatedRequest, res: Response) => {
try {
const { companyCode } = req.user as any;
const screenIds = await screenManagementService.getScreenIdsWithPopLayout(companyCode);
res.json({
success: true,
data: screenIds,
count: screenIds.length
});
} catch (error) {
console.error("POP 레이아웃 화면 ID 목록 조회 실패:", error);
res
.status(500)
.json({ success: false, message: "POP 레이아웃 화면 ID 목록 조회에 실패했습니다." });
}
};
// 화면 코드 자동 생성
export const generateScreenCode = async (
req: AuthenticatedRequest,