总览仓位合计只显示持仓笔数,不再附带张数。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-03 03:45:30 +08:00
parent c1c5f0e355
commit 5e73093b11
2 changed files with 3 additions and 20 deletions
+2 -19
View File
@@ -301,7 +301,6 @@
online: 0,
offline: 0,
positions: 0,
sheets: 0,
pnl: 0,
premium: 0,
cash: 0,
@@ -314,10 +313,6 @@
function addOnlineMetrics(bucket, snap) {
const brief = snap.positions_brief || snap.positions || [];
bucket.positions += brief.length;
brief.forEach(function (p) {
const sheets = numOrNull(p && p.sheets);
if (sheets != null) bucket.sheets += sheets;
});
const pnl =
snap.pnl && snap.pnl.unrealized_usdt != null
? numOrNull(snap.pnl.unrealized_usdt)
@@ -369,12 +364,6 @@
}
function renderAggCards(bucket) {
const posText =
bucket.positions > 0
? bucket.positions +
" 笔" +
(bucket.sheets > 0 ? " / " + Math.round(bucket.sheets) + " 张" : "")
: "0";
const items = [
{
label: "在线",
@@ -386,7 +375,7 @@
value: String(bucket.offline),
cls: bucket.offline > 0 ? "status-off" : "",
},
{ label: "仓位合计", value: posText },
{ label: "仓位合计", value: String(bucket.positions) },
{
label: "浮盈合计",
value: bucket.hasPnl ? fmtPnl(bucket.pnl) : "—",
@@ -446,13 +435,7 @@
bucket.offline +
"</td>" +
"<td>" +
escapeHtml(
bucket.positions > 0
? bucket.positions +
" 笔" +
(bucket.sheets > 0 ? " / " + Math.round(bucket.sheets) + " 张" : "")
: "0"
) +
bucket.positions +
"</td>" +
'<td class="' +
(bucket.hasPnl ? pnlClass(bucket.pnl) : "") +