Keep reviewed trades in options list and stop search autofill.
Top trade list no longer hides reviewed rows; search box resists browser username autofill (dekun). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -288,7 +288,7 @@
|
|||||||
tbody.innerHTML = '<tr><td colspan="7" class="muted">加载中…</td></tr>';
|
tbody.innerHTML = '<tr><td colspan="7" class="muted">加载中…</td></tr>';
|
||||||
}
|
}
|
||||||
var p = baseQs();
|
var p = baseQs();
|
||||||
p.set("reviewed", "0");
|
// 交易记录保留已复盘条目,不再只显示待复盘
|
||||||
p.set("limit", String(PAGE_SIZE));
|
p.set("limit", String(PAGE_SIZE));
|
||||||
p.set("offset", String(tradesPage * PAGE_SIZE));
|
p.set("offset", String(tradesPage * PAGE_SIZE));
|
||||||
if (!doSync) p.set("sync", "0");
|
if (!doSync) p.set("sync", "0");
|
||||||
@@ -311,7 +311,7 @@
|
|||||||
tradesCache = {};
|
tradesCache = {};
|
||||||
if (!rows.length) {
|
if (!rows.length) {
|
||||||
tbody.innerHTML =
|
tbody.innerHTML =
|
||||||
'<tr><td colspan="7" class="muted">暂无待复盘记录</td></tr>';
|
'<tr><td colspan="7" class="muted">暂无交易记录</td></tr>';
|
||||||
endListLoad(wrap);
|
endListLoad(wrap);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -319,6 +319,17 @@
|
|||||||
.map(function (t) {
|
.map(function (t) {
|
||||||
tradesCache[t.id] = t;
|
tradesCache[t.id] = t;
|
||||||
var active = currentTradeId === t.id ? " or-row-active" : "";
|
var active = currentTradeId === t.id ? " or-row-active" : "";
|
||||||
|
var reviewed = !!t.reviewed;
|
||||||
|
var actionBtn = reviewed
|
||||||
|
? '<button type="button" class="btn or-review-btn" data-id="' +
|
||||||
|
t.id +
|
||||||
|
'" style="font-size:.72rem;padding:2px 8px">编辑</button>'
|
||||||
|
: '<button type="button" class="btn or-review-btn" data-id="' +
|
||||||
|
t.id +
|
||||||
|
'" style="font-size:.72rem;padding:2px 8px">复盘</button>';
|
||||||
|
var badgeExtra = reviewed
|
||||||
|
? ' <span class="or-badge" style="background:rgba(61,214,140,.2)">已复盘</span>'
|
||||||
|
: "";
|
||||||
return (
|
return (
|
||||||
'<tr class="or-trade-row' +
|
'<tr class="or-trade-row' +
|
||||||
active +
|
active +
|
||||||
@@ -327,7 +338,9 @@
|
|||||||
'">' +
|
'">' +
|
||||||
"<td><span class=\"or-badge\">" +
|
"<td><span class=\"or-badge\">" +
|
||||||
escapeHtml(t.source_label || t.source_type) +
|
escapeHtml(t.source_label || t.source_type) +
|
||||||
"</span></td>" +
|
"</span>" +
|
||||||
|
badgeExtra +
|
||||||
|
"</td>" +
|
||||||
"<td>" +
|
"<td>" +
|
||||||
escapeHtml(tradeTitle(t)) +
|
escapeHtml(tradeTitle(t)) +
|
||||||
"</td>" +
|
"</td>" +
|
||||||
@@ -345,9 +358,9 @@
|
|||||||
"<td>" +
|
"<td>" +
|
||||||
fmtHold(t.hold_seconds) +
|
fmtHold(t.hold_seconds) +
|
||||||
"</td>" +
|
"</td>" +
|
||||||
'<td><button type="button" class="btn or-review-btn" data-id="' +
|
"<td>" +
|
||||||
t.id +
|
actionBtn +
|
||||||
'" style="font-size:.72rem;padding:2px 8px">复盘</button> ' +
|
" " +
|
||||||
'<button type="button" class="btn-secondary or-hide-btn" data-id="' +
|
'<button type="button" class="btn-secondary or-hide-btn" data-id="' +
|
||||||
t.id +
|
t.id +
|
||||||
'" style="font-size:.72rem;padding:2px 8px">删除</button></td>' +
|
'" style="font-size:.72rem;padding:2px 8px">删除</button></td>' +
|
||||||
@@ -1184,9 +1197,28 @@
|
|||||||
bindUploadSlots();
|
bindUploadSlots();
|
||||||
hideJournalForm();
|
hideJournalForm();
|
||||||
hideDetail();
|
hideDetail();
|
||||||
|
hardenSearchAutofill();
|
||||||
setActiveTab("option_spot");
|
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 = {
|
global.OptionsReview = {
|
||||||
init: init,
|
init: init,
|
||||||
openJournalForm: openJournalForm,
|
openJournalForm: openJournalForm,
|
||||||
|
|||||||
@@ -87,21 +87,27 @@
|
|||||||
<button type="button" class="or-tab" data-source="options_options" role="tab">期期对冲记录</button>
|
<button type="button" class="or-tab" data-source="options_options" role="tab">期期对冲记录</button>
|
||||||
<button type="button" class="or-tab" data-source="perp_options" role="tab">永期对冲记录</button>
|
<button type="button" class="or-tab" data-source="perp_options" role="tab">永期对冲记录</button>
|
||||||
</div>
|
</div>
|
||||||
<p class="muted" style="margin:0 0 8px;font-size:.72rem">待复盘交易(每页5条).点「复盘」填写表单;保存后进入下方复盘记录.</p>
|
<p class="muted" style="margin:0 0 8px;font-size:.72rem">交易记录(每页5条).点「复盘」填写表单;已复盘仍保留在此列表,也可在下方查看详情.</p>
|
||||||
<div class="form-row" style="flex-wrap:wrap;gap:6px;margin-bottom:8px">
|
<div class="form-row" style="flex-wrap:wrap;gap:6px;margin-bottom:8px">
|
||||||
<select id="or-filter-uly" style="font-size:.76rem">
|
<select id="or-filter-uly" style="font-size:.76rem" autocomplete="off">
|
||||||
<option value="">标的:全部</option>
|
<option value="">标的:全部</option>
|
||||||
<option value="ETH">ETH</option>
|
<option value="ETH">ETH</option>
|
||||||
<option value="BTC">BTC</option>
|
<option value="BTC">BTC</option>
|
||||||
</select>
|
</select>
|
||||||
<select id="or-filter-opt" style="font-size:.76rem">
|
<select id="or-filter-opt" style="font-size:.76rem" autocomplete="off">
|
||||||
<option value="">Call/Put:全部</option>
|
<option value="">Call/Put:全部</option>
|
||||||
<option value="C">Call</option>
|
<option value="C">Call</option>
|
||||||
<option value="P">Put</option>
|
<option value="P">Put</option>
|
||||||
</select>
|
</select>
|
||||||
<input type="text" id="or-filter-q" placeholder="搜索标的/合约/策略" autocomplete="off" style="max-width:150px;font-size:.76rem">
|
{# 诱饵框吸收浏览器把用户名(dekun)填进搜索框 #}
|
||||||
<input type="datetime-local" id="or-filter-from" title="平仓起" style="font-size:.76rem">
|
<input type="text" name="username" autocomplete="username" tabindex="-1" aria-hidden="true"
|
||||||
<input type="datetime-local" id="or-filter-to" title="平仓止" style="font-size:.76rem">
|
style="position:absolute;left:-9999px;width:1px;height:1px;opacity:0" value="">
|
||||||
|
<input type="search" id="or-filter-q" name="or_filter_q" placeholder="搜索标的/合约/策略"
|
||||||
|
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||||
|
data-lpignore="true" data-1p-ignore="true" data-form-type="other"
|
||||||
|
readonly style="max-width:150px;font-size:.76rem">
|
||||||
|
<input type="datetime-local" id="or-filter-from" title="平仓起" autocomplete="off" style="font-size:.76rem">
|
||||||
|
<input type="datetime-local" id="or-filter-to" title="平仓止" autocomplete="off" style="font-size:.76rem">
|
||||||
<label class="muted" style="display:flex;align-items:center;gap:4px;font-size:.72rem">
|
<label class="muted" style="display:flex;align-items:center;gap:4px;font-size:.72rem">
|
||||||
<input type="checkbox" id="or-include-hedge-legs"> 含已归属对冲的期权腿
|
<input type="checkbox" id="or-include-hedge-legs"> 含已归属对冲的期权腿
|
||||||
</label>
|
</label>
|
||||||
@@ -265,4 +271,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/options_review.js?v=14"></script>
|
<script src="/static/options_review.js?v=15"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user