Compare commits

...

3 Commits

Author SHA1 Message Date
hjlee ee273c5103 Merge pull request 'lhj' (#368) from lhj into main
Reviewed-on: http://39.117.244.52:3000/kjs/ERP-node/pulls/368
2026-01-16 16:51:03 +09:00
leeheejin 50a25cb9de Merge branch 'main' of http://39.117.244.52:3000/kjs/ERP-node into lhj
; Please enter a commit message to explain why this merge is necessary,
; especially if it merges an updated upstream into a topic branch.
;
; Lines starting with ';' will be ignored, and an empty message aborts
; the commit.
2026-01-16 16:50:34 +09:00
leeheejin d1631d15ff 안닫히게 수정 2 2026-01-16 16:49:59 +09:00
1 changed files with 14 additions and 4 deletions

View File

@ -267,11 +267,13 @@ export const FieldChooser: React.FC<FieldChooserProps> = ({
const existingConfig = selectedFields.find((f) => f.field === field.field);
if (area === "none") {
// 필드 제거 또는 숨기기
// 🆕 필드 완전 제거 (visible: false 대신 배열에서 제거)
if (existingConfig) {
const newFields = selectedFields.map((f) =>
f.field === field.field ? { ...f, visible: false } : f
);
const newFields = selectedFields.filter((f) => f.field !== field.field);
console.log("🔷 [FieldChooser] 필드 제거:", {
removedField: field.field,
remainingFields: newFields.length,
});
onFieldsChange(newFields);
}
} else {
@ -282,6 +284,10 @@ export const FieldChooser: React.FC<FieldChooserProps> = ({
? { ...f, area, visible: true }
: f
);
console.log("🔷 [FieldChooser] 필드 영역 변경:", {
field: field.field,
newArea: area,
});
onFieldsChange(newFields);
} else {
// 새 필드 추가
@ -294,6 +300,10 @@ export const FieldChooser: React.FC<FieldChooserProps> = ({
summaryType: area === "data" ? "sum" : undefined,
areaIndex: selectedFields.filter((f) => f.area === area).length,
};
console.log("🔷 [FieldChooser] 필드 추가:", {
field: field.field,
area,
});
onFieldsChange([...selectedFields, newField]);
}
}