From d6f39e018d308693f270ad26d5fd81fedcc400fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=80=BB=E5=B7=A5?= Date: Fri, 28 Aug 2026 11:49:23 +0000 Subject: [PATCH] =?UTF-8?q?HEL-208:=20=E6=95=B4=E5=90=88=20b49892e=20?= =?UTF-8?q?=E7=9A=84=20formatWan=20=E6=8B=86=E5=88=86=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=88=B0=202fb1f2b=EF=BC=88=E4=B8=A2=E5=BC=83=E5=85=B6?= =?UTF-8?q?=E5=AF=B9=20HEL-206=20=E6=96=B9=E5=90=91=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=8E=E6=B5=8B=E8=AF=95=E7=9A=84=E8=AF=AF=E5=9B=9E=E9=80=80?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: multica-agent --- web/app.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/web/app.js b/web/app.js index 39c4036..64ee979 100644 --- a/web/app.js +++ b/web/app.js @@ -3395,7 +3395,7 @@ function yuanToWan(value) { return n / 10000; } -function formatWan(value, { signed = false } = {}) { +function formatWanHtml(value, { signed = false } = {}) { const wan = yuanToWan(value); if (wan === null) return "—"; const abs = Math.abs(wan).toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 }); @@ -3472,13 +3472,13 @@ function renderWorkspaceTransfersCard(summary) { const net = $("#wsTfNet"); const pendingEl = $("#wsTfPending"); const netLabel = $("#wsTfNetLabel"); - if (inflow) inflow.innerHTML = formatWan(confirmed.inflow_total, { signed: true }); + if (inflow) inflow.innerHTML = formatWanHtml(confirmed.inflow_total, { signed: true }); if (outflow) { - outflow.innerHTML = formatWan( + outflow.innerHTML = formatWanHtml( confirmed.outflow_total != null ? -Math.abs(Number(confirmed.outflow_total)) : null, { signed: true }, ); - // formatWan with negative value already adds −; ensure unit + // formatWanHtml with negative value already adds −; ensure unit if (confirmed.outflow_total != null) { const wan = yuanToWan(confirmed.outflow_total); const abs = Math.abs(wan).toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 }); @@ -3488,12 +3488,12 @@ function renderWorkspaceTransfersCard(summary) { if (netLabel) netLabel.textContent = `${netLabelForWindow(win)}${netMeta.label !== "持平" ? ` · ${netMeta.label}` : ""}`; if (net) { net.className = `ms-value ${netMeta.signedClass}`.trim(); - net.innerHTML = formatWan(confirmed.net_change, { signed: true }); + net.innerHTML = formatWanHtml(confirmed.net_change, { signed: true }); } if (pendingEl) { const pCount = Number(pending.count) || 0; pendingEl.innerHTML = pCount - ? `${formatWan(pending.amount_total)} · ${pCount} 笔` + ? `${formatWanHtml(pending.amount_total)} · ${pCount} 笔` : `0.00万元 · 0 笔`; } } @@ -3564,7 +3564,7 @@ function renderTransfersOverview(summary) { const netFoot = $("#tfStatNetFoot"); const netMeta = netDirectionMeta(confirmed.net_change, confirmed.net_direction); if (companies) companies.innerHTML = `${cps.length}`; - if (inflow) inflow.innerHTML = formatWan(confirmed.inflow_total, { signed: true }); + if (inflow) inflow.innerHTML = formatWanHtml(confirmed.inflow_total, { signed: true }); if (outflow) { const wan = yuanToWan(confirmed.outflow_total); const abs = wan === null ? "—" : Math.abs(wan).toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 }); @@ -3575,7 +3575,7 @@ function renderTransfersOverview(summary) { const tag = netMeta.label !== "持平" ? ` ${netMeta.label}` : ""; - net.innerHTML = `${formatWan(confirmed.net_change, { signed: true })}${tag}`; + net.innerHTML = `${formatWanHtml(confirmed.net_change, { signed: true })}${tag}`; } if (netFoot) { netFoot.textContent = win.has_opening @@ -3589,7 +3589,7 @@ function renderTransfersOverview(summary) { const tfPendingCount = $("#tfPendingCount"); const tfPendingAmount = $("#tfPendingAmount"); if (tfConfirmedCount) tfConfirmedCount.textContent = `${confirmedCount} 笔`; - if (tfConfirmedNet) tfConfirmedNet.innerHTML = formatWan(confirmed.net_change, { signed: true }); + if (tfConfirmedNet) tfConfirmedNet.innerHTML = formatWanHtml(confirmed.net_change, { signed: true }); const openingCard = $("#tfStatOpeningCard"); const endingCard = $("#tfStatEndingCard"); const openingEl = $("#tfStatOpening"); @@ -3597,15 +3597,15 @@ function renderTransfersOverview(summary) { if (win.has_opening) { if (openingCard) openingCard.hidden = false; if (endingCard) endingCard.hidden = false; - if (openingEl) openingEl.innerHTML = formatWan(win.opening, { signed: true }); - if (endingEl) endingEl.innerHTML = formatWan(win.ending, { signed: true }); + if (openingEl) openingEl.innerHTML = formatWanHtml(win.opening, { signed: true }); + if (endingEl) endingEl.innerHTML = formatWanHtml(win.ending, { signed: true }); } else { if (openingCard) openingCard.hidden = true; if (endingCard) endingCard.hidden = true; } if (tfPendingCount) tfPendingCount.textContent = `${pCount} 笔`; - if (tfPendingAmount) tfPendingAmount.innerHTML = formatWan(pending.amount_total || 0); + if (tfPendingAmount) tfPendingAmount.innerHTML = formatWanHtml(pending.amount_total || 0); const tbody = $("#transfersCpBody"); const tfoot = $("#transfersCpFoot"); @@ -3706,7 +3706,7 @@ async function openTransfersDetail(companyId, companyName, { keepFilters = false $("#tfDetailCount").innerHTML = `—`; $("#tfDetailCountFoot").textContent = pendingN ? `其中待确认 ${pendingN} 笔(汇总)` : "按筛选加载明细"; if (cp) { - $("#tfDetailIn").innerHTML = formatWan(cp.confirmed_inflow, { signed: true }); + $("#tfDetailIn").innerHTML = formatWanHtml(cp.confirmed_inflow, { signed: true }); const wan = yuanToWan(cp.confirmed_outflow); $("#tfDetailOut").innerHTML = wan === null ? "—"