总览出场单独成列;已设绿色、未设红色。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-03 04:05:22 +08:00
parent 5396fcd1f0
commit 0ecca62488
3 changed files with 29 additions and 9 deletions
+8
View File
@@ -403,6 +403,14 @@ button, .btn {
.pos-brief li {
margin: 2px 0;
}
.exit-brief .exit-set {
color: var(--ok);
font-weight: 600;
}
.exit-brief .exit-unset {
color: var(--bad);
font-weight: 600;
}
.pos-exit {
margin-top: 2px;
font-size: 0.76rem;
+20 -8
View File
@@ -52,8 +52,6 @@
const items = list.slice(0, 8).map(function (p) {
const id = p.inst_id || "";
const sheets = escapeHtml(String(p.sheets != null ? p.sheets : "—"));
const exitText = formatExitBrief(p);
const exitCls = exitText === "未设出场" ? "muted" : "";
return (
"<li>" +
escapeHtml(id) +
@@ -61,11 +59,7 @@
sheets +
"张 · " +
fmtPnlHtml(p.pnl_usdt) +
'<div class="pos-exit ' +
exitCls +
'">出场: ' +
escapeHtml(exitText) +
"</div></li>"
"</li>"
);
});
const more =
@@ -75,6 +69,21 @@
return "<ul class=\"pos-brief\">" + items.join("") + more + "</ul>";
}
function exitSummary(brief) {
const list = brief || [];
if (!list.length) return '<span class="muted">—</span>';
const items = list.slice(0, 8).map(function (p) {
const exitText = formatExitBrief(p);
const exitCls = exitText === "未设出场" ? "exit-unset" : "exit-set";
return '<li class="' + exitCls + '">' + escapeHtml(exitText) + "</li>";
});
const more =
list.length > 8
? '<li class="muted">…共 ' + list.length + " 笔</li>"
: "";
return '<ul class="pos-brief exit-brief">' + items.join("") + more + "</ul>";
}
function closeActionButtons(brief, instanceId, online) {
if (!online) return "";
const list = (brief || []).filter(function (p) {
@@ -253,6 +262,9 @@
positionSummary(brief) +
"</td>" +
"<td>" +
exitSummary(brief) +
"</td>" +
"<td>" +
bidLiquiditySummary(brief) +
"</td>" +
'<td class="muted">' +
@@ -463,7 +475,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><th>买一/流动性</th><th>拉取时间</th><th>操作</th>" +
"</tr></thead><tbody>" +
list.map(renderRow).join("") +
"</tbody></table></div>";