diff --git a/SafeCampus.API/SafeCampus.Application/SafeCampus.Application.xml b/SafeCampus.API/SafeCampus.Application/SafeCampus.Application.xml
index 4e0ade0..b7c10c5 100644
--- a/SafeCampus.API/SafeCampus.Application/SafeCampus.Application.xml
+++ b/SafeCampus.API/SafeCampus.Application/SafeCampus.Application.xml
@@ -463,6 +463,12 @@
+
+
+ 获取寝室使用的摄像头
+
+
+
父级id
@@ -607,6 +613,12 @@
+
+
+ 获取未被宿舍楼使用的摄像头
+
+
+
租户id
@@ -1579,7 +1591,7 @@
进班时间
-
+
人员名称
@@ -1703,6 +1715,13 @@
+
+
+ 检查名称是否存在
+
+
+
+
预警id
diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/AttendanceService/AttendanceService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/AttendanceService/AttendanceService.cs
index ce33a82..aeedf6a 100644
--- a/SafeCampus.API/SafeCampus.Application/Services/Business/AttendanceService/AttendanceService.cs
+++ b/SafeCampus.API/SafeCampus.Application/Services/Business/AttendanceService/AttendanceService.cs
@@ -59,7 +59,7 @@ public class AttendanceService:DbRepository, IAttendanceService
.WhereIF(!string.IsNullOrEmpty(search.PersonSetId), x => x.PersonSetId == search.PersonSetId)
.WhereIF(!string.IsNullOrEmpty(search.PersonId), x => x.PersonId == search.PersonId)
.WhereIF(!string.IsNullOrEmpty(search.TrackId), x => x.TrackId == search.TrackId)
- .WhereIF(!string.IsNullOrEmpty(search.CameraId), x => x.CameraId == search.CameraId)
+ //.WhereIF(!string.IsNullOrEmpty(search.CameraId), x => x.CameraId == search.CameraId)
.WhereIF(search.CameraIds!=null&&search.CameraIds.Any(),x=>search.CameraIds.Contains(x.CameraId))
.WhereIF(search.StartTick.HasValue, x => x.Tick >= search.StartTick)
.WhereIF(search.EndTick.HasValue, x => x.Tick <= search.EndTick);
diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/AttendanceService/Dto/AttendanceList.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/AttendanceService/Dto/AttendanceList.cs
index 0780121..48c3fe2 100644
--- a/SafeCampus.API/SafeCampus.Application/Services/Business/AttendanceService/Dto/AttendanceList.cs
+++ b/SafeCampus.API/SafeCampus.Application/Services/Business/AttendanceService/Dto/AttendanceList.cs
@@ -93,7 +93,7 @@ public class AttendanceListMapper : IRegister
config.ForType()
.Map(x => x.PersonName, x => !string.IsNullOrEmpty(x.PersonId) ? x.PersonInfoItem.Name : "")
.Map(x => x.PersonSetName, x => !string.IsNullOrEmpty(x.PersonId) ? x.PersonInfoItem.PersonSetInfoItem.PersonSetName : "")
- .Map(x => x.DormitName, x => !string.IsNullOrEmpty(x.PersonId) ? x.PersonInfoItem.DormitoryInfoItem.Name : "")
+ .Map(x => x.DormitName, x => !string.IsNullOrEmpty(x.PersonId) ? (x.PersonInfoItem.DormitoryId.HasValue? x.PersonInfoItem.DormitoryInfoItem.Name : "") : "")
.Map(x => x.Gender, x => !string.IsNullOrEmpty(x.PersonId) ? x.PersonInfoItem.Gender : "");
}
}
\ No newline at end of file
diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/BuildingService/BuildingService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/BuildingService/BuildingService.cs
index c55b708..33e37be 100644
--- a/SafeCampus.API/SafeCampus.Application/Services/Business/BuildingService/BuildingService.cs
+++ b/SafeCampus.API/SafeCampus.Application/Services/Business/BuildingService/BuildingService.cs
@@ -5,6 +5,11 @@ public class BuildingService:DbRepository,IBuildingService
public async Task Add(BuildingInfoDto input)
{
var model = input.Adapt();
+ var modelold = await GetFirstAsync(p => p.Name == input.Name);
+ if (modelold != null)
+ {
+ throw Oops.Oh("宿舍楼已存在");
+ }
await InsertAsync(model);
return true;
}
@@ -58,8 +63,18 @@ public class BuildingService:DbRepository,IBuildingService
var list = await Context.Queryable()
.Includes(x => x.InsCameraInfoItem)
.Includes(x => x.OutCameraInfoItem)
+ .OrderBy(x=>x.CreateTime)
.ToListAsync();
//var list = await GetListAsync();
return list.Adapt>();
}
+
+ public async Task> GetUseCameraList()
+ {
+ var list = await GetListAsync();
+ var camera = new List();
+ camera.AddRange(list.Select(x=>x.InsCameraId));
+ camera.AddRange(list.Select(x=>x.OutCameraId));
+ return camera;
+ }
}
\ No newline at end of file
diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/BuildingService/IBuildingService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/BuildingService/IBuildingService.cs
index c775070..3aa2576 100644
--- a/SafeCampus.API/SafeCampus.Application/Services/Business/BuildingService/IBuildingService.cs
+++ b/SafeCampus.API/SafeCampus.Application/Services/Business/BuildingService/IBuildingService.cs
@@ -1,4 +1,6 @@
+using SafeCampus.Application.Services.Business.CameraInfoService;
+
namespace SafeCampus.Application.Services.Business.BuildingService;
public interface IBuildingService:ITransient
@@ -32,4 +34,9 @@ public interface IBuildingService:ITransient
///
///
Task> GetNoPageList();
+ ///
+ /// 获取寝室使用的摄像头
+ ///
+ ///
+ Task> GetUseCameraList();
}
\ No newline at end of file
diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/CameraInfoService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/CameraInfoService.cs
index 1e1e265..e306f7c 100644
--- a/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/CameraInfoService.cs
+++ b/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/CameraInfoService.cs
@@ -196,4 +196,10 @@ public class CameraInfoService : DbRepository, ICameraInfoService
throw Oops.Oh("分组不存在");
}
+
+ public async Task> GetBuildCameraList(List useList)
+ {
+ var list=await Context.Queryable().Where(x=> !useList.Contains(x.SensorId)).ToListAsync();
+ return list.Adapt>();
+ }
}
\ No newline at end of file
diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/ICameraInfoService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/ICameraInfoService.cs
index fece2a6..0a7852f 100644
--- a/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/ICameraInfoService.cs
+++ b/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/ICameraInfoService.cs
@@ -37,4 +37,9 @@ public interface ICameraInfoService:ITransient
///
///
Task BatchSetPushPersonByWarn(SetPushPersonWarnInput input);
+ ///
+ /// 获取未被宿舍楼使用的摄像头
+ ///
+ ///
+ Task> GetBuildCameraList(List useList);
}
\ No newline at end of file
diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/DepartmentService/DepartmentService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/DepartmentService/DepartmentService.cs
index d192df8..11f33ba 100644
--- a/SafeCampus.API/SafeCampus.Application/Services/Business/DepartmentService/DepartmentService.cs
+++ b/SafeCampus.API/SafeCampus.Application/Services/Business/DepartmentService/DepartmentService.cs
@@ -5,6 +5,11 @@ public class DepartmentService: DbRepository, IDepartmentService
public async Task Add(DepartmentDto input)
{
var model = input.Adapt();
+ var modelold = await GetFirstAsync(p => p.Code == input.Code);
+ if (modelold != null)
+ {
+ throw Oops.Oh("院系编号已存在");
+ }
await InsertAsync(model);
return true;
}
diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/DormitoryService/DormitoryService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/DormitoryService/DormitoryService.cs
index 28f053b..08ae0ac 100644
--- a/SafeCampus.API/SafeCampus.Application/Services/Business/DormitoryService/DormitoryService.cs
+++ b/SafeCampus.API/SafeCampus.Application/Services/Business/DormitoryService/DormitoryService.cs
@@ -5,6 +5,11 @@ public class DormitoryService:DbRepository,IDormitoryService
public async Task Add(DormitoryInfoDto input)
{
var model = input.Adapt();
+ var modelold = await GetFirstAsync(p => p.Name == input.Name&&p.BuildId==input.BuildId);
+ if (modelold != null)
+ {
+ throw Oops.Oh("寝室名称已存在");
+ }
await InsertAsync(model);
return true;
}
diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/MajorService/MajorService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/MajorService/MajorService.cs
index 2808a0f..a2fd145 100644
--- a/SafeCampus.API/SafeCampus.Application/Services/Business/MajorService/MajorService.cs
+++ b/SafeCampus.API/SafeCampus.Application/Services/Business/MajorService/MajorService.cs
@@ -5,6 +5,11 @@ public class MajorService: DbRepository, IMajorService
public async Task Add(MajorDto input)
{
var model = input.Adapt();
+ var modelold = await GetFirstAsync(p => p.Code == input.Code);
+ if (modelold != null)
+ {
+ throw Oops.Oh("专业编号已存在");
+ }
await InsertAsync(model);
return true;
}
diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/Dto/PersonInfoSearch.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/Dto/PersonInfoSearch.cs
index 861c195..4b8dacc 100644
--- a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/Dto/PersonInfoSearch.cs
+++ b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/Dto/PersonInfoSearch.cs
@@ -5,7 +5,7 @@ public class PersonInfoSearch:BasePageInput
///
/// 人员名称
///
- public string PersonName { get; set; }
+ public string Name { get; set; }
///
/// 手机号
///
diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/PersonInfoService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/PersonInfoService.cs
index cc4b65c..ae0287a 100644
--- a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/PersonInfoService.cs
+++ b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonInfoService/PersonInfoService.cs
@@ -68,7 +68,7 @@ public class PersonInfoService:DbRepository, IPersonInfoService
.Includes(x=>x.PersonFacesList)
.Includes(x=>x.DormitoryInfoItem)
.WhereIF(!string.IsNullOrEmpty(search.PersonSetId), x => x.PersonSetId == search.PersonSetId)
- .WhereIF(!string.IsNullOrEmpty(search.PersonName), x => x.Name.Contains(search.PersonName))
+ .WhereIF(!string.IsNullOrEmpty(search.Name), x => x.Name.Contains(search.Name))
.WhereIF(search.DepId.HasValue, x => x.PersonSetInfoItem.MajorInfoItem.DepId==search.DepId)
.WhereIF(search.MajorId.HasValue, x => x.PersonSetInfoItem.MajorId==search.MajorId)
.WhereIF(!string.IsNullOrEmpty(search.Phone), x => x.Phone.Contains(search.Phone));
diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/IPersonSetInfoService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/IPersonSetInfoService.cs
index 2e8419c..9472f98 100644
--- a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/IPersonSetInfoService.cs
+++ b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/IPersonSetInfoService.cs
@@ -24,4 +24,10 @@ public interface IPersonSetInfoService:ITransient
///
///
Task> GetPageList(long? majorId,string setName);
+ ///
+ /// 检查名称是否存在
+ ///
+ ///
+ ///
+ Task CheckName(string name);
}
\ No newline at end of file
diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/PersonSetInfoService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/PersonSetInfoService.cs
index 0752ca9..c408abf 100644
--- a/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/PersonSetInfoService.cs
+++ b/SafeCampus.API/SafeCampus.Application/Services/Business/PersonSetInfoService/PersonSetInfoService.cs
@@ -49,4 +49,10 @@ public class PersonSetInfoService:DbRepository, IPersonSetInfoSer
.ToListAsync();
return list.Adapt>();
}
+
+ public async Task CheckName(string name)
+ {
+ var model = GetFirstAsync(x => x.PersonSetName == name);
+ return model != null;
+ }
}
\ No newline at end of file
diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Dto/WarnInfoDto.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Dto/WarnInfoDto.cs
index 0b8e02d..4192721 100644
--- a/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Dto/WarnInfoDto.cs
+++ b/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Dto/WarnInfoDto.cs
@@ -138,6 +138,7 @@ public class WarnInfoDtoMapper : IRegister
//.Map(dest => dest.CameraName, src => src.CameraId.GetDescriptionByEnum());
.Map(x => x.PersonSetName,x=>x.PersonSetInfoItem.PersonSetName)
.Map(x => x.PersonName,x=>x.PersonInfoItem.Name)
- .Map(dest => dest.CameraName, src => src.CameraInfoItem.SensorName);
+ .Map(dest => dest.CameraName, src => src.CameraInfoItem.SensorName)
+ .Map(x=>x.Extend,x=>string.IsNullOrEmpty(x.PersonId)?"":$"年龄:{x.PersonInfoItem.Age},年龄置信度:100%");
}
}
diff --git a/SafeCampus.API/SafeCampus.System/Entity/Attendance.cs b/SafeCampus.API/SafeCampus.System/Entity/Attendance.cs
index 4b09c1d..2a3ec94 100644
--- a/SafeCampus.API/SafeCampus.System/Entity/Attendance.cs
+++ b/SafeCampus.API/SafeCampus.System/Entity/Attendance.cs
@@ -97,8 +97,8 @@ public class Attendance : PrimaryKeyEntity
[Navigate(NavigateType.OneToOne, nameof(CameraId), nameof(CameraInfo.SensorId))]
public CameraInfo CameraInfoItem { get; set; }
///
- /// 寝室信息
+ /// 人员信息
///
- [Navigate(NavigateType.OneToOne, nameof(PersonId), nameof(PersonInfo.PersonId))]
+ [Navigate(NavigateType.OneToOne, nameof(PersonId))]
public PersonInfo PersonInfoItem { get; set; }
}
\ No newline at end of file
diff --git a/SafeCampus.API/SafeCampus.System/Entity/PersonInfo.cs b/SafeCampus.API/SafeCampus.System/Entity/PersonInfo.cs
index 053a1c1..57b56e0 100644
--- a/SafeCampus.API/SafeCampus.System/Entity/PersonInfo.cs
+++ b/SafeCampus.API/SafeCampus.System/Entity/PersonInfo.cs
@@ -49,7 +49,7 @@ public class PersonInfo
///
/// 创建时间
///
- [SugarColumn(ColumnName = "CreateTime", ColumnDescription = "创建时间", IsNullable = true)]
+ [SugarColumn(ColumnName = "CreateTime", ColumnDescription = "创建时间", IsNullable = true, IsOnlyIgnoreUpdate = true)]
public DateTime CreateTime { get; set; }
///
/// 所属班级id
diff --git a/SafeCampus.API/SafeCampus.System/SafeCampus.System.xml b/SafeCampus.API/SafeCampus.System/SafeCampus.System.xml
index afacee2..ec2547e 100644
--- a/SafeCampus.API/SafeCampus.System/SafeCampus.System.xml
+++ b/SafeCampus.API/SafeCampus.System/SafeCampus.System.xml
@@ -788,7 +788,7 @@
- 寝室信息
+ 人员信息
diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/BuildingController.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/BuildingController.cs
index 8c79ab6..f5b91e5 100644
--- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/BuildingController.cs
+++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/BuildingController.cs
@@ -1,4 +1,5 @@
using SafeCampus.Application.Services.Business.BuildingService;
+using SafeCampus.Application.Services.Business.CameraInfoService;
namespace SafeCampus.Web.Core.Controllers.Application.Business;
///
@@ -10,10 +11,12 @@ namespace SafeCampus.Web.Core.Controllers.Application.Business;
public class BuildingController
{
private readonly IBuildingService _buildingService;
+ private readonly ICameraInfoService _cameraInfoService;
- public BuildingController(IBuildingService buildingService)
+ public BuildingController(IBuildingService buildingService, ICameraInfoService cameraInfoService)
{
_buildingService = buildingService;
+ _cameraInfoService = cameraInfoService;
}
///
@@ -54,4 +57,14 @@ public class BuildingController
{
return await _buildingService.GetNoPageList();
}
+ ///
+ /// 获取未被宿舍楼使用的摄像头
+ ///
+ ///
+ public async Task> GetBuildCameraList()
+ {
+ var list =await _buildingService.GetUseCameraList();
+ var camera = await _cameraInfoService.GetBuildCameraList(list);
+ return camera;
+ }
}
\ No newline at end of file
diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/ClothApi.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/ClothApi.cs
index 9eb6344..836cb7a 100644
--- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/ClothApi.cs
+++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/ClothApi.cs
@@ -10,7 +10,7 @@ namespace SafeCampus.Web.Core.Controllers.Application.Business;
/// 服装底库管理接口
///
[Route("/business/[controller]")]
-[ApiDescriptionSettings(ApiGroupConsts.SYSTEM_Business, Order = 97,Tag = "服装底库管理")]
+[ApiDescriptionSettings(ApiGroupConsts.SYSTEM_Business, Order = 97, Tag = "服装底库管理")]
public class ClothApi
{
private readonly IDeepelephManager _deepelephManager;
@@ -27,7 +27,28 @@ public class ClothApi
///
public async Task AddClothDataBaseA(ClothDataNameInfo input)
{
+
var appSettings = App.GetOptionsMonitor();
+ var liststr = await $"{appSettings.SXAPIURL}/dfield-api/ecology/cloth/set/query-list"
+ .SetBody(new
+ {
+ token = _deepelephManager.GetToken(),
+ tenantCode = appSettings.TenantCode,
+ poiId = appSettings.PoiId,
+ })
+ .SetContentType("application/json")
+ .PostAsAsync();
+ var list = JsonConvert.DeserializeObject(liststr);
+ var newlist = new List();
+ foreach (var item in list["data"])
+ {
+ newlist.Add(item.Value("clothSetName"));
+ }
+
+ if (newlist.Any(x=>x==input.ClothSetName))
+ {
+ throw Oops.Oh("服装库名称已存在");
+ }
var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/cloth/set/create"
.SetBody(new
{
@@ -60,7 +81,7 @@ public class ClothApi
token = _deepelephManager.GetToken(),
tenantCode = appSettings.TenantCode,
poiId = appSettings.PoiId,
- clothSetId= clothSetId,
+ clothSetId = clothSetId,
})
.SetContentType("application/json")
.PostAsAsync();
@@ -133,7 +154,7 @@ public class ClothApi
token = _deepelephManager.GetToken(),
tenantCode = appSettings.TenantCode,
poiId = appSettings.PoiId,
- clothSetId= clothSetId
+ clothSetId = clothSetId
})
.SetContentType("application/json")
.PostAsAsync();
@@ -207,23 +228,38 @@ public class ClothApi
[HttpPost]
public async Task DeleteClothD(ClothInfos info)
{
- var appSettings = App.GetOptionsMonitor();
- var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/cloth/delete"
- .SetBody(new
- {
- token = _deepelephManager.GetToken(),
- tenantCode = appSettings.TenantCode,
- poiId = appSettings.PoiId,
- info.clothSetId,
- info.clothId
- })
- .SetContentType("application/json")
- .PostAsAsync();
- var model = JsonConvert.DeserializeObject(str);
- if ((bool)model["success"])
+ var list = new List();
+ if (info.clothId.Contains(","))
{
- return model["data"];
+ list = info.clothId.Split(",").ToList();
}
- throw Oops.Oh(model["message"].ToString());
+ else
+ {
+ list.Add(info.clothId);
+ }
+
+ foreach (var ids in list)
+ {
+ var appSettings = App.GetOptionsMonitor();
+ var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/cloth/delete"
+ .SetBody(new
+ {
+ token = _deepelephManager.GetToken(),
+ tenantCode = appSettings.TenantCode,
+ poiId = appSettings.PoiId,
+ info.clothSetId,
+ clothId= ids
+ })
+ .SetContentType("application/json")
+ .PostAsAsync();
+ //var model = JsonConvert.DeserializeObject(str);
+ //if ((bool)model["success"])
+ //{
+ // return model["data"];
+ //}
+ //throw Oops.Oh(model["message"].ToString());
+ }
+
+ return true;
}
}
\ No newline at end of file
diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/DfieldApi.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/DfieldApi.cs
index 3cfe2be..b37133e 100644
--- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/DfieldApi.cs
+++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/DfieldApi.cs
@@ -29,6 +29,10 @@ public class DfieldApi : IDynamicApiController
///
public async Task CreateDfieldA(ControllersNameInput input)
{
+ if (await _personSetInfoService.CheckName(input.Name))
+ {
+ throw Oops.Oh("【"+input.Name+"】班级名称已存在");
+ }
var personSetId = Guid.NewGuid().ToString("N");
var appSettings = App.GetOptionsMonitor();
var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/set/create"
@@ -130,13 +134,13 @@ public class DfieldApi : IDynamicApiController
{
await _personSetInfoService.Delete(ids);
}
- return isOk;
}
-
- throw Oops.Oh(model["message"].ToString());
+ //else
+ //{
+ // throw Oops.Oh(model["message"].ToString());
+ //}
}
-
- return false;
+ return true;
}
///
/// 更新底库
diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/KeyPersonnelController.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/KeyPersonnelController.cs
index 7c9dad6..35beb40 100644
--- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/KeyPersonnelController.cs
+++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/KeyPersonnelController.cs
@@ -3,6 +3,8 @@ using MoYu.RemoteRequest;
using MoYu.RemoteRequest.Extensions;
using Newtonsoft.Json.Linq;
using SafeCampus.Application.Manager.DeepelephManager;
+using SafeCampus.Application.Services.Business.PersonFacesService;
+using SafeCampus.Application.Services.Business.PersonInfoService;
using SafeCampus.Web.Core.Controllers.Application.Business.Dto.Person;
namespace SafeCampus.Web.Core.Controllers.Application.Business;
@@ -15,10 +17,14 @@ namespace SafeCampus.Web.Core.Controllers.Application.Business;
public class KeyPersonnelController
{
private readonly IDeepelephManager _deepelephManager;
+ private readonly IPersonInfoService _personInfoService;
+ private readonly IPersonFacesService _personFacesService;
- public KeyPersonnelController(IDeepelephManager deepelephManager)
+ public KeyPersonnelController(IDeepelephManager deepelephManager, IPersonInfoService personInfoService, IPersonFacesService personFacesService)
{
_deepelephManager = deepelephManager;
+ _personInfoService = personInfoService;
+ _personFacesService = personFacesService;
}
///
@@ -129,25 +135,45 @@ public class KeyPersonnelController
///
public async Task DeletePersonD(string id)
{
- var appSettings = App.GetOptionsMonitor();
- var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/delete"
- .SetBody(new
- {
- token = _deepelephManager.GetToken(),
- tenantCode = appSettings.TenantCode,
- poiId = appSettings.PoiId,
- personId = id,
+ var list = new List();
+ if (id.Contains(","))
+ {
+ list = id.Split(",").ToList();
+ }
+ else
+ {
+ list.Add(id);
+ }
- })
- .SetContentType("application/json")
- .PostAsAsync();
- var model = JsonConvert.DeserializeObject(str);
- if ((bool)model["success"])
+ foreach (var ids in list)
{
- return model["data"].ToString() == id;
+ var appSettings = App.GetOptionsMonitor();
+ var str = await $"{appSettings.SXAPIURL}/dfield-api/ecology/person/delete"
+ .SetBody(new
+ {
+ token = _deepelephManager.GetToken(),
+ tenantCode = appSettings.TenantCode,
+ poiId = appSettings.PoiId,
+ personId = ids,
+
+ })
+ .SetContentType("application/json")
+ .PostAsAsync();
+ //var model = JsonConvert.DeserializeObject(str);
+ //if ((bool)model["success"])
+ //{
+ // var isOk = model["data"].ToString() == ids;
+ // if (isOk)
+ // {
+ // await _personInfoService.Delete(ids);
+ // }
+ // //return model["data"].ToString() == id;
+ //}
+
+ //throw Oops.Oh(model["message"].ToString());
}
- throw Oops.Oh(model["message"].ToString());
+ return true;
}
///
/// 更新人员信息,如果人员不存在,则创建人员;如果人员存在,则覆盖信息。
diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/PersonApi.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/PersonApi.cs
index 3521eb1..2f970cb 100644
--- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/PersonApi.cs
+++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/PersonApi.cs
@@ -185,13 +185,13 @@ public class PersonApi : IDynamicApiController
{
await _personInfoService.Delete(ids);
}
- return isOk;
+ //return isOk;
}
- throw Oops.Oh(model["message"].ToString());
+ //throw Oops.Oh(model["message"].ToString());
}
- return false;
+ return true;
}
///
/// 更新人员信息
@@ -327,7 +327,7 @@ public class PersonApi : IDynamicApiController
poiId = appSettings.PoiId,
personSetId = search.PersonSetId,
//personId = search.PersonId,
- personName = search.PersonName,
+ personName = search.Name,
pageIndex = search.PageNum,
pageSize = search.PageSize,
})
diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/WarnInfoController.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/WarnInfoController.cs
index b69b847..edd9810 100644
--- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/WarnInfoController.cs
+++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/WarnInfoController.cs
@@ -61,8 +61,12 @@ public class WarnInfoController
var model = await _warnInfoService.GetInfo(Id);
if (!string.IsNullOrEmpty(model.Extend))
{
- var extend = JsonConvert.DeserializeObject(model.Extend);
- model.Extend = extend["age"]!=null?$"年龄:{extend["age"]};年龄置信度:{Convert.ToInt32(Convert.ToDecimal(extend["ageProb"])*100)}%;":"";
+ if (string.IsNullOrEmpty(model.PersonId))
+ {
+ var extend = JsonConvert.DeserializeObject(model.Extend);
+ model.Extend = extend["age"] != null ? $"年龄:{extend["age"]};年龄置信度:{Convert.ToInt32(Convert.ToDecimal(extend["ageProb"]) * 100)}%;" : "";
+ }
+
}
try
diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioAnalysisController.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioAnalysisController.cs
index 1d388ba..9b14334 100644
--- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioAnalysisController.cs
+++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioAnalysisController.cs
@@ -184,8 +184,8 @@ public class VioAnalysisController
var warnList = await _warnInfoService.GetListNoPage(new WarnInfoSearch
{
StartTick = input.StartTime,
- EndTick = input.EndTime,
- AlarmTypes = warnGroup.Subset.Select(x => x.Code).ToArray(),
+ EndTick = input.EndTime.AddDays(1).AddSeconds(-1),
+ AlarmTypes = warnGroup.Subset.Where(x=>x.State).Select(x => x.Code).ToArray(),
PersonSetIds = input.PersonSetIds
});
var templatePath = Path.Combine(Directory.GetCurrentDirectory(), "Template", $"WordTemplate.docx");
diff --git a/SafeCampus.API/SafeCampus.Web.Core/SafeCampus.Web.Core.xml b/SafeCampus.API/SafeCampus.Web.Core/SafeCampus.Web.Core.xml
index 8f521c9..eeb5fca 100644
--- a/SafeCampus.API/SafeCampus.Web.Core/SafeCampus.Web.Core.xml
+++ b/SafeCampus.API/SafeCampus.Web.Core/SafeCampus.Web.Core.xml
@@ -139,6 +139,12 @@
+
+
+ 获取未被宿舍楼使用的摄像头
+
+
+
摄像头分组管理接口
diff --git a/SafeCampus.API/SafeCampus.Web.Entry/Properties/PublishProfiles/FolderProfile.pubxml.user b/SafeCampus.API/SafeCampus.Web.Entry/Properties/PublishProfiles/FolderProfile.pubxml.user
index 64ecd7d..cdb73e2 100644
--- a/SafeCampus.API/SafeCampus.Web.Entry/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ b/SafeCampus.API/SafeCampus.Web.Entry/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<_PublishTargetUrl>F:\Project\QJKJ\SafeCampus\SafeCampus.API\SafeCampus.Web.Entry\bin\Release\net6.0\publish\
- True|2024-09-23T06:58:29.0998917Z;True|2024-09-23T14:34:42.4664825+08:00;True|2024-09-23T14:34:14.9788969+08:00;True|2024-09-23T14:21:01.8969413+08:00;True|2024-09-23T14:17:25.6978104+08:00;True|2024-09-23T13:44:21.2948521+08:00;True|2024-09-23T13:42:29.2647186+08:00;True|2024-09-19T17:53:09.3428873+08:00;True|2024-09-19T17:47:47.8015573+08:00;True|2024-09-19T17:33:18.0038814+08:00;True|2024-09-19T17:13:16.6885326+08:00;True|2024-09-19T16:40:10.4911580+08:00;True|2024-09-19T15:32:43.5092007+08:00;True|2024-09-19T14:13:40.1278496+08:00;True|2024-09-19T11:00:03.7642790+08:00;True|2024-09-04T16:01:07.1761640+08:00;True|2024-09-04T15:47:33.3094448+08:00;True|2024-09-04T13:33:22.9396193+08:00;True|2024-08-30T13:27:03.2003529+08:00;True|2024-08-27T15:31:21.7026102+08:00;True|2024-08-20T11:12:26.7141701+08:00;True|2024-08-19T17:23:34.5703879+08:00;True|2024-08-19T15:55:28.3484786+08:00;True|2024-08-19T15:45:49.5623372+08:00;True|2024-08-19T14:56:17.7733738+08:00;True|2024-08-19T14:52:03.2782392+08:00;True|2024-08-19T14:10:57.7043528+08:00;True|2024-08-19T13:38:29.9236695+08:00;False|2024-08-19T13:29:18.8873264+08:00;True|2024-08-19T12:31:57.9280692+08:00;True|2024-08-19T11:50:36.7241244+08:00;True|2024-08-19T10:24:05.0018377+08:00;True|2024-08-19T10:23:30.0445364+08:00;True|2024-08-19T10:12:33.8316906+08:00;True|2024-08-19T10:10:48.0967630+08:00;True|2024-08-16T12:17:51.5743944+08:00;True|2024-08-16T11:36:15.1880346+08:00;True|2024-08-12T11:27:42.2864171+08:00;True|2024-08-09T14:54:42.9062124+08:00;True|2024-08-09T11:49:01.0339449+08:00;True|2024-08-09T11:43:21.9947939+08:00;True|2024-08-09T10:43:25.7641675+08:00;True|2024-08-08T15:23:17.0510180+08:00;True|2024-08-08T15:20:50.3450876+08:00;True|2024-08-08T11:06:43.0783261+08:00;True|2024-08-07T17:24:03.0780935+08:00;True|2024-08-07T17:20:50.6266614+08:00;True|2024-08-07T17:18:15.6367265+08:00;True|2024-08-06T17:31:40.3452266+08:00;True|2024-07-31T16:54:03.1890463+08:00;True|2024-07-30T17:11:33.2514194+08:00;True|2024-07-30T17:08:14.5888060+08:00;True|2024-07-30T09:56:08.6349163+08:00;True|2024-07-30T09:50:02.2368269+08:00;True|2024-07-29T16:20:12.3202393+08:00;True|2024-07-29T16:16:29.9634841+08:00;True|2024-07-29T16:09:51.7696392+08:00;True|2024-07-29T16:06:49.4145658+08:00;True|2024-07-29T15:58:50.6654249+08:00;True|2024-07-29T11:32:11.6206514+08:00;True|2024-07-29T11:26:26.1574563+08:00;True|2024-07-29T11:04:41.1896705+08:00;True|2024-07-29T10:38:38.4560275+08:00;True|2024-07-29T10:33:38.5288332+08:00;False|2024-07-29T10:33:21.0642261+08:00;False|2024-07-29T10:33:00.1005216+08:00;True|2024-07-29T09:54:59.2794860+08:00;True|2024-07-29T09:08:54.4899269+08:00;True|2024-07-26T18:02:13.5407348+08:00;True|2024-07-26T17:46:06.7922851+08:00;True|2024-07-26T15:50:48.6986834+08:00;True|2024-07-26T15:11:17.1696147+08:00;True|2024-07-26T13:58:49.6884964+08:00;True|2024-07-25T17:31:33.0050952+08:00;True|2024-07-25T17:09:12.7084910+08:00;True|2024-07-25T17:02:01.2617736+08:00;True|2024-07-25T16:59:51.6271873+08:00;True|2024-07-25T16:58:05.5249148+08:00;True|2024-07-25T14:14:10.2008367+08:00;False|2024-07-25T14:13:54.0300465+08:00;True|2024-07-25T14:08:57.0244482+08:00;True|2024-07-25T13:41:48.8201522+08:00;True|2024-07-25T10:41:30.7277553+08:00;True|2024-07-25T10:16:05.9105335+08:00;True|2024-07-24T15:31:54.7914854+08:00;True|2024-07-24T09:54:17.6182454+08:00;True|2024-07-23T17:01:18.1510211+08:00;True|2024-07-23T16:41:53.3366577+08:00;True|2024-07-23T16:07:25.4129335+08:00;True|2024-07-23T15:50:42.2437488+08:00;True|2024-07-23T15:19:00.1900116+08:00;True|2024-07-23T14:59:22.8551233+08:00;True|2024-07-23T14:19:55.1193373+08:00;True|2024-07-19T18:04:32.2703039+08:00;True|2024-07-19T15:56:25.4103701+08:00;True|2024-07-19T15:09:00.9662436+08:00;True|2024-07-19T15:05:35.7255851+08:00;True|2024-07-19T13:14:42.9559521+08:00;False|2024-07-19T11:37:52.4020673+08:00;True|2024-07-19T11:10:22.8661346+08:00;
+ True|2024-09-29T06:44:27.0928205Z;True|2024-09-24T17:04:13.1154955+08:00;True|2024-09-23T14:58:29.0998917+08:00;True|2024-09-23T14:34:42.4664825+08:00;True|2024-09-23T14:34:14.9788969+08:00;True|2024-09-23T14:21:01.8969413+08:00;True|2024-09-23T14:17:25.6978104+08:00;True|2024-09-23T13:44:21.2948521+08:00;True|2024-09-23T13:42:29.2647186+08:00;True|2024-09-19T17:53:09.3428873+08:00;True|2024-09-19T17:47:47.8015573+08:00;True|2024-09-19T17:33:18.0038814+08:00;True|2024-09-19T17:13:16.6885326+08:00;True|2024-09-19T16:40:10.4911580+08:00;True|2024-09-19T15:32:43.5092007+08:00;True|2024-09-19T14:13:40.1278496+08:00;True|2024-09-19T11:00:03.7642790+08:00;True|2024-09-04T16:01:07.1761640+08:00;True|2024-09-04T15:47:33.3094448+08:00;True|2024-09-04T13:33:22.9396193+08:00;True|2024-08-30T13:27:03.2003529+08:00;True|2024-08-27T15:31:21.7026102+08:00;True|2024-08-20T11:12:26.7141701+08:00;True|2024-08-19T17:23:34.5703879+08:00;True|2024-08-19T15:55:28.3484786+08:00;True|2024-08-19T15:45:49.5623372+08:00;True|2024-08-19T14:56:17.7733738+08:00;True|2024-08-19T14:52:03.2782392+08:00;True|2024-08-19T14:10:57.7043528+08:00;True|2024-08-19T13:38:29.9236695+08:00;False|2024-08-19T13:29:18.8873264+08:00;True|2024-08-19T12:31:57.9280692+08:00;True|2024-08-19T11:50:36.7241244+08:00;True|2024-08-19T10:24:05.0018377+08:00;True|2024-08-19T10:23:30.0445364+08:00;True|2024-08-19T10:12:33.8316906+08:00;True|2024-08-19T10:10:48.0967630+08:00;True|2024-08-16T12:17:51.5743944+08:00;True|2024-08-16T11:36:15.1880346+08:00;True|2024-08-12T11:27:42.2864171+08:00;True|2024-08-09T14:54:42.9062124+08:00;True|2024-08-09T11:49:01.0339449+08:00;True|2024-08-09T11:43:21.9947939+08:00;True|2024-08-09T10:43:25.7641675+08:00;True|2024-08-08T15:23:17.0510180+08:00;True|2024-08-08T15:20:50.3450876+08:00;True|2024-08-08T11:06:43.0783261+08:00;True|2024-08-07T17:24:03.0780935+08:00;True|2024-08-07T17:20:50.6266614+08:00;True|2024-08-07T17:18:15.6367265+08:00;True|2024-08-06T17:31:40.3452266+08:00;True|2024-07-31T16:54:03.1890463+08:00;True|2024-07-30T17:11:33.2514194+08:00;True|2024-07-30T17:08:14.5888060+08:00;True|2024-07-30T09:56:08.6349163+08:00;True|2024-07-30T09:50:02.2368269+08:00;True|2024-07-29T16:20:12.3202393+08:00;True|2024-07-29T16:16:29.9634841+08:00;True|2024-07-29T16:09:51.7696392+08:00;True|2024-07-29T16:06:49.4145658+08:00;True|2024-07-29T15:58:50.6654249+08:00;True|2024-07-29T11:32:11.6206514+08:00;True|2024-07-29T11:26:26.1574563+08:00;True|2024-07-29T11:04:41.1896705+08:00;True|2024-07-29T10:38:38.4560275+08:00;True|2024-07-29T10:33:38.5288332+08:00;False|2024-07-29T10:33:21.0642261+08:00;False|2024-07-29T10:33:00.1005216+08:00;True|2024-07-29T09:54:59.2794860+08:00;True|2024-07-29T09:08:54.4899269+08:00;True|2024-07-26T18:02:13.5407348+08:00;True|2024-07-26T17:46:06.7922851+08:00;True|2024-07-26T15:50:48.6986834+08:00;True|2024-07-26T15:11:17.1696147+08:00;True|2024-07-26T13:58:49.6884964+08:00;True|2024-07-25T17:31:33.0050952+08:00;True|2024-07-25T17:09:12.7084910+08:00;True|2024-07-25T17:02:01.2617736+08:00;True|2024-07-25T16:59:51.6271873+08:00;True|2024-07-25T16:58:05.5249148+08:00;True|2024-07-25T14:14:10.2008367+08:00;False|2024-07-25T14:13:54.0300465+08:00;True|2024-07-25T14:08:57.0244482+08:00;True|2024-07-25T13:41:48.8201522+08:00;True|2024-07-25T10:41:30.7277553+08:00;True|2024-07-25T10:16:05.9105335+08:00;True|2024-07-24T15:31:54.7914854+08:00;True|2024-07-24T09:54:17.6182454+08:00;True|2024-07-23T17:01:18.1510211+08:00;True|2024-07-23T16:41:53.3366577+08:00;True|2024-07-23T16:07:25.4129335+08:00;True|2024-07-23T15:50:42.2437488+08:00;True|2024-07-23T15:19:00.1900116+08:00;True|2024-07-23T14:59:22.8551233+08:00;True|2024-07-23T14:19:55.1193373+08:00;True|2024-07-19T18:04:32.2703039+08:00;True|2024-07-19T15:56:25.4103701+08:00;True|2024-07-19T15:09:00.9662436+08:00;True|2024-07-19T15:05:35.7255851+08:00;True|2024-07-19T13:14:42.9559521+08:00;
\ No newline at end of file
diff --git a/SafeCampus.WEB/src/views/userManage/clothing/index.vue b/SafeCampus.WEB/src/views/userManage/clothing/index.vue
index f79ba84..6ee6956 100644
--- a/SafeCampus.WEB/src/views/userManage/clothing/index.vue
+++ b/SafeCampus.WEB/src/views/userManage/clothing/index.vue
@@ -144,7 +144,7 @@ function onOpen(opt: FormOptEnum, record: {},treeAllData:any) {
async function addDelete(clothSetId: string[],msg: string) {
// 二次确认 => 请求api => 刷新表格
await useHandleData(userManageClothApi.deleteClothDataBaseD, { clothSetId }, msg);
- RefreshTree(); //刷新表格
+ RefreshTree('delete'); //刷新表格
}
/**
@@ -162,7 +162,8 @@ const RefreshTable = () => {
getList(clothSetId.value)
}
// 刷新表格+树
-const RefreshTree = async() => {
+const RefreshTree = async(type='') => {
+ if(type == 'delete'){clothSetId.value = ''}
treeKey.value = Math.random();
await getTree(); //刷新树形筛选器
await getList(clothSetId.value)
diff --git a/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/form_basic.vue b/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/form_basic.vue
index a0320f6..380eace 100644
--- a/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/form_basic.vue
+++ b/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/form_basic.vue
@@ -51,7 +51,7 @@
-
+
diff --git a/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/index.vue b/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/index.vue
index 407bd69..1c9cb8f 100644
--- a/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/index.vue
+++ b/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/index.vue
@@ -42,6 +42,14 @@ const sysUserProps = reactive>({
record: {},
disabled: false
});
+const checkAgeNumber = (rule: any, value: any, callback: any) => {
+ if (value === "") callback("请输入年龄");
+ if (value > 100 || value < 0) {
+ callback(new Error("请输入正确的年龄(年龄范围1-100岁)"));
+ } else {
+ return callback();
+ }
+};
// 表单验证规则
const rules = reactive({
@@ -51,7 +59,8 @@ const rules = reactive({
phone: [
{ required: true, message: "请输入手机号", trigger: "blur" },
{ validator: checkPhoneNumber, trigger: "blur" }
- ]
+ ],
+ age: [{ validator: checkAgeNumber, trigger: "blur" }]
});
/**
diff --git a/SafeCampus.WEB/src/views/userManage/personnel/components/form/form_basic.vue b/SafeCampus.WEB/src/views/userManage/personnel/components/form/form_basic.vue
index 119a694..f38cb8e 100644
--- a/SafeCampus.WEB/src/views/userManage/personnel/components/form/form_basic.vue
+++ b/SafeCampus.WEB/src/views/userManage/personnel/components/form/form_basic.vue
@@ -73,7 +73,7 @@
-
+
diff --git a/SafeCampus.WEB/src/views/userManage/personnel/components/form/index.vue b/SafeCampus.WEB/src/views/userManage/personnel/components/form/index.vue
index cb438b1..8271add 100644
--- a/SafeCampus.WEB/src/views/userManage/personnel/components/form/index.vue
+++ b/SafeCampus.WEB/src/views/userManage/personnel/components/form/index.vue
@@ -43,7 +43,14 @@ const sysUserProps = reactive>({
record: {},
disabled: false
});
-
+const checkAgeNumber = (rule: any, value: any, callback: any) => {
+ if (value === "") callback("请输入年龄");
+ if (value > 100 || value < 0) {
+ callback(new Error("请输入正确的年龄(年龄范围1-100岁)"));
+ } else {
+ return callback();
+ }
+};
// 表单验证规则
const rules = reactive({
name: [required("请输入姓名")],
@@ -53,9 +60,8 @@ const rules = reactive({
{ required: true, message: "请输入手机号", trigger: "blur" },
{ validator: checkPhoneNumber, trigger: "blur" }
],
- // depId: [required("请选择系部")],
- // majorId: [required("请选择专业")],
- personSetId: [required("请选择班级")]
+ personSetId: [required("请选择班级")],
+ age: [{ validator: checkAgeNumber, trigger: "blur" }]
});
/**
diff --git a/SafeCampus.WEB/src/views/violation/portraitSummary/index.vue b/SafeCampus.WEB/src/views/violation/portraitSummary/index.vue
index 9362e35..9f49b24 100644
--- a/SafeCampus.WEB/src/views/violation/portraitSummary/index.vue
+++ b/SafeCampus.WEB/src/views/violation/portraitSummary/index.vue
@@ -65,7 +65,11 @@ const getDataChart = async () => {
getCharts1(sex.data.label, sex.data.value);
/* 获取学生年龄 */
let age: any = await portraitSummaryApi.getStudentAge();
- getCharts2(age.data.label, age.data.value);
+ let data = {
+ label: [89, 99, 36, 29, 31, 30, 28, 22, 32, 33, 35, 12012012, 26, 27, 23],
+ value: [1, 1, 1, 2, 2, 2, 1, 16, 1, 1, 1, 1, 1, 1, 1]
+ };
+ getCharts2(data.label, data.value);
/* 获取属性标签 */
let attr: any = await portraitSummaryApi.getStudentAttr();
getCharts4(attr.data.label, attr.data.value);
@@ -104,7 +108,7 @@ function getCharts1(label: any, value: any) {
type: "pie",
radius: "80%",
center: ["50%", "50%"],
- roseType: "area",
+ // roseType: "area",
label: {
normal: {
show: true
@@ -158,10 +162,15 @@ function getCharts2(label: any, value: any) {
{
name: "年龄分布",
type: "pie",
- radius: [50, 140],
-
+ radius: [50, 110],
roseType: "area",
+ center: ["35%", "50%"],
data: data,
+ label: {
+ bleedMargin: 5,
+ position: "outer",
+ alignTo: "none"
+ },
itemStyle: {
normal: {
label: {
@@ -171,7 +180,12 @@ function getCharts2(label: any, value: any) {
}
},
labelLine: {
- show: true
+ show: true, //数据标签引导线
+ length: 20,
+ lineStyle: {
+ width: 1,
+ type: "solid"
+ }
}
}
}