//表格内容
tableData([]);
function tableData(relativeDataD){
$("#LAY_table").bootstrapTable('destroy');
$('#LAY_table').bootstrapTable({
onDblClickRow:function(row,$element){
},
data:relativeDataD,
showFooter:true,//合计
columns:[
{
field:'priority',
title:'工单级别',
footerFormatter: function (value) {
return '合计';
}
},
{
field:'finalNum',
title:'完成工单数量',
footerFormatter: function (value) {
var count = 0;
for (var i in value) { count += value[i].finalNum; }
return count;
}
},
{
field:'clooseNum',
title:'关闭工单数',
footerFormatter: function (value) {
var count = 0;
for (var i in value) { count += value[i].clooseNum; }
return count;
}
},
{
field:'isbugNum',
title:'提交bug数',
footerFormatter: function (value) {
var count = 0;
for (var i in value) { count += value[i].isbugNum; }
return count;
}
},
{
field:'finalTime',
title:'平均完成时长',
footerFormatter: function (value) {
var count = 0;
for (var i in value) {
count += changesec(value[i].finalTime);
}
return changeTime(count);
}
},
{
field:'solutionTime',
title:'平均解决时长',
footerFormatter: function (value) {
var count = 0;
for (var i in value) {
count += changesec(value[i].solutionTime);
}
return changeTime(count);
}
},
],
})
$('#LAY_table').bootstrapTable("hideLoading");
}
function changesec (time) {
var s = '';
var hour = time.split(':')[0];
var min = time.split(':')[1];
var sec = time.split(':')[2];
s = Number(hour*3600) + Number(min*60) + Number(sec);
return s;
};
function changeTime (s) {
var t;
if(s > -1){
var hour = Math.floor(s/3600);
var min = Math.floor(s/60) % 60;
var sec = s % 60;
if(hour < 10) {
t = '0'+ hour + ":";
} else {
t = hour + ":";
}
if(min < 10){t += "0";}
t += min + ":";
if(sec < 10){t += "0";}
// t += sec.toFixed(2);
t += sec;
}
return t;
}
合计
最新推荐文章于 2021-08-12 21:50:38 发布