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.
This commit is contained in:
kjs
2026-04-13 10:36:41 +09:00
parent 72aa401da5
commit f1d01d0eed
7 changed files with 56 additions and 7 deletions
@@ -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<string, string> = { 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) => {
@@ -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<string, string> = { 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) => {
@@ -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<string, string> = { 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) => {
@@ -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<string, string> = { 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) => {
@@ -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<string, string> = { 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) => {
@@ -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<string, string> = { 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) => {
@@ -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<string, string> = { 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) => {