Split options review open/close times into separate columns.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-19 15:08:23 +08:00
parent 0ed2eabf0d
commit bc797cb1db
2 changed files with 27 additions and 17 deletions
+20 -13
View File
@@ -285,7 +285,7 @@
if (!tbody) return; if (!tbody) return;
var wrap = beginListLoad("or-trades-wrap", soft); var wrap = beginListLoad("or-trades-wrap", soft);
if (!soft) { if (!soft) {
tbody.innerHTML = '<tr><td colspan="6" 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("reviewed", "0");
@@ -299,7 +299,7 @@
.then(function (data) { .then(function (data) {
if (doSync) setSyncStatus("本地记录已加载"); if (doSync) setSyncStatus("本地记录已加载");
if (!data.ok) { if (!data.ok) {
tbody.innerHTML = '<tr><td colspan="6" class="muted">加载失败</td></tr>'; tbody.innerHTML = '<tr><td colspan="7" class="muted">加载失败</td></tr>';
endListLoad(wrap); endListLoad(wrap);
return; return;
} }
@@ -311,7 +311,7 @@
tradesCache = {}; tradesCache = {};
if (!rows.length) { if (!rows.length) {
tbody.innerHTML = tbody.innerHTML =
'<tr><td colspan="6" class="muted">暂无待复盘记录</td></tr>'; '<tr><td colspan="7" class="muted">暂无待复盘记录</td></tr>';
endListLoad(wrap); endListLoad(wrap);
return; return;
} }
@@ -336,9 +336,10 @@
'">' + '">' +
fmtPnl(t.realized_pnl_total) + fmtPnl(t.realized_pnl_total) +
"</td>" + "</td>" +
'<td class="muted" style="font-size:12px">' + '<td class="muted" style="font-size:12px;white-space:nowrap">' +
escapeHtml(t.opened_at || "—") + escapeHtml(t.opened_at || "—") +
"<br>" + "</td>" +
'<td class="muted" style="font-size:12px;white-space:nowrap">' +
escapeHtml(t.closed_at || "—") + escapeHtml(t.closed_at || "—") +
"</td>" + "</td>" +
"<td>" + "<td>" +
@@ -371,7 +372,7 @@
endListLoad(wrap); endListLoad(wrap);
}) })
.catch(function () { .catch(function () {
tbody.innerHTML = '<tr><td colspan="6" class="muted">加载失败</td></tr>'; tbody.innerHTML = '<tr><td colspan="7" class="muted">加载失败</td></tr>';
endListLoad(wrap); endListLoad(wrap);
}); });
} }
@@ -384,7 +385,7 @@
if (!tbody) return; if (!tbody) return;
var wrap = beginListLoad("or-reviewed-wrap", soft); var wrap = beginListLoad("or-reviewed-wrap", soft);
if (!soft) { if (!soft) {
tbody.innerHTML = '<tr><td colspan="6" class="muted">加载中…</td></tr>'; tbody.innerHTML = '<tr><td colspan="8" class="muted">加载中…</td></tr>';
} }
var p = baseQs(); var p = baseQs();
p.set("reviewed", "1"); p.set("reviewed", "1");
@@ -397,7 +398,7 @@
}) })
.then(function (data) { .then(function (data) {
if (!data.ok) { if (!data.ok) {
tbody.innerHTML = '<tr><td colspan="6" class="muted">加载失败</td></tr>'; tbody.innerHTML = '<tr><td colspan="8" class="muted">加载失败</td></tr>';
endListLoad(wrap); endListLoad(wrap);
return; return;
} }
@@ -408,7 +409,7 @@
var rows = data.trades || []; var rows = data.trades || [];
reviewedCache = {}; reviewedCache = {};
if (!rows.length) { if (!rows.length) {
tbody.innerHTML = '<tr><td colspan="6" class="muted">暂无复盘记录</td></tr>'; tbody.innerHTML = '<tr><td colspan="8" class="muted">暂无复盘记录</td></tr>';
endListLoad(wrap); endListLoad(wrap);
return; return;
} }
@@ -430,13 +431,19 @@
'">' + '">' +
fmtPnl(t.realized_pnl_total) + fmtPnl(t.realized_pnl_total) +
"</td>" + "</td>" +
'<td class="muted" style="font-size:12px;white-space:nowrap">' +
escapeHtml(t.opened_at || "—") +
"</td>" +
'<td class="muted" style="font-size:12px;white-space:nowrap">' +
escapeHtml(t.closed_at || "—") +
"</td>" +
"<td>" + "<td>" +
escapeHtml(t.strategy_tag || "—") + escapeHtml(t.strategy_tag || "—") +
"</td>" + "</td>" +
"<td>" + "<td>" +
escapeHtml(t.result_tag || "—") + escapeHtml(t.result_tag || "—") +
"</td>" + "</td>" +
'<td class="muted" style="font-size:12px">' + '<td class="muted" style="font-size:12px;white-space:nowrap">' +
escapeHtml(t.reviewed_at || "—") + escapeHtml(t.reviewed_at || "—") +
"</td>" + "</td>" +
"</tr>" "</tr>"
@@ -451,7 +458,7 @@
endListLoad(wrap); endListLoad(wrap);
}) })
.catch(function () { .catch(function () {
tbody.innerHTML = '<tr><td colspan="6" class="muted">加载失败</td></tr>'; tbody.innerHTML = '<tr><td colspan="8" class="muted">加载失败</td></tr>';
endListLoad(wrap); endListLoad(wrap);
}); });
} }
@@ -502,8 +509,8 @@
["合约/计划", tradeTitle(t)], ["合约/计划", tradeTitle(t)],
["盈亏", fmtPnl(t.realized_pnl_total)], ["盈亏", fmtPnl(t.realized_pnl_total)],
["持有", fmtHold(t.hold_seconds)], ["持有", fmtHold(t.hold_seconds)],
["开仓", t.opened_at || "—"], ["开仓时间", t.opened_at || "—"],
["平仓", t.closed_at || "—"], ["平仓时间", t.closed_at || "—"],
["策略", e.strategy_tag || "—"], ["策略", e.strategy_tag || "—"],
["方向", e.direction_view || "—"], ["方向", e.direction_view || "—"],
["结果", e.result_tag || "—"], ["结果", e.result_tag || "—"],
@@ -79,13 +79,14 @@
<th>类型</th> <th>类型</th>
<th>标的/合约</th> <th>标的/合约</th>
<th>盈亏</th> <th>盈亏</th>
<th>/平</th> <th>仓时间</th>
<th>平仓时间</th>
<th>持有</th> <th>持有</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
<tbody id="or-trades-tbody"> <tbody id="or-trades-tbody">
<tr><td colspan="6" class="muted">加载中…</td></tr> <tr><td colspan="7" class="muted">加载中…</td></tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@@ -189,13 +190,15 @@
<th>类型</th> <th>类型</th>
<th>标的/合约</th> <th>标的/合约</th>
<th>盈亏</th> <th>盈亏</th>
<th>开仓时间</th>
<th>平仓时间</th>
<th>策略</th> <th>策略</th>
<th>结果</th> <th>结果</th>
<th>复盘时间</th> <th>复盘时间</th>
</tr> </tr>
</thead> </thead>
<tbody id="or-reviewed-tbody"> <tbody id="or-reviewed-tbody">
<tr><td colspan="6" class="muted">加载中…</td></tr> <tr><td colspan="8" class="muted">加载中…</td></tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@@ -224,4 +227,4 @@
</div> </div>
</div> </div>
<script src="/static/options_review.js?v=10"></script> <script src="/static/options_review.js?v=11"></script>