From b2134d7515e3adb51fec64aa986aebc08462a1e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=98=9C=EC=9D=B8?= Date: Mon, 4 May 2026 14:07:40 +0900 Subject: [PATCH] Refresh lifecycle breakdown panel after allocation mode change --- PTC/management_dashboard_preview.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/PTC/management_dashboard_preview.html b/PTC/management_dashboard_preview.html index 44970fd..eccf12d 100644 --- a/PTC/management_dashboard_preview.html +++ b/PTC/management_dashboard_preview.html @@ -3636,6 +3636,24 @@ if (detailRes.ok) { const nextDetail = await detailRes.json(); setDetail(nextDetail); + if (lifecycleBreakdownModal?.label) { + const refreshed = (nextDetail?.lifecycle_cost?.breakdown || []).find( + (item) => item.label === lifecycleBreakdownModal.label + ); + if (refreshed) { + setLifecycleBreakdownModal({ + label: refreshed.label || "", + expense_supply: Number(refreshed.expense_supply || 0), + direct_expense_supply: Number(refreshed.direct_expense_supply || 0), + shared_expense_supply: Number(refreshed.shared_expense_supply || 0), + projects: Array.isArray(refreshed.projects) ? refreshed.projects.map((project) => ({ ...project })) : [], + accounts: Array.isArray(refreshed.accounts) ? refreshed.accounts.map((account) => ({ ...account })) : [], + opened_at: Date.now(), + }); + } else { + setLifecycleBreakdownModal(null); + } + } } } catch (err) { setLifecycleCommonAllocationDraft("");