曲线回读+测试报告导出前期工作
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Logger;
|
||||
using MahApps.Metro.Controls;
|
||||
using Model;
|
||||
using Model.Entity;
|
||||
using Model.Models;
|
||||
using NLog.Targets;
|
||||
@@ -26,24 +27,46 @@ namespace ExportModule.ViewModels
|
||||
{
|
||||
#region 属性
|
||||
public bool KeepAlive => true;
|
||||
|
||||
private ObservableCollection<TestReportModel> _testReportModelList = new();
|
||||
|
||||
public ObservableCollection<TestReportModel> TestReportModelList
|
||||
{
|
||||
get { return _testReportModelList; }
|
||||
set { SetProperty(ref _testReportModelList, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 命令
|
||||
|
||||
#endregion
|
||||
|
||||
public ICommand LoadedCommand { get; set; }
|
||||
#region 私有字段
|
||||
|
||||
ITestReportService _testReportService { get; set; }
|
||||
#endregion
|
||||
public ExportViewModel(IContainerProvider containerProvider) : base(containerProvider)
|
||||
{
|
||||
|
||||
_testReportService = containerProvider.Resolve<ITestReportService>();
|
||||
LoadedCommand = new AsyncDelegateCommand(OnLoad);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 命令处理
|
||||
|
||||
|
||||
|
||||
private async Task OnLoad()
|
||||
{
|
||||
var result=await _testReportService.GetFilterList();
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
IList<TestReportModel> reportList = result.Data;
|
||||
TestReportModelList = new ObservableCollection<TestReportModel>(reportList);
|
||||
}
|
||||
else
|
||||
{
|
||||
TestReportModelList = new();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 辅助方法
|
||||
|
||||
Reference in New Issue
Block a user