From c827191a36ca04b4a93c8d21130528a1178ae383 Mon Sep 17 00:00:00 2001 From: zyc <1439655764@qq.com> Date: Tue, 30 Jun 2026 11:19:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B4=A6=E5=8D=95=E6=B5=81=E6=B0=B4=20?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=88=97=E6=88=AA=E6=96=AD=20+=20=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E4=B8=8D=E6=8D=A2=E8=A1=8C=20+=20=E5=8A=A0=E8=B7=B3?= =?UTF-8?q?=E9=A1=B5=E8=BE=93=E5=85=A5=20(row39/row40)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - row39: 详情列文字过长撑得「状态·成功」换行 → 详情列 max-width+nowrap+省略号截断(hover title 看全)、状态列 white-space:nowrap - row40: 账单流水分页器加「跳至第 N 页」输入框,回车或点「跳转」钳到 [1,总页数] 直达 Co-Authored-By: Claude Opus 4.8 --- core/frontend/src/account-page.css | 10 ++++++++++ core/frontend/src/routes/account.tsx | 24 ++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/core/frontend/src/account-page.css b/core/frontend/src/account-page.css index 6677cd1..eb43601 100644 --- a/core/frontend/src/account-page.css +++ b/core/frontend/src/account-page.css @@ -166,6 +166,16 @@ .bill-pager .pages button.active { background: var(--heat); color: var(--accent-white); border-color: var(--heat); font-weight: 600; } .bill-pager .pages button:disabled { opacity: .4; cursor: not-allowed; } .bill-pager .pages .ellipsis { min-width: 20px; height: 28px; display: inline-flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; color: var(--black-alpha-32); font-family: var(--font-mono); font-size: 12px; user-select: none; } + /* row40:跳页输入框 */ + .bill-pager .bill-jump { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--black-alpha-48); } + .bill-pager .bill-jump input { width: 48px; height: 28px; padding: 0 6px; border: 1px solid var(--border-muted); border-radius: var(--r-sm); background: var(--surface); font-family: var(--font-mono); font-size: 12px; color: var(--accent-black); text-align: center; } + .bill-pager .bill-jump input:focus { outline: none; border-color: var(--heat); } + .bill-pager .bill-jump button { min-width: 40px; height: 28px; padding: 0 10px; border: 1px solid var(--border-muted); border-radius: var(--r-sm); background: var(--surface); font-family: var(--font-mono); font-size: 12px; color: var(--black-alpha-56); cursor: pointer; transition: border-color var(--t-base), color var(--t-base); } + .bill-pager .bill-jump button:hover:not(:disabled) { border-color: var(--black-alpha-32); color: var(--accent-black); } + .bill-pager .bill-jump button:disabled { opacity: .4; cursor: not-allowed; } + /* row39:详情列过长不撑行 —— 截断省略,状态列不换行(避免「成功」被挤换行) */ + .billing-table .bill-detail { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } + .billing-table .bill-status { white-space: nowrap; } .billing-table .progress-mini { width: 80px; height: 4px; background: var(--background-lighter); border-radius: 2px; overflow: hidden; display: inline-block; vertical-align: middle; margin-left: 8px; } .billing-table .progress-mini > span { display: block; height: 100%; background: var(--heat); } diff --git a/core/frontend/src/routes/account.tsx b/core/frontend/src/routes/account.tsx index 1324f14..14c5366 100644 --- a/core/frontend/src/routes/account.tsx +++ b/core/frontend/src/routes/account.tsx @@ -152,6 +152,13 @@ export function AccountPage({ billing, projects, onRecharge }: { }, [billPage, reloadFlag]); const billTotalPages = Math.max(1, Math.ceil(ledgerCount / BILLS_PER_PAGE)); const safeBillPage = Math.min(billPage, billTotalPages); + // row40:跳页输入框 —— 输入页码回车/点「跳转」即钳到 [1,总页数] 并翻页 + const [billJump, setBillJump] = useState(""); + function gotoBillPage() { + const n = parseInt(billJump, 10); + if (!Number.isNaN(n)) setBillPage(Math.min(billTotalPages, Math.max(1, n))); + setBillJump(""); + } const selectedCard = RECHARGE.find((item) => item.amt === recharge); const effectiveAmount = Number(customAmt) > 0 ? Number(customAmt) : recharge; @@ -422,11 +429,11 @@ export function AccountPage({ billing, projects, onRecharge }: { {new Date(l.created_at).toLocaleString("zh-CN")} {ledgerTypeLabel(l.ledger_type)} - {ledgerReasonLabel(l.reason)} + {ledgerReasonLabel(l.reason)} {l.user_label ? {l.user_label.slice(0, 1).toUpperCase()}{l.user_label} : 系统} - 成功 + 成功 {l.amount} ))} @@ -445,6 +452,19 @@ export function AccountPage({ billing, projects, onRecharge }: { ))} + {/* row40:跳页输入 —— 输入页码回车或点「跳转」直达 */} + + 跳至 + setBillJump(e.target.value)} + onKeyDown={(e) => { if (e.key === "Enter") gotoBillPage(); }} + aria-label="跳至页码" + /> + 页 + + )}