update 删除所有Xn前缀, 规范了所有分页参数和返回值
This commit is contained in:
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Ewide.Application.Service.HouseProjectInfo.Dto
|
namespace Ewide.Application.Service.HouseProjectInfo.Dto
|
||||||
{
|
{
|
||||||
public class HouseProjectInfoInput : XnInputBase
|
public class HouseProjectInfoInput : InputBase
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string Note { get; set; }
|
public string Note { get; set; }
|
||||||
|
|||||||
@@ -92,8 +92,8 @@ namespace Ewide.Application.Service.HouseProjectInfo
|
|||||||
.Where(!string.IsNullOrEmpty(input.Note), x => x.p.Note.Contains(input.Note))
|
.Where(!string.IsNullOrEmpty(input.Note), x => x.p.Note.Contains(input.Note))
|
||||||
.Where(!string.IsNullOrEmpty(input.AreaCode), x => x.p.AreaCode == input.AreaCode)
|
.Where(!string.IsNullOrEmpty(input.AreaCode), x => x.p.AreaCode == input.AreaCode)
|
||||||
.Where(!string.IsNullOrEmpty(input.pid) , x=> x.p.AreaCode.Contains(input.pid))
|
.Where(!string.IsNullOrEmpty(input.pid) , x=> x.p.AreaCode.Contains(input.pid))
|
||||||
.Select(x => new { x.p.Id, x.p.Name, x.p.Note, x.p.Sort, x.p.AreaCode, x.AreaName, x.p.Type }.Adapt<HouseProjectOutput>()).ToPagedListAsync(input.PageNo, input.PageSize);
|
.Select(x => new { x.p.Id, x.p.Name, x.p.Note, x.p.Sort, x.p.AreaCode, x.AreaName, x.p.Type }.Adapt<HouseProjectOutput>()).ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
return XnPageResult<HouseProjectOutput>.PageResult(projects);
|
return PageDataResult<HouseProjectOutput>.PageResult(projects);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -2528,27 +2528,27 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<param name="dict"></param>
|
<param name="dict"></param>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:Ewide.Core.XnInputBase">
|
<member name="T:Ewide.Core.InputBase">
|
||||||
<summary>
|
<summary>
|
||||||
通用输入扩展参数(带权限)
|
通用输入扩展参数(带权限)
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Ewide.Core.XnInputBase.GrantMenuIdList">
|
<member name="P:Ewide.Core.InputBase.GrantMenuIdList">
|
||||||
<summary>
|
<summary>
|
||||||
授权菜单
|
授权菜单
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Ewide.Core.XnInputBase.GrantRoleIdList">
|
<member name="P:Ewide.Core.InputBase.GrantRoleIdList">
|
||||||
<summary>
|
<summary>
|
||||||
授权角色
|
授权角色
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Ewide.Core.XnInputBase.GrantOrgIdList">
|
<member name="P:Ewide.Core.InputBase.GrantOrgIdList">
|
||||||
<summary>
|
<summary>
|
||||||
授权数据
|
授权数据
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Ewide.Core.XnInputBase.GrantAreaCodeList">
|
<member name="P:Ewide.Core.InputBase.GrantAreaCodeList">
|
||||||
<summary>
|
<summary>
|
||||||
授权区域
|
授权区域
|
||||||
</summary>
|
</summary>
|
||||||
@@ -2563,7 +2563,7 @@
|
|||||||
搜索值
|
搜索值
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Ewide.Core.PageInputBase.PageNo">
|
<member name="P:Ewide.Core.PageInputBase.PageIndex">
|
||||||
<summary>
|
<summary>
|
||||||
当前页码
|
当前页码
|
||||||
</summary>
|
</summary>
|
||||||
@@ -2598,25 +2598,25 @@
|
|||||||
降序排序(不要问我为什么是descend不是desc,前端约定参数就是这样)
|
降序排序(不要问我为什么是descend不是desc,前端约定参数就是这样)
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:Ewide.Core.XnPageResult`1">
|
<member name="T:Ewide.Core.PageDataResult`1">
|
||||||
<summary>
|
<summary>
|
||||||
小诺分页列表结果
|
小诺分页列表结果
|
||||||
</summary>
|
</summary>
|
||||||
<typeparam name="T"></typeparam>
|
<typeparam name="T"></typeparam>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:Ewide.Core.XnRestfulResultProvider">
|
<member name="T:Ewide.Core.RestfulResultProvider">
|
||||||
<summary>
|
<summary>
|
||||||
规范化RESTful风格返回值
|
规范化RESTful风格返回值
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Ewide.Core.XnRestfulResultProvider.OnException(Microsoft.AspNetCore.Mvc.Filters.ExceptionContext)">
|
<member name="M:Ewide.Core.RestfulResultProvider.OnException(Microsoft.AspNetCore.Mvc.Filters.ExceptionContext)">
|
||||||
<summary>
|
<summary>
|
||||||
异常返回值
|
异常返回值
|
||||||
</summary>
|
</summary>
|
||||||
<param name="context"></param>
|
<param name="context"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Ewide.Core.XnRestfulResultProvider.OnResponseStatusCodes(Microsoft.AspNetCore.Http.HttpContext,System.Int32,Furion.UnifyResult.UnifyResultStatusCodesOptions)">
|
<member name="M:Ewide.Core.RestfulResultProvider.OnResponseStatusCodes(Microsoft.AspNetCore.Http.HttpContext,System.Int32,Furion.UnifyResult.UnifyResultStatusCodesOptions)">
|
||||||
<summary>
|
<summary>
|
||||||
处理输出状态码
|
处理输出状态码
|
||||||
</summary>
|
</summary>
|
||||||
@@ -2625,14 +2625,14 @@
|
|||||||
<param name="options"></param>
|
<param name="options"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Ewide.Core.XnRestfulResultProvider.OnSucceeded(Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext)">
|
<member name="M:Ewide.Core.RestfulResultProvider.OnSucceeded(Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext)">
|
||||||
<summary>
|
<summary>
|
||||||
成功返回值
|
成功返回值
|
||||||
</summary>
|
</summary>
|
||||||
<param name="context"></param>
|
<param name="context"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Ewide.Core.XnRestfulResultProvider.OnValidateFailed(Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext,Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary,System.Collections.Generic.IEnumerable{Furion.DataValidation.ValidateFailedModel},System.String)">
|
<member name="M:Ewide.Core.RestfulResultProvider.OnValidateFailed(Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext,Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary,System.Collections.Generic.IEnumerable{Furion.DataValidation.ValidateFailedModel},System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
验证失败返回值
|
验证失败返回值
|
||||||
</summary>
|
</summary>
|
||||||
@@ -2642,38 +2642,38 @@
|
|||||||
<param name="validateFailedMessage"></param>
|
<param name="validateFailedMessage"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:Ewide.Core.XnRestfulResult`1">
|
<member name="T:Ewide.Core.RestfulResult`1">
|
||||||
<summary>
|
<summary>
|
||||||
RESTful风格---XIAONUO返回格式
|
RESTful风格---XIAONUO返回格式
|
||||||
</summary>
|
</summary>
|
||||||
<typeparam name="T"></typeparam>
|
<typeparam name="T"></typeparam>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Ewide.Core.XnRestfulResult`1.Success">
|
<member name="P:Ewide.Core.RestfulResult`1.Success">
|
||||||
<summary>
|
<summary>
|
||||||
执行成功
|
执行成功
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Ewide.Core.XnRestfulResult`1.Code">
|
<member name="P:Ewide.Core.RestfulResult`1.Code">
|
||||||
<summary>
|
<summary>
|
||||||
状态码
|
状态码
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Ewide.Core.XnRestfulResult`1.Message">
|
<member name="P:Ewide.Core.RestfulResult`1.Message">
|
||||||
<summary>
|
<summary>
|
||||||
错误信息
|
错误信息
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Ewide.Core.XnRestfulResult`1.Data">
|
<member name="P:Ewide.Core.RestfulResult`1.Data">
|
||||||
<summary>
|
<summary>
|
||||||
数据
|
数据
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Ewide.Core.XnRestfulResult`1.Extras">
|
<member name="P:Ewide.Core.RestfulResult`1.Extras">
|
||||||
<summary>
|
<summary>
|
||||||
附加数据
|
附加数据
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Ewide.Core.XnRestfulResult`1.Timestamp">
|
<member name="P:Ewide.Core.RestfulResult`1.Timestamp">
|
||||||
<summary>
|
<summary>
|
||||||
时间戳
|
时间戳
|
||||||
</summary>
|
</summary>
|
||||||
@@ -3696,51 +3696,6 @@
|
|||||||
表名称描述(注释)(功能名)
|
表名称描述(注释)(功能名)
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Ewide.Core.Service.XnCodeGenOutput.AuthorName">
|
|
||||||
<summary>
|
|
||||||
作者姓名
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:Ewide.Core.Service.XnCodeGenOutput.TablePrefix">
|
|
||||||
<summary>
|
|
||||||
是否移除表前缀
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:Ewide.Core.Service.XnCodeGenOutput.GenerateType">
|
|
||||||
<summary>
|
|
||||||
生成方式
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:Ewide.Core.Service.XnCodeGenOutput.TableName">
|
|
||||||
<summary>
|
|
||||||
数据库表名
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:Ewide.Core.Service.XnCodeGenOutput.TableNameAss">
|
|
||||||
<summary>
|
|
||||||
数据库表名(经过组装的)
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:Ewide.Core.Service.XnCodeGenOutput.PackageName">
|
|
||||||
<summary>
|
|
||||||
代码包名
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:Ewide.Core.Service.XnCodeGenOutput.CreateTimestring">
|
|
||||||
<summary>
|
|
||||||
生成时间(string类型的)
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:Ewide.Core.Service.XnCodeGenOutput.ConfigList">
|
|
||||||
<summary>
|
|
||||||
数据库表中字段集合
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:Ewide.Core.Service.XnCodeGenOutput.BusName">
|
|
||||||
<summary>
|
|
||||||
业务名
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="T:Ewide.Core.Service.ConfigInput">
|
<member name="T:Ewide.Core.Service.ConfigInput">
|
||||||
<summary>
|
<summary>
|
||||||
参数配置
|
参数配置
|
||||||
@@ -6793,6 +6748,16 @@
|
|||||||
状态-正常_0、停用_1、删除_2
|
状态-正常_0、停用_1、删除_2
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:Ewide.Core.Service.UserOutput.OrgName">
|
||||||
|
<summary>
|
||||||
|
所在机构名称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Ewide.Core.Service.UserOutput.RoleName">
|
||||||
|
<summary>
|
||||||
|
角色名称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:Ewide.Core.Service.UserOutput.SysEmpInfo">
|
<member name="P:Ewide.Core.Service.UserOutput.SysEmpInfo">
|
||||||
<summary>
|
<summary>
|
||||||
员工信息
|
员工信息
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace Ewide.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 通用输入扩展参数(带权限)
|
/// 通用输入扩展参数(带权限)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class XnInputBase : PageInputBase
|
public class InputBase : PageInputBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 授权菜单
|
/// 授权菜单
|
||||||
@@ -40,7 +40,7 @@ namespace Ewide.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当前页码
|
/// 当前页码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual int PageNo { get; set; } = 1;
|
public virtual int PageIndex { get; set; } = 1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 页码容量
|
/// 页码容量
|
||||||
38
Api/Ewide.Core/Extension/PageDataResult.cs
Normal file
38
Api/Ewide.Core/Extension/PageDataResult.cs
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Ewide.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 小诺分页列表结果
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
public static class PageDataResult<T> where T : new()
|
||||||
|
{
|
||||||
|
public static dynamic PageResult(PagedList<T> page)
|
||||||
|
{
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
PageIndex = page.PageIndex,
|
||||||
|
PageSize = page.PageSize,
|
||||||
|
TotalPage = page.TotalPages,
|
||||||
|
TotalCount = page.TotalCount,
|
||||||
|
Items = page.Items
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class PageDataResult
|
||||||
|
{
|
||||||
|
public static dynamic PageResult(PagedList page)
|
||||||
|
{
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
PageIndex = page.PageIndex,
|
||||||
|
PageSize = page.PageSize,
|
||||||
|
TotalPage = page.TotalPages,
|
||||||
|
TotalCount = page.TotalCount,
|
||||||
|
Items = page.Items
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -43,12 +43,12 @@ namespace Ewide.Core.Extension
|
|||||||
|
|
||||||
public static Task<PagedList<T>> ToPageData<T>(this IQueryable<T> source, PageInputBase input) where T : new()
|
public static Task<PagedList<T>> ToPageData<T>(this IQueryable<T> source, PageInputBase input) where T : new()
|
||||||
{
|
{
|
||||||
return source.OrderBy(OrderBuilder<T>(input)).ToPagedListAsync(input.PageNo, input.PageSize);
|
return source.OrderBy(OrderBuilder<T>(input)).ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Task<PagedList<O>> ToPageData<T, O>(this IQueryable<T> source, PageInputBase input) where O : new()
|
public static Task<PagedList<O>> ToPageData<T, O>(this IQueryable<T> source, PageInputBase input) where O : new()
|
||||||
{
|
{
|
||||||
return source.OrderBy(OrderBuilder<T>(input)).Select(u => u.Adapt<O>()).ToPagedListAsync(input.PageNo, input.PageSize);
|
return source.OrderBy(OrderBuilder<T>(input)).Select(u => u.Adapt<O>()).ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region DAPPER
|
#region DAPPER
|
||||||
@@ -72,7 +72,7 @@ namespace Ewide.Core.Extension
|
|||||||
|
|
||||||
var page = new PagedList
|
var page = new PagedList
|
||||||
{
|
{
|
||||||
PageIndex = input.PageNo,
|
PageIndex = input.PageIndex,
|
||||||
PageSize = input.PageSize,
|
PageSize = input.PageSize,
|
||||||
Items = data,
|
Items = data,
|
||||||
TotalCount = count,
|
TotalCount = count,
|
||||||
@@ -102,7 +102,7 @@ namespace Ewide.Core.Extension
|
|||||||
|
|
||||||
var page = new PagedList<T>
|
var page = new PagedList<T>
|
||||||
{
|
{
|
||||||
PageIndex = input.PageNo,
|
PageIndex = input.PageIndex,
|
||||||
PageSize = input.PageSize,
|
PageSize = input.PageSize,
|
||||||
Items = data,
|
Items = data,
|
||||||
TotalCount = count,
|
TotalCount = count,
|
||||||
@@ -131,7 +131,7 @@ namespace Ewide.Core.Extension
|
|||||||
var orderStr = OrderBuilder(input);
|
var orderStr = OrderBuilder(input);
|
||||||
if (!string.IsNullOrEmpty(orderStr)) sqlStrList.Add(" ORDER BY " + orderStr);
|
if (!string.IsNullOrEmpty(orderStr)) sqlStrList.Add(" ORDER BY " + orderStr);
|
||||||
// input.PageSize = 0表示不分页
|
// input.PageSize = 0表示不分页
|
||||||
if (input.PageSize != 0) sqlStrList.Add(" LIMIT " + ((input.PageNo - 1) * input.PageSize).ToString() + "," + input.PageSize.ToString());
|
if (input.PageSize != 0) sqlStrList.Add(" LIMIT " + ((input.PageIndex - 1) * input.PageSize).ToString() + "," + input.PageSize.ToString());
|
||||||
sql += String.Join("", sqlStrList);
|
sql += String.Join("", sqlStrList);
|
||||||
return sql;
|
return sql;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ namespace Ewide.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 规范化RESTful风格返回值
|
/// 规范化RESTful风格返回值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SkipScan, UnifyModel(typeof(XnRestfulResult<>))]
|
[SkipScan, UnifyModel(typeof(RestfulResult<>))]
|
||||||
public class XnRestfulResultProvider : IUnifyResultProvider
|
public class RestfulResultProvider : IUnifyResultProvider
|
||||||
{
|
{
|
||||||
private IActionResult DisplayJson(object data)
|
private IActionResult DisplayJson(object data)
|
||||||
{
|
{
|
||||||
@@ -41,7 +41,7 @@ namespace Ewide.Core
|
|||||||
// 解析异常信息
|
// 解析异常信息
|
||||||
var (StatusCode, ErrorCode, Errors) = UnifyContext.GetExceptionMetadata(context);
|
var (StatusCode, ErrorCode, Errors) = UnifyContext.GetExceptionMetadata(context);
|
||||||
|
|
||||||
return DisplayJson(new XnRestfulResult<object>
|
return DisplayJson(new RestfulResult<object>
|
||||||
{
|
{
|
||||||
Code = StatusCode,
|
Code = StatusCode,
|
||||||
Success = false,
|
Success = false,
|
||||||
@@ -65,7 +65,7 @@ namespace Ewide.Core
|
|||||||
{
|
{
|
||||||
// 处理 401 状态码
|
// 处理 401 状态码
|
||||||
case StatusCodes.Status401Unauthorized:
|
case StatusCodes.Status401Unauthorized:
|
||||||
await context.Response.WriteAsJsonAsync(new XnRestfulResult<object>
|
await context.Response.WriteAsJsonAsync(new RestfulResult<object>
|
||||||
{
|
{
|
||||||
Code = StatusCodes.Status401Unauthorized,
|
Code = StatusCodes.Status401Unauthorized,
|
||||||
Success = false,
|
Success = false,
|
||||||
@@ -77,7 +77,7 @@ namespace Ewide.Core
|
|||||||
break;
|
break;
|
||||||
// 处理 403 状态码
|
// 处理 403 状态码
|
||||||
case StatusCodes.Status403Forbidden:
|
case StatusCodes.Status403Forbidden:
|
||||||
await context.Response.WriteAsJsonAsync(new XnRestfulResult<object>
|
await context.Response.WriteAsJsonAsync(new RestfulResult<object>
|
||||||
{
|
{
|
||||||
Code = StatusCodes.Status403Forbidden,
|
Code = StatusCodes.Status403Forbidden,
|
||||||
Success = false,
|
Success = false,
|
||||||
@@ -108,7 +108,7 @@ namespace Ewide.Core
|
|||||||
else if (context.Result is EmptyResult) data = null;
|
else if (context.Result is EmptyResult) data = null;
|
||||||
else return null;
|
else return null;
|
||||||
|
|
||||||
return DisplayJson(new XnRestfulResult<object>
|
return DisplayJson(new RestfulResult<object>
|
||||||
{
|
{
|
||||||
Code = context.Result is EmptyResult ? StatusCodes.Status204NoContent : StatusCodes.Status200OK, // 处理没有返回值情况 204
|
Code = context.Result is EmptyResult ? StatusCodes.Status204NoContent : StatusCodes.Status200OK, // 处理没有返回值情况 204
|
||||||
Success = true,
|
Success = true,
|
||||||
@@ -129,7 +129,7 @@ namespace Ewide.Core
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public IActionResult OnValidateFailed(ActionExecutingContext context, ModelStateDictionary modelStates, IEnumerable<ValidateFailedModel> validationResults, string validateFailedMessage)
|
public IActionResult OnValidateFailed(ActionExecutingContext context, ModelStateDictionary modelStates, IEnumerable<ValidateFailedModel> validationResults, string validateFailedMessage)
|
||||||
{
|
{
|
||||||
return DisplayJson(new XnRestfulResult<object>
|
return DisplayJson(new RestfulResult<object>
|
||||||
{
|
{
|
||||||
Code = StatusCodes.Status400BadRequest,
|
Code = StatusCodes.Status400BadRequest,
|
||||||
Success = false,
|
Success = false,
|
||||||
@@ -146,7 +146,7 @@ namespace Ewide.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T"></typeparam>
|
/// <typeparam name="T"></typeparam>
|
||||||
[SkipScan]
|
[SkipScan]
|
||||||
public class XnRestfulResult<T>
|
public class RestfulResult<T>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 执行成功
|
/// 执行成功
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Ewide.Core
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 小诺分页列表结果
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="T"></typeparam>
|
|
||||||
public static class XnPageResult<T> where T : new()
|
|
||||||
{
|
|
||||||
public static dynamic PageResult(PagedList<T> page)
|
|
||||||
{
|
|
||||||
return new
|
|
||||||
{
|
|
||||||
PageNo = page.PageIndex,
|
|
||||||
PageSize = page.PageSize,
|
|
||||||
TotalPage = page.TotalPages,
|
|
||||||
TotalRows = page.TotalCount,
|
|
||||||
Rows = page.Items //.Adapt<List<T>>(),
|
|
||||||
//Rainbow = PageUtil.Rainbow(page.PageIndex, page.TotalPages, PageUtil.RAINBOW_NUM)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -80,7 +80,7 @@ namespace Ewide.Core.Service
|
|||||||
u => EF.Functions.Like(u.Code, $"%{input.Code.Trim()}%")
|
u => EF.Functions.Like(u.Code, $"%{input.Code.Trim()}%")
|
||||||
)
|
)
|
||||||
.ToPageData(input);
|
.ToPageData(input);
|
||||||
return XnPageResult<SysApp>.PageResult(apps);
|
return PageDataResult<SysApp>.PageResult(apps);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ namespace Ewide.Core.Service.Area
|
|||||||
.Where(!string.IsNullOrEmpty(input.Name), a => a.Name.Contains(input.Name))
|
.Where(!string.IsNullOrEmpty(input.Name), a => a.Name.Contains(input.Name))
|
||||||
.Where(!string.IsNullOrEmpty(input.Pcode), a => a.Code.StartsWith(input.Pcode))
|
.Where(!string.IsNullOrEmpty(input.Pcode), a => a.Code.StartsWith(input.Pcode))
|
||||||
.ToPageData(input);
|
.ToPageData(input);
|
||||||
return XnPageResult<SysAreaCode>.PageResult(AreaCodes);
|
return PageDataResult<SysAreaCode>.PageResult(AreaCodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Ewide.Core.Service.Area.Dto
|
namespace Ewide.Core.Service.Area.Dto
|
||||||
{
|
{
|
||||||
public class AreaCodeInput : XnInputBase
|
public class AreaCodeInput : InputBase
|
||||||
{
|
{
|
||||||
public string Code { get; set; }
|
public string Code { get; set; }
|
||||||
public string AdCode { get; set; }
|
public string AdCode { get; set; }
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ namespace Ewide.Core.Service.CodeGen
|
|||||||
var tableName = !string.IsNullOrEmpty(input.TableName?.Trim());
|
var tableName = !string.IsNullOrEmpty(input.TableName?.Trim());
|
||||||
var codeGens = await _sysCodeGenRep.DetachedEntities
|
var codeGens = await _sysCodeGenRep.DetachedEntities
|
||||||
.Where((tableName, u => EF.Functions.Like(u.TableName, $"%{input.TableName.Trim()}%")))
|
.Where((tableName, u => EF.Functions.Like(u.TableName, $"%{input.TableName.Trim()}%")))
|
||||||
.ToPagedListAsync(input.PageNo, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
return XnPageResult<SysCodeGen>.PageResult(codeGens);
|
return PageDataResult<SysCodeGen>.PageResult(codeGens);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace Ewide.Core.Service
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 代码生成参数类
|
/// 代码生成参数类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CodeGenInput : XnInputBase
|
public class CodeGenInput : InputBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 作者姓名
|
/// 作者姓名
|
||||||
|
|||||||
@@ -1,52 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Ewide.Core.Service
|
|
||||||
{
|
|
||||||
public class XnCodeGenOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 作者姓名
|
|
||||||
/// </summary>
|
|
||||||
public string AuthorName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否移除表前缀
|
|
||||||
/// </summary>
|
|
||||||
public string TablePrefix { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 生成方式
|
|
||||||
/// </summary>
|
|
||||||
public string GenerateType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 数据库表名
|
|
||||||
/// </summary>
|
|
||||||
public string TableName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 数据库表名(经过组装的)
|
|
||||||
/// </summary>
|
|
||||||
public string TableNameAss { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 代码包名
|
|
||||||
/// </summary>
|
|
||||||
public string PackageName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 生成时间(string类型的)
|
|
||||||
/// </summary>
|
|
||||||
public string CreateTimestring { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 数据库表中字段集合
|
|
||||||
/// </summary>
|
|
||||||
public List<SysCodeGenConfig> ConfigList { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 业务名
|
|
||||||
/// </summary>
|
|
||||||
public string BusName { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -44,7 +44,7 @@ namespace Ewide.Core.Service
|
|||||||
(groupCode, u => EF.Functions.Like(u.Code, $"%{input.GroupCode.Trim()}%")))
|
(groupCode, u => EF.Functions.Like(u.Code, $"%{input.GroupCode.Trim()}%")))
|
||||||
.Where(u => u.Status != CommonStatus.DELETED).OrderBy(u => u.GroupCode)
|
.Where(u => u.Status != CommonStatus.DELETED).OrderBy(u => u.GroupCode)
|
||||||
.ToPageData(input);
|
.ToPageData(input);
|
||||||
return XnPageResult<SysConfig>.PageResult(configs);
|
return PageDataResult<SysConfig>.PageResult(configs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace Ewide.Core.Service
|
|||||||
//.Select(u => u.Adapt<DictDataOutput>())
|
//.Select(u => u.Adapt<DictDataOutput>())
|
||||||
// .ToPagedListAsync(input.PageNo, input.PageSize)
|
// .ToPagedListAsync(input.PageNo, input.PageSize)
|
||||||
.ToPageData<SysDictData, DictDataOutput>(input);
|
.ToPageData<SysDictData, DictDataOutput>(input);
|
||||||
return XnPageResult<DictDataOutput>.PageResult(dictDatas);
|
return PageDataResult<DictDataOutput>.PageResult(dictDatas);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ namespace Ewide.Core.Service
|
|||||||
.Where(u => u.Status != CommonStatus.DELETED).OrderBy(u => u.Sort)
|
.Where(u => u.Status != CommonStatus.DELETED).OrderBy(u => u.Sort)
|
||||||
//.ToPagedListAsync(input.PageNo, input.PageSize);
|
//.ToPagedListAsync(input.PageNo, input.PageSize);
|
||||||
.ToPageData(input);
|
.ToPageData(input);
|
||||||
return XnPageResult<SysDictType>.PageResult(dictTypes);
|
return PageDataResult<SysDictType>.PageResult(dictTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ namespace Ewide.Core.Service
|
|||||||
.Where(fileBucket, u => EF.Functions.Like(u.FileBucket, $"%{input.FileBucket.Trim()}%"))
|
.Where(fileBucket, u => EF.Functions.Like(u.FileBucket, $"%{input.FileBucket.Trim()}%"))
|
||||||
.Where(fileOriginName, u => EF.Functions.Like(u.FileOriginName, $"%{input.FileOriginName.Trim()}%"))
|
.Where(fileOriginName, u => EF.Functions.Like(u.FileOriginName, $"%{input.FileOriginName.Trim()}%"))
|
||||||
.Select(u => u.Adapt<FileOutput>())
|
.Select(u => u.Adapt<FileOutput>())
|
||||||
.ToPagedListAsync(input.PageNo, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
return XnPageResult<FileOutput>.PageResult(files);
|
return PageDataResult<FileOutput>.PageResult(files);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace Ewide.Core.Service
|
|||||||
.Where(searchBeginTime, u => u.OpTime >= DateTime.Parse(input.SearchBeginTime.Trim()) &&
|
.Where(searchBeginTime, u => u.OpTime >= DateTime.Parse(input.SearchBeginTime.Trim()) &&
|
||||||
u.OpTime <= DateTime.Parse(input.SearchEndTime.Trim()))
|
u.OpTime <= DateTime.Parse(input.SearchEndTime.Trim()))
|
||||||
.ToPageData<SysLogOp, OpLogOutput>(input);
|
.ToPageData<SysLogOp, OpLogOutput>(input);
|
||||||
return XnPageResult<OpLogOutput>.PageResult(opLogs);
|
return PageDataResult<OpLogOutput>.PageResult(opLogs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace Ewide.Core.Service
|
|||||||
.Where(searchBeginTime, u => u.VisTime >= DateTime.Parse(input.SearchBeginTime.Trim()) &&
|
.Where(searchBeginTime, u => u.VisTime >= DateTime.Parse(input.SearchBeginTime.Trim()) &&
|
||||||
u.VisTime <= DateTime.Parse(input.SearchEndTime.Trim()))
|
u.VisTime <= DateTime.Parse(input.SearchEndTime.Trim()))
|
||||||
.ToPageData<SysLogVis, VisLogOutput>(input);
|
.ToPageData<SysLogVis, VisLogOutput>(input);
|
||||||
return XnPageResult<VisLogOutput>.PageResult(visLogs);
|
return PageDataResult<VisLogOutput>.PageResult(visLogs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ namespace Ewide.Core.Service.Notice
|
|||||||
EF.Functions.Like(u.Content, $"%{input.SearchValue.Trim()}%"))
|
EF.Functions.Like(u.Content, $"%{input.SearchValue.Trim()}%"))
|
||||||
.Where(input.Type > 0, u => u.Type == input.Type)
|
.Where(input.Type > 0, u => u.Type == input.Type)
|
||||||
.Where(u => u.Status != (int)NoticeStatus.DELETED)
|
.Where(u => u.Status != (int)NoticeStatus.DELETED)
|
||||||
.ToPagedListAsync(input.PageNo, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
return XnPageResult<SysNotice>.PageResult(notices);
|
return PageDataResult<SysNotice>.PageResult(notices);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -203,8 +203,8 @@ namespace Ewide.Core.Service.Notice
|
|||||||
.Where(input.Type > 0, u => u.u.Type == input.Type)
|
.Where(input.Type > 0, u => u.u.Type == input.Type)
|
||||||
.Where(u => u.u.Status != (int)NoticeStatus.DELETED)
|
.Where(u => u.u.Status != (int)NoticeStatus.DELETED)
|
||||||
.Select(u => u.u.Adapt<NoticeReceiveOutput>())
|
.Select(u => u.u.Adapt<NoticeReceiveOutput>())
|
||||||
.ToPagedListAsync(input.PageNo, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
return XnPageResult<NoticeReceiveOutput>.PageResult(notices);
|
return PageDataResult<NoticeReceiveOutput>.PageResult(notices);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace Ewide.Core.Service
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 组织机构参数
|
/// 组织机构参数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class OrgInput : XnInputBase
|
public class OrgInput : InputBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 父Id
|
/// 父Id
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ namespace Ewide.Core.Service
|
|||||||
.ToPageData<SysOrg,OrgOutput>(input);
|
.ToPageData<SysOrg,OrgOutput>(input);
|
||||||
//.Select(u => u.Adapt<OrgOutput>())
|
//.Select(u => u.Adapt<OrgOutput>())
|
||||||
//.ToPagedListAsync(input.PageNo, input.PageSize);
|
//.ToPagedListAsync(input.PageNo, input.PageSize);
|
||||||
return XnPageResult<OrgOutput>.PageResult(orgs);
|
return PageDataResult<OrgOutput>.PageResult(orgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace Ewide.Core.Service
|
|||||||
.Where(u => u.Status == CommonStatus.ENABLE).OrderBy(u => u.Sort)
|
.Where(u => u.Status == CommonStatus.ENABLE).OrderBy(u => u.Sort)
|
||||||
.ToPageData(input);
|
.ToPageData(input);
|
||||||
//.ToPagedListAsync(input.PageNo, input.PageSize);
|
//.ToPagedListAsync(input.PageNo, input.PageSize);
|
||||||
return XnPageResult<SysPos>.PageResult(pos);
|
return PageDataResult<SysPos>.PageResult(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace Ewide.Core.Service
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 角色参数
|
/// 角色参数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class RoleInput : XnInputBase
|
public class RoleInput : InputBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 名称
|
/// 名称
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ namespace Ewide.Core.Service
|
|||||||
(code, u => EF.Functions.Like(u.Code, $"%{input.Code.Trim()}%")))
|
(code, u => EF.Functions.Like(u.Code, $"%{input.Code.Trim()}%")))
|
||||||
.Where(u => u.Status == (int)CommonStatus.ENABLE).OrderBy(u => u.Sort)
|
.Where(u => u.Status == (int)CommonStatus.ENABLE).OrderBy(u => u.Sort)
|
||||||
.ToPageData(input);
|
.ToPageData(input);
|
||||||
return XnPageResult<SysRole>.PageResult(roles);
|
return PageDataResult<SysRole>.PageResult(roles);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ namespace Ewide.Core.Service
|
|||||||
.Where((name, u => EF.Functions.Like(u.Name, $"%{input.Name.Trim()}%")),
|
.Where((name, u => EF.Functions.Like(u.Name, $"%{input.Name.Trim()}%")),
|
||||||
(host, u => EF.Functions.Like(u.Host, $"%{input.Host.Trim()}%")))
|
(host, u => EF.Functions.Like(u.Host, $"%{input.Host.Trim()}%")))
|
||||||
.Select(u => u.Adapt<TenantOutput>())
|
.Select(u => u.Adapt<TenantOutput>())
|
||||||
.ToPagedListAsync(input.PageNo, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
return XnPageResult<TenantOutput>.PageResult(tenants);
|
return PageDataResult<TenantOutput>.PageResult(tenants);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -40,13 +40,13 @@ namespace Ewide.Core.Service
|
|||||||
var timers = await _sysTimerRep.DetachedEntities
|
var timers = await _sysTimerRep.DetachedEntities
|
||||||
.Where((jobName, u => EF.Functions.Like(u.JobName, $"%{input.JobName.Trim()}%")))
|
.Where((jobName, u => EF.Functions.Like(u.JobName, $"%{input.JobName.Trim()}%")))
|
||||||
.Select(u => u.Adapt<JobInput>())
|
.Select(u => u.Adapt<JobInput>())
|
||||||
.ToPagedListAsync(input.PageNo, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
|
|
||||||
timers.Items.ToList().ForEach(u =>
|
timers.Items.ToList().ForEach(u =>
|
||||||
{
|
{
|
||||||
u.DisplayState = jobList.Find(m => m.JobName == u.JobName)?.DisplayState;
|
u.DisplayState = jobList.Find(m => m.JobName == u.JobName)?.DisplayState;
|
||||||
});
|
});
|
||||||
return XnPageResult<JobInput>.PageResult(timers);
|
return PageDataResult<JobInput>.PageResult(timers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ namespace Ewide.Core.Service
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户参数
|
/// 用户参数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class UserInput : XnInputBase
|
public class UserInput : InputBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 账号
|
/// 账号
|
||||||
|
|||||||
@@ -62,6 +62,16 @@ namespace Ewide.Core.Service
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual int Status { get; set; }
|
public virtual int Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所在机构名称
|
||||||
|
/// </summary>
|
||||||
|
public virtual string OrgName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 角色名称
|
||||||
|
/// </summary>
|
||||||
|
public virtual string RoleName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 员工信息
|
/// 员工信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace Ewide.Core.Service
|
|||||||
.Where(input.SearchStatus >= 0, x => x.n.u.Status == input.SearchStatus)
|
.Where(input.SearchStatus >= 0, x => x.n.u.Status == input.SearchStatus)
|
||||||
.Where(!superAdmin, x => x.n.u.AdminType != AdminType.SuperAdmin)
|
.Where(!superAdmin, x => x.n.u.AdminType != AdminType.SuperAdmin)
|
||||||
.Where(!superAdmin && dataScopes.Count > 0, x => dataScopes.Contains(x.n.e.OrgId))
|
.Where(!superAdmin && dataScopes.Count > 0, x => dataScopes.Contains(x.n.e.OrgId))
|
||||||
.Select(u => u.n.u.Adapt<UserOutput>()).ToPagedListAsync(input.PageNo, input.PageSize);
|
.Select(u => u.n.u.Adapt<UserOutput>()).ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
|
|
||||||
//var emps = new List<Task<EmpOutput>>();
|
//var emps = new List<Task<EmpOutput>>();
|
||||||
//users.Items.ToList().ForEach(u =>
|
//users.Items.ToList().ForEach(u =>
|
||||||
@@ -81,7 +81,7 @@ namespace Ewide.Core.Service
|
|||||||
{
|
{
|
||||||
user.SysEmpInfo = await _sysEmpService.GetEmpInfo(user.Id);
|
user.SysEmpInfo = await _sysEmpService.GetEmpInfo(user.Id);
|
||||||
}
|
}
|
||||||
return XnPageResult<UserOutput>.PageResult(users);
|
return PageDataResult<UserOutput>.PageResult(users);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Ewide.Web.Core
|
|||||||
|
|
||||||
services.AddControllersWithViews()
|
services.AddControllersWithViews()
|
||||||
.AddMvcFilter<RequestActionFilter>()
|
.AddMvcFilter<RequestActionFilter>()
|
||||||
.AddInjectWithUnifyResult<XnRestfulResultProvider>()
|
.AddInjectWithUnifyResult<RestfulResultProvider>()
|
||||||
// 在管道中增加NewtonsoftJson,防止参数类型严格验证
|
// 在管道中增加NewtonsoftJson,防止参数类型严格验证
|
||||||
.AddNewtonsoftJson(options => {
|
.AddNewtonsoftJson(options => {
|
||||||
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
|
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
pageNo: {
|
pageIndex: {
|
||||||
default: 1,
|
default: 1,
|
||||||
type: Number,
|
type: Number,
|
||||||
},
|
},
|
||||||
@@ -21,7 +21,7 @@ export default {
|
|||||||
data: [],
|
data: [],
|
||||||
|
|
||||||
pagination: {
|
pagination: {
|
||||||
current: this.pageNo,
|
current: this.pageIndex,
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
total: 0,
|
total: 0,
|
||||||
size: 'small',
|
size: 'small',
|
||||||
@@ -52,38 +52,41 @@ export default {
|
|||||||
this.onLoading()
|
this.onLoading()
|
||||||
|
|
||||||
this.loadData({
|
this.loadData({
|
||||||
pageNo: this.pagination.current,
|
pageIndex: this.pagination.current,
|
||||||
pageSize: this.pagination.pageSize,
|
pageSize: this.pagination.pageSize,
|
||||||
...this.sorter
|
...this.sorter
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.data = res.rows
|
this.data = res.rows || res.data || res.items
|
||||||
this.pagination.total = res.totalRows
|
this.pagination.total = res.totalCount
|
||||||
this.onLoaded()
|
this.onLoaded()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onReloadData(refresh = false) {
|
onReloadData(refresh = false) {
|
||||||
if (refresh && refresh.constructor === Boolean && this.pagination.constructor === Object) {
|
if (refresh && refresh.constructor === Boolean && this.pagination.constructor === Object) {
|
||||||
this.pagination.current = this.pageNo
|
this.pagination.current = this.pageIndex
|
||||||
this.pagination.pageSize = this.pageSize
|
this.pagination.pageSize = this.pageSize
|
||||||
}
|
}
|
||||||
this.onLoadData()
|
this.onLoadData()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onListChange(current, pageSize) {
|
||||||
|
this.pagination.current = current
|
||||||
|
this.pagination.pageSize = pageSize
|
||||||
|
this.onLoadData()
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const props = {
|
const props = {
|
||||||
loading: this.loading,
|
loading: this.loading,
|
||||||
pagination: this.pagination,
|
|
||||||
dataSource: this.data,
|
dataSource: this.data,
|
||||||
rowKey: record => record.id,
|
rowKey: record => record.id,
|
||||||
...this.$attrs
|
...this.$attrs
|
||||||
}
|
}
|
||||||
|
|
||||||
const on = {
|
const on = {}
|
||||||
//change: this.onTableChange
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
<div class="yo-action-bar">
|
<div class="yo-action-bar">
|
||||||
@@ -101,6 +104,7 @@ export default {
|
|||||||
<template slot={name}>{this.$slots[name]}</template>
|
<template slot={name}>{this.$slots[name]}</template>
|
||||||
))}
|
))}
|
||||||
</a-list>
|
</a-list>
|
||||||
|
<a-pagination size="small" {... { props: this.pagination }} onChange={this.onListChange} onShowSizeChange={this.onListChange} />
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import ColumnSetting from './column'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
pageNo: {
|
pageIndex: {
|
||||||
default: 1,
|
default: 1,
|
||||||
type: Number,
|
type: Number,
|
||||||
},
|
},
|
||||||
@@ -33,7 +33,7 @@ export default {
|
|||||||
data: [],
|
data: [],
|
||||||
|
|
||||||
pagination: {
|
pagination: {
|
||||||
current: this.pageNo,
|
current: this.pageIndex,
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
total: 0,
|
total: 0,
|
||||||
size: 'small',
|
size: 'small',
|
||||||
@@ -102,15 +102,15 @@ export default {
|
|||||||
this.onLoading()
|
this.onLoading()
|
||||||
|
|
||||||
this.loadData({
|
this.loadData({
|
||||||
pageNo: this.pagination.current,
|
pageIndex: this.pagination.current,
|
||||||
pageSize: this.pagination.pageSize,
|
pageSize: this.pagination.pageSize,
|
||||||
...this.sorter
|
...this.sorter
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.rows) {
|
if (res.rows || res.data || res.items) {
|
||||||
// 普通表格
|
// 普通表格
|
||||||
this.type = 'table'
|
this.type = 'table'
|
||||||
this.data = res.rows
|
this.data = res.rows || res.data || res.items
|
||||||
this.pagination.total = res.totalRows
|
this.pagination.total = res.totalCount
|
||||||
} else if (res) {
|
} else if (res) {
|
||||||
// 树形表格
|
// 树形表格
|
||||||
this.type = 'tree'
|
this.type = 'tree'
|
||||||
@@ -124,7 +124,7 @@ export default {
|
|||||||
|
|
||||||
onReloadData(refresh = false) {
|
onReloadData(refresh = false) {
|
||||||
if (refresh && refresh.constructor === Boolean && this.pagination.constructor === Object) {
|
if (refresh && refresh.constructor === Boolean && this.pagination.constructor === Object) {
|
||||||
this.pagination.current = this.pageNo
|
this.pagination.current = this.pageIndex
|
||||||
this.pagination.pageSize = this.pageSize
|
this.pagination.pageSize = this.pageSize
|
||||||
}
|
}
|
||||||
this.onLoadData()
|
this.onLoadData()
|
||||||
|
|||||||
Reference in New Issue
Block a user