feat: 复盘四周期手动上传,移除 AI 识别预填
固定 5m/15m/1h/4h 四槽截图上传与详情四宫格展示;自动 K 线默认关闭且与手动上传互斥。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -583,61 +583,6 @@ function fillJournalFromTrade(t){
|
||||
alert("已填入下方复盘表单,请手动补充主观原因。");
|
||||
}
|
||||
|
||||
function prefillJournalByImage(){
|
||||
const fileInput = document.getElementById("journal-screenshot");
|
||||
if(!fileInput || !fileInput.files || !fileInput.files.length){
|
||||
alert("请先选择截图");
|
||||
return;
|
||||
}
|
||||
const fd = new FormData();
|
||||
fd.append("screenshot", fileInput.files[0]);
|
||||
fetch("/api/journal_prefill", { method: "POST", body: fd })
|
||||
.then(r=>r.json())
|
||||
.then(res=>{
|
||||
if(!res.ok){
|
||||
alert(res.msg || "AI识别失败");
|
||||
return;
|
||||
}
|
||||
const d = res.data || {};
|
||||
setJournalField("open_datetime", normalizeDatetimeLocal(d.open_datetime));
|
||||
setJournalField("close_datetime", normalizeDatetimeLocal(d.close_datetime));
|
||||
setJournalField("coin", d.coin || "");
|
||||
setJournalField("tf", d.tf || "");
|
||||
setJournalField("pnl", d.pnl || "");
|
||||
setJournalField("expect_rr", d.expect_rr || "");
|
||||
setJournalField("real_rr", d.real_rr || "");
|
||||
let entryReason = String(d.entry_reason || "").trim();
|
||||
let customEr = "";
|
||||
if(JOURNAL_ENTRY_REASON_OPTIONS && JOURNAL_ENTRY_REASON_OPTIONS.includes(entryReason)){
|
||||
// keep
|
||||
} else if(entryReason){
|
||||
customEr = entryReason;
|
||||
entryReason = JOURNAL_ENTRY_REASON_OTHER;
|
||||
} else {
|
||||
entryReason = "";
|
||||
}
|
||||
setJournalField("entry_reason", entryReason);
|
||||
setJournalField("entry_reason_custom", customEr);
|
||||
syncJournalEntryReasonOtherUi();
|
||||
const trig = (d.early_exit_trigger || "").trim();
|
||||
let noteEx = (d.early_exit_note || "").trim();
|
||||
const legacy = (d.early_exit_reason || "").trim();
|
||||
if(!noteEx && legacy && !trig){
|
||||
const sp = splitLegacyEarlyExitReason(legacy);
|
||||
setJournalField("early_exit_trigger", sp.trigger);
|
||||
setJournalField("early_exit_note", sp.note);
|
||||
} else {
|
||||
setJournalField("early_exit_trigger", trig);
|
||||
setJournalField("early_exit_note", noteEx);
|
||||
}
|
||||
setJournalField("note", d.note || "");
|
||||
if(typeof syncEarlyExitNoteRequired === "function") syncEarlyExitNoteRequired();
|
||||
recomputeJournalRealRr();
|
||||
alert("已完成预填,请手动检查并补充原因");
|
||||
})
|
||||
.catch(()=>alert("AI识别请求失败"));
|
||||
}
|
||||
|
||||
function recomputeJournalRealRr(){
|
||||
const form = document.getElementById("journal-form");
|
||||
if(!form) return;
|
||||
|
||||
Reference in New Issue
Block a user