From c6142dc2460c82c3cbaa6b9aedb61a2dd4a33041 Mon Sep 17 00:00:00 2001 From: dekun Date: Fri, 17 Jul 2026 09:49:14 +0800 Subject: [PATCH] Show options review upload form always on page. Keep the multi-timeframe journal card visible like contract review instead of hiding it until a row is selected. Co-authored-by: Cursor --- lib/common/static/options_review.js | 36 +++++++- .../templates/options_review_panel.html | 86 ++++++++++--------- 2 files changed, 77 insertions(+), 45 deletions(-) diff --git a/lib/common/static/options_review.js b/lib/common/static/options_review.js index 346a850..dd8de8c 100644 --- a/lib/common/static/options_review.js +++ b/lib/common/static/options_review.js @@ -371,17 +371,41 @@ function hideJournalForm() { currentTradeId = null; var card = $("or-journal-card"); - if (card) card.hidden = true; + if (card) card.classList.add("or-journal-idle"); document.querySelectorAll(".or-trade-row").forEach(function (tr) { tr.classList.remove("or-row-active"); }); + ($("or-trade-id") || {}).value = ""; + ($("or-f-open") || {}).value = ""; + ($("or-f-close") || {}).value = ""; + ($("or-f-coin") || {}).value = ""; + ($("or-f-inst") || {}).value = ""; + ($("or-f-pnl") || {}).value = ""; + ($("or-f-hold") || {}).value = ""; + ($("or-f-strategy") || {}).value = ""; + ($("or-f-direction") || {}).value = ""; + ($("or-f-exit") || {}).value = ""; + ($("or-f-followed") || {}).value = ""; + ($("or-f-result") || {}).value = ""; + ($("or-f-entry") || {}).value = ""; + ($("or-f-note") || {}).value = ""; + setMoodTags(""); + resetUploadSlots(); + var summary = $("or-journal-summary"); + if (summary) { + summary.textContent = + "先点「同步」拉记录,再在下方列表点选一笔填入;截图槽位 5m/15m/1h/4h 可先传."; + } + var legsHost = $("or-legs-host"); + if (legsHost) legsHost.innerHTML = ""; + ($("or-save-status") || {}).textContent = ""; } function openJournalForm(tradeId) { currentTradeId = tradeId; var card = $("or-journal-card"); if (!card) return; - card.hidden = false; + card.classList.remove("or-journal-idle"); card.scrollIntoView({ behavior: "smooth", block: "start" }); document.querySelectorAll(".or-trade-row").forEach(function (tr) { tr.classList.toggle("or-row-active", Number(tr.getAttribute("data-id")) === tradeId); @@ -400,7 +424,7 @@ return; } fillForm(data.trade); - ($("or-save-status") || {}).textContent = ""; + ($("or-save-status") || {}).textContent = "已选中 #" + tradeId; }) .catch(function () { ($("or-save-status") || {}).textContent = "加载失败"; @@ -484,7 +508,10 @@ function saveEntry() { var tradeId = Number(($("or-trade-id") || {}).value || 0); - if (!tradeId) return; + if (!tradeId) { + alert("请先在下方列表点选一笔记录(若无记录请先点同步)"); + return; + } var strategy = (($("or-f-strategy") || {}).value || "").trim(); if (!strategy) { alert("请填写策略标签"); @@ -566,6 +593,7 @@ } ); bindUploadSlots(); + hideJournalForm(); setActiveTab("option_spot"); } diff --git a/lib/options/templates/options_review_panel.html b/lib/options/templates/options_review_panel.html index 2753a20..4138ef0 100644 --- a/lib/options/templates/options_review_panel.html +++ b/lib/options/templates/options_review_panel.html @@ -1,4 +1,4 @@ -{# OKX 期权复盘:三类 Tab + 列表 + 下方多周期截图复盘表单 #} +{# OKX 期权复盘:三类 Tab + 常驻复盘上传(同合约多周期截图) + 列表 #}
{% if not options_enabled %}
期权未启用:请设置 OKX_OPTIONS_ENABLED=true 后重启.对冲计划仍可单独同步(若本地有已结束计划).
@@ -18,6 +18,7 @@ .or-mood-grid{display:flex;flex-wrap:wrap;gap:10px 14px;margin:10px 0} .or-form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px;margin-bottom:8px} .or-form-grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px;margin-bottom:8px} + .or-journal-idle .or-journal-body{opacity:.72}
@@ -31,7 +32,6 @@
-

点列表行进入下方「复盘记录上传」;截图槽位与合约一致(5m / 15m / 1h / 4h).对冲盈亏用计划合计;归属对冲的期权腿默认不重复计入.

- - - - - - + + + + + +
@@ -132,7 +106,7 @@
{% endfor %}
-

可只传部分周期;选文件后即时上传,保存后详情可查看

+

可只传部分周期;选文件后即时上传(与合约复盘相同 5m/15m/1h/4h)

@@ -145,13 +119,43 @@
- +
+
+
+ +
+

统计

+
+
+
+ +
+

期权交易记录

+

点选一行,上方复盘表单会自动填入该笔数据.

+
+ + + + + + + + + + + + + + + +
类型标的/合约盈亏开/平持有策略状态
加载中…
+
- +