feat: review entry reason picker uses dropdown instead of prompt

Add modal select for trade record review, expand options to two-level labels (反转/启动A), and accept legacy short labels on save.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-07 00:38:16 +08:00
parent f580e4542d
commit 1092816359
10 changed files with 188 additions and 34 deletions
+10 -3
View File
@@ -155,6 +155,13 @@ function toggleReviewMode(){
function editTradeRecordReview(t){
if(!t) return;
const pickEntryReason = function(){
if(window.InstanceUI && typeof InstanceUI.promptReviewEntryReason === "function"){
return InstanceUI.promptReviewEntryReason(JOURNAL_ENTRY_REASON_OPTIONS, t.effective_entry_reason || "");
}
const entryHint = "开仓类型(下拉选项之一,留空=不改该项)";
return Promise.resolve(prompt(entryHint, String(t.effective_entry_reason || "")));
};
const opened = prompt("开仓时间(YYYY-MM-DD HH:MM:SS)", normalizeBeijingDatetimeString(t.opened_at || ""));
if(opened === null) return;
const closed = prompt("平仓时间(YYYY-MM-DD HH:MM:SS)", normalizeBeijingDatetimeString(t.closed_at || ""));
@@ -168,9 +175,8 @@ function editTradeRecordReview(t){
const result = prompt("结果(止盈/止损/保本止盈/移动止盈/手动平仓/时间平仓)", String(t.result || ""));
if(result === null) return;
const note = prompt("备注(可空)", String(t.miss_reason || "")) ?? "";
const entryHint = "开仓类型(下拉选项之一,留空=不改该项)";
const entryIn = prompt(entryHint, String(t.effective_entry_reason || ""));
if(entryIn === null) return;
pickEntryReason().then(function(entryIn){
if(entryIn === null) return;
const payload = {
id: t.id,
reviewed_opened_at: normalizeBeijingDatetimeString(opened),
@@ -198,6 +204,7 @@ function editTradeRecordReview(t){
reloadInstancePage();
})
.catch(()=>alert("核对保存请求失败"));
});
}