Commit 53108326 authored by 李苏's avatar 李苏 💬

timespan调整为公共格式化

parent 077e19bd
......@@ -98,33 +98,7 @@
{
title: "耗时",
field: "timespan",
width: 180,
formatter(a, b, duration) {
if (duration == 0 || !duration) {
return "0";
} else {
var days = Math.floor(duration / (1000 * 60 * 60 * 24));
var hours = Math.floor((duration % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((duration % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((duration % (1000 * 60)) / 1000);
var result = "";
if (days > 0) {
result += days + "天";
}
if (hours > 0) {
result += hours + "小时";
}
if (minutes > 0) {
result += minutes + "分钟";
}
if (seconds > 0) {
result += seconds + "秒";
}
return result;
}
}
fieldType: "timespan"
},
{
title: "创建人",
......
......@@ -109,32 +109,7 @@
title: "耗时",
field: "timespan",
width: 140,
formatter(a, b, duration) {
if (duration == 0 || !duration) {
return "0";
} else {
var days = Math.floor(duration / (1000 * 60 * 60 * 24));
var hours = Math.floor((duration % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((duration % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((duration % (1000 * 60)) / 1000);
var result = "";
if (days > 0) {
result += days + "天";
}
if (hours > 0) {
result += hours + "小时";
}
if (minutes > 0) {
result += minutes + "分钟";
}
if (seconds > 0) {
result += seconds + "秒";
}
return result;
}
}
fieldType: "timespan"
},
{
title: "创建人",
......
......@@ -109,32 +109,7 @@
title: "耗时",
field: "timespan",
width: 140,
formatter(a, b, duration) {
if (duration == 0 || !duration) {
return "0";
} else {
var days = Math.floor(duration / (1000 * 60 * 60 * 24));
var hours = Math.floor((duration % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((duration % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((duration % (1000 * 60)) / 1000);
var result = "";
if (days > 0) {
result += days + "天";
}
if (hours > 0) {
result += hours + "小时";
}
if (minutes > 0) {
result += minutes + "分钟";
}
if (seconds > 0) {
result += seconds + "秒";
}
return result;
}
}
fieldType: "timespan"
},
{
title: "创建人",
......
......@@ -128,32 +128,7 @@
title: "耗时",
field: "timespan",
width: 140,
formatter(a, b, duration) {
if (duration == 0 || !duration) {
return "0";
} else {
var days = Math.floor(duration / (1000 * 60 * 60 * 24));
var hours = Math.floor((duration % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((duration % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((duration % (1000 * 60)) / 1000);
var result = "";
if (days > 0) {
result += days + "天";
}
if (hours > 0) {
result += hours + "小时";
}
if (minutes > 0) {
result += minutes + "分钟";
}
if (seconds > 0) {
result += seconds + "秒";
}
return result;
}
}
fieldType: "timespan"
},
{
title: "巷道",
......
......@@ -132,33 +132,7 @@
{
title: "耗时",
field: "timespan",
width: 140,
formatter(a, b, duration) {
if (duration == 0 || !duration) {
return "0";
} else {
var days = Math.floor(duration / (1000 * 60 * 60 * 24));
var hours = Math.floor((duration % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((duration % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((duration % (1000 * 60)) / 1000);
var result = "";
if (days > 0) {
result += days + "天";
}
if (hours > 0) {
result += hours + "小时";
}
if (minutes > 0) {
result += minutes + "分";
}
if (seconds > 0) {
result += seconds + "秒";
}
return result;
}
}
fieldType: "timespan"
},
{
title: "业务类型",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment