Merge pull request '복사에러 수정' (#309) from feature/screen-management into main

Reviewed-on: http://39.117.244.52:3000/kjs/ERP-node/pulls/309
This commit is contained in:
kjs 2025-12-22 09:53:53 +09:00
commit 01778661ed
1 changed files with 13 additions and 4 deletions

View File

@ -2449,10 +2449,19 @@ export class MenuCopyService {
// menuIdMap에 없으면 원본 menu_objid가 복사된 메뉴 범위 밖이므로 // menuIdMap에 없으면 원본 menu_objid가 복사된 메뉴 범위 밖이므로
// scope_type을 'table'로 변경하거나, 매핑이 없으면 null 처리 // scope_type을 'table'로 변경하거나, 매핑이 없으면 null 처리
const finalMenuObjid = newMenuObjid !== undefined ? newMenuObjid : null; const finalMenuObjid = newMenuObjid !== undefined ? newMenuObjid : null;
const finalScopeType = // scope_type 결정 로직:
r.scope_type === "menu" && finalMenuObjid === null // 1. menu 스코프인데 menu_objid 매핑이 없는 경우
? "table" // 메뉴 매핑이 없으면 table 스코프로 변경 // - table_name이 있으면 'table' 스코프로 변경
: r.scope_type; // - table_name이 없으면 'global' 스코프로 변경
// 2. 그 외에는 원본 scope_type 유지
let finalScopeType = r.scope_type;
if (r.scope_type === "menu" && finalMenuObjid === null) {
if (r.table_name) {
finalScopeType = "table"; // table_name이 있으면 table 스코프
} else {
finalScopeType = "global"; // table_name도 없으면 global 스코프
}
}
return [ return [
r.newRuleId, r.newRuleId,