@@ -7,28 +7,6 @@ | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">填表人员</div> | |||
<input id="Creater" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">类别</div> | |||
<div id="Type"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">身份证号</div> | |||
<input id="IDCard" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">单位名称</div> | |||
<input id="UnitName" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
@@ -12,19 +12,15 @@ | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">填表人员</div> | |||
<input id="Creater" type="text" class="form-control" /> | |||
<div id="Creater"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">类别</div> | |||
<div id="Type"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">身份证号</div> | |||
<input id="IDCard" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">单位名称</div> | |||
<input id="UnitName" type="text" class="form-control" /> | |||
<div class="lr-form-item-title">系|专业|班级</div> | |||
<input id="StudentSource" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -5,6 +5,7 @@ | |||
* 描 述:疫情记录 | |||
*/ | |||
var refreshGirdData; | |||
var startTime, endTime; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
@@ -13,10 +14,13 @@ var bootstrap = function ($, learun) { | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#Type').lrDataItemSelect({ code: 'EUserType' }); | |||
$('#Creater').lrDataSourceSelect({ code: 'BaseUser', value: 'f_userid', text: 'f_realname' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
@@ -55,12 +59,6 @@ var bootstrap = function ($, learun) { | |||
} | |||
}, | |||
{ | |||
label: "填报日期", name: "CreateTime", width: 100, align: "left", | |||
formatter: function (value, row) { | |||
return dateFormat("YYYY-mm-dd", new Date(value)); | |||
} | |||
}, | |||
{ | |||
label: "类别", name: "Type", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
@@ -144,7 +144,31 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
list.Add(entity); | |||
} | |||
list = this.BaseRepository("CollegeMIS").FindList<EpidemicSituationEntity>(list, pagination).ToList(); | |||
var expression = LinqExtensions.True<EpidemicSituationEntity>(); | |||
var queryParam = queryJson.ToJObject(); | |||
// 填表人员 | |||
if (!queryParam["Creater"].IsEmpty()) | |||
{ | |||
string Creater = queryParam["Creater"].ToString(); | |||
expression = expression.And(t => t.Creater.Equals(Creater)); | |||
} | |||
// 类别 | |||
if (!queryParam["Type"].IsEmpty()) | |||
{ | |||
int Type = 0; | |||
int.TryParse(queryParam["Type"].ToString(), out Type); | |||
expression = expression.And(t => t.Type.Equals(Type)); | |||
} | |||
// 学生来源 | |||
if (!queryParam["StudentSource"].IsEmpty()) | |||
{ | |||
string StudentSource = queryParam["StudentSource"].ToString(); | |||
expression = expression.And(t => t.StudentSource.Contains(StudentSource)); | |||
} | |||
list = this.BaseRepository("CollegeMIS").FindList<EpidemicSituationEntity>(list, expression, pagination).ToList(); | |||
return list; | |||
@@ -233,6 +233,7 @@ namespace Learun.DataBase.Repository | |||
IEnumerable<T> FindList<T>(Pagination pagination) where T : class, new(); | |||
IEnumerable<T> FindList<T>(List<T> data, Pagination pagination) where T : class, new(); | |||
IEnumerable<T> FindList<T>(List<T> data, Expression<Func<T, bool>> condition, Pagination pagination) where T : class, new(); | |||
/// <summary> | |||
/// 查询列表(分页) | |||
/// </summary> | |||
@@ -447,11 +447,55 @@ namespace Learun.DataBase.Repository | |||
var property = typeof(T).GetProperty(_orderField); | |||
var propertyAccess = Expression.MakeMemberAccess(parameter, property); | |||
var orderByExp = Expression.Lambda(propertyAccess, parameter); | |||
resultExp = Expression.Call(typeof(Queryable), isAsc ? "OrderBy" : "OrderByDescending", new Type[] { typeof(T), property.PropertyType }, tempData.Expression, Expression.Quote(orderByExp)); | |||
} | |||
} | |||
if (resultExp != null) | |||
{ | |||
tempData = tempData.Provider.CreateQuery<T>(resultExp); | |||
} | |||
pagination.records = tempData.Count(); | |||
tempData = tempData.Skip<T>(pageSize * (pageIndex - 1)).Take<T>(pageSize).AsQueryable(); | |||
return tempData.ToList(); | |||
} | |||
public IEnumerable<T> FindList<T>(List<T> data, Expression<Func<T, bool>> condition, Pagination pagination) where T : class, new() | |||
{ | |||
var isAsc = pagination.sord.ToLower() == "asc" ? true : false; | |||
var pageSize = pagination.rows; | |||
var pageIndex = pagination.page; | |||
string[] _order = pagination.sidx.Split(','); | |||
MethodCallExpression resultExp = null; | |||
var tempData = data.AsQueryable().Where(condition); | |||
foreach (string item in _order) | |||
{ | |||
if (!string.IsNullOrEmpty(item)) | |||
{ | |||
string _orderPart = item; | |||
_orderPart = Regex.Replace(_orderPart, @"\s+", " "); | |||
string[] _orderArry = _orderPart.Split(' '); | |||
string _orderField = _orderArry[0]; | |||
bool sort = isAsc; | |||
if (_orderArry.Length == 2) | |||
{ | |||
isAsc = _orderArry[1].ToUpper() == "ASC" ? true : false; | |||
} | |||
var parameter = Expression.Parameter(typeof(T), "t"); | |||
var property = typeof(T).GetProperty(_orderField); | |||
var propertyAccess = Expression.MakeMemberAccess(parameter, property); | |||
var orderByExp = Expression.Lambda(propertyAccess, parameter); | |||
resultExp = Expression.Call(typeof(Queryable), isAsc ? "OrderBy" : "OrderByDescending", new Type[] { typeof(T), property.PropertyType }, tempData.Expression, Expression.Quote(orderByExp)); | |||
} | |||
} | |||
if (resultExp != null) | |||
{ | |||
tempData = tempData.Provider.CreateQuery<T>(resultExp); | |||
} | |||
pagination.records = tempData.Count(); | |||
tempData = tempData.Skip<T>(pageSize * (pageIndex - 1)).Take<T>(pageSize).AsQueryable(); | |||
return tempData.ToList(); | |||
} | |||