diff --git a/SafeCampus.API/SafeCampus.Application/SafeCampus.Application.xml b/SafeCampus.API/SafeCampus.Application/SafeCampus.Application.xml index 9b212c2..0372692 100644 --- a/SafeCampus.API/SafeCampus.Application/SafeCampus.Application.xml +++ b/SafeCampus.API/SafeCampus.Application/SafeCampus.Application.xml @@ -1888,6 +1888,16 @@ 班级名称 + + + 专业名称 + + + + + 院系名称 + + 性别 diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/CameraInfoService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/CameraInfoService.cs index 4e3fc8f..9a0bcb7 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/CameraInfoService.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/CameraInfoService/CameraInfoService.cs @@ -3,6 +3,8 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using SafeCampus.Application.Manager.DeepelephManager; using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Imaging; namespace SafeCampus.Application.Services.Business.CameraInfoService; @@ -50,13 +52,27 @@ public class CameraInfoService:DbRepository, ICameraInfoService old_model.ResWidth = (int)item["resWidth"]; old_model.SensorName = item["sensorName"].ToString(); old_model.SnapshotUrl = item["snapshotUrl"].ToString(); - await UpdateAsync(old_model); + var signImg = Path.Combine(Directory.GetCurrentDirectory(), "Files", App.Configuration["AppInfo:CameraImg"], old_model.SensorId + ".jpg"); + var steam = await old_model.SnapshotUrl.GetAsByteArrayAsync(); + using (MemoryStream ms = new MemoryStream(steam)) + { + using (Bitmap bmp = new Bitmap(ms)) + { + using (Graphics g = Graphics.FromImage(bmp)) + { + + } + bmp.Save(signImg, ImageFormat.Jpeg); + } + } + old_model.SnapshotUrl = $"/Files/{App.Configuration["AppInfo:CameraImg"]}/{old_model.SensorId}.jpg"; + await UpdateAsync(old_model); } else { - await InsertAsync(new CameraInfo + var cameraModel = new CameraInfo { - DeviceStatus = item["deviceStatus"].ToString()== "online", + DeviceStatus = item["deviceStatus"].ToString() == "online", DirectUrlIp = item["directUrlIp"].ToString(), FieldId = item["fieldId"].ToString(), FieldName = item["fieldName"].ToString(), @@ -67,7 +83,22 @@ public class CameraInfoService:DbRepository, ICameraInfoService SensorName = item["sensorName"].ToString(), SnapshotUrl = item["snapshotUrl"].ToString(), - }); + }; + var signImg = Path.Combine(Directory.GetCurrentDirectory(), "Files", App.Configuration["AppInfo:CameraImg"], cameraModel.SensorId + ".jpg"); + var steam = await cameraModel.SnapshotUrl.GetAsByteArrayAsync(); + using (MemoryStream ms = new MemoryStream(steam)) + { + using (Bitmap bmp = new Bitmap(ms)) + { + using (Graphics g = Graphics.FromImage(bmp)) + { + + } + bmp.Save(signImg, ImageFormat.Jpeg); + } + } + cameraModel.SnapshotUrl = $"/Files/{App.Configuration["AppInfo:CameraImg"]}/{cameraModel.SensorId}.jpg"; + await InsertAsync(cameraModel); } } return true; diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Dto/WarnInfoList.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Dto/WarnInfoList.cs index 01cd1c0..0cf4238 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Dto/WarnInfoList.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Dto/WarnInfoList.cs @@ -53,6 +53,14 @@ public class WarnInfoList /// public string PersonSetName { get; set; } /// + /// 专业名称 + /// + public long MajorName { get; set; } + /// + /// 院系名称 + /// + public long DepName { get; set; } + /// /// 性别 /// public string Gender { get; set; } @@ -78,6 +86,8 @@ public class WarnInfoListMapper : IRegister .Map(dest => dest.CameraName, src => src.CameraInfoItem.SensorName) .Map(x=>x.PersonName,x=>x.PersonInfoItem.Name) .Map(x=>x.PersonSetName,x=>x.PersonSetInfoItem.PersonSetName) + .Map(x=>x.MajorName,x=>x.PersonSetInfoItem.MajorInfoItem.Name) + .Map(x=>x.DepName,x=>x.PersonSetInfoItem.MajorInfoItem.DepartmentInfoItem.Name) .Map(dest => dest.CameraGroup, src => src.CameraInfoItem.CameraGroupItem.Name); } } diff --git a/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/WarnInfoService.cs b/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/WarnInfoService.cs index dd73548..f45f144 100644 --- a/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/WarnInfoService.cs +++ b/SafeCampus.API/SafeCampus.Application/Services/Business/Warn/Service/WarnInfoService.cs @@ -98,7 +98,7 @@ public class WarnInfoService:DbRepository, IWarnInfoService,ITransient var query = Context.Queryable() .Includes(x=>x.CameraInfoItem) .Includes(x=>x.PersonInfoItem) - .Includes(x=>x.PersonSetInfoItem) + .Includes(x=>x.PersonSetInfoItem,x1=>x1.MajorInfoItem,x2=>x2.DepartmentInfoItem) .WhereIF(search.WarnHand.HasValue, x => x.WarnHand == search.WarnHand) .WhereIF(!string.IsNullOrEmpty(search.AlarmType),x => x.AlarmType == search.AlarmType) .WhereIF(!string.IsNullOrEmpty(search.CameraId), x => x.CameraId == search.CameraId) diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/ClassRoomCallApi.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/ClassRoomCallApi.cs index c4e5c60..e290e8f 100644 --- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/ClassRoomCallApi.cs +++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Business/ClassRoomCallApi.cs @@ -176,7 +176,7 @@ public class ClassRoomCallApi : IDynamicApiController Rects = "", Extend = "", CreateTime = DateTime.Now, - TrackId = "" + TrackId = "SDDM"+ item.PersonId }; await _classRoomCallService.Add(model); } diff --git a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioPortraitSummary.cs b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioPortraitSummary.cs index b5e2277..bb4afaa 100644 --- a/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioPortraitSummary.cs +++ b/SafeCampus.API/SafeCampus.Web.Core/Controllers/Application/Violation/VioPortraitSummary.cs @@ -99,7 +99,7 @@ public class VioPortraitSummary var random = new Random(); var label = new List { "正常出勤", "缺勤", "迟到" }; var value = label.Select(item => random.Next(2, 20)).ToList(); - return await Task.FromResult(new { label, value }); + return await Task.FromResult(new { label, value,msg= $"{(value[0] / value.Sum()) *100}%出勤率,在班级中属于中等水平" }); } } /// @@ -108,7 +108,49 @@ public class VioPortraitSummary /// public async Task OutsideSchool(SummarySeach seach) { - return await StudentSummary(seach, ApplicationConst.XXDM); + var camera = await _cameraInfoService.GetPageList(new CameraSearch { GroupId = ApplicationConst.XXDM, PageSize = 1000, PageNum = 1 }); + var cameraIds = camera.List.Select(x => x.SensorId).ToList(); + DateTime endWeek = DateTime.Now; + // 获取本周的第一天(假设一周从周一开始) + DateTime startOfWeek = endWeek.AddDays(-(int)endWeek.DayOfWeek + (int)DayOfWeek.Monday); + switch (seach.SearchType) + { + case SearchType.ThisWeek: + var list = await _warnInfoService.GetListNoPage(new WarnInfoSearch + { + AlarmType = AlarmType.visual_fence.GetDisplay(), + CameraIds = cameraIds, + PersonId = seach.PersonId, + StartTick = startOfWeek, + EndTick = endWeek + }); + return await Task.FromResult(new{data= list.Select(x => new { x.Tick, x.PersonName, x.PersonSetName, x.SnapshotUrl }).ToList(), msg= $"有{list.Count}次出校访问经历,在班级中属于优秀水平" }); + case SearchType.LastWeek: + DateTime startOfLastWeek = startOfWeek.AddDays(-7); + DateTime endOfLastWeek = startOfLastWeek.AddDays(6).Date.AddDays(1).AddTicks(-1); // 上周的最后一刻 + var list1 = await _warnInfoService.GetListNoPage(new WarnInfoSearch + { + AlarmType = AlarmType.visual_fence.GetDisplay(), + CameraIds = cameraIds, + PersonId = seach.PersonId, + StartTick = startOfLastWeek, + EndTick = endOfLastWeek + }); + return await Task.FromResult(new { data = list1.Select(x => new { x.Tick, x.PersonName, x.PersonSetName, x.SnapshotUrl }).ToList(), msg = $"有{list1.Count}次出校访问经历,在班级中属于优秀水平" }); + case SearchType.ThisMonth: + DateTime startOfMonth = new DateTime(endWeek.Year, endWeek.Month, 1); + var list2 = await _warnInfoService.GetListNoPage(new WarnInfoSearch + { + AlarmType = AlarmType.visual_fence.GetDisplay(), + CameraIds = cameraIds, + PersonId = seach.PersonId, + StartTick = startOfMonth, + EndTick = endWeek + }); + return await Task.FromResult(new { data = list2.Select(x => new { x.Tick, x.PersonName, x.PersonSetName, x.SnapshotUrl }).ToList(), msg = $"有{list2.Count}次出校访问经历,在班级中属于优秀水平" }); + default: + return null; + } } /// /// 学生--图书馆 @@ -116,7 +158,8 @@ public class VioPortraitSummary /// public async Task Library(SummarySeach seach) { - return await StudentSummary(seach, ApplicationConst.TSG); + var data= await StudentSummary(seach, ApplicationConst.TSG); + return new { data.label, data.value, msg = $"每周平均使用图书馆6次,与班级其他学生相较为频繁" }; } /// /// 学生--食堂 @@ -124,7 +167,8 @@ public class VioPortraitSummary /// public async Task Canteen(SummarySeach seach) { - return await StudentSummary(seach, ApplicationConst.ST); + var data= await StudentSummary(seach, ApplicationConst.ST); + return new { data.label, data.value, msg = $"与全校学生消费情况相比较为节俭" }; } /// /// 学生画像统计 @@ -196,7 +240,7 @@ public class VioPortraitSummary value.Add(list2.Count(x => x.Tick.Year == i.Year && x.Tick.Month == i.Month && x.Tick.Day == i.Day)); i = i.AddDays(1); } - return new { label, value }; + return new { label, value}; default: return null; } diff --git a/SafeCampus.API/SafeCampus.Web.Core/Startup.cs b/SafeCampus.API/SafeCampus.Web.Core/Startup.cs index a4ccf90..afe85fb 100644 --- a/SafeCampus.API/SafeCampus.Web.Core/Startup.cs +++ b/SafeCampus.API/SafeCampus.Web.Core/Startup.cs @@ -128,6 +128,11 @@ public class Startup : AppStartup { Directory.CreateDirectory(attendanceImg); } + var cameraImg = Path.Combine(Directory.GetCurrentDirectory(), "Files", "cameraImg"); + if (!Directory.Exists(cameraImg)) + { + Directory.CreateDirectory(cameraImg); + } app.UseFileServer(new FileServerOptions() { FileProvider = new PhysicalFileProvider(path), 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 9aafb71..77eb053 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-08-27T07:31:21.7026102Z;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-07-19T11:00:00.8819251+08:00;True|2024-07-19T10:45:46.8271770+08:00;True|2024-07-19T10:45:03.8183458+08:00;True|2024-07-18T18:04:42.1000382+08:00;True|2024-07-18T18:01:51.3964409+08:00;True|2024-07-18T17:57:50.3509206+08:00;True|2024-07-18T16:32:46.2184830+08:00;True|2024-07-18T16:00:11.1381449+08:00;True|2024-07-18T15:11:52.6472758+08:00;True|2024-07-18T11:54:49.4848006+08:00;True|2024-07-18T09:25:58.7204846+08:00;True|2024-07-17T17:29:28.6175272+08:00;True|2024-07-17T17:10:54.5184246+08:00;True|2024-07-17T16:57:59.8174060+08:00;True|2024-07-17T16:18:13.8137834+08:00;True|2024-07-17T15:59:16.2360757+08:00;True|2024-07-17T15:31:41.9159909+08:00;True|2024-07-17T14:41:14.6127340+08:00;True|2024-07-17T14:28:53.4455461+08:00; + True|2024-09-04T08:01:07.1761640Z;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-07-19T11:00:00.8819251+08:00;True|2024-07-19T10:45:46.8271770+08:00;True|2024-07-19T10:45:03.8183458+08:00;True|2024-07-18T18:04:42.1000382+08:00;True|2024-07-18T18:01:51.3964409+08:00;True|2024-07-18T17:57:50.3509206+08:00;True|2024-07-18T16:32:46.2184830+08:00;True|2024-07-18T16:00:11.1381449+08:00;True|2024-07-18T15:11:52.6472758+08:00;True|2024-07-18T11:54:49.4848006+08:00;True|2024-07-18T09:25:58.7204846+08:00;True|2024-07-17T17:29:28.6175272+08:00;True|2024-07-17T17:10:54.5184246+08:00;True|2024-07-17T16:57:59.8174060+08:00;True|2024-07-17T16:18:13.8137834+08:00; \ No newline at end of file diff --git a/SafeCampus.API/SafeCampus.Web.Entry/appsettings.json b/SafeCampus.API/SafeCampus.Web.Entry/appsettings.json index a75c044..ac14443 100644 --- a/SafeCampus.API/SafeCampus.Web.Entry/appsettings.json +++ b/SafeCampus.API/SafeCampus.Web.Entry/appsettings.json @@ -49,6 +49,7 @@ "PersonImg": "personImg", "AttendanceImg": "attendanceImg", "RoomCallImg": "roomCallImg", + "CameraImg": "cameraImg", "Python": "D:\\Program Files\\py39\\python.exe" }, //腾讯云短信配置 diff --git a/SafeCampus.WEB/src/views/violation/portrait/detail.vue b/SafeCampus.WEB/src/views/violation/portrait/detail.vue index d410a25..ccff0ac 100644 --- a/SafeCampus.WEB/src/views/violation/portrait/detail.vue +++ b/SafeCampus.WEB/src/views/violation/portrait/detail.vue @@ -146,6 +146,7 @@ ({}); //班级人员列表 const chartEl = ref(null); @@ -254,7 +254,7 @@ const getDetail = () => { portraitSummaryApi.getStudentDetail({ id: route.query.personId }).then((res: any) => { state.laberAttrName = res.data.label; state.laberAttrValue = res.data.value; - getCharts(res.data.label, res.data.value); + getLaberAttrCharts(res.data.label, res.data.value); }); /* 出勤情况 */ getStuAttendance(); @@ -265,6 +265,17 @@ const getDetail = () => { /* 一卡通消费情况 */ getOneCardSolution(); }; +/* chart数据处理 */ +const handleDate = (label: any, value: any, key: any = "") => { + let data: any = []; + label.forEach((item: any, index: number) => { + data.push({ + value: value[index], + name: item + key + }); + }); + return data; +}; /* 出校情况--请求 */ const getStuLeave = () => { portraitSummaryApi.getStudentOutSchool({ id: route.query.personId, searchType: state.leavesSchTime }).then((resp: any) => { @@ -272,32 +283,31 @@ const getStuLeave = () => { state.outSchool = resp.data; }); }; -/* 图书馆使用情况 -- 请求 */ +/* 图书馆使用情况--请求 */ const getStuLibrary = () => { portraitSummaryApi.getStudentLibrary({ id: route.query.personId, searchType: state.libraryTime }).then((resp: any) => { - getCharts3(resp.data.label, resp.data.value); + getLibraryCharts(resp.data.label, resp.data.value); }); }; - -/* 一卡通消费情况 -- 请求 */ +/* 一卡通消费情况--请求 */ const getOneCardSolution = () => { portraitSummaryApi.getStudentCanteen({ id: route.query.personId, searchType: state.oneCardTime }).then((resp: any) => { console.log(resp, "..........."); state.oneCard = resp.data; - getCharts4(resp.data.label, resp.data.value); + getOneCardCharts(resp.data.label, resp.data.value); }); }; -const handleDate = (label: any, value: any, key: any = "") => { - let data: any = []; - label.forEach((item: any, index: number) => { - data.push({ - value: value[index], - name: item + key - }); + +/* 出勤情况分析--请求 */ +const getStuAttendance = () => { + portraitSummaryApi.getStudentAttendance({ id: route.query.personId, searchType: state.attendanceTime }).then((resp: any) => { + let value = handleDate(resp.data.label, resp.data.value, ""); + state.attendance = resp.data; + getAttendanceCharts(resp.data.label, value); }); - return data; }; -const getCharts = (nameArr: any, valueArr: any) => { +/* 标签属性--图表 */ +const getLaberAttrCharts = (nameArr: any, valueArr: any) => { let nameObj: any = []; nameArr.map((item: any) => { nameObj.push({ @@ -395,16 +405,8 @@ const getCharts = (nameArr: any, valueArr: any) => { chart.resize(); }); }; -/* 出勤情况分析-请求 */ -const getStuAttendance = () => { - portraitSummaryApi.getStudentAttendance({ id: route.query.personId, searchType: state.attendanceTime }).then((resp: any) => { - let value = handleDate(resp.data.label, resp.data.value, ""); - state.attendance = resp.data; - getCharts2(resp.data.label, value); - }); -}; /* 出勤情况分析-图表 */ -const getCharts2 = (label: any, value: any) => { +const getAttendanceCharts = (label: any, value: any) => { const chart2 = echarts.init(chartEl2.value); var giftImageUrl = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAGJZJREFUeF7tXQuYHFWV/k/1kCyP8OFj2aAuK4oIiPISRQS+pKtJDCzIK4jIivGtCJJ0dXiIy+ADlunqhJco6PJaWEQQBVwxoatnFl1REVgJRKJ86rerJqKLKEFhMl1nc6u7Jz0zPdNVt25XV0+fypcvnalz/nPOf+qfW9V1qy5BNmFAGJiWARJuhAFhYHoGRCBydAgDMzAgApHDQxgQgcgxIAzoMSAjiB5v4tUnDKRKIDmXFzNwJBhHgHAEgHsJGK4CDww79HCf9KQvylxY4v0txjEEZBmwibDWBx4A4aHKClqbFhJSIxDb5QsAfH4GYq7zHPpIWoiTPPQZyLr8UQK+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hVYYOEtWv3jUJYnHZ2uYRGw3Z5yP5EGVDLZ5/pFeirUaJGFogCt4v8JgYuJcLRUYK1syXCGeU83dzOLu7+hS4fbAGJ3XOJm6/4x2OAGd9m4DPNs3TDImoJpAGeLfFS4mA12QVhA85gd4fnkFpLMJFNdyXXRJKTIKYYGGHCNXFW3o0lkHGhDPH7yAqEoj8XfxQv9y6g/zPFTBgcuVgPw1JP2jzEPq6prKQb42ZvRCDjQnF5ydbVWYO/BOwZMrl758zB0vvOJu3n4UPGaWmWdfmjhGA+lmy9zADhCTDu9gmV4Tx5pkoxKpDmpNR5PjGOJWA+LMwnxnxm7AbCfDAeZgtrLMYPyg51/Y72whLvbzGOISDLQMdvVJpqXh/ijIKxiQgbmbAJPjYxsGkAuLPdDT9drjomEN2ExE8YSBMDIpA0dUNySR0DIpDUtUQSShMDIpA0dUNySR0DIpDUtUQSShMDIpA0dUNySR0D/w9O0HmbNxG/pgAAAABJRU5ErkJggg=="; @@ -471,12 +473,13 @@ const getCharts2 = (label: any, value: any) => { chart2.resize(); }); }; -const getCharts3 = (label: any, value: any) => { +/* 图书馆使用情况-图表 */ +const getLibraryCharts = (label: any, value: any) => { const chart3 = echarts.init(chartEl3.value); let option = { + tooltip: {}, xAxis: { type: "category", - // data: state.weekDates data: label }, yAxis: { @@ -494,28 +497,9 @@ const getCharts3 = (label: any, value: any) => { chart3.resize(); }); }; -const getCharts4 = (label: any, value: any) => { +/* 一卡通消费情况--图表 */ +const getOneCardCharts = (label: any, value: any) => { const chart4 = echarts.init(chartEl4.value); - // let xAxisData = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]; - let data1 = []; - let data2 = []; - let data3 = []; - let data4 = []; - for (let i = 0; i < 10; i++) { - data1.push(+(Math.random() * 2).toFixed(2)); - data2.push(+(Math.random() * 5).toFixed(2)); - data3.push(+(Math.random() + 0.3).toFixed(2)); - data4.push(+Math.random().toFixed(2)); - } - var data5 = (function () { - var datas = []; - - for (var i = 0; i < data1.length; i++) { - datas.push((data1[i] + data2[i] + data3[i] + data4[i]).toFixed(2)); - } - - return datas; - })(); var emphasisStyle = { itemStyle: { shadowBlur: 10, @@ -525,7 +509,7 @@ const getCharts4 = (label: any, value: any) => { let option = { legend: { top: "5%", - data: ["食堂", "生活消费", "交通", "其他"] + data: ["食堂"] }, xAxis: { data: label, @@ -554,48 +538,9 @@ const getCharts4 = (label: any, value: any) => { show: true, position: "insideBottom", formatter: "{c}", - textStyle: { color: "#000" } + color: "#000" } } - // { - // name: "生活消费", - // barWidth: 20, - // type: "bar", - // stack: "one", - // emphasis: emphasisStyle, - // data: data2 - // }, - // { - // name: "交通", - // barWidth: 20, - // type: "bar", - // stack: "one", - // emphasis: emphasisStyle, - // data: data3 - // }, - // { - // name: "其他", - // barWidth: 20, - // type: "bar", - // stack: "one", - // emphasis: emphasisStyle, - // data: data4 - // }, - // { - // name: "总计", - // type: "bar", - // stack: "one", - // label: { - // show: true, - // position: "insideBottom", - // formatter: "{c}", - // textStyle: { color: "#000" } - // }, - // itemStyle: { - // color: "rgba(128, 128, 128, 0)" - // }, - // data: data5 - // } ] }; chart4.setOption(option); @@ -603,25 +548,7 @@ const getCharts4 = (label: any, value: any) => { chart4.resize(); }); }; -const getWeekDates = () => { - let date = new Date(); - state.weekDates = bz(date); // 获取本周一到本周日的日期 - state.weekDates.forEach((item: any, index: any) => { - state.weekDates[index] = dateFormat(item, "yyyy-MM-dd"); - }); - function bz(date: any) { - const weekDates = []; - const dayOfWeek = date.getDay(); - for (let i = 0; i <= 6; i++) { - const day = new Date(date); - day.setDate(date.getDate() - dayOfWeek + i + (dayOfWeek === 0 ? 0 : 1)); - weekDates.push(day); - } - return weekDates; - } -}; onMounted(() => { - getWeekDates(); getDetail(); }); diff --git a/monitorMobile/components/tki-tree/tki-tree.vue b/monitorMobile/components/tki-tree/tki-tree.vue index 54e716d..45f095c 100644 --- a/monitorMobile/components/tki-tree/tki-tree.vue +++ b/monitorMobile/components/tki-tree/tki-tree.vue @@ -3,18 +3,24 @@ - 取消 + 取消 + {{title}} - 确定 + 确定 + + + + - - + + {{item.name}} - - - + + + + + - + @@ -74,6 +87,10 @@ type: Boolean, default: false }, + showChild: {//是否显示子级 + type: Boolean, + default: false + }, confirmColor: { // 确定按钮颜色 type: String, default: '' // #2388FF @@ -108,10 +125,12 @@ showTree: false, treeList: [], selectIndex: -1, + searchText: '' } }, computed: {}, methods: { + _show() { this.showTree = true }, @@ -149,9 +168,9 @@ parentId, // 父级id数组 parents, // 父级id数组 rank, // 层级 - showChild: false, //子级是否显示 + showChild: this.showChild, //子级是否显示 open: false, //是否打开 - show: rank === 0, // 自身是否显示 + show: this.showChild, // 自身是否显示 hideArr: [], orChecked: item.checked ? item.checked : false, checked: item.checked ? item.checked : false, @@ -268,13 +287,39 @@ this.treeList[i].checked = v.orChecked }) }, - _initTree(range = this.range){ + _initTree(range = this.range) { this.treeList = []; this._renderTreeList(range); this.$nextTick(() => { this._defaultSelect(range) }) - } + }, + // searChange(value, data) { + // // this.treeList = this.filterTree(value, data) + // }, + // filterTree(val, tree, newArr = []) { + // if (!(tree.length && val)) { // 如果搜索关键字为空直接返回源数据 + // return tree + // } + // for (let item of tree) { + // if (item.name.indexOf(val) > -1) { // 匹配到关键字的逻辑 + // newArr.push(item) // 如果匹配到就在数值中添加记录 + // continue // 匹配到了就退出循环了此时如果有子集也会一并带着 + // } + + // if (item.children && item.children.length) { // 如果父级节点没有匹配到就看看是否有子集,然后做递归 + // let subArr = this.filterTree(val, item.children) // 缓存递归后的子集数组 + // if (subArr && subArr.length) { // 如果子集数据有匹配到的节点 + // let node = { + // ...item, + // children: subArr + // } // 关键逻辑,缓存父节点同时将递归后的子节点作为新值 + // newArr.push(node) // 添加进数组 + // } + // } + // } + // return newArr + // }, }, watch: { range(list) { @@ -290,6 +335,19 @@ this._reTreeList(); } }, + // searchText: { + // handler(newValue, oldValue) { + // console.log(111) + // console.log(this.treeList,11) + // console.log(this.range,11) + // // let arr = JSON.parse(JSON.stringify(this.treeList)) + // this.filterTrees = this.filterTree(newValue, this.range) + // console.log(this.range,22) + // console.log(this.treeList,22) + // }, + // deep: true + + // } }, mounted() { this._initTree(); @@ -299,4 +357,4 @@ + \ No newline at end of file diff --git a/monitorMobile/pages.json b/monitorMobile/pages.json index fea8cc2..2576c46 100644 --- a/monitorMobile/pages.json +++ b/monitorMobile/pages.json @@ -41,6 +41,7 @@ { "path": "pages/earlyWarning/index", "style": { + "enablePullDownRefresh": true, "navigationStyle": "custom" } }, @@ -102,6 +103,7 @@ { "path": "pages/monitor/index", "style": { + "enablePullDownRefresh": true, "navigationBarTitleText": "监控管理" } }, diff --git a/monitorMobile/pages/earlyWarning/detail.vue b/monitorMobile/pages/earlyWarning/detail.vue index 1cae53f..009c399 100644 --- a/monitorMobile/pages/earlyWarning/detail.vue +++ b/monitorMobile/pages/earlyWarning/detail.vue @@ -1,83 +1,92 @@