Keep unflat legs on 当前持仓 after plan end.

Closed plans with open legs stay visible and closable so residual positions are not orphaned from the UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-14 16:51:33 +08:00
parent 989accdc50
commit a83b6794d8
6 changed files with 92 additions and 14 deletions
+9 -2
View File
@@ -937,12 +937,15 @@
const perpSide = String(perp.side || "").toLowerCase() === "short" ? "空" : "多";
const comboCls = pnlClsNum(combo.net_usdt);
const liqWarn = opt.liq_ok === false;
const unflat = !!card.unflat || String(card.status || "") === "closed";
const bidTxt =
opt.bid != null
? fmt(opt.bid, 4) + (opt.bid_sz != null ? "/" + fmt(opt.bid_sz, 0) : "")
: "—";
return (
'<article class="hp-live-card" data-plan-id="' +
'<article class="hp-live-card' +
(unflat ? " hp-live-card--unflat" : "") +
'" data-plan-id="' +
(card.plan_id || "") +
'">' +
'<div class="hp-live-card-head">' +
@@ -950,7 +953,11 @@
(card.plan_id || "—") +
" · " +
(card.underlying || "") +
"</strong></div>" +
"</strong>" +
(unflat
? '<span class="hp-live-unflat-tag" title="计划已结束但腿仍持仓中">未平仓</span>'
: "") +
"</div>" +
'<div class="hp-live-time-row">' +
"<span>开仓 <strong>" +
(card.opened_at || "—") +
+12
View File
@@ -4175,6 +4175,18 @@ html[data-theme="light"] .opt-be-dist-down {
margin-bottom: 8px;
font-size: 0.88rem;
}
.hedge-plan-page-wrap .hp-live-card--unflat {
border-color: rgba(245, 197, 66, 0.35);
}
.hedge-plan-page-wrap .hp-live-unflat-tag {
font-size: 0.72rem;
font-weight: 650;
color: #1a1408;
background: #f5c542;
padding: 2px 8px;
border-radius: 4px;
white-space: nowrap;
}
.hedge-plan-page-wrap .hp-live-time-row {
display: flex;
flex-wrap: wrap;