Fix mark/PnL display fallback and intraday entry labels
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1112,6 +1112,17 @@
|
||||
return mt || "下单监控";
|
||||
}
|
||||
|
||||
function monitorEntryStyleHtml(mo, intradayDiscipline) {
|
||||
const o = mo || {};
|
||||
if (o.entry_model_label) return `开仓: ${esc(o.entry_model_label)}`;
|
||||
if (intradayDiscipline) return "开仓: —";
|
||||
const ts = String(o.trade_style || "").toLowerCase();
|
||||
if (ts === "swing") return "风格: 波段单";
|
||||
if (ts === "trend") return "风格: 趋势单";
|
||||
if (o.trade_style) return `风格: ${esc(o.trade_style)}`;
|
||||
return "风格: —";
|
||||
}
|
||||
|
||||
function monitorOrderSourceHtml(mo, trendPlan) {
|
||||
if (isTrendContext(mo, trendPlan)) {
|
||||
return `来源: ${esc(monitorOrderSourceLabel(mo, trendPlan))}`;
|
||||
@@ -3073,8 +3084,7 @@
|
||||
meta.push(`<span class="pos-meta-off">移动保本:关</span>`);
|
||||
} else if (mo.monitor_type || mo.key_signal_type || mo.trend_plan_id) {
|
||||
meta.push(monitorOrderSourceHtml(mo, trendPlan));
|
||||
if (mo.trade_style) meta.push(`风格: ${esc(mo.trade_style)}`);
|
||||
else meta.push("风格: —");
|
||||
meta.push(monitorEntryStyleHtml(mo, intraday));
|
||||
const riskLine = formatMonitorRiskMeta(mo, trendPlan);
|
||||
if (riskLine) meta.push(riskLine);
|
||||
const latestRiskLine = formatLatestRiskMeta(mo, trendPlan, pos, tpsl);
|
||||
@@ -3188,7 +3198,7 @@
|
||||
const fcBadge = o.force_close_enabled ? forceCloseSymbolBadgeHtml(o) : "";
|
||||
return `<div class="hub-mini-card">
|
||||
<div class="hub-mini-title">#${esc(o.id)} · ${esc(o.symbol || o.exchange_symbol)} ${tcBadge}${fcBadge} · ${renderDirectionHtml(o.direction)}</div>
|
||||
<div class="hub-mini-line">触发 ${fmtSymbolPrice(o.trigger_price, sym, tickMap)} · SL ${fmtSymbolPrice(o.stop_loss, sym, tickMap)} · TP ${fmtSymbolPrice(o.take_profit, sym, tickMap)} · ${esc(o.trade_style || o.monitor_type || "下单监控")}</div>
|
||||
<div class="hub-mini-line">触发 ${fmtSymbolPrice(o.trigger_price, sym, tickMap)} · SL ${fmtSymbolPrice(o.stop_loss, sym, tickMap)} · TP ${fmtSymbolPrice(o.take_profit, sym, tickMap)} · ${esc(o.entry_model_label || o.trade_style || o.monitor_type || "下单监控")}</div>
|
||||
</div>`;
|
||||
})
|
||||
.join("");
|
||||
|
||||
Reference in New Issue
Block a user