92 lines
2.2 KiB
C#
92 lines
2.2 KiB
C#
using Logger;
|
|
using MahApps.Metro.Controls;
|
|
using Model;
|
|
using Model.Entity;
|
|
using Model.Models;
|
|
using NLog.Targets;
|
|
using OxyPlot;
|
|
using Service.Interface;
|
|
using System;
|
|
using System.Collections.Concurrent;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Data;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Input;
|
|
using System.Windows.Threading;
|
|
using UIShare.GlobalVariable;
|
|
using UIShare.UIViewModel;
|
|
using UIShare.ViewModelBase;
|
|
|
|
namespace ExportModule.ViewModels
|
|
{
|
|
public class ExportViewModel : NavigateViewModelBase, IRegionMemberLifetime, IDisposable
|
|
{
|
|
#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 辅助方法
|
|
|
|
|
|
#endregion
|
|
#region 生命周期
|
|
|
|
public override void OnNavigatedTo(NavigationContext navigationContext)
|
|
{
|
|
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|