feat(dashboard): 新增生肖转移概率表格
在控制台页面转移概率区域新增生肖(12生肖)转移概率矩阵,与现有 的区域转移和波色转移保持一致的展示风格。
This commit is contained in:
@@ -88,6 +88,7 @@ define(['jquery'], function ($) {
|
||||
// 区域转移概率 + 波色转移概率
|
||||
if (zt && zt.matrix && zt.matrix.length > 0) {
|
||||
var cwt = data.colorwavetransition;
|
||||
var zt2 = data.zodiactransition;
|
||||
html += '<div class="dash-section"><h4>🔄 转移概率</h4><div class="row">';
|
||||
// 左侧:区域转移
|
||||
html += '<div class="col-sm-7"><div style="font-size:12px;color:#999;margin-bottom:8px;">区域转移(共 ' + zt.total_transitions + ' 次)</div>';
|
||||
@@ -153,6 +154,28 @@ define(['jquery'], function ($) {
|
||||
}
|
||||
html += '</tbody></table>';
|
||||
}
|
||||
// 下方:生肖转移矩阵
|
||||
if (zt2 && zt2.matrix && zt2.matrix.length > 0) {
|
||||
html += '<div style="margin-top:20px;font-size:12px;color:#999;margin-bottom:8px;">生肖转移(共 ' + zt2.total_transitions + ' 次)</div>';
|
||||
html += '<table class="table table-bordered table-condensed text-center" style="max-width:720px;margin:0 auto;"><thead><tr><th style="width:50px;">特码</th>';
|
||||
for (var z = 0; z < zt2.animals.length; z++) {
|
||||
html += '<th>' + zt2.animals[z] + '</th>';
|
||||
}
|
||||
html += '</tr></thead><tbody>';
|
||||
var animalColors = ['#e74c3c', '#3498db', '#2ecc71', '#f39c12', '#9b59b6', '#1abc9c', '#e67e22', '#34495e', '#e74c3c', '#3498db', '#2ecc71', '#f39c12'];
|
||||
for (var r = 0; r < zt2.animals.length; r++) {
|
||||
html += '<tr><td style="font-weight:bold;color:' + animalColors[r] + ';">' + zt2.animals[r] + '</td>';
|
||||
for (var c = 0; c < zt2.animals.length; c++) {
|
||||
var pct = zt2.probabilities[r][c];
|
||||
var cnt = zt2.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>';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user