From 14690a64e56d0d761ee9a8397003a46617108d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=A5=E5=BE=AE?= Date: Thu, 9 Jul 2026 20:24:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=87=AA=E9=80=89=E6=8C=89=E4=BF=A1?= =?UTF-8?q?=E5=8F=B7=E4=BC=98=E5=85=88=E7=BA=A7=E6=8E=92=E5=BA=8F+?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E6=98=BE=E7=A4=BAtech=5Fsnapshot/sector=5Fco?= =?UTF-8?q?ntext?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.py | 15 +++++++++++++-- static/index.html | 10 +++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index 424d6524..e81f035d 100644 --- a/server.py +++ b/server.py @@ -110,11 +110,22 @@ def api_watchlist(): conn.row_factory = sqlite3.Row rows = conn.execute(""" SELECT hs.code, hs.name, hs.entry_low, hs.entry_high, hs.stop_loss, hs.take_profit, - hs.timing_signal, hs.action, lp.price, lp.change_pct, hs.rr_ratio, hs.updated_at + hs.timing_signal, hs.action, lp.price, lp.change_pct, hs.rr_ratio, hs.updated_at, + hs.tech_snapshot, hs.sector_context FROM holding_strategies hs LEFT JOIN live_prices lp ON hs.code = lp.code WHERE hs.status='active' AND hs.decision_type='自选策略' - ORDER BY hs.code + ORDER BY + CASE + WHEN hs.timing_signal IN ('买入','可买入','可加仓') THEN 0 + WHEN hs.timing_signal IN ('关注') THEN 1 + WHEN hs.timing_signal IN ('信号不充分') THEN 2 + WHEN hs.timing_signal IN ('持有') THEN 3 + WHEN hs.timing_signal IN ('弱势持有') THEN 4 + ELSE 5 + END, + COALESCE(hs.rr_ratio,0) DESC, + hs.code """).fetchall() conn.close() stocks = [dict(r) for r in rows] diff --git a/static/index.html b/static/index.html index 33c4847f..b8e4482b 100644 --- a/static/index.html +++ b/static/index.html @@ -310,9 +310,17 @@ function renderWatchlist() { const tp = s.take_profit || 0; const signal = s.timing_signal || ''; const action = (s.action||''); + const tech = s.tech_snapshot || ''; + const sector = s.sector_context || ''; const price = s.price || 0; const chg = s.change_pct || 0; const priceDisplay = price ? price.toFixed(2) : '—'; + // 构建完整策略显示 + let detailLines = []; + if (action) detailLines.push(action); + if (tech) detailLines.push('📊 ' + tech); + if (sector) detailLines.push('🏭 ' + sector); + const detailText = detailLines.join(' | '); return `
${s.name}
${s.code}
@@ -323,7 +331,7 @@ function renderWatchlist() { ${signal||'—'} - ${action || '—'} + ${detailText || '—'} `; }).join('')}