diff --git a/manual_trading_hub/static/app.css b/manual_trading_hub/static/app.css index 904a543..a109acb 100644 --- a/manual_trading_hub/static/app.css +++ b/manual_trading_hub/static/app.css @@ -10270,9 +10270,9 @@ html[data-theme="light"] .hub-logs-card-hint { } body.hub-page-funds:not(.hub-phone) .funds-chart-panel { - flex: 1 1 auto; - min-height: 140px; - max-height: 42vh; + flex: 1 1 0; + min-height: 280px; + max-height: none; margin-bottom: 8px; display: flex; flex-direction: column; @@ -10281,7 +10281,7 @@ html[data-theme="light"] .hub-logs-card-hint { body.hub-page-funds:not(.hub-phone) .funds-chart-host { flex: 1 1 auto; height: auto; - min-height: 120px; + min-height: 260px; } body.hub-page-funds:not(.hub-phone) .funds-section-head { @@ -10290,9 +10290,13 @@ html[data-theme="light"] .hub-logs-card-hint { } body.hub-page-funds:not(.hub-phone) .funds-accounts { - flex: 0 0 auto; + flex: 0 1 auto; + min-height: 0; + max-height: min(260px, 28vh); + overflow-x: hidden; + overflow-y: auto; gap: 8px; - padding: 0; + padding: 0 2px 4px 0; } body.hub-page-funds:not(.hub-phone) .funds-ac-card { @@ -10300,3 +10304,41 @@ html[data-theme="light"] .hub-logs-card-hint { gap: 6px; } } + +/* 1920×1080 一类矮屏:再压紧上方 KPI,把高度让给资金曲线 */ +@media (min-width: 1600px) and (min-height: 900px) and (max-height: 1100px) { + body.hub-page-funds:not(.hub-phone) .funds-head { + margin-bottom: 2px !important; + } + + body.hub-page-funds:not(.hub-phone) .funds-toolbar { + margin-bottom: 4px; + } + + body.hub-page-funds:not(.hub-phone) .funds-summary { + margin-bottom: 4px; + gap: 6px; + } + + body.hub-page-funds:not(.hub-phone) .funds-stat-card { + padding: 6px 8px; + } + + body.hub-page-funds:not(.hub-phone) .funds-meta { + margin-bottom: 4px; + padding: 3px 8px; + font-size: 0.7rem; + } + + body.hub-page-funds:not(.hub-phone) .funds-chart-panel { + min-height: 320px; + } + + body.hub-page-funds:not(.hub-phone) .funds-chart-host { + min-height: 300px; + } + + body.hub-page-funds:not(.hub-phone) .funds-accounts { + max-height: min(220px, 24vh); + } +} diff --git a/manual_trading_hub/static/funds.js b/manual_trading_hub/static/funds.js index 77cf5f7..cd1286f 100644 --- a/manual_trading_hub/static/funds.js +++ b/manual_trading_hub/static/funds.js @@ -134,10 +134,15 @@ }); new ResizeObserver(function () { if (c && host) { - c.applyOptions({ width: host.clientWidth, height: host.clientHeight }); + const w = Math.max(host.clientWidth || 0, 1); + const h = Math.max(host.clientHeight || 0, 1); + c.applyOptions({ width: w, height: h }); } }).observe(host); - c.applyOptions({ width: host.clientWidth, height: host.clientHeight }); + c.applyOptions({ + width: Math.max(host.clientWidth || 0, 1), + height: Math.max(host.clientHeight || 0, 200), + }); return { chart: c, series: s }; } @@ -443,6 +448,17 @@ } } renderAccounts(data.accounts || []); + // 分户卡片渲染后高度会变,补一次尺寸,避免 1080p 一屏布局下曲线被裁切 + if (chart && elChartHost) { + requestAnimationFrame(function () { + if (!chart || !elChartHost) return; + chart.applyOptions({ + width: Math.max(elChartHost.clientWidth || 0, 1), + height: Math.max(elChartHost.clientHeight || 0, 200), + }); + chart.timeScale().fitContent(); + }); + } if (fsAccountKey) { const ac = findAccount(fsAccountKey); if (ac && ac.monitored) openAccountFullscreen(fsAccountKey); diff --git a/manual_trading_hub/static/index.html b/manual_trading_hub/static/index.html index c1ce6df..1a364c9 100644 --- a/manual_trading_hub/static/index.html +++ b/manual_trading_hub/static/index.html @@ -15,7 +15,7 @@ - + @@ -1312,7 +1312,7 @@ - +