* finish task 5810.

This commit is contained in:
Yagami
2019-06-19 13:50:20 +08:00
parent 50cb4f7ea1
commit adbd46fce6
2 changed files with 10 additions and 5 deletions
+9 -4
View File
@@ -288,7 +288,8 @@ $(function()
{
statisticCreator: function(table)
{
var $checkedRows = table.$.find('tbody>tr.checked');
var $checkedRows = table.getTable().find(table.isDataTable ? '.datatable-row-left.checked' : 'tbody>tr.checked');
var $originTable = table.isDataTable ? table.$.find('.datatable-origin') : null;
var checkedTotal = $checkedRows.length;
if(!checkedTotal) return;
@@ -297,13 +298,17 @@ $(function()
$checkedRows.each(function()
{
var $row = $(this);
if ($originTable)
{
$row = $originTable.find('tbody>tr[data-id="' + $row.data('id') + '"]');
}
var data = $row.data();
checkedEstimate += data.estimate;
checkedCase += data.cases;
if(data.cases > 0) checkedCase += 1;
});
var rate = Math.round(checkedCase / checkedTotal * 10000) / 100 + '' + '%';
var rate = Math.round(checkedCase / checkedTotal * 10000 / 100) + '' + '%';
return checkedSummary.replace('%total%', checkedTotal)
.replace('%estimate%', checkedEstimate)
.replace('%estimate%', checkedEstimate.toFixed(1))
.replace('%rate%', rate);
}
});