feat: 화면 편집기에서 메뉴 기반 데이터 스코프 적용
- 백엔드: screenManagementService에 getMenuByScreen 함수 추가 - 백엔드: GET /api/screen-management/screens/:id/menu 엔드포인트 추가 - 프론트엔드: screenApi.getScreenMenu() 함수 추가 - ScreenDesigner: 화면 로드 시 menu_objid 자동 조회 - ScreenDesigner: menuObjid를 RealtimePreview와 UnifiedPropertiesPanel에 전달 - UnifiedPropertiesPanel: menuObjid를 DynamicComponentConfigPanel에 전달 이로써 화면 편집기에서 코드/카테고리/채번규칙이 해당 화면이 할당된 메뉴 기준으로 필터링됨
This commit is contained in:
@@ -1547,6 +1547,39 @@ export class ScreenManagementService {
|
||||
return screens.map((screen) => this.mapToScreenDefinition(screen));
|
||||
}
|
||||
|
||||
/**
|
||||
* 화면에 할당된 메뉴 조회 (첫 번째 할당만 반환)
|
||||
* 화면 편집기에서 menuObjid를 가져오기 위해 사용
|
||||
*/
|
||||
async getMenuByScreen(
|
||||
screenId: number,
|
||||
companyCode: string
|
||||
): Promise<{ menuObjid: number; menuName?: string } | null> {
|
||||
const result = await queryOne<{
|
||||
menu_objid: string;
|
||||
menu_name_kor?: string;
|
||||
}>(
|
||||
`SELECT sma.menu_objid, mi.menu_name_kor
|
||||
FROM screen_menu_assignments sma
|
||||
LEFT JOIN menu_info mi ON sma.menu_objid = mi.objid
|
||||
WHERE sma.screen_id = $1
|
||||
AND sma.company_code = $2
|
||||
AND sma.is_active = 'Y'
|
||||
ORDER BY sma.created_at ASC
|
||||
LIMIT 1`,
|
||||
[screenId, companyCode]
|
||||
);
|
||||
|
||||
if (!result) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
menuObjid: parseInt(result.menu_objid),
|
||||
menuName: result.menu_name_kor,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 화면-메뉴 할당 해제 (✅ Raw Query 전환 완료)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user