diff --git a/frontend/app/(main)/COMPANY_16/master-data/item-info/page.tsx b/frontend/app/(main)/COMPANY_16/master-data/item-info/page.tsx index 5fa81eae..fec0f371 100644 --- a/frontend/app/(main)/COMPANY_16/master-data/item-info/page.tsx +++ b/frontend/app/(main)/COMPANY_16/master-data/item-info/page.tsx @@ -36,6 +36,7 @@ import { Pencil, Copy, Settings2, Check, ChevronsUpDown, } from "lucide-react"; import { Badge } from "@/components/ui/badge"; +import { ImageUpload } from "@/components/common/ImageUpload"; import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command"; import { EDataTable, EDataTableColumn } from "@/components/common/EDataTable"; @@ -88,6 +89,7 @@ const TABLE_NAME = "item_info"; const GRID_COLUMNS = [ { key: "item_number", label: "품목코드" }, { key: "item_name", label: "품명" }, + { key: "image", label: "이미지", type: "image" }, { key: "division", label: "관리품목" }, { key: "type", label: "품목구분" }, { key: "size", label: "규격" }, @@ -122,6 +124,7 @@ const FORM_FIELDS = [ { key: "user_type01", label: "대분류", type: "category" }, { key: "user_type02", label: "중분류", type: "category" }, { key: "lead_time", label: "생산 리드타임(일)", type: "text", placeholder: "숫자 입력 (예: 7)" }, + { key: "image", label: "품목 이미지", type: "image" }, { key: "meno", label: "메모", type: "textarea" }, ]; @@ -407,8 +410,14 @@ export default function ItemInfoPage() { columns={ts.visibleColumns.map((col): EDataTableColumn => ({ key: col.key, label: col.label, - align: col.align as "left" | "center" | "right" | undefined, + align: (col as any).type === "image" ? "center" : col.align as "left" | "center" | "right" | undefined, formatNumber: (col as any).formatNumber, + width: (col as any).type === "image" ? "w-[50px]" : undefined, + render: (col as any).type === "image" ? (val: any) => ( + val ? ( + { (e.target as HTMLImageElement).style.display = "none"; }} /> + ) :
+ ) : undefined, }))} data={ts.groupData(items)} loading={loading} @@ -435,13 +444,22 @@ export default function ItemInfoPage() { {FORM_FIELDS.map((field) => (
- {field.type === "category" ? ( + {field.type === "image" ? ( + setFormData((prev) => ({ ...prev, [field.key]: v }))} + tableName={TABLE_NAME} + recordId={formData.id || ""} + columnName={field.key} + height="h-32" + /> + ) : field.type === "category" ? (