fix: 修复重构引入的 bug

- partner-records: 修复 SQL 参数顺序错误
- partner-records: 移除对已删除变量的引用
- stats.js: 修复 toFixed 在数字原型上调用的问题
- stats.js: 简化 onclick 处理避免转义问题

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
lizhilun
2026-03-19 10:27:39 +08:00
co-authored by Claude Opus 4.6
parent 0b450a65ed
commit d473e3a431
2 changed files with 3 additions and 4 deletions
+2 -2
View File
@@ -276,8 +276,8 @@ function renderHBarRanking(rows, { containerId, getValue, getLabel, onClick, for
container.innerHTML = rows.map((r, i) => {
const pct = Math.max((getValue(r) / max) * 100, 2);
const label = getLabel(r).replace(/'/g, "\\'");
const value = formatValue ? formatValue(getValue(r)) : (getValue(r).toFixed ? getValue(r).toFixed(2) : getValue(r));
return `<div class="hbar-row" onclick="${onClick}(${JSON.stringify(label).replace(/"/g, '&quot;')}, 'homePage')">
const value = formatValue ? formatValue(getValue(r)) : (typeof getValue(r) === 'number' ? getValue(r).toFixed(2) : getValue(r));
return `<div class="hbar-row" onclick="${onClick}('${label}', 'homePage')">
<div class="hbar-index ${i < 3 ? 'top' : ''}">${i + 1}</div>
<div class="hbar-label" title="${label}">${label}</div>
<div class="hbar-track"><div class="hbar-fill" style="width:${pct}%"></div></div>