diff --git a/strategy_templates/key_monitor_panel.html b/strategy_templates/key_monitor_panel.html index 9e23134..1667dcf 100644 --- a/strategy_templates/key_monitor_panel.html +++ b/strategy_templates/key_monitor_panel.html @@ -1,6 +1,9 @@ {% macro key_direction_label(k) -%} @@ -77,7 +80,7 @@ 关键位监控规则说明
{{ key_gate_rule_text }}
-
+
{% for k in key %}
@@ -127,7 +130,7 @@

关键位历史

失效或已结案的关键位 · 点击展开详情
-
+
{% for h in key_history %}
@@ -173,4 +176,24 @@ function paintKeyMonitorSummary(id, snap){ const gate = snap.gate_summary || "—"; el.innerText = `现价 ${px} · 门控 ${gate}`; } +document.querySelectorAll(".key-row-collapse").forEach((row)=>{ + row.addEventListener("toggle", ()=>{ + if(!row.open) return; + requestAnimationFrame(()=>{ + const body = row.querySelector(".key-row-collapse-body"); + const panel = row.closest(".key-panel-scroll"); + if(body && panel){ + const bodyRect = body.getBoundingClientRect(); + const panelRect = panel.getBoundingClientRect(); + if(bodyRect.bottom > panelRect.bottom - 8){ + panel.scrollTop += bodyRect.bottom - panelRect.bottom + 16; + } else if(bodyRect.top < panelRect.top + 8){ + panel.scrollTop -= panelRect.top - bodyRect.top + 16; + } + } else { + row.scrollIntoView({block:"nearest", behavior:"smooth"}); + } + }); + }); +});