+58
-1
@@ -132,6 +132,57 @@
|
||||
return '<ul class="' + wrapCls + '">' + items.join("") + more + "</ul>";
|
||||
}
|
||||
|
||||
function fmtMoneyU(v) {
|
||||
if (v == null || v === "") return "—";
|
||||
const n = Number(v);
|
||||
if (!Number.isFinite(n)) return "—";
|
||||
return n.toFixed(2) + " U";
|
||||
}
|
||||
|
||||
function fmtRatioPct(v) {
|
||||
if (v == null || v === "") return "—";
|
||||
const n = Number(v);
|
||||
if (!Number.isFinite(n)) return "—";
|
||||
return n.toFixed(2) + "%";
|
||||
}
|
||||
|
||||
function premiumCell(snap) {
|
||||
const prem = snap.premium || {};
|
||||
const paid = prem.paid_usdt;
|
||||
const equity = prem.equity_usdt;
|
||||
const ratio = prem.ratio_pct;
|
||||
const tip =
|
||||
equity != null
|
||||
? "账户资金(资+交) " + fmtMoneyU(equity)
|
||||
: "账户资金暂无";
|
||||
return (
|
||||
'<span title="' +
|
||||
escapeHtml(tip) +
|
||||
'">' +
|
||||
escapeHtml(fmtMoneyU(paid)) +
|
||||
"</span>"
|
||||
);
|
||||
}
|
||||
|
||||
function premiumRatioCell(snap) {
|
||||
const prem = snap.premium || {};
|
||||
const ratio = prem.ratio_pct;
|
||||
const tip =
|
||||
prem.paid_usdt != null && prem.equity_usdt != null
|
||||
? "权利金 " +
|
||||
fmtMoneyU(prem.paid_usdt) +
|
||||
" / 账户 " +
|
||||
fmtMoneyU(prem.equity_usdt)
|
||||
: "";
|
||||
return (
|
||||
'<span title="' +
|
||||
escapeHtml(tip) +
|
||||
'">' +
|
||||
escapeHtml(fmtRatioPct(ratio)) +
|
||||
"</span>"
|
||||
);
|
||||
}
|
||||
|
||||
function renderRow(row) {
|
||||
const snap = row.snapshot || {};
|
||||
const inst = snap.instance || {};
|
||||
@@ -164,6 +215,12 @@
|
||||
fmtPnlHtml(pnl) +
|
||||
"</td>" +
|
||||
"<td>" +
|
||||
premiumCell(snap) +
|
||||
"</td>" +
|
||||
"<td>" +
|
||||
premiumRatioCell(snap) +
|
||||
"</td>" +
|
||||
"<td>" +
|
||||
positionSummary(brief) +
|
||||
"</td>" +
|
||||
"<td>" +
|
||||
@@ -248,7 +305,7 @@
|
||||
grid.innerHTML =
|
||||
'<div class="overview-table-wrap"><table class="overview-table">' +
|
||||
"<thead><tr>" +
|
||||
"<th>名称</th><th>状态</th><th>模式</th><th>浮盈</th><th>持仓</th><th>买一/流动性</th><th>拉取时间</th><th>操作</th>" +
|
||||
"<th>名称</th><th>状态</th><th>模式</th><th>浮盈</th><th>权利金</th><th>资金占比</th><th>持仓</th><th>买一/流动性</th><th>拉取时间</th><th>操作</th>" +
|
||||
"</tr></thead><tbody>" +
|
||||
list.map(renderRow).join("") +
|
||||
"</tbody></table></div>";
|
||||
|
||||
Reference in New Issue
Block a user