fix: 温区表每行状态按该表温区(rg)独立判定——可激活/可用/不合格/手动停用四态,替代全局isActive(老莫反复强调)
This commit is contained in:
+14
-3
@@ -2541,9 +2541,20 @@ 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 isActive = s.current === true;
|
||||
return '<tr class="border-b border-slate-800/50 hover:bg-slate-800/30 cursor-pointer' + (isActive ? ' bg-emerald-900/10' : '') + '" onclick="showStrategyDetail(\'' + s.version + '\')">' +
|
||||
'<td class="px-2 py-1.5 font-mono font-bold ' + (isActive ? 'text-emerald-400' : 'text-blue-400') + '">' + s.version + (isActive ? ' <span class="text-[10px] bg-emerald-500/20 text-emerald-300 px-1 rounded">激活</span>' : '') + ((s.market && s.market !== 'all') ? ' <span class="text-[10px] bg-cyan-500/20 text-cyan-300 px-1 rounded">' + (s.market === 'hk' ? '港' : 'A') + '</span>' : '') + '</td>' +
|
||||
// ── 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;
|
||||
const r3 = rLong && rMid && rShort; // 三项全过
|
||||
const r2 = rLong && rMid; // 长期+近期
|
||||
const rManual = s.manual_available !== false;
|
||||
let rState, rStateCls, rStateBadge, rRowBg;
|
||||
if (!rManual) { rState = 'manual_off'; rStateCls = 'text-slate-500'; rStateBadge = '<span class="text-[10px] bg-slate-500/20 text-slate-400 px-1 rounded">手动停用</span>'; rRowBg = 'opacity-50'; }
|
||||
else if (r3) { rState = 'ok3'; rStateCls = 'text-emerald-400'; rStateBadge = '<span class="text-[10px] bg-emerald-500/20 text-emerald-300 px-1 rounded">可激活</span>'; rRowBg = 'bg-emerald-900/10'; }
|
||||
else if (r2) { rState = 'ok2'; rStateCls = 'text-blue-400'; rStateBadge = '<span class="text-[10px] bg-blue-500/20 text-blue-300 px-1 rounded">可用</span>'; rRowBg = ''; }
|
||||
else { rState = 'bad'; rStateCls = 'text-red-400/80'; rStateBadge = '<span class="text-[10px] bg-red-500/20 text-red-300 px-1 rounded">不合格</span>'; rRowBg = 'opacity-60'; }
|
||||
const isActive = rState === 'ok3';
|
||||
return '<tr class="border-b border-slate-800/50 hover:bg-slate-800/30 cursor-pointer ' + rRowBg + '" onclick="showStrategyDetail(\'' + s.version + '\')">' +
|
||||
'<td class="px-2 py-1.5 font-mono font-bold ' + rStateCls + '">' + s.version + ' ' + rStateBadge + ((s.market && s.market !== 'all') ? ' <span class="text-[10px] bg-cyan-500/20 text-cyan-300 px-1 rounded">' + (s.market === 'hk' ? '港' : 'A') + '</span>' : '') + '</td>' +
|
||||
'<td class="px-2 py-1.5 whitespace-normal break-words" title="' + (s.hypothesis || s.summary || '').replace(/"/g, '"') + '">' + (s.name || '') + (smallSample ? ' <span class="text-amber-500" title="样本<40笔">⚠️</span>' : '') + '</td>' +
|
||||
// 2026-08-16 资格列:长期/近期/当下 三项达标徽章
|
||||
'<td class="text-center px-1 py-1.5 whitespace-nowrap" onclick="event.stopPropagation()">' + (s.qualification && s.qualification[rg] ? (
|
||||
|
||||
Reference in New Issue
Block a user