diff --git a/server.py b/server.py index b9addd63..54e9bc6b 100644 --- a/server.py +++ b/server.py @@ -535,10 +535,11 @@ def get_tracking(): @app.route("/api/research/strategies") def api_research_strategies(): - """策略版本列表(含回测结果摘要)""" + """策略版本列表(含回测结果摘要,支持 period_tag 区间过滤)""" try: from strategy_lab import list_strategies - return jsonify({'strategies': list_strategies()}) + pt = request.args.get('period_tag') + return jsonify({'strategies': list_strategies(period_tag=pt)}) except Exception as e: return jsonify({'error': str(e)}), 500 diff --git a/static/index.html b/static/index.html index 66427c73..7ee52d96 100644 --- a/static/index.html +++ b/static/index.html @@ -1931,9 +1931,9 @@ function renderResearch() { if (!el) return; el.innerHTML = '
' + '

📋 策略研究 — 版本迭代对比

' + - '' + '' + - '' + + '' + '' + '每版策略基于上一版归因分析迭代 · 点击行展开明细
' + @@ -1945,7 +1945,9 @@ function renderResearch() { async function loadStrategyList() { const listEl = document.getElementById('strategyList'); try { - const resp = await fetch('/api/research/strategies'); + const ptMap = {'1m':'1m','6m':'6m','1y':'1y','2y':'2y','5y':'5y'}; + const pt = ptMap[document.getElementById('btPeriod')?.value || '2y'] || '2y'; + const resp = await fetch('/api/research/strategies?period_tag=' + pt); const data = await resp.json(); if (data.error) { listEl.innerHTML = '
' + data.error + '
'; return; } const mkt = document.getElementById('btMarket')?.value || 'all';