chore(admin-dashboard): enrich trend bar tooltip with avg paid
This commit is contained in:
@@ -144,8 +144,12 @@
|
||||
bar.style.height = h + 'px';
|
||||
|
||||
var date = (p && p.date) ? String(p.date) : '';
|
||||
var count = (p && p.count != null) ? String(p.count) : '0';
|
||||
bar.title = date + ':' + count + ' 单,已付 ¥' + formatMoney(paid);
|
||||
var countNum = Number(p && p.count != null ? p.count : 0);
|
||||
if (!isFinite(countNum) || countNum < 0) {
|
||||
countNum = 0;
|
||||
}
|
||||
var avg = countNum > 0 ? (paid / countNum) : 0;
|
||||
bar.title = date + '|订单 ' + String(countNum) + ' 单|已付 ¥' + formatMoney(paid) + '|单均 ¥' + formatMoney(avg);
|
||||
|
||||
el.appendChild(bar);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user