feat(dashboard): 新增区域→波色交叉转移概率表格
This commit is contained in:
@@ -130,7 +130,31 @@ define(['jquery'], function ($) {
|
||||
}
|
||||
html += '</tbody></table></div>';
|
||||
}
|
||||
html += '</div></div>';
|
||||
html += '</div>';
|
||||
// 下方:区域→波色交叉转移
|
||||
var ztc = data.zonetocolortransition;
|
||||
if (ztc && ztc.matrix && ztc.matrix.length > 0) {
|
||||
html += '<div style="margin-top:20px;font-size:12px;color:#999;margin-bottom:8px;">区域→波色交叉转移(共 ' + ztc.total_transitions + ' 次)</div>';
|
||||
html += '<table class="table table-bordered table-condensed text-center" style="max-width:500px;margin:0 auto;"><thead><tr><th style="width:80px;position:relative;"><div style="width:100%;height:35px;border-bottom:1px solid #e5e5e5;position:relative;"><span style="position:absolute;top:2px;right:5px;font-size:12px;">波色</span><span style="position:absolute;bottom:2px;left:5px;font-size:12px;">特码</span></div></th>';
|
||||
var cwColors2 = ['#e74c3c', '#3498db', '#2ecc71'];
|
||||
for (var z = 0; z < ztc.colors.length; z++) {
|
||||
html += '<th><span style="color:' + cwColors2[z] + '">' + ztc.colors[z] + '</span></th>';
|
||||
}
|
||||
html += '</tr></thead><tbody>';
|
||||
for (var r = 0; r < 5; r++) {
|
||||
html += '<tr><td style="font-weight:bold;">' + ztc.zones[r] + '</td>';
|
||||
for (var c = 0; c < 3; c++) {
|
||||
var pct = ztc.probabilities[r][c];
|
||||
var cnt = ztc.matrix[r][c];
|
||||
var bg = pct > 40 ? cwColors2[c] : pct > 20 ? cwColors2[c] + 'cc' : pct > 0 ? '#95a5a6' : '#f5f5f5';
|
||||
var txt = pct > 20 ? '#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