Move strategy residual table below market panels.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-06 03:37:52 +08:00
parent 52948c0a54
commit 68d02b9c17
2 changed files with 78 additions and 75 deletions
+74 -73
View File
@@ -569,79 +569,6 @@ export default function PlanPage() {
</div>
) : null}
</div>
{plan?.residuals && plan.residuals.length > 0 ? (
<div className="plan-residual-block">
<div className="plan-residual-head">
<h4></h4>
<span className="meta">
</span>
</div>
<div className="plan-residual-wrap">
<table className="plan-residual-table">
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th title="最新买一价格 / 买一数量(ETH)"></th>
<th title="买一价 × 持仓数量"></th>
<th title="买一权利金 ÷ 开仓权利金"></th>
<th></th>
</tr>
</thead>
<tbody>
{plan.residuals.map((r) => {
const gid = String(r.group_id || "");
const inst = String(r.option_inst_id || "—");
const liqOk = r.liquidity_ok === true;
return (
<tr key={`${gid}:${inst}`}>
<td className="mono">{gid || "—"}</td>
<td className="mono">{inst}</td>
<td className="mono">{fmt(r.option_qty_eth, 4)}</td>
<td className="mono">{fmt(r.initial_premium, 2)}</td>
<td
className="mono"
title={
liqOk
? "买一深度可覆盖持仓"
: "买一不足或盘口不可用"
}
>
{fmtBidLiquidity(r.bid_px, r.bid_sz_eth)}
</td>
<td className="mono">{fmt(r.current_premium, 2)}</td>
<td className="mono">
{r.recovery_pct == null
? "—"
: `${fmt(r.recovery_pct, 1)}%`}
</td>
<td>
<button
type="button"
className="btn ghost"
style={{ padding: "4px 10px", fontSize: 12 }}
disabled={!!residualBusy || !!busy || !liqOk}
title={
liqOk
? "按最新买一 IOC 平仓(不验权利金比例)"
: "买一流动性不足或盘口不可用"
}
onClick={() => void closeResidual(gid, inst)}
>
{residualBusy === gid ? "平仓中…" : "平仓"}
</button>
</td>
</tr>
);
})}
</tbody>
</table>
</div>
</div>
) : null}
</div>
<div className="plan-positions">
@@ -924,6 +851,80 @@ export default function PlanPage() {
</div>
</div>
</div>
{plan?.residuals && plan.residuals.length > 0 ? (
<div className="card plan-residual-block">
<div className="plan-residual-head">
<h4></h4>
<span className="meta">
</span>
</div>
<div className="plan-residual-wrap">
<table className="plan-residual-table">
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th title="最新买一价格 / 买一数量(ETH)"></th>
<th title="买一价 × 持仓数量"></th>
<th title="买一权利金 ÷ 开仓权利金"></th>
<th></th>
</tr>
</thead>
<tbody>
{plan.residuals.map((r) => {
const gid = String(r.group_id || "");
const inst = String(r.option_inst_id || "—");
const liqOk = r.liquidity_ok === true;
return (
<tr key={`${gid}:${inst}`}>
<td className="mono">{gid || "—"}</td>
<td className="mono">{inst}</td>
<td className="mono">{fmt(r.option_qty_eth, 4)}</td>
<td className="mono">{fmt(r.initial_premium, 2)}</td>
<td
className="mono"
title={
liqOk
? "买一深度可覆盖持仓"
: "买一不足或盘口不可用"
}
>
{fmtBidLiquidity(r.bid_px, r.bid_sz_eth)}
</td>
<td className="mono">{fmt(r.current_premium, 2)}</td>
<td className="mono">
{r.recovery_pct == null
? "—"
: `${fmt(r.recovery_pct, 1)}%`}
</td>
<td>
<button
type="button"
className="btn ghost"
style={{ padding: "4px 10px", fontSize: 12 }}
disabled={!!residualBusy || !!busy || !liqOk}
title={
liqOk
? "按最新买一 IOC 平仓(不验权利金比例)"
: "买一流动性不足或盘口不可用"
}
onClick={() => void closeResidual(gid, inst)}
>
{residualBusy === gid ? "平仓中…" : "平仓"}
</button>
</td>
</tr>
);
})}
</tbody>
</table>
</div>
</div>
) : null}
</div>
</div>
);
+4 -2
View File
@@ -732,9 +732,11 @@ input {
}
.plan-residual-block {
margin-top: 14px;
margin-top: 0;
padding-top: 12px;
border-top: 1px solid var(--line);
width: 100%;
min-width: 0;
box-sizing: border-box;
}
.plan-residual-head {