Merge pull request 'feature/screen-management' (#319) from feature/screen-management into main

Reviewed-on: http://39.117.244.52:3000/kjs/ERP-node/pulls/319
This commit is contained in:
kjs 2025-12-30 17:45:50 +09:00
commit 4ce0411809
2 changed files with 65 additions and 5 deletions

View File

@ -51,17 +51,17 @@ export default function DataFlowPage() {
// 에디터 모드일 때는 레이아웃 없이 전체 화면 사용
if (isEditorMode) {
return (
<div className="fixed inset-0 z-50 bg-background">
<div className="bg-background fixed inset-0 z-50">
<div className="flex h-full flex-col">
{/* 에디터 헤더 */}
<div className="flex items-center gap-4 border-b bg-background p-4">
<div className="bg-background flex items-center gap-4 border-b p-4">
<Button variant="outline" size="sm" onClick={handleBackToList} className="flex items-center gap-2">
<ArrowLeft className="h-4 w-4" />
</Button>
<div>
<h1 className="text-2xl font-bold tracking-tight"> </h1>
<p className="mt-1 text-sm text-muted-foreground">
<p className="text-muted-foreground mt-1 text-sm">
</p>
</div>
@ -77,12 +77,12 @@ export default function DataFlowPage() {
}
return (
<div className="flex min-h-screen flex-col bg-background">
<div className="bg-background flex min-h-screen flex-col">
<div className="space-y-6 p-4 sm:p-6">
{/* 페이지 헤더 */}
<div className="space-y-2 border-b pb-4">
<h1 className="text-3xl font-bold tracking-tight"> </h1>
<p className="text-sm text-muted-foreground"> </p>
<p className="text-muted-foreground text-sm"> </p>
</div>
{/* 플로우 목록 */}

View File

@ -1608,6 +1608,66 @@ export class ButtonActionExecutor {
return { handled: false, success: false };
}
// 🎯 채번 규칙 할당 처리 (저장 시점에 실제 순번 증가)
console.log("🔍 [handleUniversalFormModalTableSectionSave] 채번 규칙 할당 체크 시작");
const fieldsWithNumbering: Record<string, string> = {};
// commonFieldsData와 modalData에서 채번 규칙이 설정된 필드 찾기
for (const [key, value] of Object.entries(modalData)) {
if (key.endsWith("_numberingRuleId") && value) {
const fieldName = key.replace("_numberingRuleId", "");
fieldsWithNumbering[fieldName] = value as string;
console.log(`🎯 [handleUniversalFormModalTableSectionSave] 채번 필드 발견: ${fieldName} → 규칙 ${value}`);
}
}
// formData에서도 확인 (모달 외부에 있을 수 있음)
for (const [key, value] of Object.entries(formData)) {
if (key.endsWith("_numberingRuleId") && value && !fieldsWithNumbering[key.replace("_numberingRuleId", "")]) {
const fieldName = key.replace("_numberingRuleId", "");
fieldsWithNumbering[fieldName] = value as string;
console.log(
`🎯 [handleUniversalFormModalTableSectionSave] 채번 필드 발견 (formData): ${fieldName} → 규칙 ${value}`,
);
}
}
console.log("📋 [handleUniversalFormModalTableSectionSave] 채번 규칙이 설정된 필드:", fieldsWithNumbering);
// 🔥 저장 시점에 allocateCode 호출하여 실제 순번 증가
if (Object.keys(fieldsWithNumbering).length > 0) {
console.log("🎯 [handleUniversalFormModalTableSectionSave] 채번 규칙 할당 시작 (allocateCode 호출)");
const { allocateNumberingCode } = await import("@/lib/api/numberingRule");
for (const [fieldName, ruleId] of Object.entries(fieldsWithNumbering)) {
try {
console.log(
`🔄 [handleUniversalFormModalTableSectionSave] ${fieldName} 필드에 대해 allocateCode 호출: ${ruleId}`,
);
const allocateResult = await allocateNumberingCode(ruleId);
if (allocateResult.success && allocateResult.data?.generatedCode) {
const newCode = allocateResult.data.generatedCode;
console.log(
`✅ [handleUniversalFormModalTableSectionSave] ${fieldName} 새 코드 할당: ${commonFieldsData[fieldName]}${newCode}`,
);
commonFieldsData[fieldName] = newCode;
} else {
console.warn(
`⚠️ [handleUniversalFormModalTableSectionSave] ${fieldName} 코드 할당 실패, 기존 값 유지:`,
allocateResult.error,
);
}
} catch (allocateError) {
console.error(`❌ [handleUniversalFormModalTableSectionSave] ${fieldName} 코드 할당 오류:`, allocateError);
// 오류 시 기존 값 유지
}
}
}
console.log("✅ [handleUniversalFormModalTableSectionSave] 채번 규칙 할당 완료");
try {
// 사용자 정보 추가
if (!context.userId) {