From 195e63fb2e1ecf078174d438fd68e3f6a0f2c9fe Mon Sep 17 00:00:00 2001 From: dekun Date: Mon, 27 Jul 2026 16:02:10 +0800 Subject: [PATCH] Show each residual option on its own line. Co-authored-by: Cursor --- docs/更新说明.md | 8 +++++++ frontend/src/pages/Plan.tsx | 26 ++++++++++++--------- frontend/src/styles/app.css | 45 +++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 11 deletions(-) diff --git a/docs/更新说明.md b/docs/更新说明.md index e95ad08..58e0d77 100644 --- a/docs/更新说明.md +++ b/docs/更新说明.md @@ -5,6 +5,14 @@ --- +## 2026-07-27 — 残留期权一行一条 + +### 变更 + +1. 监控页「残留期权(待到期)」由用 `·` 拼成一行,改为**每条期权单独一行**(手机端卡片式)。 + +--- + ## 2026-07-27 — 交易记录详情改为弹窗 ### 变更 diff --git a/frontend/src/pages/Plan.tsx b/frontend/src/pages/Plan.tsx index f562530..c256f9a 100644 --- a/frontend/src/pages/Plan.tsx +++ b/frontend/src/pages/Plan.tsx @@ -306,18 +306,22 @@ export default function PlanPage() { 当前组 {pos?.group_id || "—"} -
+
残留期权(待到期) - - {plan?.residuals && plan.residuals.length > 0 - ? plan.residuals - .map( - (r) => - `${r.group_id}:${r.option_inst_id || "?"}@${r.expiry_ymd || "?"}` - ) - .join(" · ") - : "无"} - + {plan?.residuals && plan.residuals.length > 0 ? ( +
+ {plan.residuals.map((r) => ( +
+ {r.group_id}:{r.option_inst_id || "?"}@{r.expiry_ymd || "?"} +
+ ))} +
+ ) : ( + + )}
信号方向 diff --git a/frontend/src/styles/app.css b/frontend/src/styles/app.css index 2d78a74..7412991 100644 --- a/frontend/src/styles/app.css +++ b/frontend/src/styles/app.css @@ -512,6 +512,51 @@ input { min-width: 0; } +.kv-residuals { + align-items: flex-start; +} + +.kv-residuals > span:first-child { + padding-top: 2px; +} + +.residual-list { + display: flex; + flex-direction: column; + align-items: flex-end; + gap: 6px; + min-width: 0; + max-width: min(100%, 28em); +} + +.residual-item { + text-align: right; + line-height: 1.35; + word-break: break-word; + overflow-wrap: anywhere; +} + +@media (max-width: 900px) { + .kv-residuals { + flex-direction: column; + align-items: stretch; + gap: 6px; + } + + .residual-list { + align-items: stretch; + max-width: none; + } + + .residual-item { + text-align: left; + padding: 6px 8px; + border-radius: 6px; + background: rgba(255, 255, 255, 0.03); + border: 1px solid var(--line); + } +} + .trade-list { padding-top: 4px; padding-bottom: 4px;