diff --git a/frontend/app/(main)/COMPANY_10/equipment/info/page.tsx b/frontend/app/(main)/COMPANY_10/equipment/info/page.tsx index cd53e9b1..f32273ae 100644 --- a/frontend/app/(main)/COMPANY_10/equipment/info/page.tsx +++ b/frontend/app/(main)/COMPANY_10/equipment/info/page.tsx @@ -624,8 +624,17 @@ export default function EquipmentInfoPage() { {inspections.map((item) => ( { - const std = item.standard_value || ""; - const tol = item.tolerance || ""; + // lower/upper → standard/tolerance 역산 + const lower = item.lower_limit !== "" && item.lower_limit != null ? Number(item.lower_limit) : null; + const upper = item.upper_limit !== "" && item.upper_limit != null ? Number(item.upper_limit) : null; + let std = item.standard_value || ""; + let tol = item.tolerance || ""; + if (lower !== null && upper !== null && !isNaN(lower) && !isNaN(upper)) { + const stdCalc = (lower + upper) / 2; + const tolCalc = (upper - lower) / 2; + std = String(stdCalc); + tol = String(tolCalc); + } setInspectionForm({ ...item, standard_value: std, tolerance: tol }); setInspectionEditMode(true); setInspectionModalOpen(true); diff --git a/frontend/app/(main)/COMPANY_16/equipment/info/page.tsx b/frontend/app/(main)/COMPANY_16/equipment/info/page.tsx index cd53e9b1..f32273ae 100644 --- a/frontend/app/(main)/COMPANY_16/equipment/info/page.tsx +++ b/frontend/app/(main)/COMPANY_16/equipment/info/page.tsx @@ -624,8 +624,17 @@ export default function EquipmentInfoPage() { {inspections.map((item) => ( { - const std = item.standard_value || ""; - const tol = item.tolerance || ""; + // lower/upper → standard/tolerance 역산 + const lower = item.lower_limit !== "" && item.lower_limit != null ? Number(item.lower_limit) : null; + const upper = item.upper_limit !== "" && item.upper_limit != null ? Number(item.upper_limit) : null; + let std = item.standard_value || ""; + let tol = item.tolerance || ""; + if (lower !== null && upper !== null && !isNaN(lower) && !isNaN(upper)) { + const stdCalc = (lower + upper) / 2; + const tolCalc = (upper - lower) / 2; + std = String(stdCalc); + tol = String(tolCalc); + } setInspectionForm({ ...item, standard_value: std, tolerance: tol }); setInspectionEditMode(true); setInspectionModalOpen(true); diff --git a/frontend/app/(main)/COMPANY_29/equipment/info/page.tsx b/frontend/app/(main)/COMPANY_29/equipment/info/page.tsx index cd53e9b1..f32273ae 100644 --- a/frontend/app/(main)/COMPANY_29/equipment/info/page.tsx +++ b/frontend/app/(main)/COMPANY_29/equipment/info/page.tsx @@ -624,8 +624,17 @@ export default function EquipmentInfoPage() { {inspections.map((item) => ( { - const std = item.standard_value || ""; - const tol = item.tolerance || ""; + // lower/upper → standard/tolerance 역산 + const lower = item.lower_limit !== "" && item.lower_limit != null ? Number(item.lower_limit) : null; + const upper = item.upper_limit !== "" && item.upper_limit != null ? Number(item.upper_limit) : null; + let std = item.standard_value || ""; + let tol = item.tolerance || ""; + if (lower !== null && upper !== null && !isNaN(lower) && !isNaN(upper)) { + const stdCalc = (lower + upper) / 2; + const tolCalc = (upper - lower) / 2; + std = String(stdCalc); + tol = String(tolCalc); + } setInspectionForm({ ...item, standard_value: std, tolerance: tol }); setInspectionEditMode(true); setInspectionModalOpen(true); diff --git a/frontend/app/(main)/COMPANY_30/equipment/info/page.tsx b/frontend/app/(main)/COMPANY_30/equipment/info/page.tsx index cd53e9b1..f32273ae 100644 --- a/frontend/app/(main)/COMPANY_30/equipment/info/page.tsx +++ b/frontend/app/(main)/COMPANY_30/equipment/info/page.tsx @@ -624,8 +624,17 @@ export default function EquipmentInfoPage() { {inspections.map((item) => ( { - const std = item.standard_value || ""; - const tol = item.tolerance || ""; + // lower/upper → standard/tolerance 역산 + const lower = item.lower_limit !== "" && item.lower_limit != null ? Number(item.lower_limit) : null; + const upper = item.upper_limit !== "" && item.upper_limit != null ? Number(item.upper_limit) : null; + let std = item.standard_value || ""; + let tol = item.tolerance || ""; + if (lower !== null && upper !== null && !isNaN(lower) && !isNaN(upper)) { + const stdCalc = (lower + upper) / 2; + const tolCalc = (upper - lower) / 2; + std = String(stdCalc); + tol = String(tolCalc); + } setInspectionForm({ ...item, standard_value: std, tolerance: tol }); setInspectionEditMode(true); setInspectionModalOpen(true); diff --git a/frontend/app/(main)/COMPANY_7/equipment/info/page.tsx b/frontend/app/(main)/COMPANY_7/equipment/info/page.tsx index cd53e9b1..f32273ae 100644 --- a/frontend/app/(main)/COMPANY_7/equipment/info/page.tsx +++ b/frontend/app/(main)/COMPANY_7/equipment/info/page.tsx @@ -624,8 +624,17 @@ export default function EquipmentInfoPage() { {inspections.map((item) => ( { - const std = item.standard_value || ""; - const tol = item.tolerance || ""; + // lower/upper → standard/tolerance 역산 + const lower = item.lower_limit !== "" && item.lower_limit != null ? Number(item.lower_limit) : null; + const upper = item.upper_limit !== "" && item.upper_limit != null ? Number(item.upper_limit) : null; + let std = item.standard_value || ""; + let tol = item.tolerance || ""; + if (lower !== null && upper !== null && !isNaN(lower) && !isNaN(upper)) { + const stdCalc = (lower + upper) / 2; + const tolCalc = (upper - lower) / 2; + std = String(stdCalc); + tol = String(tolCalc); + } setInspectionForm({ ...item, standard_value: std, tolerance: tol }); setInspectionEditMode(true); setInspectionModalOpen(true); diff --git a/frontend/app/(main)/COMPANY_8/equipment/info/page.tsx b/frontend/app/(main)/COMPANY_8/equipment/info/page.tsx index cd53e9b1..f32273ae 100644 --- a/frontend/app/(main)/COMPANY_8/equipment/info/page.tsx +++ b/frontend/app/(main)/COMPANY_8/equipment/info/page.tsx @@ -624,8 +624,17 @@ export default function EquipmentInfoPage() { {inspections.map((item) => ( { - const std = item.standard_value || ""; - const tol = item.tolerance || ""; + // lower/upper → standard/tolerance 역산 + const lower = item.lower_limit !== "" && item.lower_limit != null ? Number(item.lower_limit) : null; + const upper = item.upper_limit !== "" && item.upper_limit != null ? Number(item.upper_limit) : null; + let std = item.standard_value || ""; + let tol = item.tolerance || ""; + if (lower !== null && upper !== null && !isNaN(lower) && !isNaN(upper)) { + const stdCalc = (lower + upper) / 2; + const tolCalc = (upper - lower) / 2; + std = String(stdCalc); + tol = String(tolCalc); + } setInspectionForm({ ...item, standard_value: std, tolerance: tol }); setInspectionEditMode(true); setInspectionModalOpen(true); diff --git a/frontend/app/(main)/COMPANY_9/equipment/info/page.tsx b/frontend/app/(main)/COMPANY_9/equipment/info/page.tsx index cd53e9b1..f32273ae 100644 --- a/frontend/app/(main)/COMPANY_9/equipment/info/page.tsx +++ b/frontend/app/(main)/COMPANY_9/equipment/info/page.tsx @@ -624,8 +624,17 @@ export default function EquipmentInfoPage() { {inspections.map((item) => ( { - const std = item.standard_value || ""; - const tol = item.tolerance || ""; + // lower/upper → standard/tolerance 역산 + const lower = item.lower_limit !== "" && item.lower_limit != null ? Number(item.lower_limit) : null; + const upper = item.upper_limit !== "" && item.upper_limit != null ? Number(item.upper_limit) : null; + let std = item.standard_value || ""; + let tol = item.tolerance || ""; + if (lower !== null && upper !== null && !isNaN(lower) && !isNaN(upper)) { + const stdCalc = (lower + upper) / 2; + const tolCalc = (upper - lower) / 2; + std = String(stdCalc); + tol = String(tolCalc); + } setInspectionForm({ ...item, standard_value: std, tolerance: tol }); setInspectionEditMode(true); setInspectionModalOpen(true);