Compare commits
2 Commits
e3b78309fa
...
640351d812
| Author | SHA1 | Date |
|---|---|---|
|
|
640351d812 | |
|
|
348c040e20 |
|
|
@ -1535,7 +1535,7 @@ export const SelectedItemsDetailInputComponent: React.FC<SelectedItemsDetailInpu
|
|||
{/* 🆕 이미 입력된 상세 항목들 표시 */}
|
||||
{editingItem.details.length > 0 && (
|
||||
<div className="space-y-2">
|
||||
<div className="text-xs font-medium">입력된 품번 ({editingItem.details.length}개)</div>
|
||||
<div className="text-xs font-medium">입력된 항목 ({editingItem.details.length}개)</div>
|
||||
{editingItem.details.map((detail, idx) => (
|
||||
<div key={detail.id} className="flex items-center justify-between border rounded p-2 text-xs bg-muted/30">
|
||||
<span>{idx + 1}. {detail[componentConfig.additionalFields?.[0]?.name] || "입력됨"}</span>
|
||||
|
|
@ -1889,7 +1889,7 @@ export const SelectedItemsDetailInputComponent: React.FC<SelectedItemsDetailInpu
|
|||
{/* 🆕 이미 입력된 상세 항목들 표시 */}
|
||||
{editingItem.details.length > 0 && (
|
||||
<div className="space-y-2">
|
||||
<div className="text-xs font-medium">입력된 품번 ({editingItem.details.length}개)</div>
|
||||
<div className="text-xs font-medium">입력된 항목 ({editingItem.details.length}개)</div>
|
||||
{editingItem.details.map((detail, idx) => (
|
||||
<div key={detail.id} className="flex items-center justify-between border rounded p-2 text-xs bg-muted/30">
|
||||
<span>{idx + 1}. {detail[componentConfig.additionalFields?.[0]?.name] || "입력됨"}</span>
|
||||
|
|
@ -1957,15 +1957,9 @@ export const SelectedItemsDetailInputComponent: React.FC<SelectedItemsDetailInpu
|
|||
{index + 1}. {item.originalData[componentConfig.displayColumns?.[0]?.name] || "항목"}
|
||||
</div>
|
||||
<div className="text-xs text-muted-foreground">
|
||||
{componentConfig.displayColumns?.map((col) => item.originalData[col.name]).filter(Boolean).join(" | ")}
|
||||
</div>
|
||||
{/* 입력된 값 표시 */}
|
||||
{item.additionalData && Object.keys(item.additionalData).length > 0 && (
|
||||
<div className="text-xs text-primary mt-1">
|
||||
품번: {item.additionalData.customer_item_name} / 품명: {item.additionalData.customer_item_code}
|
||||
</div>
|
||||
)}
|
||||
{componentConfig.displayColumns?.map((col) => item.originalData[col.name]).filter(Boolean).join(" | ")}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
|
|
|
|||
|
|
@ -60,6 +60,18 @@ export const SplitPanelLayoutComponent: React.FC<SplitPanelLayoutComponentProps>
|
|||
const resizable = componentConfig.resizable ?? true;
|
||||
const minLeftWidth = componentConfig.minLeftWidth || 200;
|
||||
const minRightWidth = componentConfig.minRightWidth || 300;
|
||||
|
||||
// 필드 표시 유틸리티 (하드코딩 제거, 동적으로 작동)
|
||||
const shouldShowField = (fieldName: string): boolean => {
|
||||
const lower = fieldName.toLowerCase();
|
||||
|
||||
// 기본 제외: id, 비밀번호, 토큰, 회사코드
|
||||
if (lower === "id" || lower === "company_code" || lower === "company_name") return false;
|
||||
if (lower.includes("password") || lower.includes("token")) return false;
|
||||
|
||||
// 나머지는 모두 표시!
|
||||
return true;
|
||||
};
|
||||
|
||||
// TableOptions Context
|
||||
const { registerTable, unregisterTable } = useTableOptions();
|
||||
|
|
@ -1690,13 +1702,13 @@ export const SplitPanelLayoutComponent: React.FC<SplitPanelLayoutComponentProps>
|
|||
value: item[leftColumn],
|
||||
});
|
||||
|
||||
// 추가로 다른 의미있는 필드 1-2개 표시 (name, title 등)
|
||||
// 추가로 다른 의미있는 필드 1-2개 표시 (동적)
|
||||
const additionalKeys = Object.keys(item).filter(
|
||||
(k) =>
|
||||
k !== "id" &&
|
||||
k !== "ID" &&
|
||||
k !== leftColumn &&
|
||||
(k.includes("name") || k.includes("title") || k.includes("desc")),
|
||||
shouldShowField(k),
|
||||
);
|
||||
|
||||
if (additionalKeys.length > 0) {
|
||||
|
|
@ -1925,7 +1937,7 @@ export const SplitPanelLayoutComponent: React.FC<SplitPanelLayoutComponentProps>
|
|||
label: rightColumnLabels[col.name] || col.label || col.name,
|
||||
}))
|
||||
: Object.keys(filteredData[0] || {})
|
||||
.filter((key) => !key.toLowerCase().includes("password"))
|
||||
.filter((key) => shouldShowField(key))
|
||||
.slice(0, 5)
|
||||
.map((key) => ({
|
||||
name: key,
|
||||
|
|
@ -2537,9 +2549,9 @@ export const SplitPanelLayoutComponent: React.FC<SplitPanelLayoutComponentProps>
|
|||
</div>
|
||||
));
|
||||
} else {
|
||||
// 설정이 없으면 모든 컬럼 표시 (company_code, company_name 제외)
|
||||
// 설정이 없으면 모든 컬럼 표시 (민감한 필드 제외)
|
||||
return Object.entries(editModalFormData)
|
||||
.filter(([key]) => key !== "company_code" && key !== "company_name")
|
||||
.filter(([key]) => shouldShowField(key))
|
||||
.map(([key, value]) => (
|
||||
<div key={key}>
|
||||
<Label htmlFor={`edit-${key}`} className="text-xs sm:text-sm">
|
||||
|
|
|
|||
Loading…
Reference in New Issue