From f1d01d0eedc7fb72c2e7c8c0c22082727b8724ac Mon Sep 17 00:00:00 2001 From: kjs Date: Mon, 13 Apr 2026 10:36:41 +0900 Subject: [PATCH] feat: Update progress label mapping in work instruction pages - Enhanced the `getProgressLabel` function to utilize a mapping for progress statuses, improving clarity in status representation. - The mapping includes translations for statuses such as "completed", "in_progress", and "pending", ensuring a more user-friendly display across multiple company implementations. - This change aims to improve the overall user experience by providing clearer information regarding work progress. --- .../COMPANY_10/production/work-instruction/page.tsx | 9 ++++++++- .../COMPANY_16/production/work-instruction/page.tsx | 9 ++++++++- .../COMPANY_29/production/work-instruction/page.tsx | 9 ++++++++- .../COMPANY_30/production/work-instruction/page.tsx | 9 ++++++++- .../COMPANY_7/production/work-instruction/page.tsx | 9 ++++++++- .../COMPANY_8/production/work-instruction/page.tsx | 9 ++++++++- .../COMPANY_9/production/work-instruction/page.tsx | 9 ++++++++- 7 files changed, 56 insertions(+), 7 deletions(-) diff --git a/frontend/app/(main)/COMPANY_10/production/work-instruction/page.tsx b/frontend/app/(main)/COMPANY_10/production/work-instruction/page.tsx index 08ace7ec..ef7c2a39 100644 --- a/frontend/app/(main)/COMPANY_10/production/work-instruction/page.tsx +++ b/frontend/app/(main)/COMPANY_10/production/work-instruction/page.tsx @@ -349,7 +349,14 @@ export default function WorkInstructionPage() { const t = Number(o.total_qty || 0), c = Number(o.completed_qty || 0); return t === 0 ? 0 : Math.min(100, Math.round((c / t) * 100)); }; - const getProgressLabel = (o: any) => { const p = getProgress(o); if (o.progress_status) return o.progress_status; if (p >= 100) return "완료"; if (p > 0) return "진행중"; return "대기"; }; + const getProgressLabel = (o: any) => { + const p = getProgress(o); + if (o.progress_status) { + const map: Record = { completed: "완료", in_progress: "진행중", pending: "대기" }; + return map[o.progress_status] || o.progress_status; + } + if (p >= 100) return "완료"; if (p > 0) return "진행중"; return "대기"; + }; const totalRegPages = Math.max(1, Math.ceil(regTotalCount / regPageSize)); const getDisplayNo = (o: any) => { diff --git a/frontend/app/(main)/COMPANY_16/production/work-instruction/page.tsx b/frontend/app/(main)/COMPANY_16/production/work-instruction/page.tsx index 08ace7ec..ef7c2a39 100644 --- a/frontend/app/(main)/COMPANY_16/production/work-instruction/page.tsx +++ b/frontend/app/(main)/COMPANY_16/production/work-instruction/page.tsx @@ -349,7 +349,14 @@ export default function WorkInstructionPage() { const t = Number(o.total_qty || 0), c = Number(o.completed_qty || 0); return t === 0 ? 0 : Math.min(100, Math.round((c / t) * 100)); }; - const getProgressLabel = (o: any) => { const p = getProgress(o); if (o.progress_status) return o.progress_status; if (p >= 100) return "완료"; if (p > 0) return "진행중"; return "대기"; }; + const getProgressLabel = (o: any) => { + const p = getProgress(o); + if (o.progress_status) { + const map: Record = { completed: "완료", in_progress: "진행중", pending: "대기" }; + return map[o.progress_status] || o.progress_status; + } + if (p >= 100) return "완료"; if (p > 0) return "진행중"; return "대기"; + }; const totalRegPages = Math.max(1, Math.ceil(regTotalCount / regPageSize)); const getDisplayNo = (o: any) => { diff --git a/frontend/app/(main)/COMPANY_29/production/work-instruction/page.tsx b/frontend/app/(main)/COMPANY_29/production/work-instruction/page.tsx index 08ace7ec..ef7c2a39 100644 --- a/frontend/app/(main)/COMPANY_29/production/work-instruction/page.tsx +++ b/frontend/app/(main)/COMPANY_29/production/work-instruction/page.tsx @@ -349,7 +349,14 @@ export default function WorkInstructionPage() { const t = Number(o.total_qty || 0), c = Number(o.completed_qty || 0); return t === 0 ? 0 : Math.min(100, Math.round((c / t) * 100)); }; - const getProgressLabel = (o: any) => { const p = getProgress(o); if (o.progress_status) return o.progress_status; if (p >= 100) return "완료"; if (p > 0) return "진행중"; return "대기"; }; + const getProgressLabel = (o: any) => { + const p = getProgress(o); + if (o.progress_status) { + const map: Record = { completed: "완료", in_progress: "진행중", pending: "대기" }; + return map[o.progress_status] || o.progress_status; + } + if (p >= 100) return "완료"; if (p > 0) return "진행중"; return "대기"; + }; const totalRegPages = Math.max(1, Math.ceil(regTotalCount / regPageSize)); const getDisplayNo = (o: any) => { diff --git a/frontend/app/(main)/COMPANY_30/production/work-instruction/page.tsx b/frontend/app/(main)/COMPANY_30/production/work-instruction/page.tsx index 08ace7ec..ef7c2a39 100644 --- a/frontend/app/(main)/COMPANY_30/production/work-instruction/page.tsx +++ b/frontend/app/(main)/COMPANY_30/production/work-instruction/page.tsx @@ -349,7 +349,14 @@ export default function WorkInstructionPage() { const t = Number(o.total_qty || 0), c = Number(o.completed_qty || 0); return t === 0 ? 0 : Math.min(100, Math.round((c / t) * 100)); }; - const getProgressLabel = (o: any) => { const p = getProgress(o); if (o.progress_status) return o.progress_status; if (p >= 100) return "완료"; if (p > 0) return "진행중"; return "대기"; }; + const getProgressLabel = (o: any) => { + const p = getProgress(o); + if (o.progress_status) { + const map: Record = { completed: "완료", in_progress: "진행중", pending: "대기" }; + return map[o.progress_status] || o.progress_status; + } + if (p >= 100) return "완료"; if (p > 0) return "진행중"; return "대기"; + }; const totalRegPages = Math.max(1, Math.ceil(regTotalCount / regPageSize)); const getDisplayNo = (o: any) => { diff --git a/frontend/app/(main)/COMPANY_7/production/work-instruction/page.tsx b/frontend/app/(main)/COMPANY_7/production/work-instruction/page.tsx index 08ace7ec..ef7c2a39 100644 --- a/frontend/app/(main)/COMPANY_7/production/work-instruction/page.tsx +++ b/frontend/app/(main)/COMPANY_7/production/work-instruction/page.tsx @@ -349,7 +349,14 @@ export default function WorkInstructionPage() { const t = Number(o.total_qty || 0), c = Number(o.completed_qty || 0); return t === 0 ? 0 : Math.min(100, Math.round((c / t) * 100)); }; - const getProgressLabel = (o: any) => { const p = getProgress(o); if (o.progress_status) return o.progress_status; if (p >= 100) return "완료"; if (p > 0) return "진행중"; return "대기"; }; + const getProgressLabel = (o: any) => { + const p = getProgress(o); + if (o.progress_status) { + const map: Record = { completed: "완료", in_progress: "진행중", pending: "대기" }; + return map[o.progress_status] || o.progress_status; + } + if (p >= 100) return "완료"; if (p > 0) return "진행중"; return "대기"; + }; const totalRegPages = Math.max(1, Math.ceil(regTotalCount / regPageSize)); const getDisplayNo = (o: any) => { diff --git a/frontend/app/(main)/COMPANY_8/production/work-instruction/page.tsx b/frontend/app/(main)/COMPANY_8/production/work-instruction/page.tsx index 08ace7ec..ef7c2a39 100644 --- a/frontend/app/(main)/COMPANY_8/production/work-instruction/page.tsx +++ b/frontend/app/(main)/COMPANY_8/production/work-instruction/page.tsx @@ -349,7 +349,14 @@ export default function WorkInstructionPage() { const t = Number(o.total_qty || 0), c = Number(o.completed_qty || 0); return t === 0 ? 0 : Math.min(100, Math.round((c / t) * 100)); }; - const getProgressLabel = (o: any) => { const p = getProgress(o); if (o.progress_status) return o.progress_status; if (p >= 100) return "완료"; if (p > 0) return "진행중"; return "대기"; }; + const getProgressLabel = (o: any) => { + const p = getProgress(o); + if (o.progress_status) { + const map: Record = { completed: "완료", in_progress: "진행중", pending: "대기" }; + return map[o.progress_status] || o.progress_status; + } + if (p >= 100) return "완료"; if (p > 0) return "진행중"; return "대기"; + }; const totalRegPages = Math.max(1, Math.ceil(regTotalCount / regPageSize)); const getDisplayNo = (o: any) => { diff --git a/frontend/app/(main)/COMPANY_9/production/work-instruction/page.tsx b/frontend/app/(main)/COMPANY_9/production/work-instruction/page.tsx index 08ace7ec..ef7c2a39 100644 --- a/frontend/app/(main)/COMPANY_9/production/work-instruction/page.tsx +++ b/frontend/app/(main)/COMPANY_9/production/work-instruction/page.tsx @@ -349,7 +349,14 @@ export default function WorkInstructionPage() { const t = Number(o.total_qty || 0), c = Number(o.completed_qty || 0); return t === 0 ? 0 : Math.min(100, Math.round((c / t) * 100)); }; - const getProgressLabel = (o: any) => { const p = getProgress(o); if (o.progress_status) return o.progress_status; if (p >= 100) return "완료"; if (p > 0) return "진행중"; return "대기"; }; + const getProgressLabel = (o: any) => { + const p = getProgress(o); + if (o.progress_status) { + const map: Record = { completed: "완료", in_progress: "진행중", pending: "대기" }; + return map[o.progress_status] || o.progress_status; + } + if (p >= 100) return "완료"; if (p > 0) return "진행중"; return "대기"; + }; const totalRegPages = Math.max(1, Math.ceil(regTotalCount / regPageSize)); const getDisplayNo = (o: any) => {