fix: 补回showDesc函数(commit 9f1185fc误删致📖说明按钮失效)含进化来源展示
This commit is contained in:
@@ -2890,6 +2890,29 @@ async function runStrategyBacktest(version) {
|
||||
}
|
||||
}
|
||||
|
||||
function showDesc(version) {
|
||||
// 2026-08-18 补回(commit 9f1185fc 误删导致📖按钮失效)
|
||||
const s = (window._strats || []).find(x => x.version === version);
|
||||
const d = s && s.description;
|
||||
if (!d || !d.title) { alert('暂无说明'); return; }
|
||||
// 用模态框展示说明(替代旧 alert,含进化说明)
|
||||
const evoRows = (window._evolutionHistory || []).filter(e => e.child_version === version || e.parent_version === version);
|
||||
let evoHtml = '';
|
||||
if (evoRows.length) {
|
||||
evoHtml = '\n\n【进化来源】\n' + evoRows.map(e =>
|
||||
(e.parent_version || '?') + ' → ' + (e.child_version || version) +
|
||||
(e.change_description ? ':' + e.change_description : '')).join('\n');
|
||||
}
|
||||
const text = ['【' + d.title + '】', '【算法】' + (d.algorithm || ''), '【思路】' + (d.rationale || ''), '【证据】' + (d.evidence || '')].join('\n\n') + evoHtml;
|
||||
const el = document.getElementById('desc-modal');
|
||||
if (el) {
|
||||
el.querySelector('.modal-body').innerHTML = text.replace(/\n/g, '<br>');
|
||||
el.classList.remove('hidden');
|
||||
} else {
|
||||
alert(text);
|
||||
}
|
||||
}
|
||||
|
||||
async function showStrategyDetail(version) {
|
||||
const detail = document.getElementById('strategyDetail');
|
||||
detail.innerHTML = '<div class="text-slate-500 text-sm">加载 ' + version + ' 明细...</div>';
|
||||
|
||||
Reference in New Issue
Block a user