diff --git a/lib/common/static/options_review.js b/lib/common/static/options_review.js index a963eba..c272a70 100644 --- a/lib/common/static/options_review.js +++ b/lib/common/static/options_review.js @@ -288,7 +288,7 @@ tbody.innerHTML = '加载中…'; } var p = baseQs(); - p.set("reviewed", "0"); + // 交易记录保留已复盘条目,不再只显示待复盘 p.set("limit", String(PAGE_SIZE)); p.set("offset", String(tradesPage * PAGE_SIZE)); if (!doSync) p.set("sync", "0"); @@ -311,7 +311,7 @@ tradesCache = {}; if (!rows.length) { tbody.innerHTML = - '暂无待复盘记录'; + '暂无交易记录'; endListLoad(wrap); return; } @@ -319,6 +319,17 @@ .map(function (t) { tradesCache[t.id] = t; var active = currentTradeId === t.id ? " or-row-active" : ""; + var reviewed = !!t.reviewed; + var actionBtn = reviewed + ? '' + : ''; + var badgeExtra = reviewed + ? ' 已复盘' + : ""; return ( '' + "" + escapeHtml(t.source_label || t.source_type) + - "" + + "" + + badgeExtra + + "" + "" + escapeHtml(tradeTitle(t)) + "" + @@ -345,9 +358,9 @@ "" + fmtHold(t.hold_seconds) + "" + - ' ' + + "" + + actionBtn + + " " + '' + @@ -1184,9 +1197,28 @@ bindUploadSlots(); hideJournalForm(); hideDetail(); + hardenSearchAutofill(); setActiveTab("option_spot"); } + function hardenSearchAutofill() { + var qEl = $("or-filter-q"); + if (!qEl) return; + function wipe() { + qEl.value = ""; + } + wipe(); + qEl.addEventListener("focus", function () { + qEl.removeAttribute("readonly"); + }); + qEl.addEventListener("blur", function () { + if (!qEl.value) qEl.setAttribute("readonly", "readonly"); + }); + // 密码管理器常延后写入用户名,加载后再清两次 + setTimeout(wipe, 200); + setTimeout(wipe, 800); + } + global.OptionsReview = { init: init, openJournalForm: openJournalForm, diff --git a/lib/options/templates/options_review_panel.html b/lib/options/templates/options_review_panel.html index 13c7aca..f394c6e 100644 --- a/lib/options/templates/options_review_panel.html +++ b/lib/options/templates/options_review_panel.html @@ -87,21 +87,27 @@ -

待复盘交易(每页5条).点「复盘」填写表单;保存后进入下方复盘记录.

+

交易记录(每页5条).点「复盘」填写表单;已复盘仍保留在此列表,也可在下方查看详情.

- - - - - + {# 诱饵框吸收浏览器把用户名(dekun)填进搜索框 #} + + + + @@ -265,4 +271,4 @@
- +