fix 处理前端冗余数据
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Request;
|
||||
|
||||
public class GainfoPageRequest : PageDto
|
||||
public class GainfoPageRequest : PageDto, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// 档案类型
|
||||
@@ -16,4 +17,20 @@ public class GainfoPageRequest : PageDto
|
||||
/// 部门选择
|
||||
/// </summary>
|
||||
public List<TenantDepartmentRequest> DepartmentSelections { get; set; } = new List<TenantDepartmentRequest>();
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
DepartmentSelections.ForEach(d =>
|
||||
{
|
||||
//存在
|
||||
if (d.DepartmentNos.IsPresent())
|
||||
{
|
||||
d.DepartmentNos.Remove(d.Tenant);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user