曲线回读+测试报告导出前期工作
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 辅助方法
|
||||
|
||||
@@ -3,11 +3,17 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
mc:Ignorable="d"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
d:DesignHeight="1080" d:DesignWidth="1920">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Loaded">
|
||||
<i:InvokeCommandAction Command="{Binding LoadedCommand}"/>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user