fix: 普适指标重复import bug(守卫回滚后补)+前端普适列显示有效年/总年

This commit is contained in:
xxm
2026-08-17 01:32:28 +08:00
parent 4a78664f72
commit a82b8c72b7
2 changed files with 3 additions and 3 deletions
+3 -2
View File
@@ -2549,7 +2549,7 @@ function renderStrategyTable(strategies) {
'<td class="text-center px-2 py-1.5 font-mono text-cyan-300">' + (st.sizing_slots ? st.sizing_slots + '仓' : '10仓') + (st.conviction_model ? '<button onclick="event.stopPropagation();showConviction(\'' + s.version + '\')" class="text-amber-400 hover:text-amber-300" title="查看信念分级仓位规则">⚡</button>' : '') + '</td>' +
'<td class="text-center px-2 py-1.5">' + ((s.description && s.description.title) ? '<button onclick="event.stopPropagation();showDesc(\'' + s.version + '\')" class="text-blue-400 hover:text-blue-300" title="查看策略说明">📖</button>' : '<span class="text-slate-700">—</span>') + '</td>' +
cell('composite', compositeShow, v => v + (s._confidence != null && s._confidence < 1 ? '<span class="text-slate-500 text-[10px]">×' + s._confidence.toFixed(2) + '</span>' : ''), 'font-bold text-amber-300') +
cell('universality_score', universalityShow, v => v + '<span class="text-slate-500">/' + (isOverall ? (st.universality || {}).months : (rwUniv ? rwUniv.months + '/' + (rwUniv.regime_total_months || '?') : '?')) + '</span>') +
cell('universality_score', universalityShow, v => v + '<span class="text-slate-500" title="普适=跨独立年份有效性: 有效年占比×覆盖因子。100分=每年都有效(非特例)">' + (isOverall ? ('/' + ((st.universality || {}).valid_years || 0) + '年有效') : (rwUniv ? ('/' + (rwUniv.valid_years || 0) + '年有效') : '?')) + '</span>') +
cell('full_return_pct', retShow, v => v + '%', 'font-bold text-amber-300') +
cell('capital_final', capShow, v => '¥' + (v/10000).toFixed(0) + '万') +
cell('cagr_pct', cagrShow, v => v + '%', hl(cagrShow, best.cagr_pct)) +
@@ -2599,6 +2599,7 @@ function renderStrategyTable(strategies) {
const ddV = rwPf ? rwPf.portfolio_max_dd_pct : null;
const univ = rw.universality ? rw.universality.score : null;
const univM = rw.universality ? (rw.universality.months + '/' + (rw.universality.regime_total_months || '?')) : null;
const univYears = rw.universality ? ((rw.universality.valid_years || 0) + '/' + (rw.universality.years || 0) + '年') : null;
// ── 2026-08-16 行状态按【该表温区 rg】独立判定(老莫反复强调)──
const qg = (s.qualification || {})[rg];
const rLong = qg && qg.long_ok, rMid = qg && qg.mid_ok, rShort = qg && qg.short_ok;
@@ -2637,7 +2638,7 @@ function renderStrategyTable(strategies) {
cell('composite', comp, v => v, 'font-bold text-amber-300') +
cell('sharpe_ratio', rw.sharpe_ratio != null ? rw.sharpe_ratio : null, v => v) +
cell('profit_factor', rw.profit_factor != null ? rw.profit_factor : null, v => v) +
cell('universality_score', univ, v => v + '<span class="text-slate-500">/' + (univM || '?') + '</span>') +
cell('universality_score', univ, v => v + '<span class="text-slate-500" title="普适=跨独立年份有效性: 有效年占比×覆盖因子。100分=每年都有效(非特例)">' + (univYears || '') + '</span>') +
cell('portfolio_max_dd_pct', ddV, v => v + '%', '') +
'<td class="text-center px-2 py-1.5" onclick="event.stopPropagation()"><button onclick="runStrategyBacktest(\'' + s.version + '\')" class="px-2 py-0.5 bg-blue-600/60 hover:bg-blue-500 rounded text-xs">▶回测</button></td></tr>';
};