mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 17:54:15 +08:00
feat(monitor): 个股通知带行业/概念 ext 标签 + 全局配置 (#118)
监控中心顶部加全局配置(齿轮), 选择要在个股通知里展示的 ext 字段
(默认概念 ext_gn_ths + 行业 ext_hy_ths)。开启后触发记录卡片和推送
toast 统一显示行业(蓝)/概念(橙)标签。
架构: 源头富化 — 后端 SSE 推送前 (_enrich_alerts_ext) 用
_load_ext_value_maps (带 mtime 缓存) 按 symbol 富化; GET /api/alerts
读取时同样富化。前端零额外请求。
配置支持细粒度裁剪:
- 字段下拉按扩展表分组 (optgroup)
- 显示前N个 (maxTags), 留空=全部
- 隐藏指定位置 (hiddenIndices), 点数字划掉
数据结构 {field, maxTags, hiddenIndices} 向后兼容旧字符串格式。
后端:
- preferences.py: get_monitor_ext_fields + _normalize_ext_field
- settings.py: RealtimeMonitorConfigIn + get_preferences 加字段
- quote_service.py: _enrich_alerts_ext SSE 推送前富化
- alerts.py: list_alerts 加 ext_columns 参数
前端:
- api.ts: MonitorExtFieldItem 类型 + alertsList extColumns 参数
- Monitor.tsx: 齿轮入口 + 配置弹窗 + 卡片标签行
- AlertToast.tsx: toast 底行加标签
Co-authored-by: shy3130 <shy3130@users.noreply.github.com>
This commit is contained in:
@@ -430,6 +430,7 @@ def get_preferences() -> dict:
|
||||
"sidebar_index_symbols": preferences.get_sidebar_index_symbols(),
|
||||
"minute_intraday_refresh": preferences.get_minute_intraday_refresh(),
|
||||
"minute_intraday_refresh_interval": preferences.get_minute_intraday_refresh_interval(),
|
||||
"monitor_ext_fields": preferences.get_monitor_ext_fields(),
|
||||
"nav_order": preferences.get_nav_order(),
|
||||
"nav_hidden": preferences.get_nav_hidden(),
|
||||
"screener_auto_run": preferences.get_screener_auto_run(),
|
||||
@@ -756,6 +757,7 @@ class RealtimeMonitorConfigIn(BaseModel):
|
||||
screener_auto_run: bool | None = None
|
||||
minute_intraday_refresh: bool | None = None
|
||||
minute_intraday_refresh_interval: int | None = None
|
||||
monitor_ext_fields: dict | None = None
|
||||
|
||||
|
||||
@router.put("/preferences/realtime-monitor")
|
||||
|
||||
Reference in New Issue
Block a user