ow
This commit is contained in:
1 parent
fcbeba7287
commit
f2f5807372
33 files changed
+1385
-1430
No files matched your search
@@ -87,17 +87,17 @@ namespace CloudBuilder.Core.Application.Builders
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public T GetTransientService<T>()
|
//public T GetTransientService<T>()
|
||||||
{
|
//{
|
||||||
object? t = Services.BuildServiceProvider().GetService(typeof(T));
|
// object? t = Services.BuildServiceProvider().GetService(typeof(T));
|
||||||
if (t == null) return default(T)!;
|
// if (t == null) return default(T)!;
|
||||||
return (T)t;
|
// return (T)t;
|
||||||
}
|
//}
|
||||||
|
|
||||||
public T GetTransientRequiredService<T>()
|
//public T GetTransientRequiredService<T>()
|
||||||
{
|
//{
|
||||||
return (T)Services.BuildServiceProvider().GetRequiredService(typeof(T));
|
// return (T)Services.BuildServiceProvider().GetRequiredService(typeof(T));
|
||||||
}
|
//}
|
||||||
|
|
||||||
public static Assembly[] GetAssemblies()
|
public static Assembly[] GetAssemblies()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,19 +41,6 @@ namespace CloudBuilder.Core.Application.Packs
|
|||||||
|
|
||||||
services.AddScoped<IApplicationService, ApplicationService>();
|
services.AddScoped<IApplicationService, ApplicationService>();
|
||||||
|
|
||||||
//services.TryAddSingleton<IInputDtoTypeFinder, InputDtoTypeFinder>();
|
|
||||||
//services.TryAddSingleton<IOutputDtoTypeFinder, OutputDtoTypeFinder>();
|
|
||||||
//services.TryAddSingleton<ICancellationTokenProvider, NoneCancellationTokenProvider>();
|
|
||||||
//services.TryAddSingleton<IEmailSender, DefaultEmailSender>();
|
|
||||||
|
|
||||||
//services.TryAddSingleton<ICacheService, CacheService>();
|
|
||||||
//services.TryAddScoped<IFilterService, FilterService>();
|
|
||||||
|
|
||||||
//services.TryAddTransient<IClientHttpCrypto, ClientHttpCrypto>();
|
|
||||||
//services.AddTransient<ClientHttpCryptoHandler>();
|
|
||||||
|
|
||||||
//services.AddDistributedMemoryCache();
|
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,15 @@ namespace CloudBuilder.Core.DatabaseAccessor
|
|||||||
{
|
{
|
||||||
public class ApplicationService : IApplicationService
|
public class ApplicationService : IApplicationService
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 显式赋值的登录Id(登录流程/桌面端会主动赋值),为空时按当前请求的令牌解析
|
||||||
|
/// </summary>
|
||||||
|
private string? userId;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 显式赋值的语言,为空时按当前请求的报文头解析
|
||||||
|
/// </summary>
|
||||||
|
private string? locale;
|
||||||
|
|
||||||
public ApplicationService(
|
public ApplicationService(
|
||||||
CloudBuilderBuilder cloudBuilder,
|
CloudBuilderBuilder cloudBuilder,
|
||||||
@@ -29,23 +38,47 @@ namespace CloudBuilder.Core.DatabaseAccessor
|
|||||||
this.ServiceProvider = serviceProvider;
|
this.ServiceProvider = serviceProvider;
|
||||||
this.UnitOfWork = unitOfWork;
|
this.UnitOfWork = unitOfWork;
|
||||||
this.HttpContext = httpContext;
|
this.HttpContext = httpContext;
|
||||||
if (httpContext.HttpContext != null)
|
|
||||||
{
|
|
||||||
UserId = ClaimPolicy.GetClaimValue(HttpContext, ClaimPolicy.CLAINM_USERID);
|
|
||||||
string key = ClaimPolicy.GetHeaderKeyValue(HttpContext, ClaimPolicy.HEADER_LOCALE);
|
|
||||||
if (!string.IsNullOrEmpty(key))
|
|
||||||
{
|
|
||||||
Locale = key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IServiceProvider ServiceProvider { get; private set; }
|
public IServiceProvider ServiceProvider { get; private set; }
|
||||||
|
|
||||||
public IHttpContextAccessor HttpContext { get; private set; }
|
public IHttpContextAccessor HttpContext { get; private set; }
|
||||||
|
|
||||||
public string UserId { get; set; }
|
/// <summary>
|
||||||
public string Locale { get; set; } = ClaimPolicy.CLAINM_LOCALE;
|
/// 当前登录Id:取自当前请求的令牌,每次访问都重新解析
|
||||||
|
/// (不能在构造函数中缓存,否则实例被长生命周期对象持有时会一直返回上一个登录用户)
|
||||||
|
/// </summary>
|
||||||
|
public string UserId
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(userId)) return userId!;
|
||||||
|
if (HttpContext?.HttpContext == null) return string.Empty;
|
||||||
|
return ClaimPolicy.GetClaimValue(HttpContext, ClaimPolicy.CLAINM_USERID);
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
userId = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当前语言:取自当前请求的报文头,每次访问都重新解析
|
||||||
|
/// </summary>
|
||||||
|
public string Locale
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(locale)) return locale!;
|
||||||
|
if (HttpContext?.HttpContext == null) return ClaimPolicy.CLAINM_LOCALE;
|
||||||
|
string key = ClaimPolicy.GetHeaderKeyValue(HttpContext, ClaimPolicy.HEADER_LOCALE);
|
||||||
|
return string.IsNullOrEmpty(key) ? ClaimPolicy.CLAINM_LOCALE : key;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
locale = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
public IUnitOfWork UnitOfWork { get; set; }
|
public IUnitOfWork UnitOfWork { get; set; }
|
||||||
public CloudBuilderBuilder CloudBuilder { get; set; }
|
public CloudBuilderBuilder CloudBuilder { get; set; }
|
||||||
public IConfiguration Configuration { get; private set; }
|
public IConfiguration Configuration { get; private set; }
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace CloudBuilder.Gui
|
|||||||
private int OrgLimit;
|
private int OrgLimit;
|
||||||
public int CurrentPage { get; set; } = 0;
|
public int CurrentPage { get; set; } = 0;
|
||||||
public int Page { get; set; } = 0;
|
public int Page { get; set; } = 0;
|
||||||
public int Total { get; set; } = 0;
|
public long Total { get; set; } = 0;
|
||||||
|
|
||||||
public GridViewPagination()
|
public GridViewPagination()
|
||||||
{
|
{
|
||||||
@@ -39,8 +39,11 @@ namespace CloudBuilder.Gui
|
|||||||
limitTxt.Text = limit.ToString();
|
limitTxt.Text = limit.ToString();
|
||||||
Limit = limit;
|
Limit = limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetTotal(int total)
|
public void SetTotal(int total)
|
||||||
|
{
|
||||||
|
SetTotal(long.Parse(total.ToString()));
|
||||||
|
}
|
||||||
|
public void SetTotal(long total)
|
||||||
{
|
{
|
||||||
this.Total = total;
|
this.Total = total;
|
||||||
if (Limit > 0)
|
if (Limit > 0)
|
||||||
|
|||||||
@@ -117,9 +117,24 @@ namespace CloudBuilder.Master.Service
|
|||||||
|
|
||||||
if (d == null) return data;
|
if (d == null) return data;
|
||||||
|
|
||||||
|
IRepository<FamilyTreePermissionUserViewEntity> repositoryPermission = repository.GetRepository<IRepository<FamilyTreePermissionUserViewEntity>>();
|
||||||
|
|
||||||
|
|
||||||
data.FamilyTree = new FamilyTreeDisplayData(d);
|
data.FamilyTree = new FamilyTreeDisplayData(d);
|
||||||
data.CurrentPerson = new FamilyPersonData();
|
data.CurrentPerson = new FamilyPersonData();
|
||||||
|
|
||||||
|
data.FamilyTreePermissions = repositoryPermission.DetachedEntities.Where(x => x.TreeId == key).ToArray();
|
||||||
|
|
||||||
|
if (data.FamilyTreePermissions.Any())
|
||||||
|
{
|
||||||
|
data.IsManager = data.FamilyTreePermissions.Where(x => x.UserName == service.UserId && x.ManagerIndc == YesNoPolicy.YES).Any();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!data.IsManager && data.FamilyTreePermissions.Any())
|
||||||
|
{
|
||||||
|
data.FamilyTreePermissions = data.FamilyTreePermissions.Where(x => x.UserName == service.UserId && x.ValidIndc == YesNoPolicy.NO).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
IRepository<FamilyPersonEntity> repositoryFamilyPerson = repository.GetRepository<IRepository<FamilyPersonEntity>>();
|
IRepository<FamilyPersonEntity> repositoryFamilyPerson = repository.GetRepository<IRepository<FamilyPersonEntity>>();
|
||||||
|
|
||||||
var currentPerson = personId;
|
var currentPerson = personId;
|
||||||
@@ -248,6 +263,21 @@ namespace CloudBuilder.Master.Service
|
|||||||
|
|
||||||
repository.InsertNow(d);
|
repository.InsertNow(d);
|
||||||
|
|
||||||
|
FamilyTreePermissionEntity treePermissionEntity = new FamilyTreePermissionEntity();
|
||||||
|
treePermissionEntity.TreeId = d.TreeId;
|
||||||
|
treePermissionEntity.PersonId = d.AncestorPersonId;
|
||||||
|
treePermissionEntity.UserName = service.UserId;
|
||||||
|
treePermissionEntity.ManagerIndc = YesNoPolicy.YES;
|
||||||
|
treePermissionEntity.ValidIndc = YesNoPolicy.YES;
|
||||||
|
InsertFamilyTreePermission(treePermissionEntity);
|
||||||
|
|
||||||
|
IRepository<FamilyPersonEntity> repositoryPerson = repository.GetRepository<IRepository<FamilyPersonEntity>>();
|
||||||
|
FamilyPersonEntity familyPerson;
|
||||||
|
|
||||||
|
familyPerson = repositoryPerson.DetachedEntities.Where(x => x.PersonId == d.AncestorPersonId).FirstOrDefault()!;
|
||||||
|
familyPerson.TreeId = d.TreeId;
|
||||||
|
repositoryPerson.UpdateNow(familyPerson);
|
||||||
|
|
||||||
var currentPerson = d.AncestorPersonId;
|
var currentPerson = d.AncestorPersonId;
|
||||||
|
|
||||||
if (data.CurrentPerson != null && data.CurrentPerson.FamilyPerson != null && !string.IsNullOrEmpty(data.CurrentPerson.FamilyPerson.PersonId))
|
if (data.CurrentPerson != null && data.CurrentPerson.FamilyPerson != null && !string.IsNullOrEmpty(data.CurrentPerson.FamilyPerson.PersonId))
|
||||||
@@ -268,16 +298,74 @@ namespace CloudBuilder.Master.Service
|
|||||||
return FindByCurrentPerson(d.TreeId, currentPerson);
|
return FindByCurrentPerson(d.TreeId, currentPerson);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void InsertFamilyTreePermission(FamilyTreePermissionEntity treePermissionEntity)
|
||||||
|
{
|
||||||
|
IRepository<FamilyTreePermissionEntity> repositoryPermission = repository.GetRepository<IRepository<FamilyTreePermissionEntity>>();
|
||||||
|
repositoryPermission.InsertNow(treePermissionEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
[PermissionOperate(name: MasterPermissionPolicy.FamilyTree, operate: Operate.Find)]
|
||||||
|
[UnitOfWork]
|
||||||
|
public void RequestFamilyTreePermission(string treeId, string currentPersonId)
|
||||||
|
{
|
||||||
|
IRepository<FamilyTreePermissionEntity> repositoryPermission = repository.GetRepository<IRepository<FamilyTreePermissionEntity>>();
|
||||||
|
FamilyTreePermissionEntity treePermissionEntity = repositoryPermission.DetachedEntities.Where(x => x.TreeId == treeId && x.PersonId == currentPersonId && service.UserId == x.UserName).FirstOrDefault()!;
|
||||||
|
|
||||||
|
if (treePermissionEntity != null) return;
|
||||||
|
|
||||||
|
treePermissionEntity = new FamilyTreePermissionEntity();
|
||||||
|
treePermissionEntity.TreeId = treeId;
|
||||||
|
treePermissionEntity.PersonId = currentPersonId;
|
||||||
|
treePermissionEntity.UserName = service.UserId;
|
||||||
|
treePermissionEntity.ManagerIndc = YesNoPolicy.NO;
|
||||||
|
treePermissionEntity.ValidIndc = YesNoPolicy.NO;
|
||||||
|
InsertFamilyTreePermission(treePermissionEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
[PermissionOperate(name: MasterPermissionPolicy.FamilyTree, operate: Operate.Find)]
|
||||||
|
[UnitOfWork]
|
||||||
|
public void ApproveFamilyTreePermission(string treeId, string currentPersonId, string userName, string managerIndc)
|
||||||
|
{
|
||||||
|
IRepository<FamilyTreePermissionEntity> repositoryPermission = repository.GetRepository<IRepository<FamilyTreePermissionEntity>>();
|
||||||
|
FamilyTreePermissionEntity treePermissionEntity = repositoryPermission.DetachedEntities.Where(x => x.TreeId == treeId && x.PersonId == currentPersonId && userName == x.UserName).FirstOrDefault()!;
|
||||||
|
if (treePermissionEntity == null) return;
|
||||||
|
|
||||||
|
treePermissionEntity.ManagerIndc = managerIndc;
|
||||||
|
treePermissionEntity.ValidIndc = YesNoPolicy.YES;
|
||||||
|
|
||||||
|
repositoryPermission.UpdateNow(treePermissionEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
[PermissionOperate(name: MasterPermissionPolicy.FamilyTree, operate: Operate.Find)]
|
||||||
|
[UnitOfWork]
|
||||||
|
public void RejectFamilyTreePermission(string treeId, string currentPersonId, string userName)
|
||||||
|
{
|
||||||
|
IRepository<FamilyTreePermissionEntity> repositoryPermission = repository.GetRepository<IRepository<FamilyTreePermissionEntity>>();
|
||||||
|
FamilyTreePermissionEntity treePermissionEntity = repositoryPermission.DetachedEntities.Where(x => x.TreeId == treeId && x.PersonId == currentPersonId && userName == x.UserName).FirstOrDefault()!;
|
||||||
|
if (treePermissionEntity == null) return;
|
||||||
|
|
||||||
|
repositoryPermission.DeleteNow(treePermissionEntity);
|
||||||
|
}
|
||||||
|
|
||||||
private void SaveSpouseMaps(string personId, FamilyTreeSpouseMapViewEntity[] maps)
|
private void SaveSpouseMaps(string personId, FamilyTreeSpouseMapViewEntity[] maps)
|
||||||
{
|
{
|
||||||
IRepository<FamilyTreeSpouseMapViewEntity> repositoryMapView = repository.GetRepository<IRepository<FamilyTreeSpouseMapViewEntity>>();
|
IRepository<FamilyTreeSpouseMapViewEntity> repositoryMapView = repository.GetRepository<IRepository<FamilyTreeSpouseMapViewEntity>>();
|
||||||
IRepository<FamilyTreeSpouseMapEntity> repositoryMap = repository.GetRepository<IRepository<FamilyTreeSpouseMapEntity>>();
|
IRepository<FamilyTreeSpouseMapEntity> repositoryMap = repository.GetRepository<IRepository<FamilyTreeSpouseMapEntity>>();
|
||||||
|
IRepository<FamilyPersonEntity> repositoryPerson = repository.GetRepository<IRepository<FamilyPersonEntity>>();
|
||||||
|
FamilyPersonEntity familyPerson;
|
||||||
|
|
||||||
FamilyTreeSpouseMapViewEntity[] olds = repositoryMapView.Entities.Where(x => x.PersonId == personId).ToArray();
|
FamilyTreeSpouseMapViewEntity[] olds = repositoryMapView.Entities.Where(x => x.PersonId == personId).ToArray();
|
||||||
if (olds != null && olds.Length > 0)
|
if (olds != null && olds.Length > 0)
|
||||||
{
|
{
|
||||||
foreach (FamilyTreeSpouseMapViewEntity old in olds)
|
foreach (FamilyTreeSpouseMapViewEntity old in olds)
|
||||||
{
|
{
|
||||||
|
familyPerson = repositoryPerson.DetachedEntities.Where(x => x.PersonId == old.PersonId).FirstOrDefault()!;
|
||||||
|
if (familyPerson != null)
|
||||||
|
{
|
||||||
|
repositoryPerson.DeleteNow(familyPerson);
|
||||||
|
}
|
||||||
|
|
||||||
repositoryMap.DeleteNow(new FamilyTreeSpouseMapEntity()
|
repositoryMap.DeleteNow(new FamilyTreeSpouseMapEntity()
|
||||||
{
|
{
|
||||||
TreeId = old.TreeId,
|
TreeId = old.TreeId,
|
||||||
@@ -289,8 +377,16 @@ namespace CloudBuilder.Master.Service
|
|||||||
|
|
||||||
if (maps == null || maps.Length == 0) return;
|
if (maps == null || maps.Length == 0) return;
|
||||||
int i = 1;
|
int i = 1;
|
||||||
|
|
||||||
foreach (FamilyTreeSpouseMapViewEntity map in maps.OrderBy(x => x.Orderby).ToArray())
|
foreach (FamilyTreeSpouseMapViewEntity map in maps.OrderBy(x => x.Orderby).ToArray())
|
||||||
{
|
{
|
||||||
|
familyPerson = repositoryPerson.DetachedEntities.Where(x => x.PersonId == map.PersonId && string.IsNullOrEmpty(x.TreeId)).FirstOrDefault()!;
|
||||||
|
if (familyPerson != null)
|
||||||
|
{
|
||||||
|
familyPerson.TreeId = map.TreeId;
|
||||||
|
repositoryPerson.Update(familyPerson);
|
||||||
|
}
|
||||||
|
|
||||||
repositoryMap.InsertNow(new FamilyTreeSpouseMapEntity()
|
repositoryMap.InsertNow(new FamilyTreeSpouseMapEntity()
|
||||||
{
|
{
|
||||||
TreeId = map.TreeId,
|
TreeId = map.TreeId,
|
||||||
@@ -309,55 +405,25 @@ namespace CloudBuilder.Master.Service
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveParentMaps(string personId, FamilyTreeChildrenMapViewEntity[] maps)
|
|
||||||
{
|
|
||||||
IRepository<FamilyTreeChildrenMapViewEntity> repositoryMapView = repository.GetRepository<IRepository<FamilyTreeChildrenMapViewEntity>>();
|
|
||||||
IRepository<FamilyTreeChildrenMapEntity> repositoryMap = repository.GetRepository<IRepository<FamilyTreeChildrenMapEntity>>();
|
|
||||||
FamilyTreeChildrenMapViewEntity[] olds = repositoryMapView.Entities.Where(x => x.ChildrenId == personId).ToArray();
|
|
||||||
if (olds != null && olds.Length > 0)
|
|
||||||
{
|
|
||||||
foreach (FamilyTreeChildrenMapViewEntity old in olds)
|
|
||||||
{
|
|
||||||
repositoryMap.DeleteNow(new FamilyTreeChildrenMapEntity()
|
|
||||||
{
|
|
||||||
TreeId = old.TreeId,
|
|
||||||
ChildrenId = personId,
|
|
||||||
PersonId = old.PersonId
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (maps == null || maps.Length == 0) return;
|
|
||||||
|
|
||||||
int maxOrderBy = 0;
|
|
||||||
foreach (FamilyTreeChildrenMapViewEntity map in maps)
|
|
||||||
{
|
|
||||||
FamilyTreeChildrenMapViewEntity[] oldMaps = repositoryMapView.Entities.Where(x => x.PersonId == map.PersonId).ToArray();
|
|
||||||
|
|
||||||
if (oldMaps != null && oldMaps.Count() > 0) maxOrderBy = oldMaps.Max(x => x.Orderby);
|
|
||||||
|
|
||||||
repositoryMap.InsertNow(new FamilyTreeChildrenMapEntity()
|
|
||||||
{
|
|
||||||
TreeId = map.TreeId,
|
|
||||||
ChildrenId = personId,
|
|
||||||
PersonId = map.PersonId,
|
|
||||||
Orderby = oldMaps == null ? 1 : maxOrderBy + 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void SaveSonMaps(string personId, FamilyTreeChildrenMapViewEntity[] maps)
|
private void SaveSonMaps(string personId, FamilyTreeChildrenMapViewEntity[] maps)
|
||||||
{
|
{
|
||||||
IRepository<FamilyTreeChildrenMapViewEntity> repositoryMapView = repository.GetRepository<IRepository<FamilyTreeChildrenMapViewEntity>>();
|
IRepository<FamilyTreeChildrenMapViewEntity> repositoryMapView = repository.GetRepository<IRepository<FamilyTreeChildrenMapViewEntity>>();
|
||||||
IRepository<FamilyTreeChildrenMapEntity> repositoryMap = repository.GetRepository<IRepository<FamilyTreeChildrenMapEntity>>();
|
IRepository<FamilyTreeChildrenMapEntity> repositoryMap = repository.GetRepository<IRepository<FamilyTreeChildrenMapEntity>>();
|
||||||
|
IRepository<FamilyPersonEntity> repositoryPerson = repository.GetRepository<IRepository<FamilyPersonEntity>>();
|
||||||
|
FamilyPersonEntity familyPerson;
|
||||||
|
|
||||||
FamilyTreeChildrenMapViewEntity[] olds = repositoryMapView.Entities.Where(x => x.PersonId == personId).ToArray();
|
FamilyTreeChildrenMapViewEntity[] olds = repositoryMapView.Entities.Where(x => x.PersonId == personId).ToArray();
|
||||||
if (olds != null && olds.Length > 0)
|
if (olds != null && olds.Length > 0)
|
||||||
{
|
{
|
||||||
foreach (FamilyTreeChildrenMapViewEntity old in olds)
|
foreach (FamilyTreeChildrenMapViewEntity old in olds)
|
||||||
{
|
{
|
||||||
|
familyPerson = repositoryPerson.DetachedEntities.Where(x => x.PersonId == old.PersonId).FirstOrDefault()!;
|
||||||
|
if (familyPerson != null)
|
||||||
|
{
|
||||||
|
repositoryPerson.DeleteNow(familyPerson);
|
||||||
|
}
|
||||||
|
|
||||||
repositoryMap.DeleteNow(new FamilyTreeChildrenMapEntity()
|
repositoryMap.DeleteNow(new FamilyTreeChildrenMapEntity()
|
||||||
{
|
{
|
||||||
TreeId = old.TreeId,
|
TreeId = old.TreeId,
|
||||||
@@ -369,8 +435,16 @@ namespace CloudBuilder.Master.Service
|
|||||||
|
|
||||||
if (maps == null || maps.Length == 0) return;
|
if (maps == null || maps.Length == 0) return;
|
||||||
int i = 1;
|
int i = 1;
|
||||||
|
|
||||||
foreach (FamilyTreeChildrenMapViewEntity map in maps.OrderBy(x => x.Orderby).ToArray())
|
foreach (FamilyTreeChildrenMapViewEntity map in maps.OrderBy(x => x.Orderby).ToArray())
|
||||||
{
|
{
|
||||||
|
familyPerson = repositoryPerson.DetachedEntities.Where(x => x.PersonId == map.PersonId && string.IsNullOrEmpty(x.TreeId)).FirstOrDefault()!;
|
||||||
|
if (familyPerson != null)
|
||||||
|
{
|
||||||
|
familyPerson.TreeId = map.TreeId;
|
||||||
|
repositoryPerson.Update(familyPerson);
|
||||||
|
}
|
||||||
|
|
||||||
repositoryMap.InsertNow(new FamilyTreeChildrenMapEntity()
|
repositoryMap.InsertNow(new FamilyTreeChildrenMapEntity()
|
||||||
{
|
{
|
||||||
TreeId = map.TreeId,
|
TreeId = map.TreeId,
|
||||||
@@ -439,6 +513,15 @@ namespace CloudBuilder.Master.Service
|
|||||||
if (ent == null) return;
|
if (ent == null) return;
|
||||||
repository.DeleteNow(ent);
|
repository.DeleteNow(ent);
|
||||||
|
|
||||||
|
IRepository<FamilyPersonEntity> repositoryPerson = repository.GetRepository<IRepository<FamilyPersonEntity>>();
|
||||||
|
FamilyPersonEntity familyPerson;
|
||||||
|
|
||||||
|
familyPerson = repositoryPerson.DetachedEntities.Where(x => x.PersonId == ent.AncestorPersonId).FirstOrDefault()!;
|
||||||
|
if (familyPerson != null)
|
||||||
|
{
|
||||||
|
repositoryPerson.DeleteNow(familyPerson);
|
||||||
|
}
|
||||||
|
|
||||||
DeleteSpouses(ent.AncestorPersonId);
|
DeleteSpouses(ent.AncestorPersonId);
|
||||||
DeleteChildrens(ent.AncestorPersonId);
|
DeleteChildrens(ent.AncestorPersonId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ namespace CloudBuilder.Master.Data
|
|||||||
public FamilyTreeDisplayData? FamilyTree { get; set; }
|
public FamilyTreeDisplayData? FamilyTree { get; set; }
|
||||||
|
|
||||||
public FamilyPersonData? CurrentPerson { get; set; }
|
public FamilyPersonData? CurrentPerson { get; set; }
|
||||||
|
public bool IsManager { get; set; } = false;
|
||||||
|
|
||||||
|
public FamilyTreePermissionUserViewEntity[]? FamilyTreePermissions { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,6 +22,7 @@ namespace CloudBuilder.Master.Data
|
|||||||
public FamilyTreeDisplayData(FamilyTreeEntity entity)
|
public FamilyTreeDisplayData(FamilyTreeEntity entity)
|
||||||
{
|
{
|
||||||
CopyFrom(entity);
|
CopyFrom(entity);
|
||||||
|
this.OrgTreeName = entity.TreeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string? AncestorPersonGenealogyName { get; set; }
|
public string? AncestorPersonGenealogyName { get; set; }
|
||||||
|
|||||||
@@ -106,6 +106,11 @@ builder.Entity<DmsFileUploadDeleteLogViewEntity>(eb => { eb.HasNoKey(); });
|
|||||||
|
|
||||||
builder.Entity<DmsFileUploadDeleteLogViewEntity>(eb => { eb.HasNoKey(); });
|
builder.Entity<DmsFileUploadDeleteLogViewEntity>(eb => { eb.HasNoKey(); });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
builder.Entity<FamilyTreePermissionEntity>().HasKey(c => new {c.PersonId,c.TreeId,c.UserName});
|
||||||
|
|
||||||
|
builder.Entity<FamilyTreePermissionUserViewEntity>(eb => { eb.HasNoKey(); });
|
||||||
//***END***
|
//***END***
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace CloudBuilder.Master.Entity
|
|||||||
[Column("title")]
|
[Column("title")]
|
||||||
public string? Title { get; set; }
|
public string? Title { get; set; }
|
||||||
[Column("tree_id")]
|
[Column("tree_id")]
|
||||||
public string TreeId { get; set; }
|
public string? TreeId { get; set; }
|
||||||
[Column("updated_by")]
|
[Column("updated_by")]
|
||||||
public string UpdatedBy { get; set; }
|
public string UpdatedBy { get; set; }
|
||||||
[Column("updated_datetime")]
|
[Column("updated_datetime")]
|
||||||
|
|||||||
@@ -0,0 +1,187 @@
|
|||||||
|
|
||||||
|
using CloudBuilder.Core.Authorization;
|
||||||
|
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
namespace CloudBuilder.Master.Entity
|
||||||
|
{
|
||||||
|
[TypeScript]
|
||||||
|
[Table("family_tree_permission")]
|
||||||
|
public class FamilyTreePermissionEntity : EntityBase<FamilyTreePermissionEntityKey>
|
||||||
|
{
|
||||||
|
|
||||||
|
public FamilyTreePermissionEntity()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[Column("created_by")]
|
||||||
|
public string CreatedBy { get; set; }
|
||||||
|
[Column("created_datetime")]
|
||||||
|
public DateTime CreatedDatetime { get; set; }
|
||||||
|
[Column("manager_indc")]
|
||||||
|
public string ManagerIndc { get; set; }
|
||||||
|
[Column("person_id")]
|
||||||
|
public string PersonId { get; set; }
|
||||||
|
[Column("tree_id")]
|
||||||
|
public string TreeId { get; set; }
|
||||||
|
[Column("updated_by")]
|
||||||
|
public string UpdatedBy { get; set; }
|
||||||
|
[Column("updated_datetime")]
|
||||||
|
public DateTime UpdatedDatetime { get; set; }
|
||||||
|
[Column("user_name")]
|
||||||
|
public string UserName { get; set; }
|
||||||
|
[Column("valid_indc")]
|
||||||
|
public string ValidIndc { get; set; }
|
||||||
|
|
||||||
|
public const string CREATED_BY = "CreatedBy";
|
||||||
|
public const string CREATED_DATETIME = "CreatedDatetime";
|
||||||
|
public const string MANAGER_INDC = "ManagerIndc";
|
||||||
|
public const string PERSON_ID = "PersonId";
|
||||||
|
public const string TREE_ID = "TreeId";
|
||||||
|
public const string UPDATED_BY = "UpdatedBy";
|
||||||
|
public const string UPDATED_DATETIME = "UpdatedDatetime";
|
||||||
|
public const string USER_NAME = "UserName";
|
||||||
|
public const string VALID_INDC = "ValidIndc";
|
||||||
|
|
||||||
|
public const string DB_NAME_FAMILY_TREE_PERMISSION = "family_tree_permission";
|
||||||
|
public const string DB_NAME_FIELDS="created_by,created_datetime,manager_indc,person_id,tree_id,updated_by,updated_datetime,user_name,valid_indc";
|
||||||
|
|
||||||
|
public const string DB_CREATED_BY = "created_by";
|
||||||
|
public const string DB_CREATED_DATETIME = "created_datetime";
|
||||||
|
public const string DB_MANAGER_INDC = "manager_indc";
|
||||||
|
public const string DB_PERSON_ID = "person_id";
|
||||||
|
public const string DB_TREE_ID = "tree_id";
|
||||||
|
public const string DB_UPDATED_BY = "updated_by";
|
||||||
|
public const string DB_UPDATED_DATETIME = "updated_datetime";
|
||||||
|
public const string DB_USER_NAME = "user_name";
|
||||||
|
public const string DB_VALID_INDC = "valid_indc";
|
||||||
|
|
||||||
|
private string ProviderName { get; set; }
|
||||||
|
|
||||||
|
public static FamilyTreePermissionEntity GetInstance(string providerName)
|
||||||
|
{
|
||||||
|
return new FamilyTreePermissionEntity() { ProviderName = providerName };
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void CopyFrom(FamilyTreePermissionEntity source)
|
||||||
|
{
|
||||||
|
CopyFrom(source, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void CopyFrom(FamilyTreePermissionEntity source, bool includeSystemFields)
|
||||||
|
{
|
||||||
|
if (source == null)
|
||||||
|
{
|
||||||
|
throw new NullReferenceException("Source entity is null.");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.CreatedBy = source.CreatedBy;
|
||||||
|
this.CreatedDatetime = source.CreatedDatetime;
|
||||||
|
this.ManagerIndc = source.ManagerIndc;
|
||||||
|
this.PersonId = source.PersonId;
|
||||||
|
this.TreeId = source.TreeId;
|
||||||
|
this.UpdatedBy = source.UpdatedBy;
|
||||||
|
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||||
|
this.UserName = source.UserName;
|
||||||
|
this.ValidIndc = source.ValidIndc;
|
||||||
|
|
||||||
|
if (includeSystemFields)
|
||||||
|
{
|
||||||
|
this.CreatedBy = source.CreatedBy;
|
||||||
|
this.CreatedDatetime = source.CreatedDatetime;
|
||||||
|
this.UpdatedBy = source.UpdatedBy;
|
||||||
|
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string GetSelectFrom()
|
||||||
|
{
|
||||||
|
if (ProviderName.Contains("MySql"))
|
||||||
|
{
|
||||||
|
return GetSelectFromByMySql();
|
||||||
|
}
|
||||||
|
else if (ProviderName.Contains("SqlServer"))
|
||||||
|
{
|
||||||
|
return GetSelectFromByBySqlServer();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new NotSupportedException($"不支持的数据库提供程序:{ProviderName}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string GetSelectFromByMySql()
|
||||||
|
{
|
||||||
|
return $" select {DB_NAME_FIELDS} from { DB_NAME_FAMILY_TREE_PERMISSION} with(nolock) ";
|
||||||
|
}
|
||||||
|
public string GetSelectFromByBySqlServer()
|
||||||
|
{
|
||||||
|
return $" select {DB_NAME_FIELDS} from { DB_NAME_FAMILY_TREE_PERMISSION} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string GetSelectCountFrom(string sqlWhere)
|
||||||
|
{
|
||||||
|
if (ProviderName.Contains("MySql"))
|
||||||
|
{
|
||||||
|
return GetSelectCountFromByMySql(sqlWhere);
|
||||||
|
}
|
||||||
|
else if (ProviderName.Contains("SqlServer"))
|
||||||
|
{
|
||||||
|
return GetSelectCountFromBySqlServer(sqlWhere);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new NotSupportedException($"不支持的数据库提供程序:{ProviderName}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetSelectCountFromByMySql(string sqlWhere)
|
||||||
|
{
|
||||||
|
return $" select count(*) from { DB_NAME_FAMILY_TREE_PERMISSION} where 1=1 {sqlWhere}";
|
||||||
|
}
|
||||||
|
public string GetSelectCountFromBySqlServer(string sqlWhere)
|
||||||
|
{
|
||||||
|
return $" select count(*) from { DB_NAME_FAMILY_TREE_PERMISSION} with(nolock) where 1=1 {sqlWhere}";
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string GetSelectTopFrom(int limit, int start, string orderby, string orderbytag, string sqlWhere)
|
||||||
|
{
|
||||||
|
if (ProviderName.Contains("MySql"))
|
||||||
|
{
|
||||||
|
return GetSelectTopFromByMySql(limit, start, orderby, orderbytag, sqlWhere);
|
||||||
|
}
|
||||||
|
else if (ProviderName.Contains("SqlServer"))
|
||||||
|
{
|
||||||
|
return GetSelectTopFromBySqlServer(limit, start, orderby, orderbytag, sqlWhere);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new NotSupportedException($"不支持的数据库提供程序:{ProviderName}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetSelectTopFromByMySql(int limit, int start,string orderby,string orderbytag, string sqlWhere)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc";
|
||||||
|
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_PERSON_ID ;
|
||||||
|
int offset = limit * (start - 1);
|
||||||
|
return $" select {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_FAMILY_TREE_PERMISSION} where 1=1 {sqlWhere} ) a where num> {offset} LIMIT {limit} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetSelectTopFromBySqlServer(int limit, int start,string orderby,string orderbytag, string sqlWhere)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc";
|
||||||
|
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_PERSON_ID ;
|
||||||
|
string top = limit > 0 ? $"top {limit}" : "";
|
||||||
|
return $" select {top} {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_FAMILY_TREE_PERMISSION} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
|
||||||
|
}
|
||||||
|
|
||||||
|
public FamilyTreePermissionEntity Clone()
|
||||||
|
{
|
||||||
|
FamilyTreePermissionEntity result = new FamilyTreePermissionEntity();
|
||||||
|
result.CopyFrom(this);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
|
||||||
|
using CloudBuilder.Core.Authorization;
|
||||||
|
namespace CloudBuilder.Master
|
||||||
|
{
|
||||||
|
[TypeScript]
|
||||||
|
public class FamilyTreePermissionEntityKey
|
||||||
|
{
|
||||||
|
public string PersonId { get; set; }
|
||||||
|
public string TreeId { get; set; }
|
||||||
|
public string UserName { get; set; }
|
||||||
|
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
if (this == obj) return true;
|
||||||
|
|
||||||
|
FamilyTreePermissionEntityKey pkey = obj as FamilyTreePermissionEntityKey;
|
||||||
|
if (pkey == null) return false;
|
||||||
|
|
||||||
|
if (PersonId != pkey.PersonId) return false;
|
||||||
|
if (TreeId != pkey.TreeId) return false;
|
||||||
|
if (UserName != pkey.UserName) return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
string declareSql="";
|
||||||
|
declareSql=declareSql+$"declare @__tkey_PersonId_0 varchar(50) select @__tkey_PersonId_0 ='{PersonId}'; " ; declareSql=declareSql+$"declare @__tkey_TreeId_1 varchar(50) select @__tkey_TreeId_1 ='{TreeId}'; " ; declareSql=declareSql+$"declare @__tkey_UserName_2 varchar(50) select @__tkey_UserName_2 ='{UserName}'; " ;
|
||||||
|
return declareSql;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* builder.Entity<FamilyTreePermissionEntity>().HasKey(c => new { c.PersonId, c.TreeId, c.UserName}); */
|
||||||
@@ -0,0 +1,179 @@
|
|||||||
|
|
||||||
|
using CloudBuilder.Core.Authorization;
|
||||||
|
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
namespace CloudBuilder.Master.Entity
|
||||||
|
{
|
||||||
|
[TypeScript]
|
||||||
|
[Table("family_tree_permission_user_view")]
|
||||||
|
public class FamilyTreePermissionUserViewEntity : ViewEntityBase
|
||||||
|
{
|
||||||
|
|
||||||
|
public FamilyTreePermissionUserViewEntity()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[Column("created_datetime")]
|
||||||
|
public DateTime CreatedDatetime { get; set; }
|
||||||
|
[Column("manager_indc")]
|
||||||
|
public string ManagerIndc { get; set; }
|
||||||
|
[Column("person_id")]
|
||||||
|
public string PersonId { get; set; }
|
||||||
|
[Column("person_local_name")]
|
||||||
|
public string? PersonLocalName { get; set; }
|
||||||
|
[Column("tree_id")]
|
||||||
|
public string TreeId { get; set; }
|
||||||
|
[Column("user_local_name")]
|
||||||
|
public string UserLocalName { get; set; }
|
||||||
|
[Column("user_name")]
|
||||||
|
public string UserName { get; set; }
|
||||||
|
[Column("valid_indc")]
|
||||||
|
public string ValidIndc { get; set; }
|
||||||
|
|
||||||
|
public const string CREATED_DATETIME = "CreatedDatetime";
|
||||||
|
public const string MANAGER_INDC = "ManagerIndc";
|
||||||
|
public const string PERSON_ID = "PersonId";
|
||||||
|
public const string PERSON_LOCAL_NAME = "PersonLocalName";
|
||||||
|
public const string TREE_ID = "TreeId";
|
||||||
|
public const string USER_LOCAL_NAME = "UserLocalName";
|
||||||
|
public const string USER_NAME = "UserName";
|
||||||
|
public const string VALID_INDC = "ValidIndc";
|
||||||
|
|
||||||
|
public const string DB_NAME_FAMILY_TREE_PERMISSION_USER_VIEW = "family_tree_permission_user_view";
|
||||||
|
public const string DB_NAME_FIELDS="created_datetime,manager_indc,person_id,person_local_name,tree_id,user_local_name,user_name,valid_indc";
|
||||||
|
|
||||||
|
public const string DB_CREATED_DATETIME = "created_datetime";
|
||||||
|
public const string DB_MANAGER_INDC = "manager_indc";
|
||||||
|
public const string DB_PERSON_ID = "person_id";
|
||||||
|
public const string DB_PERSON_LOCAL_NAME = "person_local_name";
|
||||||
|
public const string DB_TREE_ID = "tree_id";
|
||||||
|
public const string DB_USER_LOCAL_NAME = "user_local_name";
|
||||||
|
public const string DB_USER_NAME = "user_name";
|
||||||
|
public const string DB_VALID_INDC = "valid_indc";
|
||||||
|
|
||||||
|
private string ProviderName { get; set; }
|
||||||
|
|
||||||
|
public static FamilyTreePermissionUserViewEntity GetInstance(string providerName)
|
||||||
|
{
|
||||||
|
return new FamilyTreePermissionUserViewEntity() { ProviderName = providerName };
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void CopyFrom(FamilyTreePermissionUserViewEntity source)
|
||||||
|
{
|
||||||
|
CopyFrom(source, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void CopyFrom(FamilyTreePermissionUserViewEntity source, bool includeSystemFields)
|
||||||
|
{
|
||||||
|
if (source == null)
|
||||||
|
{
|
||||||
|
throw new NullReferenceException("Source entity is null.");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.CreatedDatetime = source.CreatedDatetime;
|
||||||
|
this.ManagerIndc = source.ManagerIndc;
|
||||||
|
this.PersonId = source.PersonId;
|
||||||
|
this.PersonLocalName = source.PersonLocalName;
|
||||||
|
this.TreeId = source.TreeId;
|
||||||
|
this.UserLocalName = source.UserLocalName;
|
||||||
|
this.UserName = source.UserName;
|
||||||
|
this.ValidIndc = source.ValidIndc;
|
||||||
|
|
||||||
|
if (includeSystemFields)
|
||||||
|
{
|
||||||
|
this.CreatedDatetime = source.CreatedDatetime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string GetSelectFrom()
|
||||||
|
{
|
||||||
|
if (ProviderName.Contains("MySql"))
|
||||||
|
{
|
||||||
|
return GetSelectFromByMySql();
|
||||||
|
}
|
||||||
|
else if (ProviderName.Contains("SqlServer"))
|
||||||
|
{
|
||||||
|
return GetSelectFromByBySqlServer();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new NotSupportedException($"不支持的数据库提供程序:{ProviderName}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string GetSelectFromByMySql()
|
||||||
|
{
|
||||||
|
return $" select {DB_NAME_FIELDS} from { DB_NAME_FAMILY_TREE_PERMISSION_USER_VIEW} with(nolock) ";
|
||||||
|
}
|
||||||
|
public string GetSelectFromByBySqlServer()
|
||||||
|
{
|
||||||
|
return $" select {DB_NAME_FIELDS} from { DB_NAME_FAMILY_TREE_PERMISSION_USER_VIEW} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string GetSelectCountFrom(string sqlWhere)
|
||||||
|
{
|
||||||
|
if (ProviderName.Contains("MySql"))
|
||||||
|
{
|
||||||
|
return GetSelectCountFromByMySql(sqlWhere);
|
||||||
|
}
|
||||||
|
else if (ProviderName.Contains("SqlServer"))
|
||||||
|
{
|
||||||
|
return GetSelectCountFromBySqlServer(sqlWhere);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new NotSupportedException($"不支持的数据库提供程序:{ProviderName}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetSelectCountFromByMySql(string sqlWhere)
|
||||||
|
{
|
||||||
|
return $" select count(*) from { DB_NAME_FAMILY_TREE_PERMISSION_USER_VIEW} where 1=1 {sqlWhere}";
|
||||||
|
}
|
||||||
|
public string GetSelectCountFromBySqlServer(string sqlWhere)
|
||||||
|
{
|
||||||
|
return $" select count(*) from { DB_NAME_FAMILY_TREE_PERMISSION_USER_VIEW} with(nolock) where 1=1 {sqlWhere}";
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string GetSelectTopFrom(int limit, int start, string orderby, string orderbytag, string sqlWhere)
|
||||||
|
{
|
||||||
|
if (ProviderName.Contains("MySql"))
|
||||||
|
{
|
||||||
|
return GetSelectTopFromByMySql(limit, start, orderby, orderbytag, sqlWhere);
|
||||||
|
}
|
||||||
|
else if (ProviderName.Contains("SqlServer"))
|
||||||
|
{
|
||||||
|
return GetSelectTopFromBySqlServer(limit, start, orderby, orderbytag, sqlWhere);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new NotSupportedException($"不支持的数据库提供程序:{ProviderName}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetSelectTopFromByMySql(int limit, int start,string orderby,string orderbytag, string sqlWhere)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc";
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_CREATED_DATETIME ; int offset = limit * (start - 1);
|
||||||
|
return $" select {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_FAMILY_TREE_PERMISSION_USER_VIEW} where 1=1 {sqlWhere} ) a where num> {offset} LIMIT {limit} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetSelectTopFromBySqlServer(int limit, int start,string orderby,string orderbytag, string sqlWhere)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc";
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_CREATED_DATETIME ; string top = limit > 0 ? $"top {limit}" : "";
|
||||||
|
return $" select {top} {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_FAMILY_TREE_PERMISSION_USER_VIEW} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
|
||||||
|
}
|
||||||
|
|
||||||
|
public FamilyTreePermissionUserViewEntity Clone()
|
||||||
|
{
|
||||||
|
FamilyTreePermissionUserViewEntity result = new FamilyTreePermissionUserViewEntity();
|
||||||
|
result.CopyFrom(this);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,5 +14,10 @@ namespace CloudBuilder.Master.Service
|
|||||||
FamilyTreeResultData FindBySearchCriteria(FamilyTreeSearchCriteria tc);
|
FamilyTreeResultData FindBySearchCriteria(FamilyTreeSearchCriteria tc);
|
||||||
dynamic PrintBySearchCriteria(FamilyTreeSearchCriteria tc);
|
dynamic PrintBySearchCriteria(FamilyTreeSearchCriteria tc);
|
||||||
void Deletes(string[] keys);
|
void Deletes(string[] keys);
|
||||||
|
|
||||||
|
void RequestFamilyTreePermission(string treeId, string currentPermission);
|
||||||
|
void ApproveFamilyTreePermission(string treeId, string currentPersonId, string userName, string managerIndc);
|
||||||
|
void RejectFamilyTreePermission(string treeId, string currentPersonId, string userName);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,164 +0,0 @@
|
|||||||
|
|
||||||
using CloudBuilder.Core.DependencyInjection.Request;
|
|
||||||
using CloudBuilder.Core.Request;
|
|
||||||
using CloudBuilder.Core.Service;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using CloudBuilder.Master.Service;
|
|
||||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using CloudBuilder.Master.Entity;
|
|
||||||
using System;
|
|
||||||
using CloudBuilder.Master.Data;
|
|
||||||
using CloudBuilder.Master.SearchCriteria;
|
|
||||||
|
|
||||||
namespace CloudBuilder.Request.Master
|
|
||||||
{
|
|
||||||
|
|
||||||
public class DmsFileRequest : IRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
private readonly IServiceRequest serviceRequest;
|
|
||||||
public DmsFileRequest(IServiceRequest serviceRequest)
|
|
||||||
{
|
|
||||||
this.serviceRequest = serviceRequest;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DmsFileEntity FindByKey(Int64 key)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<DmsFileEntity>("/DmsFile/FindByKey?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public DmsFileResultData FindBySearchCriteria(DmsFileSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<DmsFileSearchCriteria,DmsFileResultData>("/DmsFile/FindBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public DmsFileResultData FindDatasBySearchCriteria(DmsFileSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<DmsFileSearchCriteria,DmsFileResultData>("/DmsFile/FindDatasBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public DmsFileResultData FindDeleteLogBySearchCriteria(DmsFileSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<DmsFileSearchCriteria,DmsFileResultData>("/DmsFile/FindDeleteLogBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public DmsFileResultData FindFamilyBySearchCriteria(DmsFileSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<DmsFileSearchCriteria,DmsFileResultData>("/DmsFile/FindFamilyBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public DmsFileDeleteLogEntity FindDmsFileDeleteLogByKey(Int64 key)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<DmsFileDeleteLogEntity>("/DmsFile/FindDmsFileDeleteLogByKey?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public dynamic PrintBySearchCriteria(DmsFileSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<DmsFileSearchCriteria,dynamic>("/DmsFile/PrintBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public DmsFileEntity Insert(DmsFileEntity data)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<DmsFileEntity,DmsFileEntity>("/DmsFile/Insert" , data)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public DmsFileEntity Update(DmsFileEntity data)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<DmsFileEntity,DmsFileEntity>("/DmsFile/Update" , data)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void Delete(Int64 key)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsync("/DmsFile/Delete?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void RestoreDmsFile(Int64 key)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsync("/DmsFile/RestoreDmsFile?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void DeleteLog(Int64 key)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsync("/DmsFile/DeleteLog?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public string CreateDmsFolder(DmsFileEntity dmsFile)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<DmsFileEntity,string>("/DmsFile/CreateDmsFolder" , dmsFile)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void DeleteFamilyDmsFolder(FamilyDmsFileViewEntity familyDmsFile)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyDmsFileViewEntity,dynamic>("/DmsFile/DeleteFamilyDmsFolder" , familyDmsFile)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void CreateFamilyDmsFolder(FamilyDmsFileViewEntity familyDmsFile)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyDmsFileViewEntity,dynamic>("/DmsFile/CreateFamilyDmsFolder" , familyDmsFile)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void UpdateDmsFolder(DmsFileEntity dmsFile)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<DmsFileEntity,dynamic>("/DmsFile/UpdateDmsFolder" , dmsFile)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public SelectOption[] FindDmsFolders()
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<SelectOption[]> ("/DmsFile/FindDmsFolders")).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public SelectOption[] FindDmsFolderDeleteLogs()
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<SelectOption[]> ("/DmsFile/FindDmsFolderDeleteLogs")).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public DmsFolderData FindDmsFolderData()
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<DmsFolderData> ("/DmsFile/FindDmsFolderData")).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void MoveDmsFolder(DmsFileEntity dmsFile)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<DmsFileEntity,dynamic>("/DmsFile/MoveDmsFolder" , dmsFile)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void UploadFile()
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsync("/DmsFile/UploadFile")).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void UploadDmsFile()
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsync("/DmsFile/UploadDmsFile")).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public string FindM3u8Path(Int64 fileId)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<string>("/DmsFile/FindM3u8Path?fileId=" + fileId.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public string FindSourceVideoPath(Int64 fileId)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<string>("/DmsFile/FindSourceVideoPath?fileId=" + fileId.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public string FindDeleteLogM3u8Path(Int64 fileId)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<string>("/DmsFile/FindDeleteLogM3u8Path?fileId=" + fileId.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public dynamic DownloadFile(Int64 fileId)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<dynamic>("/DmsFile/DownloadFile?fileId=" + fileId.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public dynamic DownloadFilePreview(DmsFileEntity dmsFile)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<DmsFileEntity,dynamic>("/DmsFile/DownloadFilePreview" , dmsFile)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public dynamic DownloadFileCombine(string fileName)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<dynamic>("/DmsFile/DownloadFileCombine?fileName=" + fileName.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public SelectOption[] FindFamilyDmsFolders()
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<SelectOption[]> ("/DmsFile/FindFamilyDmsFolders")).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public SelectOption[] FindFamilyDmsFoldersByFamilyName(string familyName)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<SelectOption[]>("/DmsFile/FindFamilyDmsFoldersByFamilyName?familyName=" + familyName.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public Int32 FindDmsFolderMapByFolderName(string folderName)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<Int32>("/DmsFile/FindDmsFolderMapByFolderName?folderName=" + folderName.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public string FindFolderNameParentByFolderName(string folderName)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<string>("/DmsFile/FindFolderNameParentByFolderName?folderName=" + folderName.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void CreateFamilyGroupFolder(FamilyGroupFolderEntity[] familyGroupFolder)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyGroupFolderEntity[],dynamic>("/DmsFile/CreateFamilyGroupFolder" , familyGroupFolder)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void DeleteFamilyGroupFolder(FamilyGroupFolderEntity[] familyGroupFolder)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyGroupFolderEntity[],dynamic>("/DmsFile/DeleteFamilyGroupFolder" , familyGroupFolder)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
|
|
||||||
using CloudBuilder.Core.DependencyInjection.Request;
|
|
||||||
using CloudBuilder.Core.Request;
|
|
||||||
using CloudBuilder.Core.Service;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using CloudBuilder.Master.Service;
|
|
||||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using CloudBuilder.Master.Entity;
|
|
||||||
using System;
|
|
||||||
using CloudBuilder.Master.Data;
|
|
||||||
using CloudBuilder.Master.SearchCriteria;
|
|
||||||
|
|
||||||
namespace CloudBuilder.Request.Master
|
|
||||||
{
|
|
||||||
|
|
||||||
public class FamilyGroupRequest : IRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
private readonly IServiceRequest serviceRequest;
|
|
||||||
public FamilyGroupRequest(IServiceRequest serviceRequest)
|
|
||||||
{
|
|
||||||
this.serviceRequest = serviceRequest;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FamilyGroupData FindByKey(string key)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyGroupData>("/FamilyGroup/FindByKey?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public FamilyGroupResultData FindBySearchCriteria(FamilyGroupSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyGroupSearchCriteria,FamilyGroupResultData>("/FamilyGroup/FindBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public FamilyGroupResultData FindFamilyUserBySearchCriteria(FamilyGroupManagerUserSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyGroupManagerUserSearchCriteria,FamilyGroupResultData>("/FamilyGroup/FindFamilyUserBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public FamilyGroupResultData FamilyFolderFavoriteBySearchCriteria(FamilyGroupManagerUserSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyGroupManagerUserSearchCriteria,FamilyGroupResultData>("/FamilyGroup/FamilyFolderFavoriteBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public dynamic PrintBySearchCriteria(FamilyGroupSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyGroupSearchCriteria,dynamic>("/FamilyGroup/PrintBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public FamilyGroupData Insert(FamilyGroupData data)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyGroupData,FamilyGroupData>("/FamilyGroup/Insert" , data)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public FamilyGroupData Update(FamilyGroupData data)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyGroupData,FamilyGroupData>("/FamilyGroup/Update" , data)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void Delete(string key)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsync("/FamilyGroup/Delete?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void InsertFamilyGroupManager(FamilyGroupManagerEntity manager)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyGroupManagerEntity,dynamic>("/FamilyGroup/InsertFamilyGroupManager" , manager)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void InsertFamilyGroupPermission(FamilyGroupPermissionEntity[] managers)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyGroupPermissionEntity[],dynamic>("/FamilyGroup/InsertFamilyGroupPermission" , managers)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void UpdateFamilyGroupManager(FamilyGroupManagerEntity manager)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyGroupManagerEntity,dynamic>("/FamilyGroup/UpdateFamilyGroupManager" , manager)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void DeleteFamilyGroupManager(FamilyGroupManagerEntity manager)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyGroupManagerEntity,dynamic>("/FamilyGroup/DeleteFamilyGroupManager" , manager)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void InsertFamilyFolderFavorite(string folderName)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsync("/FamilyGroup/InsertFamilyFolderFavorite?folderName=" + folderName.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void DeleteFamilyFolderFavorite(string folderName)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsync("/FamilyGroup/DeleteFamilyFolderFavorite?folderName=" + folderName.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void DeleteFamilyFolderFavorites(FamilyFolderFavoriteEntity[] familyFolderFavorites)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyFolderFavoriteEntity[],dynamic>("/FamilyGroup/DeleteFamilyFolderFavorites" , familyFolderFavorites)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
|
|
||||||
using CloudBuilder.Core.DependencyInjection.Request;
|
|
||||||
using CloudBuilder.Core.Request;
|
|
||||||
using CloudBuilder.Core.Service;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using CloudBuilder.Master.Service;
|
|
||||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using CloudBuilder.Master.Entity;
|
|
||||||
using System;
|
|
||||||
using CloudBuilder.Master.Data;
|
|
||||||
using CloudBuilder.Master.SearchCriteria;
|
|
||||||
|
|
||||||
namespace CloudBuilder.Request.Master
|
|
||||||
{
|
|
||||||
|
|
||||||
public class FamilyPersonRequest : IRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
private readonly IServiceRequest serviceRequest;
|
|
||||||
public FamilyPersonRequest(IServiceRequest serviceRequest)
|
|
||||||
{
|
|
||||||
this.serviceRequest = serviceRequest;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FamilyPersonEntity[] FindAll()
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyPersonEntity[]> ("/FamilyPerson/FindAll")).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public FamilyPersonData FindByKey(string key)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyPersonData>("/FamilyPerson/FindByKey?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public FamilyPersonResultData FindBySearchCriteria(FamilyPersonSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyPersonSearchCriteria,FamilyPersonResultData>("/FamilyPerson/FindBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public dynamic PrintBySearchCriteria(FamilyPersonSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyPersonSearchCriteria,dynamic>("/FamilyPerson/PrintBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public FamilyPersonData Insert(FamilyPersonData data)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyPersonData,FamilyPersonData>("/FamilyPerson/Insert" , data)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public FamilyPersonData Update(FamilyPersonData data)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyPersonData,FamilyPersonData>("/FamilyPerson/Update" , data)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void Delete(string key)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsync("/FamilyPerson/Delete?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void Deletes(string[] keys)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<string[],dynamic>("/FamilyPerson/Deletes" , keys)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
|
|
||||||
using CloudBuilder.Core.DependencyInjection.Request;
|
|
||||||
using CloudBuilder.Core.Request;
|
|
||||||
using CloudBuilder.Core.Service;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using CloudBuilder.Master.Service;
|
|
||||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using CloudBuilder.Master.Entity;
|
|
||||||
using System;
|
|
||||||
using CloudBuilder.Master.Data;
|
|
||||||
using CloudBuilder.Master.SearchCriteria;
|
|
||||||
|
|
||||||
namespace CloudBuilder.Request.Master
|
|
||||||
{
|
|
||||||
|
|
||||||
public class FamilyTreeRequest : IRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
private readonly IServiceRequest serviceRequest;
|
|
||||||
public FamilyTreeRequest(IServiceRequest serviceRequest)
|
|
||||||
{
|
|
||||||
this.serviceRequest = serviceRequest;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FamilyTreeData FindAllByTreeId(string treeId)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyTreeData>("/FamilyTree/FindAllByTreeId?treeId=" + treeId.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public FamilyTreeData FindByKey(string key)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyTreeData>("/FamilyTree/FindByKey?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
|
|
||||||
public class FindByCurrentPersonCompositionData2 {
|
|
||||||
public string key { get; set; }
|
|
||||||
public string personId { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
public FamilyTreeData FindByCurrentPerson(string key, string personId)
|
|
||||||
{
|
|
||||||
var compositionData = new FindByCurrentPersonCompositionData2{ ␍key = key, ␍personId = personId }; ␍return Task.Run(() => serviceRequest.PostAsJsonAsync<FindByCurrentPersonCompositionData2, FamilyTreeData>("/FamilyTree/FindByCurrentPerson", compositionData)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public FamilyTreeResultData FindBySearchCriteria(FamilyTreeSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyTreeSearchCriteria,FamilyTreeResultData>("/FamilyTree/FindBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public FamilyTreeData Insert(FamilyTreeData data)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyTreeData,FamilyTreeData>("/FamilyTree/Insert" , data)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public FamilyTreeData Update(FamilyTreeData data)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<FamilyTreeData,FamilyTreeData>("/FamilyTree/Update" , data)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void Delete(string key)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsync("/FamilyTree/Delete?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void Deletes(string[] keys)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<string[],dynamic>("/FamilyTree/Deletes" , keys)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
|
|
||||||
using CloudBuilder.Core.DependencyInjection.Request;
|
|
||||||
using CloudBuilder.Core.Request;
|
|
||||||
using CloudBuilder.Core.Service;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using CloudBuilder.Master.Service;
|
|
||||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using CloudBuilder.Master.Entity;
|
|
||||||
using System;
|
|
||||||
using CloudBuilder.Master.Data;
|
|
||||||
using CloudBuilder.Master.SearchCriteria;
|
|
||||||
|
|
||||||
namespace CloudBuilder.Request.Master
|
|
||||||
{
|
|
||||||
|
|
||||||
public class FileTypePolicyRequest : IRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
private readonly IServiceRequest serviceRequest;
|
|
||||||
public FileTypePolicyRequest(IServiceRequest serviceRequest)
|
|
||||||
{
|
|
||||||
this.serviceRequest = serviceRequest;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SelectOption[] FindSelectOption(bool blank)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<SelectOption[]>("/FileTypePolicy/FindSelectOption?blank=" + blank.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
|
|
||||||
using CloudBuilder.Core.DependencyInjection.Request;
|
|
||||||
using CloudBuilder.Core.Request;
|
|
||||||
using CloudBuilder.Core.Service;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using CloudBuilder.Master.Service;
|
|
||||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using CloudBuilder.Master.Entity;
|
|
||||||
using System;
|
|
||||||
using CloudBuilder.Master.Data;
|
|
||||||
using CloudBuilder.Master.SearchCriteria;
|
|
||||||
|
|
||||||
namespace CloudBuilder.Request.Master
|
|
||||||
{
|
|
||||||
|
|
||||||
public class PublishAudioRequest : IRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
private readonly IServiceRequest serviceRequest;
|
|
||||||
public PublishAudioRequest(IServiceRequest serviceRequest)
|
|
||||||
{
|
|
||||||
this.serviceRequest = serviceRequest;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PublishAudioData FindByKey(string key)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishAudioData>("/PublishAudio/FindByKey?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public PublishAudioResultData FindBySearchCriteria(PublishAudioSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishAudioSearchCriteria,PublishAudioResultData>("/PublishAudio/FindBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public PublishAudioData FindPublishAudioDefault()
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishAudioData> ("/PublishAudio/FindPublishAudioDefault")).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public dynamic PrintBySearchCriteria(PublishAudioSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishAudioSearchCriteria,dynamic>("/PublishAudio/PrintBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public PublishAudioData Insert(PublishAudioData data)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishAudioData,PublishAudioData>("/PublishAudio/Insert" , data)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public PublishAudioData Update(PublishAudioData data)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishAudioData,PublishAudioData>("/PublishAudio/Update" , data)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void Delete(string key)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsync("/PublishAudio/Delete?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void InsertPublishAudioDetail(PublishData publishData)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<PublishData,dynamic>("/PublishAudio/InsertPublishAudioDetail" , publishData)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
|
|
||||||
using CloudBuilder.Core.DependencyInjection.Request;
|
|
||||||
using CloudBuilder.Core.Request;
|
|
||||||
using CloudBuilder.Core.Service;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using CloudBuilder.Master.Service;
|
|
||||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using CloudBuilder.Master.Entity;
|
|
||||||
using System;
|
|
||||||
using CloudBuilder.Master.Data;
|
|
||||||
using CloudBuilder.Master.SearchCriteria;
|
|
||||||
|
|
||||||
namespace CloudBuilder.Request.Master
|
|
||||||
{
|
|
||||||
|
|
||||||
public class PublishPhotoRequest : IRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
private readonly IServiceRequest serviceRequest;
|
|
||||||
public PublishPhotoRequest(IServiceRequest serviceRequest)
|
|
||||||
{
|
|
||||||
this.serviceRequest = serviceRequest;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PublishPhotoData FindByKey(string key)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishPhotoData>("/PublishPhoto/FindByKey?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public PublishPhotoResultData FindBySearchCriteria(PublishPhotoSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishPhotoSearchCriteria,PublishPhotoResultData>("/PublishPhoto/FindBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public dynamic PrintBySearchCriteria(PublishPhotoSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishPhotoSearchCriteria,dynamic>("/PublishPhoto/PrintBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public PublishPhotoData Insert(PublishPhotoData data)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishPhotoData,PublishPhotoData>("/PublishPhoto/Insert" , data)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public PublishPhotoData Update(PublishPhotoData data)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishPhotoData,PublishPhotoData>("/PublishPhoto/Update" , data)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void Delete(string key)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsync("/PublishPhoto/Delete?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public PublishPhotoDetailEntity[] FindPublishPhotoDetailByPublishName(string publishName)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishPhotoDetailEntity[]>("/PublishPhoto/FindPublishPhotoDetailByPublishName?publishName=" + publishName.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public PublishPhotoDetailEntity[] FindPublishPhotoDetail()
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishPhotoDetailEntity[]> ("/PublishPhoto/FindPublishPhotoDetail")).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void InsertPublishPhotoDetail(PublishData publishData)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<PublishData,dynamic>("/PublishPhoto/InsertPublishPhotoDetail" , publishData)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void InsertPublishPhotoDetailByFamilyGroup(PublishData publishData)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<PublishData,dynamic>("/PublishPhoto/InsertPublishPhotoDetailByFamilyGroup" , publishData)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
|
|
||||||
using CloudBuilder.Core.DependencyInjection.Request;
|
|
||||||
using CloudBuilder.Core.Request;
|
|
||||||
using CloudBuilder.Core.Service;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using CloudBuilder.Master.Service;
|
|
||||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using CloudBuilder.Master.Entity;
|
|
||||||
using System;
|
|
||||||
using CloudBuilder.Master.Data;
|
|
||||||
using CloudBuilder.Master.SearchCriteria;
|
|
||||||
|
|
||||||
namespace CloudBuilder.Request.Master
|
|
||||||
{
|
|
||||||
|
|
||||||
public class PublishVideoRequest : IRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
private readonly IServiceRequest serviceRequest;
|
|
||||||
public PublishVideoRequest(IServiceRequest serviceRequest)
|
|
||||||
{
|
|
||||||
this.serviceRequest = serviceRequest;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PublishVideoData FindByKey(string key)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishVideoData>("/PublishVideo/FindByKey?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public PublishVideoResultData FindBySearchCriteria(PublishVideoSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishVideoSearchCriteria,PublishVideoResultData>("/PublishVideo/FindBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public PublishVideoData FindPublishVideoDefault()
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishVideoData> ("/PublishVideo/FindPublishVideoDefault")).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public dynamic PrintBySearchCriteria(PublishVideoSearchCriteria criteria)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishVideoSearchCriteria,dynamic>("/PublishVideo/PrintBySearchCriteria" , criteria)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public PublishVideoData Insert(PublishVideoData data)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishVideoData,PublishVideoData>("/PublishVideo/Insert" , data)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public PublishVideoData Update(PublishVideoData data)
|
|
||||||
{
|
|
||||||
return Task.Run(() => serviceRequest.PostAsJsonAsync<PublishVideoData,PublishVideoData>("/PublishVideo/Update" , data)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void Delete(string key)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsync("/PublishVideo/Delete?key=" + key.ToString())).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
public void InsertPublishVideoDetail(PublishData publishData)
|
|
||||||
{
|
|
||||||
Task.Run(() => serviceRequest.PostAsJsonAsync<PublishData,dynamic>("/PublishVideo/InsertPublishVideoDetail" , publishData)).GetAwaiter().GetResult(); }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -145,7 +145,7 @@ namespace CloudBuilder.Security.Gui
|
|||||||
|
|
||||||
private void InitCombo()
|
private void InitCombo()
|
||||||
{
|
{
|
||||||
functionIndcCombo.SetDataSource(YesNoPolicy.GetInstance().GetComposeMessages(), true);
|
functionIndcCombo.SetDataSource(YesNoPolicy.GetInstance(ApplicationServiceContext.ServiceProvider).GetComposeMessages(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using CloudBuilder.Core.Service;
|
using CloudBuilder.Core.DependencyInjection.Form;
|
||||||
|
using CloudBuilder.Core.Service;
|
||||||
using CloudBuilder.Gui;
|
using CloudBuilder.Gui;
|
||||||
using CloudBuilder.Request.Security;
|
using CloudBuilder.Request.Security;
|
||||||
using CloudBuilder.Security.Data;
|
using CloudBuilder.Security.Data;
|
||||||
@@ -102,7 +103,7 @@ namespace CloudBuilder.Security.Gui
|
|||||||
|
|
||||||
private void InitComBox()
|
private void InitComBox()
|
||||||
{
|
{
|
||||||
functionIndcCombo.SetDataSource(YesNoPolicy.GetInstance().GetComposeMessages(), true);
|
functionIndcCombo.SetDataSource(YesNoPolicy.GetInstance(ApplicationServiceContext.ServiceProvider).GetComposeMessages(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitPermission()
|
private void InitPermission()
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using CloudBuilder.Core.Service;
|
using CloudBuilder.Core.DependencyInjection.Form;
|
||||||
|
using CloudBuilder.Core.Service;
|
||||||
using CloudBuilder.Gui;
|
using CloudBuilder.Gui;
|
||||||
using CloudBuilder.Request.Security;
|
using CloudBuilder.Request.Security;
|
||||||
using CloudBuilder.Security.Entity;
|
using CloudBuilder.Security.Entity;
|
||||||
@@ -107,7 +108,7 @@ namespace CloudBuilder.Security.Gui
|
|||||||
|
|
||||||
private void InitCombo()
|
private void InitCombo()
|
||||||
{
|
{
|
||||||
validIndcCombo.SetDataSource(YesNoPolicy.GetInstance().GetComposeMessages(), true);
|
validIndcCombo.SetDataSource(YesNoPolicy.GetInstance(ApplicationServiceContext.ServiceProvider).GetComposeMessages(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ namespace CloudBuilder.Security.Gui
|
|||||||
{
|
{
|
||||||
//設置Value與description的映射,另一方式是dataValeOperation传入函数
|
//設置Value與description的映射,另一方式是dataValeOperation传入函数
|
||||||
Dictionary<string, Dictionary<string, object>> mappings = new Dictionary<string, Dictionary<string, object>>();
|
Dictionary<string, Dictionary<string, object>> mappings = new Dictionary<string, Dictionary<string, object>>();
|
||||||
Dictionary<string, object> validDic = YesNoPolicy.GetInstance().GetDictionary();
|
Dictionary<string, object> validDic = YesNoPolicy.GetInstance(ApplicationServiceContext.ServiceProvider).GetDictionary();
|
||||||
mappings.Add(SecurityUserEntity.USER_IS_VALID_INDC, validDic);
|
mappings.Add(SecurityUserEntity.USER_IS_VALID_INDC, validDic);
|
||||||
//設置查詢條件
|
//設置查詢條件
|
||||||
List<string> searCriteria = new List<string>();
|
List<string> searCriteria = new List<string>();
|
||||||
@@ -151,7 +151,7 @@ namespace CloudBuilder.Security.Gui
|
|||||||
|
|
||||||
private void InitCombo()
|
private void InitCombo()
|
||||||
{
|
{
|
||||||
userIsValidIndcCombo.SetDataSource(YesNoPolicy.GetInstance().GetComposeMessages(), true);
|
userIsValidIndcCombo.SetDataSource(YesNoPolicy.GetInstance(ApplicationServiceContext.ServiceProvider).GetComposeMessages(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -27,13 +27,19 @@ namespace CloudBuilder.Security.Service.Authorization
|
|||||||
{
|
{
|
||||||
public class PermissionHandler : AuthorizationHandler<PermissionRequirement>, IAuthorize
|
public class PermissionHandler : AuthorizationHandler<PermissionRequirement>, IAuthorize
|
||||||
{
|
{
|
||||||
private readonly WebService service;
|
private readonly IServiceProvider serviceProvider;
|
||||||
private readonly IContext loginContext;
|
private readonly IContext loginContext;
|
||||||
private readonly IHttpContextAccessor httpContextAccessor;
|
private readonly IHttpContextAccessor httpContextAccessor;
|
||||||
|
|
||||||
public PermissionHandler(WebService service, IContext loginContext, IHttpContextAccessor httpContextAccessor)
|
/// <summary>
|
||||||
|
/// 注意:这里必须注入当前请求作用域的 IServiceProvider,
|
||||||
|
/// 不能使用 WebService.Services.BuildServiceProvider() 新建容器,
|
||||||
|
/// 否则每次鉴权都会独立构建一整套服务实例(单例/作用域都会重建,且无法释放),
|
||||||
|
/// 取到的 IApplicationService 也会与当前请求的作用域不一致。
|
||||||
|
/// </summary>
|
||||||
|
public PermissionHandler(IServiceProvider serviceProvider, IContext loginContext, IHttpContextAccessor httpContextAccessor)
|
||||||
{
|
{
|
||||||
this.service = service;
|
this.serviceProvider = serviceProvider;
|
||||||
this.loginContext = loginContext;
|
this.loginContext = loginContext;
|
||||||
this.httpContextAccessor = httpContextAccessor;
|
this.httpContextAccessor = httpContextAccessor;
|
||||||
}
|
}
|
||||||
@@ -66,7 +72,7 @@ namespace CloudBuilder.Security.Service.Authorization
|
|||||||
loginContext.SetToken(ClaimPolicy.GetJwtBearerToken(httpContextAccessor.HttpContext));
|
loginContext.SetToken(ClaimPolicy.GetJwtBearerToken(httpContextAccessor.HttpContext));
|
||||||
loginContext.SetCulture(ClaimPolicy.GetClaimValue(httpContextAccessor, ClaimPolicy.CLAINM_LOCALE) ?? CulturePolicy.ZH_CN);
|
loginContext.SetCulture(ClaimPolicy.GetClaimValue(httpContextAccessor, ClaimPolicy.CLAINM_LOCALE) ?? CulturePolicy.ZH_CN);
|
||||||
|
|
||||||
IApplicationService applicationService = service.Services.BuildServiceProvider().GetRequiredService<IApplicationService>();
|
IApplicationService applicationService = serviceProvider.GetRequiredService<IApplicationService>();
|
||||||
PermissionContext permissionContext = new PermissionContext(applicationService);
|
PermissionContext permissionContext = new PermissionContext(applicationService);
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|||||||
@@ -137,6 +137,90 @@ this.familyTreeService= familyTreeService;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class RequestFamilyTreePermissionCompositionData
|
||||||
|
{
|
||||||
|
public string treeId { get; set; }
|
||||||
|
public string currentPersonId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
[PermissionOperate(name: "FamilyTree", operate: "Find")]
|
||||||
|
[HttpPost]
|
||||||
|
[UnitOfWork]
|
||||||
|
public dynamic RequestFamilyTreePermission(RequestFamilyTreePermissionCompositionData compositionData){
|
||||||
|
try
|
||||||
|
{
|
||||||
|
familyTreeService.RequestFamilyTreePermission(compositionData.treeId,compositionData.currentPersonId);
|
||||||
|
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
catch (ValidatedException vex)
|
||||||
|
{
|
||||||
|
return vex;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return new ServiceErrorException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class ApproveFamilyTreePermissionCompositionData
|
||||||
|
{
|
||||||
|
public string treeId { get; set; }
|
||||||
|
public string currentPersonId { get; set; }
|
||||||
|
public string userName { get; set; }
|
||||||
|
public string managerIndc { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
[PermissionOperate(name: "FamilyTree", operate: "Find")]
|
||||||
|
[HttpPost]
|
||||||
|
[UnitOfWork]
|
||||||
|
public dynamic ApproveFamilyTreePermission(ApproveFamilyTreePermissionCompositionData compositionData){
|
||||||
|
try
|
||||||
|
{
|
||||||
|
familyTreeService.ApproveFamilyTreePermission(compositionData.treeId,compositionData.currentPersonId,compositionData.userName,compositionData.managerIndc);
|
||||||
|
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
catch (ValidatedException vex)
|
||||||
|
{
|
||||||
|
return vex;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return new ServiceErrorException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class RejectFamilyTreePermissionCompositionData
|
||||||
|
{
|
||||||
|
public string treeId { get; set; }
|
||||||
|
public string currentPersonId { get; set; }
|
||||||
|
public string userName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
[PermissionOperate(name: "FamilyTree", operate: "Find")]
|
||||||
|
[HttpPost]
|
||||||
|
[UnitOfWork]
|
||||||
|
public dynamic RejectFamilyTreePermission(RejectFamilyTreePermissionCompositionData compositionData){
|
||||||
|
try
|
||||||
|
{
|
||||||
|
familyTreeService.RejectFamilyTreePermission(compositionData.treeId,compositionData.currentPersonId,compositionData.userName);
|
||||||
|
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
catch (ValidatedException vex)
|
||||||
|
{
|
||||||
|
return vex;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return new ServiceErrorException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[PermissionOperate(name: "FamilyTree", operate: "Update")]
|
[PermissionOperate(name: "FamilyTree", operate: "Update")]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
|
|||||||
@@ -587,6 +587,9 @@ const handleChange = (bindValue: string, value: string) => {
|
|||||||
|
|
||||||
const onReset = () => {
|
const onReset = () => {
|
||||||
bindOptions.value.forEach((element: BindOption) => {
|
bindOptions.value.forEach((element: BindOption) => {
|
||||||
|
// 只读(disabled)的查询条件属于固定约束,重置时保留其值
|
||||||
|
if (element.disabled) return;
|
||||||
|
|
||||||
element.Value = "";
|
element.Value = "";
|
||||||
element.Value1 = "";
|
element.Value1 = "";
|
||||||
element.Values = [];
|
element.Values = [];
|
||||||
|
|||||||
@@ -56,6 +56,36 @@ class FamilyTreeService{
|
|||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
async RequestFamilyTreePermission(data: any) {
|
||||||
|
return request<any>(
|
||||||
|
{
|
||||||
|
url: "/FamilyTree/RequestFamilyTreePermission",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
async ApproveFamilyTreePermission(data: any) {
|
||||||
|
return request<any>(
|
||||||
|
{
|
||||||
|
url: "/FamilyTree/ApproveFamilyTreePermission",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
async RejectFamilyTreePermission(data: any) {
|
||||||
|
return request<any>(
|
||||||
|
{
|
||||||
|
url: "/FamilyTree/RejectFamilyTreePermission",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
async Update(data: FamilyTreeData) {
|
async Update(data: FamilyTreeData) {
|
||||||
return request<FamilyTreeData>(
|
return request<FamilyTreeData>(
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -396,6 +396,15 @@ const initBindOption = async () => {
|
|||||||
bindOption.lg = 10;
|
bindOption.lg = 10;
|
||||||
bindOptions.value.push(bindOption);
|
bindOptions.value.push(bindOption);
|
||||||
|
|
||||||
|
bindOption = ubo.getBindOption(
|
||||||
|
FamilyPersonEntity.DB_TREE_ID,
|
||||||
|
"族谱编号",
|
||||||
|
SearchFilterTypePolicy.TEXT,
|
||||||
|
SearchFilterOperatorPolicy.CONTAIN,
|
||||||
|
);
|
||||||
|
bindOption.lg = 10;
|
||||||
|
bindOptions.value.push(bindOption);
|
||||||
|
|
||||||
initBindOptions.value.forEach((element) => {
|
initBindOptions.value.forEach((element) => {
|
||||||
setBindOptionValue(
|
setBindOptionValue(
|
||||||
element.BindValue,
|
element.BindValue,
|
||||||
@@ -405,15 +414,6 @@ const initBindOption = async () => {
|
|||||||
element.disabled,
|
element.disabled,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
bindOption = ubo.getBindOption(
|
|
||||||
FamilyPersonEntity.DB_CREATED_DATETIME,
|
|
||||||
"创建日期",
|
|
||||||
SearchFilterTypePolicy.DATE,
|
|
||||||
SearchFilterOperatorPolicy.DATE_BETWEEN,
|
|
||||||
);
|
|
||||||
bindOption.lg = 10;
|
|
||||||
bindOptions.value.push(bindOption);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//table from-----------------------------------------------------------------------------------------------------------------------------------
|
//table from-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -7,47 +7,26 @@
|
|||||||
<a-row :wrap="false">
|
<a-row :wrap="false">
|
||||||
<a-col flex="none">
|
<a-col flex="none">
|
||||||
<div style="padding: 0">
|
<div style="padding: 0">
|
||||||
<a-input
|
<a-input flex="none" readonly value="族员编号" class="site-input-split" style="
|
||||||
flex="none"
|
|
||||||
readonly
|
|
||||||
value="族员编号"
|
|
||||||
class="site-input-split"
|
|
||||||
style="
|
|
||||||
width: 160px;
|
width: 160px;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
border-top-left-radius: 5pt 5pt;
|
border-top-left-radius: 5pt 5pt;
|
||||||
border-bottom-left-radius: 5pt 5pt;
|
border-bottom-left-radius: 5pt 5pt;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
"
|
" />
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col flex="auto">
|
<a-col flex="auto">
|
||||||
<a-input-search
|
<a-input-search :disabled="isEdit" v-model:value="personId" flex="auto" @search="onModalSearch" />
|
||||||
:disabled="isEdit"
|
|
||||||
v-model:value="personId"
|
|
||||||
flex="auto"
|
|
||||||
@search="onModalSearch"
|
|
||||||
/>
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="12" :sm="24">
|
<a-col :lg="12" :sm="24">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button
|
<a-button type="primary" :disabled="isEdit" :icon="h(FileSearchOutlined)"
|
||||||
type="primary"
|
@click.prevent="onSearch">查询</a-button>
|
||||||
:disabled="isEdit"
|
<a-button type="primary" :disabled="isEdit" :icon="h(ClearOutlined)"
|
||||||
:icon="h(FileSearchOutlined)"
|
@click.prevent="onReset">重置</a-button>
|
||||||
@click.prevent="onSearch"
|
|
||||||
>查询</a-button
|
|
||||||
>
|
|
||||||
<a-button
|
|
||||||
type="primary"
|
|
||||||
:disabled="isEdit"
|
|
||||||
:icon="h(ClearOutlined)"
|
|
||||||
@click.prevent="onReset"
|
|
||||||
>重置</a-button
|
|
||||||
>
|
|
||||||
<!-- <a-button
|
<!-- <a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
:disabled="isEdit"
|
:disabled="isEdit"
|
||||||
@@ -59,27 +38,13 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="page-main" :class="{ 'fp-readonly': !isEdit }" :style="{ height: resultH }">
|
||||||
class="page-main"
|
|
||||||
:class="{ 'fp-readonly': !isEdit }"
|
|
||||||
:style="{ height: resultH }"
|
|
||||||
>
|
|
||||||
<!-- 顶部:头像 / 姓名 / 编号 -->
|
<!-- 顶部:头像 / 姓名 / 编号 -->
|
||||||
<div class="fp-hero">
|
<div class="fp-hero">
|
||||||
<FileUpload
|
<FileUpload class="fp-hero-upload" accept="image/*" file-path="FamilyPersonAvatar"
|
||||||
class="fp-hero-upload"
|
:disabled="!isEdit || avatarUploading" @start="onAvatarUploadStart" @progress="onAvatarUploadProgress"
|
||||||
accept="image/*"
|
@success="onAvatarUploadSuccess" @error="onAvatarUploadError">
|
||||||
file-path="FamilyPersonAvatar"
|
<div class="fp-hero-avatar-wrap" :class="{ 'is-editing': isEdit }">
|
||||||
:disabled="!isEdit || avatarUploading"
|
|
||||||
@start="onAvatarUploadStart"
|
|
||||||
@progress="onAvatarUploadProgress"
|
|
||||||
@success="onAvatarUploadSuccess"
|
|
||||||
@error="onAvatarUploadError"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="fp-hero-avatar-wrap"
|
|
||||||
:class="{ 'is-editing': isEdit }"
|
|
||||||
>
|
|
||||||
<a-avatar class="fp-hero-avatar" :size="72" :src="avatarSrc">
|
<a-avatar class="fp-hero-avatar" :size="72" :src="avatarSrc">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<UserOutlined />
|
<UserOutlined />
|
||||||
@@ -99,22 +64,16 @@
|
|||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-hero-meta">
|
<div class="fp-hero-meta">
|
||||||
<span class="fp-chip"
|
<span class="fp-chip">编号 {{ data.FamilyPerson.PersonId || "-" }}</span>
|
||||||
>编号 {{ data.FamilyPerson.PersonId || "-" }}</span
|
</div>
|
||||||
>
|
<div class="fp-hero-meta">
|
||||||
|
<span class="fp-chip">族谱编号 {{ data.FamilyPerson.TreeId || "-" }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a-button
|
<a-button v-if="
|
||||||
v-if="
|
|
||||||
isEdit &&
|
isEdit &&
|
||||||
(data.FamilyPerson.AvatarUrl || data.FamilyPerson.AvatarFilename)
|
(data.FamilyPerson.AvatarUrl || data.FamilyPerson.AvatarFilename)
|
||||||
"
|
" class="fp-hero-clear" type="text" size="small" @click.prevent="onClearAvatar">清除头像</a-button>
|
||||||
class="fp-hero-clear"
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
@click.prevent="onClearAvatar"
|
|
||||||
>清除头像</a-button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- 基本资料 -->
|
<!-- 基本资料 -->
|
||||||
<div class="fp-card">
|
<div class="fp-card">
|
||||||
@@ -122,84 +81,43 @@
|
|||||||
<div class="fp-grid">
|
<div class="fp-grid">
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">姓氏<span class="fp-required">*</span></div>
|
<div class="fp-label">姓氏<span class="fp-required">*</span></div>
|
||||||
<a-input
|
<a-input size="large" :maxlength="100" :readonly="!isEdit" v-model:value="data.FamilyPerson.Surname"
|
||||||
size="large"
|
placeholder="请输入姓氏" />
|
||||||
:maxlength="100"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.Surname"
|
|
||||||
placeholder="请输入姓氏"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">谱名<span class="fp-required">*</span></div>
|
<div class="fp-label">谱名<span class="fp-required">*</span></div>
|
||||||
<a-input
|
<a-input size="large" :maxlength="100" :readonly="!isEdit" v-model:value="data.FamilyPerson.GenealogyName"
|
||||||
size="large"
|
placeholder="请输入谱名" />
|
||||||
:maxlength="100"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.GenealogyName"
|
|
||||||
placeholder="请输入谱名"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">常用名</div>
|
<div class="fp-label">常用名</div>
|
||||||
<a-input
|
<a-input size="large" :maxlength="100" :readonly="!isEdit" v-model:value="data.FamilyPerson.CommonName"
|
||||||
size="large"
|
placeholder="请输入常用名" />
|
||||||
:maxlength="100"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.CommonName"
|
|
||||||
placeholder="请输入常用名"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">别名</div>
|
<div class="fp-label">别名</div>
|
||||||
<a-input
|
<a-input size="large" :maxlength="100" :readonly="!isEdit" v-model:value="data.FamilyPerson.Alias"
|
||||||
size="large"
|
placeholder="请输入别名" />
|
||||||
:maxlength="100"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.Alias"
|
|
||||||
placeholder="请输入别名"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">字</div>
|
<div class="fp-label">字</div>
|
||||||
<a-input
|
<a-input size="large" :maxlength="100" :readonly="!isEdit" v-model:value="data.FamilyPerson.Zi"
|
||||||
size="large"
|
placeholder="请输入字" />
|
||||||
:maxlength="100"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.Zi"
|
|
||||||
placeholder="请输入字"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">号</div>
|
<div class="fp-label">号</div>
|
||||||
<a-input
|
<a-input size="large" :maxlength="100" :readonly="!isEdit" v-model:value="data.FamilyPerson.Hao"
|
||||||
size="large"
|
placeholder="请输入号" />
|
||||||
:maxlength="100"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.Hao"
|
|
||||||
placeholder="请输入号"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">行第</div>
|
<div class="fp-label">行第</div>
|
||||||
<a-input
|
<a-input size="large" :maxlength="32" :readonly="!isEdit" v-model:value="data.FamilyPerson.BirthOrder"
|
||||||
size="large"
|
placeholder="如:三" />
|
||||||
:maxlength="32"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.BirthOrder"
|
|
||||||
placeholder="如:三"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">性别</div>
|
<div class="fp-label">性别</div>
|
||||||
<a-select
|
<a-select size="large" v-model:value="data.FamilyPerson.Gender" :disabled="!isEdit" style="width: 100%"
|
||||||
size="large"
|
placeholder="请选择性别" :options="genderSelectOptions">
|
||||||
v-model:value="data.FamilyPerson.Gender"
|
|
||||||
:disabled="!isEdit"
|
|
||||||
style="width: 100%"
|
|
||||||
placeholder="请选择性别"
|
|
||||||
:options="genderSelectOptions"
|
|
||||||
>
|
|
||||||
</a-select>
|
</a-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -210,95 +128,47 @@
|
|||||||
<div class="fp-grid">
|
<div class="fp-grid">
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">婚姻</div>
|
<div class="fp-label">婚姻</div>
|
||||||
<a-select
|
<a-select size="large" v-model:value="data.FamilyPerson.MaritalStatus" :disabled="!isEdit"
|
||||||
size="large"
|
style="width: 100%" placeholder="请选择">
|
||||||
v-model:value="data.FamilyPerson.MaritalStatus"
|
<a-select-option v-for="o in yesNoPolicy" :value="o.BindValue">{{ o.DisplayName }}</a-select-option>
|
||||||
:disabled="!isEdit"
|
|
||||||
style="width: 100%"
|
|
||||||
placeholder="请选择"
|
|
||||||
>
|
|
||||||
<a-select-option
|
|
||||||
v-for="o in yesNoPolicy"
|
|
||||||
:value="o.BindValue"
|
|
||||||
>{{ o.DisplayName }}</a-select-option
|
|
||||||
>
|
|
||||||
</a-select>
|
</a-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">父亲姓名</div>
|
<div class="fp-label">父亲姓名</div>
|
||||||
<a-input
|
<a-input size="large" :maxlength="50" :readonly="!isEdit" v-model:value="data.FamilyPerson.FatherId"
|
||||||
size="large"
|
placeholder="请输入父亲姓名" />
|
||||||
:maxlength="50"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.FatherId"
|
|
||||||
placeholder="请输入父亲姓名"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">母亲姓名</div>
|
<div class="fp-label">母亲姓名</div>
|
||||||
<a-input
|
<a-input size="large" :maxlength="100" :readonly="!isEdit" v-model:value="data.FamilyPerson.MotherName"
|
||||||
size="large"
|
placeholder="请输入母亲姓名" />
|
||||||
:maxlength="100"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.MotherName"
|
|
||||||
placeholder="请输入母亲姓名"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">学校</div>
|
<div class="fp-label">学校</div>
|
||||||
<a-input
|
<a-input size="large" :maxlength="256" :readonly="!isEdit" v-model:value="data.FamilyPerson.School"
|
||||||
size="large"
|
placeholder="请输入毕业学校" />
|
||||||
:maxlength="256"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.School"
|
|
||||||
placeholder="请输入毕业学校"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">专业</div>
|
<div class="fp-label">专业</div>
|
||||||
<a-input
|
<a-input size="large" :maxlength="256" :readonly="!isEdit" v-model:value="data.FamilyPerson.Major"
|
||||||
size="large"
|
placeholder="请输入所学专业" />
|
||||||
:maxlength="256"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.Major"
|
|
||||||
placeholder="请输入所学专业"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">学历</div>
|
<div class="fp-label">学历</div>
|
||||||
<a-input
|
<a-input size="large" :maxlength="128" :readonly="!isEdit" v-model:value="data.FamilyPerson.Education"
|
||||||
size="large"
|
placeholder="请输入学历" />
|
||||||
:maxlength="128"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.Education"
|
|
||||||
placeholder="请输入学历"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">毕业</div>
|
<div class="fp-label">毕业</div>
|
||||||
<a-select
|
<a-select size="large" v-model:value="data.FamilyPerson.GraduationStatus" :disabled="!isEdit"
|
||||||
size="large"
|
style="width: 100%" placeholder="请选择">
|
||||||
v-model:value="data.FamilyPerson.GraduationStatus"
|
<a-select-option v-for="o in yesNoPolicy" :value="o.BindValue">{{ o.DisplayName }}</a-select-option>
|
||||||
:disabled="!isEdit"
|
|
||||||
style="width: 100%"
|
|
||||||
placeholder="请选择"
|
|
||||||
>
|
|
||||||
<a-select-option
|
|
||||||
v-for="o in yesNoPolicy"
|
|
||||||
:value="o.BindValue"
|
|
||||||
>{{ o.DisplayName }}</a-select-option
|
|
||||||
>
|
|
||||||
</a-select>
|
</a-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">职务</div>
|
<div class="fp-label">职务</div>
|
||||||
<a-input
|
<a-input size="large" :maxlength="256" :readonly="!isEdit" v-model:value="data.FamilyPerson.Duty"
|
||||||
size="large"
|
placeholder="请输入职务" />
|
||||||
:maxlength="256"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.Duty"
|
|
||||||
placeholder="请输入职务"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -308,68 +178,33 @@
|
|||||||
<div class="fp-grid">
|
<div class="fp-grid">
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">头衔</div>
|
<div class="fp-label">头衔</div>
|
||||||
<a-input
|
<a-input size="large" :maxlength="256" :readonly="!isEdit" v-model:value="data.FamilyPerson.Title"
|
||||||
size="large"
|
placeholder="请输入头衔" />
|
||||||
:maxlength="256"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.Title"
|
|
||||||
placeholder="请输入头衔"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">公开</div>
|
<div class="fp-label">公开</div>
|
||||||
<a-select
|
<a-select size="large" v-model:value="data.FamilyPerson.Privacy" :disabled="!isEdit" style="width: 100%"
|
||||||
size="large"
|
placeholder="请选择">
|
||||||
v-model:value="data.FamilyPerson.Privacy"
|
<a-select-option v-for="o in yesNoPolicy" :value="o.BindValue">{{ o.DisplayName }}</a-select-option>
|
||||||
:disabled="!isEdit"
|
|
||||||
style="width: 100%"
|
|
||||||
placeholder="请选择"
|
|
||||||
>
|
|
||||||
<a-select-option
|
|
||||||
v-for="o in yesNoPolicy"
|
|
||||||
:value="o.BindValue"
|
|
||||||
>{{ o.DisplayName }}</a-select-option
|
|
||||||
>
|
|
||||||
</a-select>
|
</a-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">状态</div>
|
<div class="fp-label">状态</div>
|
||||||
<a-select
|
<a-select size="large" v-model:value="data.FamilyPerson.LiveStatus" :disabled="!isEdit"
|
||||||
size="large"
|
style="width: 100%" placeholder="请选择">
|
||||||
v-model:value="data.FamilyPerson.LiveStatus"
|
<a-select-option v-for="o in yesNoPolicy" :value="o.BindValue">{{ o.DisplayName }}</a-select-option>
|
||||||
:disabled="!isEdit"
|
|
||||||
style="width: 100%"
|
|
||||||
placeholder="请选择"
|
|
||||||
>
|
|
||||||
<a-select-option
|
|
||||||
v-for="o in yesNoPolicy"
|
|
||||||
:value="o.BindValue"
|
|
||||||
>{{ o.DisplayName }}</a-select-option
|
|
||||||
>
|
|
||||||
</a-select>
|
</a-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">绑定用户ID</div>
|
<div class="fp-label">绑定用户ID</div>
|
||||||
<div class="fp-inline">
|
<div class="fp-inline">
|
||||||
<a-input
|
<a-input class="fp-inline-main" size="large" :maxlength="50" :readonly="!isEdit"
|
||||||
class="fp-inline-main"
|
v-model:value="data.FamilyPerson.BindUserId" placeholder="请输入用户ID" />
|
||||||
size="large"
|
<a-button class="fp-inline-btn" size="large" type="primary" ghost
|
||||||
:maxlength="50"
|
:disabled="data.FamilyPerson.IsBindUser === 'Y'" @click.prevent="
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.BindUserId"
|
|
||||||
placeholder="请输入用户ID"
|
|
||||||
/>
|
|
||||||
<a-button
|
|
||||||
class="fp-inline-btn"
|
|
||||||
size="large"
|
|
||||||
type="primary"
|
|
||||||
ghost
|
|
||||||
:disabled="data.FamilyPerson.IsBindUser === 'Y'"
|
|
||||||
@click.prevent="
|
|
||||||
data.FamilyPerson.IsBindUser =
|
data.FamilyPerson.IsBindUser =
|
||||||
data.FamilyPerson.IsBindUser === 'Y' ? 'N' : 'Y'
|
data.FamilyPerson.IsBindUser === 'Y' ? 'N' : 'Y'
|
||||||
"
|
">
|
||||||
>
|
|
||||||
{{
|
{{
|
||||||
data.FamilyPerson.IsBindUser === "Y" ? "已绑定" : "绑定用户"
|
data.FamilyPerson.IsBindUser === "Y" ? "已绑定" : "绑定用户"
|
||||||
}}
|
}}
|
||||||
@@ -379,41 +214,19 @@
|
|||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">生于</div>
|
<div class="fp-label">生于</div>
|
||||||
<div class="fp-inline">
|
<div class="fp-inline">
|
||||||
<a-input
|
<a-input class="fp-inline-main" size="large" :maxlength="128" :readonly="!isEdit"
|
||||||
class="fp-inline-main"
|
v-model:value="data.FamilyPerson.BirthText" placeholder="如:乙丑年正月初一" />
|
||||||
size="large"
|
<a-date-picker class="fp-inline-date" size="large" :disabled="!isEdit" v-model:value="birthDate"
|
||||||
:maxlength="128"
|
placeholder="选择日期" />
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.BirthText"
|
|
||||||
placeholder="如:乙丑年正月初一"
|
|
||||||
/>
|
|
||||||
<a-date-picker
|
|
||||||
class="fp-inline-date"
|
|
||||||
size="large"
|
|
||||||
:disabled="!isEdit"
|
|
||||||
v-model:value="birthDate"
|
|
||||||
placeholder="选择日期"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">离世</div>
|
<div class="fp-label">离世</div>
|
||||||
<div class="fp-inline">
|
<div class="fp-inline">
|
||||||
<a-input
|
<a-input class="fp-inline-main" size="large" :maxlength="128" :readonly="!isEdit"
|
||||||
class="fp-inline-main"
|
v-model:value="data.FamilyPerson.DeathText" placeholder="如:戊辰年八月十五" />
|
||||||
size="large"
|
<a-date-picker class="fp-inline-date" size="large" :disabled="!isEdit" v-model:value="deathDate"
|
||||||
:maxlength="128"
|
placeholder="选择日期" />
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.DeathText"
|
|
||||||
placeholder="如:戊辰年八月十五"
|
|
||||||
/>
|
|
||||||
<a-date-picker
|
|
||||||
class="fp-inline-date"
|
|
||||||
size="large"
|
|
||||||
:disabled="!isEdit"
|
|
||||||
v-model:value="deathDate"
|
|
||||||
placeholder="选择日期"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -423,14 +236,8 @@
|
|||||||
<div class="fp-card-title">生平简介</div>
|
<div class="fp-card-title">生平简介</div>
|
||||||
<div class="fp-field">
|
<div class="fp-field">
|
||||||
<div class="fp-label">简介</div>
|
<div class="fp-label">简介</div>
|
||||||
<a-textarea
|
<a-textarea size="large" :auto-size="{ minRows: 4, maxRows: 8 }" :maxlength="3000" :readonly="!isEdit"
|
||||||
size="large"
|
v-model:value="data.FamilyPerson.Introduction" placeholder="请输入生平简介" />
|
||||||
:auto-size="{ minRows: 4, maxRows: 8 }"
|
|
||||||
:maxlength="3000"
|
|
||||||
:readonly="!isEdit"
|
|
||||||
v-model:value="data.FamilyPerson.Introduction"
|
|
||||||
placeholder="请输入生平简介"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -441,60 +248,24 @@
|
|||||||
<div>
|
<div>
|
||||||
<a-row v-if="isEdit" :gutter="[16, 8]">
|
<a-row v-if="isEdit" :gutter="[16, 8]">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-popconfirm
|
<a-popconfirm v-if="data.FamilyPerson.CreatedBy" title="确定是否取消修改?" ok-text="是" cancel-text="否"
|
||||||
v-if="data.FamilyPerson.CreatedBy"
|
@confirm="onCancel">
|
||||||
title="确定是否取消修改?"
|
<a-button type="primary" ghost :icon="h(UndoOutlined)">取消</a-button>
|
||||||
ok-text="是"
|
|
||||||
cancel-text="否"
|
|
||||||
@confirm="onCancel"
|
|
||||||
>
|
|
||||||
<a-button type="primary" ghost :icon="h(UndoOutlined)"
|
|
||||||
>取消</a-button
|
|
||||||
>
|
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
<a-button
|
<a-button v-if="!data.FamilyPerson.CreatedBy" type="primary" ghost :icon="h(UndoOutlined)"
|
||||||
v-if="!data.FamilyPerson.CreatedBy"
|
@click.prevent="onCancel">取消</a-button>
|
||||||
type="primary"
|
<a-button type="primary" ghost :icon="h(SaveOutlined)" @click.prevent="onSave">保存</a-button>
|
||||||
ghost
|
|
||||||
:icon="h(UndoOutlined)"
|
|
||||||
@click.prevent="onCancel"
|
|
||||||
>取消</a-button
|
|
||||||
>
|
|
||||||
<a-button
|
|
||||||
type="primary"
|
|
||||||
ghost
|
|
||||||
:icon="h(SaveOutlined)"
|
|
||||||
@click.prevent="onSave"
|
|
||||||
>保存</a-button
|
|
||||||
>
|
|
||||||
</a-space>
|
</a-space>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row v-else :gutter="[16, 8]">
|
<a-row v-else :gutter="[16, 8]">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button
|
<a-button type="primary" v-if="canAmend" :icon="h(EditOutlined)" :disabled="!hasData"
|
||||||
type="primary"
|
@click.prevent="onAmend">修改</a-button>
|
||||||
v-if="canAmend"
|
<a-popconfirm :disabled="!hasData" title="确定是否删除这条记录?" ok-text="是" cancel-text="否"
|
||||||
:icon="h(EditOutlined)"
|
@confirm="onDelete">
|
||||||
:disabled="!hasData"
|
<a-button type="primary" danger :icon="h(DeleteOutlined)" :disabled="!hasData"
|
||||||
@click.prevent="onAmend"
|
v-if="canDelete && data.FamilyPerson && data.FamilyPerson.TreeId.length == 0">删除</a-button>
|
||||||
>修改</a-button
|
</a-popconfirm>
|
||||||
>
|
|
||||||
<!-- <a-popconfirm
|
|
||||||
:disabled="!hasData"
|
|
||||||
title="确定是否删除这条记录?"
|
|
||||||
ok-text="是"
|
|
||||||
cancel-text="否"
|
|
||||||
@confirm="onDelete"
|
|
||||||
>
|
|
||||||
<a-button
|
|
||||||
type="primary"
|
|
||||||
danger
|
|
||||||
:icon="h(DeleteOutlined)"
|
|
||||||
:disabled="!hasData"
|
|
||||||
v-if="canDelete"
|
|
||||||
>删除</a-button
|
|
||||||
>
|
|
||||||
</a-popconfirm> -->
|
|
||||||
</a-space>
|
</a-space>
|
||||||
</a-row>
|
</a-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -503,17 +274,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<dragModal
|
<dragModal v-model:open="modelOption.isModalPerson" title="人员查询" :mask-closable="false" :fullscreen="width < 640"
|
||||||
v-model:open="modelOption.isModalPerson"
|
@ok="handleSelect">
|
||||||
title="人员查询"
|
<FamilyPersonEnquiry ref="enquiry" @on-row-dblclick="handleSelect"></FamilyPersonEnquiry>
|
||||||
:mask-closable="false"
|
|
||||||
:fullscreen="width < 640"
|
|
||||||
@ok="handleSelect"
|
|
||||||
>
|
|
||||||
<FamilyPersonEnquiry
|
|
||||||
ref="enquiry"
|
|
||||||
@on-row-dblclick="handleSelect"
|
|
||||||
></FamilyPersonEnquiry>
|
|
||||||
</dragModal>
|
</dragModal>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -0,0 +1,212 @@
|
|||||||
|
<template>
|
||||||
|
<dragModal
|
||||||
|
v-model:open="visible"
|
||||||
|
:title="title || '新增家族成员'"
|
||||||
|
:fullscreen="width < 640"
|
||||||
|
:mask-closable="false"
|
||||||
|
:ok-button-props="{ loading: saving }"
|
||||||
|
cancel-text="取消"
|
||||||
|
ok-text="确定"
|
||||||
|
@ok="handleOk"
|
||||||
|
>
|
||||||
|
<div class="fpcq-form">
|
||||||
|
<div class="fpcq-field">
|
||||||
|
<div class="fpcq-label">
|
||||||
|
姓<span class="fpcq-required">*</span>
|
||||||
|
</div>
|
||||||
|
<a-input
|
||||||
|
ref="surnameInputRef"
|
||||||
|
size="large"
|
||||||
|
v-model:value="form.Surname"
|
||||||
|
placeholder="请输入姓氏"
|
||||||
|
:maxlength="100"
|
||||||
|
allow-clear
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="fpcq-field">
|
||||||
|
<div class="fpcq-label">
|
||||||
|
名<span class="fpcq-required">*</span>
|
||||||
|
</div>
|
||||||
|
<a-input
|
||||||
|
size="large"
|
||||||
|
v-model:value="form.GenealogyName"
|
||||||
|
placeholder="请输入谱名/名字"
|
||||||
|
:maxlength="100"
|
||||||
|
allow-clear
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="fpcq-field">
|
||||||
|
<div class="fpcq-label">
|
||||||
|
性别<span class="fpcq-required">*</span>
|
||||||
|
</div>
|
||||||
|
<a-select
|
||||||
|
size="large"
|
||||||
|
style="width: 100%"
|
||||||
|
v-model:value="form.Gender"
|
||||||
|
placeholder="请选择性别"
|
||||||
|
>
|
||||||
|
<a-select-option
|
||||||
|
v-for="o in genderOptions"
|
||||||
|
:key="o.BindValue"
|
||||||
|
:value="o.BindValue"
|
||||||
|
>{{ o.DisplayName }}</a-select-option
|
||||||
|
>
|
||||||
|
</a-select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</dragModal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, watch, computed, nextTick } from "vue";
|
||||||
|
import { notification } from "ant-design-vue";
|
||||||
|
import dragModal from "@/components/basic/DragModal.vue";
|
||||||
|
import FamilyPersonService from "@/service/master/familyPersonService";
|
||||||
|
import { FamilyPersonData } from "@/data/auto/familyPersonData";
|
||||||
|
import { FamilyPersonDisplayData } from "@/data/auto/familyPersonDisplayData";
|
||||||
|
import { useLocalePolicy } from "@/hooks/useLocalePolicy";
|
||||||
|
import { SelectOption } from "@/data/auto/selectOption";
|
||||||
|
import { useWindowSize } from "@vueuse/core";
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
open: boolean;
|
||||||
|
treeId?: string;
|
||||||
|
title?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
treeId: "",
|
||||||
|
title: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: "update:open", value: boolean): void;
|
||||||
|
(e: "created", person: FamilyPersonDisplayData): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const visible = computed<boolean>({
|
||||||
|
get: () => props.open,
|
||||||
|
set: (v) => emit("update:open", v),
|
||||||
|
});
|
||||||
|
|
||||||
|
const { width } = useWindowSize();
|
||||||
|
const { getPolicyOptionsComputed } = useLocalePolicy();
|
||||||
|
const genderOptions = getPolicyOptionsComputed("GenderPolicy") as SelectOption[];
|
||||||
|
|
||||||
|
const surnameInputRef = ref<any>(null);
|
||||||
|
const saving = ref<boolean>(false);
|
||||||
|
|
||||||
|
const form = ref<{
|
||||||
|
Surname: string;
|
||||||
|
GenealogyName: string;
|
||||||
|
Gender: string;
|
||||||
|
}>({
|
||||||
|
Surname: "",
|
||||||
|
GenealogyName: "",
|
||||||
|
Gender: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
const resetForm = () => {
|
||||||
|
form.value.Surname = "";
|
||||||
|
form.value.GenealogyName = "";
|
||||||
|
form.value.Gender = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.open,
|
||||||
|
(open) => {
|
||||||
|
if (open) {
|
||||||
|
resetForm();
|
||||||
|
nextTick(() => {
|
||||||
|
try {
|
||||||
|
surnameInputRef.value?.focus?.();
|
||||||
|
} catch (e) {
|
||||||
|
/* noop */
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleOk = async () => {
|
||||||
|
if (!form.value.Surname.trim()) {
|
||||||
|
notification.info({
|
||||||
|
message: "系统提示:",
|
||||||
|
description: "请输入姓",
|
||||||
|
placement: "topRight",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!form.value.GenealogyName.trim()) {
|
||||||
|
notification.info({
|
||||||
|
message: "系统提示:",
|
||||||
|
description: "请输入名",
|
||||||
|
placement: "topRight",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!form.value.Gender.trim()) {
|
||||||
|
notification.info({
|
||||||
|
message: "系统提示:",
|
||||||
|
description: "请选择性别",
|
||||||
|
placement: "topRight",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const payload = new FamilyPersonData();
|
||||||
|
payload.FamilyPerson = new FamilyPersonDisplayData();
|
||||||
|
payload.FamilyPerson.Surname = form.value.Surname.trim();
|
||||||
|
payload.FamilyPerson.GenealogyName = form.value.GenealogyName.trim();
|
||||||
|
payload.FamilyPerson.Gender = form.value.Gender;
|
||||||
|
payload.FamilyPerson.TreeId = props.treeId || "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
saving.value = true;
|
||||||
|
const result: FamilyPersonData = await FamilyPersonService.Insert(payload);
|
||||||
|
saving.value = false;
|
||||||
|
|
||||||
|
const created = result?.FamilyPerson || payload.FamilyPerson;
|
||||||
|
// notification.success({
|
||||||
|
// message: "系统提示:",
|
||||||
|
// description: "新增成功",
|
||||||
|
// placement: "topRight",
|
||||||
|
// });
|
||||||
|
emit("created", created);
|
||||||
|
visible.value = false;
|
||||||
|
} catch (error) {
|
||||||
|
saving.value = false;
|
||||||
|
console.log(error);
|
||||||
|
notification.error({
|
||||||
|
message: "系统提示:",
|
||||||
|
description: "新增失败,请稍后再试",
|
||||||
|
placement: "topRight",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.fpcq-form {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 14px;
|
||||||
|
padding: 4px 4px 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fpcq-field {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fpcq-label {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 20px;
|
||||||
|
color: #646a73;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fpcq-required {
|
||||||
|
margin-left: 2px;
|
||||||
|
color: #ff4d4f;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user