|
@@ -5,7 +5,9 @@ using MiniExcelLibs;
|
|
|
using Model.Dto;
|
|
|
using Model.Entities;
|
|
|
using PLCTool.Common;
|
|
|
+using PLCTool.Events;
|
|
|
using Prism.Commands;
|
|
|
+using Prism.Events;
|
|
|
using Prism.Mvvm;
|
|
|
using Prism.Regions;
|
|
|
using Prism.Services.Dialogs;
|
|
@@ -34,11 +36,12 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly IDialogService _dialog;
|
|
|
private readonly ILogger _logger;
|
|
|
+ private readonly IEventAggregator _aggregator;
|
|
|
private List<BasDeviceWithSchModel> allDeviceAndSchList = new List<BasDeviceWithSchModel>();//所有设备,并带有测试方案
|
|
|
private List<BasDeviceWithSchModel> allDeviceList = new List<BasDeviceWithSchModel>();//所有设备
|
|
|
private List<BasDeviceWithSchModel> conditionDevices = new List<BasDeviceWithSchModel>();//符合条件的方案
|
|
|
private string selectProjectName;
|
|
|
- public DeviceTestViewModel(IRegionManager regionManager,IBasicDeviceService iBasicDeviceService, IBasicDeviceKindService iBasicDeviceKindService, IBasicProjectService iBasicProjectService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBizTestRecordService iBizTestRecordService, IBizTestRecordDtlService iBizTestRecordDtlService, IMapper mapper, IDialogService dialog, ILogger logger)
|
|
|
+ public DeviceTestViewModel(IRegionManager regionManager,IBasicDeviceService iBasicDeviceService, IBasicDeviceKindService iBasicDeviceKindService, IBasicProjectService iBasicProjectService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBizTestRecordService iBizTestRecordService, IBizTestRecordDtlService iBizTestRecordDtlService, IMapper mapper, IDialogService dialog, ILogger logger, IEventAggregator aggregator)
|
|
|
{
|
|
|
_regionManager = regionManager;
|
|
|
_iBasicDeviceService = iBasicDeviceService;
|
|
@@ -50,6 +53,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
_mapper = mapper;
|
|
|
_dialog = dialog;
|
|
|
_logger = logger;
|
|
|
+ _aggregator = aggregator;
|
|
|
QueryCommand = new DelegateCommand<object>(Query);
|
|
|
|
|
|
ExportCommand = new DelegateCommand<string>(Export);
|
|
@@ -131,7 +135,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
DialogParameters parm = new DialogParameters();
|
|
|
parm.Add("Key", schid);
|
|
|
//弹出详情对话框
|
|
|
- //弹出详情对话框
|
|
|
+ //蒙层显示
|
|
|
+ _aggregator.GetEvent<MaskEvent>().Publish(true);
|
|
|
_dialog.ShowDialog("ReadSchView", parm, async callback =>
|
|
|
{
|
|
|
if (callback.Result == ButtonResult.OK)
|
|
@@ -141,6 +146,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
}
|
|
|
|
|
|
});
|
|
|
+ //蒙层显示
|
|
|
+ _aggregator.GetEvent<MaskEvent>().Publish(false);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 返回界面
|
|
@@ -167,7 +174,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
parm.Add("Key", id);
|
|
|
parm.Add("Key2", deviceId);
|
|
|
//弹出详情对话框
|
|
|
- //弹出详情对话框
|
|
|
+ //蒙层显示
|
|
|
+ _aggregator.GetEvent<MaskEvent>().Publish(true);
|
|
|
_dialog.ShowDialog("AutoTestView", parm, async callback =>
|
|
|
{
|
|
|
if (callback.Result == ButtonResult.OK)
|
|
@@ -177,6 +185,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
}
|
|
|
|
|
|
});
|
|
|
+ //蒙层显示
|
|
|
+ _aggregator.GetEvent<MaskEvent>().Publish(false);
|
|
|
}
|
|
|
|
|
|
private void ManualTest(object obj)
|
|
@@ -190,7 +200,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
parm.Add("Key", id);
|
|
|
parm.Add("Key2", deviceId);
|
|
|
//弹出详情对话框
|
|
|
- //弹出详情对话框
|
|
|
+ //蒙层显示
|
|
|
+ _aggregator.GetEvent<MaskEvent>().Publish(true);
|
|
|
_dialog.ShowDialog("ManualTestView", parm, async callback =>
|
|
|
{
|
|
|
if (callback.Result == ButtonResult.OK)
|
|
@@ -200,6 +211,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
}
|
|
|
|
|
|
});
|
|
|
+ //蒙层显示
|
|
|
+ _aggregator.GetEvent<MaskEvent>().Publish(false);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|