feat(history): 新增历史开奖数据分析功能

- 添加History控制器和模型实现开奖数据统计分析
- 实现遗漏号码、走势图、冷热号码等基础分析功能
- 添加波色分析、生肖分析、奇偶分析等专项统计
- 集成尾号转移矩阵和首号转移矩阵概率分析
- 在后台仪表板展示综合统计数据表格
This commit is contained in:
2026-04-30 22:45:03 +08:00
parent d18c23cd57
commit 6a782c2d65
4 changed files with 212 additions and 5 deletions
+46
View File
@@ -176,6 +176,52 @@ define(['jquery'], function ($) {
}
html += '</tbody></table>';
}
// 尾号转移矩阵
var tnt = data.tailnumbertransition;
if (tnt && tnt.matrix && tnt.matrix.length > 0) {
html += '<div style="margin-top:20px;font-size:12px;color:#999;margin-bottom:8px;">尾号转移(共 ' + tnt.total_transitions + ' 次)</div>';
html += '<table class="table table-bordered table-condensed text-center" style="max-width:600px;margin:0 auto;"><thead><tr><th style="width:50px;">特码</th>';
for (var z = 0; z < tnt.tails.length; z++) {
html += '<th>' + tnt.tails[z] + '</th>';
}
html += '</tr></thead><tbody>';
for (var r = 0; r < tnt.tails.length; r++) {
html += '<tr><td style="font-weight:bold;">' + tnt.tails[r] + '</td>';
for (var c = 0; c < tnt.tails.length; c++) {
var pct = tnt.probabilities[r][c];
var cnt = tnt.matrix[r][c];
var bg = pct > 20 ? '#e74c3c' : pct > 15 ? '#f39c12' : pct > 10 ? '#3498db' : pct > 0 ? '#95a5a6' : '#f5f5f5';
var txt = pct > 10 ? '#fff' : '#333';
html += '<td style="background-color:' + bg + ';color:' + txt + ';">' + cnt + '次<br>' + pct + '%</td>';
}
html += '</tr>';
}
html += '</tbody></table>';
}
// 首号转移矩阵
var hnt = data.headnumbertransition;
if (hnt && hnt.matrix && hnt.matrix.length > 0) {
html += '<div style="margin-top:20px;font-size:12px;color:#999;margin-bottom:8px;">首号转移(共 ' + hnt.total_transitions + ' 次)</div>';
html += '<table class="table table-bordered table-condensed text-center" style="max-width:400px;margin:0 auto;"><thead><tr><th style="width:60px;">特码</th>';
for (var z = 0; z < hnt.heads.length; z++) {
html += '<th>' + hnt.heads[z] + '</th>';
}
html += '</tr></thead><tbody>';
for (var r = 0; r < hnt.heads.length; r++) {
html += '<tr><td style="font-weight:bold;">' + hnt.heads[r] + '</td>';
for (var c = 0; c < hnt.heads.length; c++) {
var pct = hnt.probabilities[r][c];
var cnt = hnt.matrix[r][c];
var bg = pct > 30 ? '#e74c3c' : pct > 20 ? '#f39c12' : pct > 10 ? '#3498db' : pct > 0 ? '#95a5a6' : '#f5f5f5';
var txt = pct > 10 ? '#fff' : '#333';
html += '<td style="background-color:' + bg + ';color:' + txt + ';">' + cnt + '次<br>' + pct + '%</td>';
}
html += '</tr>';
}
html += '</tbody></table>';
}
html += '</div>';
}