feat: UI/UX全面优化 — CSS变量体系/a11y无障碍/Admin角色化/骨架屏/打印样式

This commit is contained in:
selfrelease
2026-07-18 07:57:23 +08:00
parent 2b5a32ca1e
commit 4b42eb80fd
15 changed files with 1519 additions and 442 deletions
+31 -6
View File
@@ -830,13 +830,15 @@ def compute_bull_stage(signal_status):
}
def find_bull_stocks(scan_rows, holding_codes=None):
def find_bull_stocks(scan_rows, holding_codes=None, scores_map=None):
"""
从扫描结果中找出潜在牛股,按阶段分组排序。
参数:
scan_rows: list[dict] 扫描结果列表 (含 code, name, signal_status, indicators, triggered_count)
holding_codes: set 持仓代码集合
scores_map: dict 综合评分映射 {code: {technical_score, external_score, final_score, verdict}}
当提供时,每只股票附加三项得分,并按综合得分排序
返回:
dict: {
@@ -872,8 +874,21 @@ def find_bull_stocks(scan_rows, holding_codes=None):
row.get('triggered_count'), is_holding,
)
# 附加综合评分(如果提供了 scores_map)
code = row.get('code', '')
technical_score = rate
external_score = 0
final_score = rate
verdict = ''
if scores_map and code in scores_map:
sc = scores_map[code]
technical_score = sc.get('technical_score', rate)
external_score = sc.get('external_score', 0)
final_score = sc.get('final_score', rate)
verdict = sc.get('verdict', '')
item = {
'code': row.get('code', ''),
'code': code,
'name': row.get('name', ''),
'stage': stage,
'stage_name': bull['stage_name'],
@@ -887,16 +902,26 @@ def find_bull_stocks(scan_rows, holding_codes=None):
'recommend_type': st,
'recommend_text': disp,
'recommend_reason': reason,
'recommend_rate': rate,
'recommend_rate': final_score,
'is_holding': is_holding,
'triggered_count': row.get('triggered_count', 0),
'technical_score': technical_score,
'external_score': external_score,
'final_score': final_score,
'verdict': verdict,
}
stages[stage].append(item)
# 每个阶段内按推荐评分降序排序
for stage_num in stages:
stages[stage_num].sort(key=lambda x: (-x['recommend_rate'], -x['progress']))
# 每个阶段内排序:有综合评分时按综合得分→技术得分→进度,否则按推荐评分→进度
if scores_map:
for stage_num in stages:
stages[stage_num].sort(
key=lambda x: (-x.get('final_score', 0), -x.get('technical_score', 0), -x['progress'])
)
else:
for stage_num in stages:
stages[stage_num].sort(key=lambda x: (-x['recommend_rate'], -x['progress']))
total = sum(len(v) for v in stages.values())