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:
commit
4ce0411809
|
|
@ -51,17 +51,17 @@ export default function DataFlowPage() {
|
||||||
// 에디터 모드일 때는 레이아웃 없이 전체 화면 사용
|
// 에디터 모드일 때는 레이아웃 없이 전체 화면 사용
|
||||||
if (isEditorMode) {
|
if (isEditorMode) {
|
||||||
return (
|
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 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">
|
<Button variant="outline" size="sm" onClick={handleBackToList} className="flex items-center gap-2">
|
||||||
<ArrowLeft className="h-4 w-4" />
|
<ArrowLeft className="h-4 w-4" />
|
||||||
목록으로
|
목록으로
|
||||||
</Button>
|
</Button>
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold tracking-tight">노드 플로우 에디터</h1>
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -77,12 +77,12 @@ export default function DataFlowPage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
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-6 p-4 sm:p-6">
|
||||||
{/* 페이지 헤더 */}
|
{/* 페이지 헤더 */}
|
||||||
<div className="space-y-2 border-b pb-4">
|
<div className="space-y-2 border-b pb-4">
|
||||||
<h1 className="text-3xl font-bold tracking-tight">제어 관리</h1>
|
<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>
|
</div>
|
||||||
|
|
||||||
{/* 플로우 목록 */}
|
{/* 플로우 목록 */}
|
||||||
|
|
|
||||||
|
|
@ -1608,6 +1608,66 @@ export class ButtonActionExecutor {
|
||||||
return { handled: false, success: false };
|
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 {
|
try {
|
||||||
// 사용자 정보 추가
|
// 사용자 정보 추가
|
||||||
if (!context.userId) {
|
if (!context.userId) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue