ui: 复盘表单紧凑布局、即时上传截图并移除占用时新开仓

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-05 22:46:05 +08:00
parent 7bb6ee1154
commit f688a504e1
17 changed files with 544 additions and 263 deletions
+18 -4
View File
@@ -77,12 +77,14 @@ from lib.strategy.strategy_trade_labels import (
trend_plan_id_from_monitor_row,
)
from lib.instance.journal_images_lib import (
collect_journal_slot_images,
enrich_journal_api_item,
images_json_dumps,
journal_image_paths,
normalize_journal_draft_id,
primary_journal_image,
save_journal_slot_uploads,
)
from lib.instance.journal_upload_api_lib import handle_journal_upload_slot
from lib.instance.journal_chart_lib import (
JOURNAL_CHART_DEFAULT_LIMIT,
JOURNAL_CHART_DEFAULT_TF1,
@@ -8910,8 +8912,9 @@ def add_journal():
early_exit_raw = "" if early_exit_trigger == "手动平仓" else ""
early_exit_reason_saved = compose_early_exit_reason_saved(early_exit_trigger, early_exit_note)
exit_reason_stored = journal_exit_reason_stored(early_exit_trigger, early_exit_note)
entry_id = uuid.uuid4().hex
manual_images = save_journal_slot_uploads(
entry_id = normalize_journal_draft_id(d.get("journal_draft_id")) or uuid.uuid4().hex
manual_images = collect_journal_slot_images(
d,
request.files,
entry_id,
app.config["UPLOAD_FOLDER"],
@@ -8999,7 +9002,7 @@ def add_journal():
d.get("pnl"), entry_reason_norm, exit_reason_stored, d.get("expect_rr"), real_rr_text,
early_exit_raw, early_exit_reason_saved, early_exit_trigger, early_exit_note,
None, None, None, mood_issues,
d.get("post_breakeven_stare"), d.get("new_trade_while_occupied"), d.get("note"), image_filename,
d.get("post_breakeven_stare"), None, d.get("note"), image_filename,
images_json_str,
)
)
@@ -9022,6 +9025,17 @@ def add_journal():
return _redirect_records()
@app.route("/api/journal_upload_slot", methods=["POST"])
@login_required
def api_journal_upload_slot():
payload, code = handle_journal_upload_slot(
request,
upload_folder=app.config["UPLOAD_FOLDER"],
secure_filename_fn=secure_filename,
)
return jsonify(payload), code
@app.route("/api/journals")
@login_required
def api_journals():