diff --git a/src/components/production/WorkerScreen/index.tsx b/src/components/production/WorkerScreen/index.tsx index 14f845ff..275aec5e 100644 --- a/src/components/production/WorkerScreen/index.tsx +++ b/src/components/production/WorkerScreen/index.tsx @@ -232,14 +232,37 @@ interface SidebarOrder { quantity: number; shutterCount: number; priority: 'urgent' | 'priority' | 'normal'; + subType?: 'slat' | 'jointbar' | 'bending' | 'wip'; } -const MOCK_SIDEBAR_ORDERS: SidebarOrder[] = [ - { id: 'order-1', siteName: '현장명', date: '2024-09-24', quantity: 7, shutterCount: 5, priority: 'urgent' }, - { id: 'order-2', siteName: '현장명', date: '2024-09-24', quantity: 7, shutterCount: 5, priority: 'priority' }, - { id: 'order-3', siteName: '현장명', date: '2024-09-24', quantity: 7, shutterCount: 5, priority: 'normal' }, - { id: 'order-4', siteName: '현장명', date: '2024-09-24', quantity: 7, shutterCount: 5, priority: 'normal' }, -]; +// 스크린: subType 없음 / 슬랫: slat|jointbar / 절곡: bending|wip +const MOCK_SIDEBAR_ORDERS: Record = { + screen: [ + { id: 'order-s1', siteName: '현장명', date: '2024-09-24', quantity: 7, shutterCount: 5, priority: 'urgent' }, + { id: 'order-s2', siteName: '현장명', date: '2024-09-24', quantity: 7, shutterCount: 5, priority: 'priority' }, + { id: 'order-s3', siteName: '현장명', date: '2024-09-24', quantity: 7, shutterCount: 5, priority: 'normal' }, + { id: 'order-s4', siteName: '현장명', date: '2024-09-24', quantity: 7, shutterCount: 5, priority: 'normal' }, + ], + slat: [ + { id: 'order-l1', siteName: '현장명A', date: '2024-09-24', quantity: 7, shutterCount: 5, priority: 'urgent', subType: 'slat' }, + { id: 'order-l2', siteName: '현장명B', date: '2024-09-24', quantity: 3, shutterCount: 2, priority: 'priority', subType: 'jointbar' }, + { id: 'order-l3', siteName: '현장명C', date: '2024-09-24', quantity: 5, shutterCount: 4, priority: 'normal', subType: 'slat' }, + { id: 'order-l4', siteName: '현장명D', date: '2024-09-24', quantity: 4, shutterCount: 3, priority: 'normal', subType: 'jointbar' }, + ], + bending: [ + { id: 'order-b1', siteName: '현장명A', date: '2024-09-24', quantity: 7, shutterCount: 5, priority: 'urgent', subType: 'bending' }, + { id: 'order-b2', siteName: '현장명B', date: '2024-09-24', quantity: 3, shutterCount: 2, priority: 'priority', subType: 'wip' }, + { id: 'order-b3', siteName: '현장명C', date: '2024-09-24', quantity: 5, shutterCount: 4, priority: 'normal', subType: 'bending' }, + { id: 'order-b4', siteName: '현장명D', date: '2024-09-24', quantity: 4, shutterCount: 3, priority: 'normal', subType: 'wip' }, + ], +}; + +const SUB_TYPE_TAGS: Record = { + slat: { label: '슬랫', className: 'bg-blue-100 text-blue-700' }, + jointbar: { label: '조인트바', className: 'bg-purple-100 text-purple-700' }, + bending: { label: '절곡', className: 'bg-amber-100 text-amber-700' }, + wip: { label: '재공품', className: 'bg-orange-100 text-orange-700' }, +}; const PRIORITY_GROUPS = [ { key: 'urgent' as const, label: '긴급', color: 'text-red-600' }, @@ -811,13 +834,11 @@ export default function WorkerScreen() {
{ + onSelectOrder={(id, subType) => { setSelectedSidebarOrderId(id); + if (subType === 'slat' || subType === 'jointbar') setSlatSubMode(subType === 'jointbar' ? 'jointbar' : 'normal'); + if (subType === 'bending' || subType === 'wip') setBendingSubMode(subType === 'wip' ? 'wip' : 'normal'); setIsSidebarOpen(false); }} /> @@ -833,12 +854,12 @@ export default function WorkerScreen() { { + setSelectedSidebarOrderId(id); + if (subType === 'slat' || subType === 'jointbar') setSlatSubMode(subType === 'jointbar' ? 'jointbar' : 'normal'); + if (subType === 'bending' || subType === 'wip') setBendingSubMode(subType === 'wip' ? 'wip' : 'normal'); + }} /> @@ -1072,110 +1093,58 @@ export default function WorkerScreen() { // ===== 사이드바 컨텐츠 ===== interface SidebarContentProps { tab: ProcessTab; - slatSubMode: 'normal' | 'jointbar'; - setSlatSubMode: (mode: 'normal' | 'jointbar') => void; - bendingSubMode: 'normal' | 'wip'; - setBendingSubMode: (mode: 'normal' | 'wip') => void; selectedOrderId: string; - onSelectOrder: (id: string) => void; + onSelectOrder: (id: string, subType?: SidebarOrder['subType']) => void; } function SidebarContent({ tab, - slatSubMode, - setSlatSubMode, - bendingSubMode, - setBendingSubMode, selectedOrderId, onSelectOrder, }: SidebarContentProps) { + const orders = MOCK_SIDEBAR_ORDERS[tab]; + return (

작업 목록

- {/* 서브 탭: 슬랫 */} - {tab === 'slat' && ( -
- - -
- )} - - {/* 서브 탭: 절곡 */} - {tab === 'bending' && ( -
- - -
- )} - - {/* 우선순위별 작업지시 카드 */} + {/* 우선순위별 작업지시 카드 + 태그 */} {PRIORITY_GROUPS.map((group) => { - const orders = MOCK_SIDEBAR_ORDERS.filter((o) => o.priority === group.key); - if (orders.length === 0) return null; + const groupOrders = orders.filter((o) => o.priority === group.key); + if (groupOrders.length === 0) return null; return (

{group.label}

- {orders.map((order) => ( - - ))} + {groupOrders.map((order) => { + const tag = order.subType ? SUB_TYPE_TAGS[order.subType] : null; + return ( + + ); + })}
);