fix: AI daily review sqlite3.Row crash and error feedback across four exchanges
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7757,6 +7757,7 @@ def ai_daily_review():
|
||||
text = f"【每日交易记录】{date}\n总笔数:{len(rows)}\n\n"
|
||||
for idx, row in enumerate(rows, 1):
|
||||
text += journal_row_lines_for_ai(idx, row)
|
||||
text += "\n"
|
||||
|
||||
image_paths = collect_images_for_ai_review(
|
||||
rows,
|
||||
@@ -7792,6 +7793,7 @@ def ai_weekly_review():
|
||||
text = f"【周交易记录】{start_date}~{end_date}\n总笔数:{len(rows)}\n\n"
|
||||
for idx, row in enumerate(rows, 1):
|
||||
text += journal_row_lines_for_ai(idx, row)
|
||||
text += "\n"
|
||||
|
||||
image_paths = collect_images_for_ai_review(
|
||||
rows,
|
||||
|
||||
@@ -1245,14 +1245,16 @@ function genDaily(){
|
||||
const d = document.getElementById("day_date").value;
|
||||
if(!d){alert("请选择日期");return;}
|
||||
fetch("/ai_daily_review",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`date=${encodeURIComponent(d)}`})
|
||||
.then(r=>r.json()).then(data=>{
|
||||
.then(r=>{ if(!r.ok) throw new Error("HTTP "+r.status); return r.json(); })
|
||||
.then(data=>{
|
||||
const el=document.getElementById("daily_result");
|
||||
const wrap=document.getElementById("daily_result_wrap");
|
||||
setAiReviewMarkdown(el, data.result);
|
||||
if(wrap){ wrap.style.display="block"; }
|
||||
else { el.style.display="block"; }
|
||||
loadReviews();
|
||||
});
|
||||
})
|
||||
.catch(e=>alert("生成日复盘失败:"+(e.message||e)));
|
||||
}
|
||||
|
||||
function genWeekly(){
|
||||
@@ -1260,14 +1262,16 @@ function genWeekly(){
|
||||
const e=document.getElementById("week_end").value;
|
||||
if(!s || !e){alert("请选择起止日期");return;}
|
||||
fetch("/ai_weekly_review",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`start_date=${encodeURIComponent(s)}&end_date=${encodeURIComponent(e)}`})
|
||||
.then(r=>r.json()).then(data=>{
|
||||
.then(r=>{ if(!r.ok) throw new Error("HTTP "+r.status); return r.json(); })
|
||||
.then(data=>{
|
||||
const el=document.getElementById("weekly_result");
|
||||
const wrap=document.getElementById("weekly_result_wrap");
|
||||
setAiReviewMarkdown(el, data.result);
|
||||
if(wrap){ wrap.style.display="block"; }
|
||||
else { el.style.display="block"; }
|
||||
loadReviews();
|
||||
});
|
||||
})
|
||||
.catch(e=>alert("生成周复盘失败:"+(e.message||e)));
|
||||
}
|
||||
|
||||
function exportDailyBundleMd(){
|
||||
|
||||
Reference in New Issue
Block a user