修改BUG:操作日志页面排序重新设计 closed #ITC2Y

#Issue
https://gitee.com/LongbowEnterprise/BootstrapAdmin/issues/ITC2Y
This commit is contained in:
Argo Zhang 2019-03-10 13:53:00 +08:00
parent edd11c5c80
commit c965b96cfa
2 changed files with 6 additions and 8 deletions

View File

@ -31,7 +31,7 @@ namespace Bootstrap.Admin.Query
var data = LogHelper.Retrieves(); var data = LogHelper.Retrieves();
if (!string.IsNullOrEmpty(OperateType)) if (!string.IsNullOrEmpty(OperateType))
{ {
data = data.Where(t => t.CRUD.ToString().Contains(OperateType)); data = data.Where(t => t.CRUD.Contains(OperateType));
} }
if (OperateTimeStart > DateTime.MinValue) if (OperateTimeStart > DateTime.MinValue)
@ -56,14 +56,12 @@ namespace Bootstrap.Admin.Query
case "LogTime": case "LogTime":
data = Order == "asc" ? data.OrderBy(t => t.LogTime) : data.OrderByDescending(t => t.LogTime); data = Order == "asc" ? data.OrderBy(t => t.LogTime) : data.OrderByDescending(t => t.LogTime);
break; break;
case "ClientIp": case "Ip":
data = Order == "asc" ? data.OrderBy(t => t.Ip) : data.OrderByDescending(t => t.Ip); data = Order == "asc" ? data.OrderBy(t => t.Ip) : data.OrderByDescending(t => t.Ip);
break; break;
case "RequestUrl": case "RequestUrl":
data = Order == "asc" ? data.OrderBy(t => t.RequestUrl) : data.OrderByDescending(t => t.RequestUrl); data = Order == "asc" ? data.OrderBy(t => t.RequestUrl) : data.OrderByDescending(t => t.RequestUrl);
break; break;
default:
break;
} }
ret.rows = data.Skip(Offset).Take(Limit); ret.rows = data.Skip(Offset).Take(Limit);
return ret; return ret;

View File

@ -13,12 +13,12 @@
{ title: "用户名称", field: "UserName", sortable: true }, { title: "用户名称", field: "UserName", sortable: true },
{ title: "操作时间", field: "LogTime", sortable: true }, { title: "操作时间", field: "LogTime", sortable: true },
{ title: "登录主机", field: "Ip", sortable: true }, { title: "登录主机", field: "Ip", sortable: true },
{ title: "操作地点", field: "City", sortable: true }, { title: "操作地点", field: "City" },
{ title: "浏览器", field: "Browser", sortable: true }, { title: "浏览器", field: "Browser" },
{ title: "操作系统", field: "OS", sortable: true }, { title: "操作系统", field: "OS" },
{ title: "操作页面", field: "RequestUrl", sortable: true }, { title: "操作页面", field: "RequestUrl", sortable: true },
{ {
title: "请求数据", field: "RequestData", sortable: true, formatter: function (value, row, index) { title: "请求数据", field: "RequestData", formatter: function (value, row, index) {
return '<button class="detail btn btn-info"><i class="fa fa-info"></i><span>明细</span></button>'; return '<button class="detail btn btn-info"><i class="fa fa-info"></i><span>明细</span></button>';
}, },
events: { events: {