[as fr] // 0-1. 지자체(ROLE_USER05, ROLE_USER04), 환경청(ROLE_USER03) 사용자인 경우: 병렬 Join 결재 시 MAIN 탭만 호출

This commit is contained in:
2026-10-21 15:16:01 +09:00
parent d0f2e41874
commit b74f2820da
2 changed files with 29 additions and 18 deletions
@@ -3,8 +3,9 @@
본 문서는 ONA 프론트엔드 모노레포 프로젝트(`frontend_as`)에서 **PM2를 활용한 애플리케이션 배포, 실행, 중지 및 모니터링 명령**을 체계적으로 정리한 가이드입니다.
---
pnpm build:common && pnpm build:as && pm2 reload as2-app
pnpm --filter=as... build
pnpm --filter=as... build && pm2 reload as2-app
## 1. 개요 및 아키텍처
- **설정 파일**: 프로젝트 루트의 `ecosystem.config.js`
@@ -100,6 +100,14 @@ function resolveDefaultBranchSeCd({
return "MAIN";
}
// 0-1. 지자체(ROLE_USER05, ROLE_USER04), 환경청(ROLE_USER03) 사용자인 경우: 병렬 Join 결재 시 MAIN 탭만 호출
if (
userRole === "ROLE_USER04" ||
userRole === "ROLE_USER03"
) {
return "MAIN";
}
// 1. TE, SL, RK 상태가 아닌 경우 (예: RB 등): SP, SF 부서 탭이 노출되지 않고 MAIN 탭만 노출되므로 무조건 "MAIN" 고정
// RK 상태는 1차 결재진행상태인 TE 상태와 논리적으로 동일하게 취급되어 부서별(SP, SF) 탭 선택이 유지됨
if (prgrsSttsComCd !== "TE" && prgrsSttsComCd !== "SL" && prgrsSttsComCd !== "RK") {
@@ -285,11 +293,16 @@ function PwrkCnsltnDocMngDialog({
return branches;
}, [elaprBranchList, isForkJoin, supplementDmndBranch]);
const effectiveUserRole = userRole || userInfo?.dtlInstCd;
const isLocalOrEnvUser =
effectiveUserRole === "ROLE_USER04" ||
effectiveUserRole === "ROLE_USER03";
const [currentBranchSeCd, setCurrentBranchSeCd] = useState<string>(() =>
resolveDefaultBranchSeCd({
branchSeCd: effectiveBranchSeCd,
isForkJoin,
userRole,
userRole: effectiveUserRole,
prgrsSttsComCd,
supplementDmndBranch,
supplementBranches,
@@ -303,7 +316,7 @@ function PwrkCnsltnDocMngDialog({
resolveDefaultBranchSeCd({
branchSeCd: effectiveBranchSeCd,
isForkJoin,
userRole,
userRole: effectiveUserRole,
prgrsSttsComCd,
supplementDmndBranch,
supplementBranches,
@@ -315,7 +328,7 @@ function PwrkCnsltnDocMngDialog({
open,
effectiveBranchSeCd,
isForkJoin,
userRole,
effectiveUserRole,
prgrsSttsComCd,
supplementBranches,
supplementDmndBranch,
@@ -535,7 +548,7 @@ function PwrkCnsltnDocMngDialog({
const canSaveCurrentBranch = useMemo(() => {
// 1. 지자체 사용자 (ROLE_USER05)
if (userRole === "ROLE_USER05") {
if (effectiveUserRole === "ROLE_USER05") {
// 1-1. RB(조치결과작성) 상태: 병렬결재에서도 프로세스상 한 개의 MAIN만 남아 처리되므로 MAIN 탭 저장 허용!
if (prgrsSttsComCd === "RB") {
return currentBranchSeCd === "MAIN";
@@ -587,7 +600,7 @@ function PwrkCnsltnDocMngDialog({
return baseCanSave;
}, [
baseCanSave,
userRole,
effectiveUserRole,
prgrsSttsComCd,
isForkJoin,
isFinalApproverAfterMerger,
@@ -622,6 +635,7 @@ function PwrkCnsltnDocMngDialog({
<div className="flex items-center gap-2">
<span className="text-sm font-semibold text-muted-foreground">부서별 문서 탭:</span>
{!isFinalApproverAfterMerger &&
!isLocalOrEnvUser &&
(prgrsSttsComCd === "TE" || prgrsSttsComCd === "SL" || prgrsSttsComCd === "RK") && (
<>
<Button
@@ -652,18 +666,14 @@ function PwrkCnsltnDocMngDialog({
</Button>
</div>
<span className="text-xs text-muted-foreground">
{userRole === "ROLE_USER05"
? prgrsSttsComCd === "RB"
? "지자체 담당자: 종합 실무협의서(MAIN) 조치결과 작성 모드 (저장 가능)"
: isForkJoin && supplementBranches.size > 0
? supplementBranches.has(currentBranchSeCd)
? supplementBranches.size > 1
? `[보완 수정 모드] 관로·시설 부서 모두 보완요청 상태이며, ${currentBranchSeCd === "SP" ? "관로" : "시설"} 초안을 수정 및 저장할 수 있습니다.`
: `[보완 수정 모드] ${supplementBranches.has("SP") ? "관로" : "시설"} 초안만 수정 및 저장 가능합니다.`
: `[읽기 전용 모드] ${currentBranchSeCd === "MAIN" ? "종합본" : currentBranchSeCd === "SP" ? "관로 초안" : "시설 초안"}은 보완 비대상으로 저장 불가합니다.`
: prgrsSttsComCd === "SL"
? `지자체 담당자: ${currentBranchSeCd === "MAIN" ? "종합본 열람 전용" : `${currentBranchSeCd === "SP" ? "관로" : "시설"} 초안 보완 수정 모드 (저장 가능)`}`
: "지자체 사용자: 문서 열람 모드"
{isLocalOrEnvUser
? effectiveUserRole === "ROLE_USER05"
? prgrsSttsComCd === "RB"
? "지자체 담당자: 종합 실무협의서(MAIN) 조치결과 작성 모드 (저장 가능)"
: "지자체 담당자: 종합 실무협의서(MAIN) 열람 모드"
: effectiveUserRole === "ROLE_USER03"
? "환경청 담당자: 종합 실무협의서(MAIN) 열람 모드"
: "문서 열람 모드"
: isFinalApproverAfterMerger
? "최종 승인자: MAIN 종합 실무협의서 열람 모드"
: isMerger || effectiveBranchSeCd === "TOTAL_AGG"