diff --git a/InSituLaboratory.Assets/Images/Snipaste.png b/InSituLaboratory.Assets/Images/Snipaste.png new file mode 100644 index 0000000..ab278ae Binary files /dev/null and b/InSituLaboratory.Assets/Images/Snipaste.png differ diff --git a/InSituLaboratory.Assets/Images/海洋.jpg b/InSituLaboratory.Assets/Images/海洋.jpg new file mode 100644 index 0000000..a478f6a Binary files /dev/null and b/InSituLaboratory.Assets/Images/海洋.jpg differ diff --git a/InSituLaboratory.Assets/InSituLaboratory.Assets.csproj b/InSituLaboratory.Assets/InSituLaboratory.Assets.csproj index 8c316db..f5bde88 100644 --- a/InSituLaboratory.Assets/InSituLaboratory.Assets.csproj +++ b/InSituLaboratory.Assets/InSituLaboratory.Assets.csproj @@ -23,6 +23,8 @@ + + @@ -57,6 +59,12 @@ + + Always + + + Always + diff --git a/InSituLaboratory.Entities/SysSequentialTotal.cs b/InSituLaboratory.Entities/SysSequentialTotal.cs index 13d4dd0..4132bb0 100644 --- a/InSituLaboratory.Entities/SysSequentialTotal.cs +++ b/InSituLaboratory.Entities/SysSequentialTotal.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -70,6 +71,19 @@ namespace InSituLaboratory.Entities /// public int? IsDelete { get; set; } + + /// + /// 序号 + /// + [NotMapped] + public int? DataIdNum { get; set; } + + + /// + /// 是否已删除 + /// + [NotMapped] + public string? DeleteType { get; set; } } } diff --git a/InSituLaboratory.IService/ISysSequentialService.cs b/InSituLaboratory.IService/ISysSequentialService.cs index 80f68e3..29a100a 100644 --- a/InSituLaboratory.IService/ISysSequentialService.cs +++ b/InSituLaboratory.IService/ISysSequentialService.cs @@ -46,5 +46,16 @@ namespace InSituLaboratory.IService SysSequentialDetails GetSequentialSequenceGroup(string SequenceGroup, string Sequential, int key); + /// + /// 获取历史时序清单 + /// + /// + /// + /// + /// + /// + IEnumerable GetSysSequentialTotal(string key, int pageSize, int pageIndex, out int totalCount); + + } } diff --git a/InSituLaboratory.Service/SysSequentialService.cs b/InSituLaboratory.Service/SysSequentialService.cs index dd305f6..32429bf 100644 --- a/InSituLaboratory.Service/SysSequentialService.cs +++ b/InSituLaboratory.Service/SysSequentialService.cs @@ -20,7 +20,7 @@ namespace InSituLaboratory.Service /// public IEnumerable GetSequentials(string key) { - return this.Set().Where(m => m.Sequential == key && m.IsDelete == 0).OrderByDescending(n => n.CreateTime); + return this.Set().Where(m => m.Sequential == key && m.IsDelete == 0).OrderByDescending(n => n.CreateTime); } /// /// 获取时序子表数据 @@ -52,7 +52,7 @@ namespace InSituLaboratory.Service /// /// /// - public SysSequentialDetails GetSequentialSequenceGroup(string SequenceGroup, string Sequential,int key) + public SysSequentialDetails GetSequentialSequenceGroup(string SequenceGroup, string Sequential, int key) { var list = this.Query(m => m.SequenceGroup == SequenceGroup && m.Sequential == Sequential && m.IsDelete == 0 && m.SysSquentialID == key).ToList(); if (list.Count == 0) @@ -65,5 +65,24 @@ namespace InSituLaboratory.Service } } + + + /// + /// 查询历史时序清单 + /// + /// + /// + /// + /// + /// + public IEnumerable GetSysSequentialTotal(string key, int pageSize, int pageIndex, out int totalCount) + { + var pResult = this.QueryPage(m => string.IsNullOrEmpty(key) || m.Sequential.Contains(key) || m.SequenceGroup.Contains(key) || m.SensorID.Contains(key), pageSize, pageIndex, order => order.CreateTime.ToString(), false); + + totalCount = pResult.TotalCount; + + return pResult.DataList; + + } } } diff --git a/InSituLaboratory/App.xaml.cs b/InSituLaboratory/App.xaml.cs index 4742766..0b13a01 100644 --- a/InSituLaboratory/App.xaml.cs +++ b/InSituLaboratory/App.xaml.cs @@ -69,6 +69,7 @@ namespace InSituLaboratory containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); containerRegistry.RegisterDialog(); containerRegistry.RegisterDialog(); diff --git a/InSituLaboratory/ViewModels/Pages/History/SequentialHistoryViewModel.cs b/InSituLaboratory/ViewModels/Pages/History/SequentialHistoryViewModel.cs new file mode 100644 index 0000000..c4e6d6b --- /dev/null +++ b/InSituLaboratory/ViewModels/Pages/History/SequentialHistoryViewModel.cs @@ -0,0 +1,71 @@ +using InSituLaboratory.Controls; +using InSituLaboratory.Entities; +using InSituLaboratory.IService; +using Prism.Commands; +using Prism.Regions; +using Prism.Services.Dialogs; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace InSituLaboratory.ViewModels.Pages.History +{ + /// + /// 历史时序 + /// + public class SequentialHistoryViewModel : ViewModelBase + { + public PaginationModel PaginationModel { get; set; } = new PaginationModel(); + + IDialogService _dialogService; + ISysSequentialService _sysSequentialService; + public SequentialHistoryViewModel(IRegionManager regionManager, IDialogService dialogService, ISysSequentialService sysSequentialService) : base(regionManager) + { + PageTitle = "历史时序"; + _dialogService = dialogService; + _sysSequentialService = sysSequentialService; + + PaginationModel.NavCommand = new DelegateCommand(index => + { + PaginationModel.PageIndex = int.Parse(index.ToString()); + this.Refresh(); + }); + + Refresh(); + } + + + public ObservableCollection SequentialHistortyList { get; set; } = new ObservableCollection(); + + public override void Refresh() + { + SequentialHistortyList.Clear(); + var list = _sysSequentialService.GetSysSequentialTotal(SearchKey, PaginationModel.PageSize, PaginationModel.PageIndex, out int totalCount); + + int index = 0; + foreach (var item in list) + { + index++; + SequentialHistortyList.Add(new SysSequentialTotal + { + DataIdNum = index + (PaginationModel.PageIndex - 1) * PaginationModel.PageSize, + StartTime = item.StartTime, + EndTime = item.EndTime, + SequenceGroup = item.SequenceGroup, + SensorID = item.SensorID, + WorkTime = item.WorkTime, + DurationTime = item.DurationTime, + CreateTime = item.CreateTime, + Sequential = item.Sequential, + DeleteType = item.IsDelete == 0 ? "未删除" : "已删除", + }); + } + + // 刷新分页组件的页码 + PaginationModel.FillPageNumbers(totalCount); + } + } +} diff --git a/InSituLaboratory/ViewModels/Pages/ViewModelBase.cs b/InSituLaboratory/ViewModels/Pages/ViewModelBase.cs index d6073eb..b5faa97 100644 --- a/InSituLaboratory/ViewModels/Pages/ViewModelBase.cs +++ b/InSituLaboratory/ViewModels/Pages/ViewModelBase.cs @@ -24,26 +24,31 @@ namespace InSituLaboratory.ViewModels.Pages public DelegateCommand DeleteCommand { get; set; } - #region 时序1-5 刷新 新增/编辑 删除 + #region 时序1-5 刷新 新增/编辑 删除 下发 public DelegateCommand RefreshS1Command { get; set; } + public DelegateCommand SendS1Command { get; set; } public DelegateCommand ModifyS1Command { get; set; } public DelegateCommand DeleteS1Command { get; set; } public DelegateCommand RefreshS2Command { get; set; } + public DelegateCommand SendS2Command { get; set; } public DelegateCommand ModifyS2Command { get; set; } public DelegateCommand DeleteS2Command { get; set; } public DelegateCommand RefreshS3Command { get; set; } + public DelegateCommand SendS3Command { get; set; } public DelegateCommand ModifyS3Command { get; set; } public DelegateCommand DeleteS3Command { get; set; } public DelegateCommand RefreshS4Command { get; set; } + public DelegateCommand SendS4Command { get; set; } public DelegateCommand ModifyS4Command { get; set; } public DelegateCommand DeleteS4Command { get; set; } public DelegateCommand RefreshS5Command { get; set; } + public DelegateCommand SendS5Command { get; set; } public DelegateCommand ModifyS5Command { get; set; } public DelegateCommand DeleteS5Command { get; set; } #endregion @@ -59,25 +64,30 @@ namespace InSituLaboratory.ViewModels.Pages ModifyCommand = new DelegateCommand(DoModify); DeleteCommand = new DelegateCommand(DoDelete); - #region 时序1-5 刷新 新增/编辑 删除 + #region 时序1-5 刷新 新增/编辑 删除 下发 RefreshS1Command = new DelegateCommand(RefreshS1); + SendS1Command = new DelegateCommand(SendS1); ModifyS1Command = new DelegateCommand(DoModifyS1); DeleteS1Command = new DelegateCommand(DoDeleteS1); RefreshS2Command = new DelegateCommand(RefreshS2); + SendS2Command = new DelegateCommand(SendS2); ModifyS2Command = new DelegateCommand(DoModifyS2); DeleteS2Command = new DelegateCommand(DoDeleteS2); RefreshS3Command = new DelegateCommand(RefreshS3); + SendS3Command = new DelegateCommand(SendS3); ModifyS3Command = new DelegateCommand(DoModifyS3); DeleteS3Command = new DelegateCommand(DoDeleteS3); RefreshS4Command = new DelegateCommand(RefreshS4); + SendS4Command = new DelegateCommand(SendS4); ModifyS4Command = new DelegateCommand(DoModifyS4); DeleteS4Command = new DelegateCommand(DoDeleteS4); RefreshS5Command = new DelegateCommand(RefreshS5); + SendS5Command = new DelegateCommand(SendS5); ModifyS5Command = new DelegateCommand(DoModifyS5); DeleteS5Command = new DelegateCommand(DoDeleteS5); #endregion @@ -101,29 +111,34 @@ namespace InSituLaboratory.ViewModels.Pages private string PageName { get; set; } - #region 时序1-5 刷新 新增/编辑 删除 + #region 时序1-5 刷新 新增/编辑 删除 下发 public virtual void RefreshS1() { } + public virtual void SendS1() { } public virtual void DoModifyS1(object model) { } public virtual void DoDeleteS1(object model) { } public virtual void RefreshS2() { } + public virtual void SendS2() { } public virtual void DoModifyS2(object model) { } public virtual void DoDeleteS2(object model) { } public virtual void RefreshS3() { } + public virtual void SendS3() { } public virtual void DoModifyS3(object model) { } public virtual void DoDeleteS3(object model) { } public virtual void RefreshS4() { } + public virtual void SendS4() { } public virtual void DoModifyS4(object model) { } public virtual void DoDeleteS4(object model) { } public virtual void RefreshS5() { } + public virtual void SendS5() { } public virtual void DoModifyS5(object model) { } public virtual void DoDeleteS5(object model) { } #endregion diff --git a/InSituLaboratory/Views/LoginView.xaml b/InSituLaboratory/Views/LoginView.xaml index 8c72f31..d046dec 100644 --- a/InSituLaboratory/Views/LoginView.xaml +++ b/InSituLaboratory/Views/LoginView.xaml @@ -8,7 +8,7 @@ xmlns:c="clr-namespace:InSituLaboratory.Controls;assembly=InSituLaboratory.Controls" mc:Ignorable="d" FontFamily="{StaticResource DigitalDisplay}" - Height="400" Width="650"> + Height="380" Width="680">