perf: 优化数据库查询和前端代码质量

- 添加 records 表常用字段索引提升查询性能
- 合并月度/老板/陪玩记录查询减少数据库往返
- 提取重复的横向柱状图渲染逻辑为通用函数
- 移除调试用的 console.log 语句

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
lizhilun
2026-03-19 10:22:15 +08:00
co-authored by Claude Opus 4.6
parent 14927f74aa
commit 0b450a65ed
4 changed files with 62 additions and 74 deletions
-1
View File
@@ -64,7 +64,6 @@ async function openTakeRanking() {
const res = await fetch(API + '/api/stats/take-ranking', { headers: headers() });
if (!res.ok) return;
const data = await res.json();
console.log('take-ranking data:', data);
const rows = data.rows || [];
// 显示统计卡片