/// <summary> /// 用户分页action /// </summary> /// <returns></returns> public IActionResult PageIndex(string realName, string deptId, string userId, int pageindex = 0, int pagesize = 10) { string enConde = string.Empty; if (!string.IsNullOrEmpty(deptId)) { enConde = _userManageService.GetDeptEncode(deptId.Trim()); } List <Expression <Func <SysUser, bool> > > searchs = new List <Expression <Func <SysUser, bool> > >(); if (!string.IsNullOrEmpty(realName)) { searchs.Add(x => x.RealName.Contains(realName.Trim())); } if (!string.IsNullOrEmpty(userId)) { searchs.Add(x => x.UserId.Contains(userId.Trim())); } if (!string.IsNullOrEmpty(enConde)) { searchs.Add(x => x.Encode.StartsWith(enConde)); } Dictionary <string, bool> order = new Dictionary <string, bool> { { "CreationTime", true } }; var pageList = _userManageService.GetRolePageList(pagesize, pageindex, out int totalcount, searchs, order); return(JsonContent(new { rows = pageList, total = totalcount })); }