createTime返回前端有时分秒,updateTime返回没有,有人对createTime做了特殊处理,在此处加上updateTime
This commit is contained in:
@@ -162,8 +162,8 @@
|
|||||||
return value ? "是" : "否";
|
return value ? "是" : "否";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{title: '创建时间', field: 'createTime', width: 70},
|
{title: '创建时间', field: 'createTime', width: 140,formatter: formatDatebox},
|
||||||
{title: '更新时间', field: 'updateTime', width: 70},
|
{title: '更新时间', field: 'updateTime', width: 140,formatter: formatDatebox},
|
||||||
{title: '备注', field: 'remark',width: 300}
|
{title: '备注', field: 'remark',width: 300}
|
||||||
]],
|
]],
|
||||||
toolbar: [
|
toolbar: [
|
||||||
@@ -448,6 +448,40 @@
|
|||||||
$("#searchBtn").click();
|
$("#searchBtn").click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
/**时间格式化*/
|
||||||
|
Date.prototype.format = function (format) {
|
||||||
|
var o = {
|
||||||
|
"M+": this.getMonth() + 1, // month
|
||||||
|
"d+": this.getDate(), // day
|
||||||
|
"h+": this.getHours(), // hour
|
||||||
|
"m+": this.getMinutes(), // minute
|
||||||
|
"s+": this.getSeconds(), // second
|
||||||
|
"q+": Math.floor((this.getMonth() + 3) / 3), // quarter
|
||||||
|
"S": this.getMilliseconds()
|
||||||
|
// millisecond
|
||||||
|
}
|
||||||
|
if (/(y+)/.test(format))
|
||||||
|
format = format.replace(RegExp.$1, (this.getFullYear() + "")
|
||||||
|
.substr(4 - RegExp.$1.length));
|
||||||
|
for (var k in o)
|
||||||
|
if (new RegExp("(" + k + ")").test(format))
|
||||||
|
format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
|
||||||
|
return format;
|
||||||
|
}
|
||||||
|
function formatDatebox(value) {
|
||||||
|
if (value == null || value == '') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
var dt;
|
||||||
|
if (value instanceof Date) {
|
||||||
|
dt = value;
|
||||||
|
} else {
|
||||||
|
dt = new Date(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return dt.format("yyyy-MM-dd hh:mm:ss"); //扩展的Date的format方法(上述插件实现)
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class ResponseJsonUtil {
|
|||||||
public static final class ResponseFilter extends ExtJsonUtils.ExtFilter implements ValueFilter {
|
public static final class ResponseFilter extends ExtJsonUtils.ExtFilter implements ValueFilter {
|
||||||
@Override
|
@Override
|
||||||
public Object process(Object object, String name, Object value) {
|
public Object process(Object object, String name, Object value) {
|
||||||
if (name.equals("createTime") || name.equals("modifyTime")) {
|
if (name.equals("createTime") || name.equals("modifyTime")||name.equals("updateTime")) {
|
||||||
return value;
|
return value;
|
||||||
} else if (value instanceof Date) {
|
} else if (value instanceof Date) {
|
||||||
return FORMAT.format(value);
|
return FORMAT.format(value);
|
||||||
|
|||||||
Reference in New Issue
Block a user