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

timespan调整为公共格式化

parent 077e19bd
...@@ -98,33 +98,7 @@ ...@@ -98,33 +98,7 @@
{ {
title: "耗时", title: "耗时",
field: "timespan", field: "timespan",
width: 180, fieldType: "timespan"
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;
}
}
}, },
{ {
title: "创建人", title: "创建人",
......
...@@ -109,32 +109,7 @@ ...@@ -109,32 +109,7 @@
title: "耗时", title: "耗时",
field: "timespan", field: "timespan",
width: 140, width: 140,
formatter(a, b, duration) { fieldType: "timespan"
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;
}
}
}, },
{ {
title: "创建人", title: "创建人",
......
...@@ -109,32 +109,7 @@ ...@@ -109,32 +109,7 @@
title: "耗时", title: "耗时",
field: "timespan", field: "timespan",
width: 140, width: 140,
formatter(a, b, duration) { fieldType: "timespan"
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;
}
}
}, },
{ {
title: "创建人", title: "创建人",
......
...@@ -128,32 +128,7 @@ ...@@ -128,32 +128,7 @@
title: "耗时", title: "耗时",
field: "timespan", field: "timespan",
width: 140, width: 140,
formatter(a, b, duration) { fieldType: "timespan"
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;
}
}
}, },
{ {
title: "巷道", title: "巷道",
......
...@@ -132,33 +132,7 @@ ...@@ -132,33 +132,7 @@
{ {
title: "耗时", title: "耗时",
field: "timespan", field: "timespan",
width: 140, fieldType: "timespan"
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;
}
}
}, },
{ {
title: "业务类型", title: "业务类型",
...@@ -223,7 +197,7 @@ ...@@ -223,7 +197,7 @@
typeConfig: { typeConfig: {
src: "lxyl/wcs/wcsTask/init/hj", src: "lxyl/wcs/wcsTask/init/hj",
} }
}, },
], ],
[ [
{ {
......
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