|
@@ -38,8 +38,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
private int testStatus = 0; //测试状态
|
|
|
private int testResult = 0; //测试结果
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ private string passPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Images", "Pass.png");
|
|
|
+ private string noPassPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Images", "NoPass.png");
|
|
|
public TestResultDetailViewModel(IDialogService dialog, IEventAggregator aggregator, IOptionConfigService optionConfigService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBasicPlcTestSchemeDtlService basicPlcTestSchemeDtlService, IBizTestRecordService iBizTestRecordService, IBizTestRecordDtlService iBizTestRecordDtlService, IMapper mapper)
|
|
|
{
|
|
|
_dialog = dialog;
|
|
@@ -99,7 +99,18 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
string itemName= _basicPlcTestSchemeDtlService.Find((int)dtlId)?.item_name;
|
|
|
if(!String.IsNullOrEmpty(itemName))
|
|
|
{
|
|
|
- SchItems.Add(itemName);
|
|
|
+
|
|
|
+ //在左侧listbox中添加测试项
|
|
|
+ //查找测试结果
|
|
|
+ int result = (int)_iBizTestRecordDtlService.Find((int)record.record_dtl_id)?.test_result;
|
|
|
+
|
|
|
+ SchItems.Add(new ImageAndItemModel()
|
|
|
+ {
|
|
|
+
|
|
|
+ ImgSource = result == 1 ? passPath : noPassPath,
|
|
|
+ ItemName = itemName
|
|
|
+ });
|
|
|
+
|
|
|
recordNotNulls.Add(record);
|
|
|
//在集合中添加满足条件的测试结果
|
|
|
conditionRecordList.Add(new BizTestRecordDtlDto()
|
|
@@ -112,6 +123,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
int recordDtlId = Convert.ToInt32((long)recordNotNulls?.First()?.record_dtl_id);
|
|
|
//显示
|
|
|
DisplayDetail(schDtlId, recordDtlId);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -564,8 +576,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
}
|
|
|
|
|
|
//所有测试项列表
|
|
|
- private List<string> schItems = new List<string>();
|
|
|
- public List<string> SchItems
|
|
|
+ private List<ImageAndItemModel> schItems = new List<ImageAndItemModel>();
|
|
|
+ public List<ImageAndItemModel> SchItems
|
|
|
{
|
|
|
get { return schItems; }
|
|
|
set { schItems = value; RaisePropertyChanged(); }
|
|
@@ -593,4 +605,10 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ public class ImageAndItemModel
|
|
|
+ {
|
|
|
+ public string ImgSource { get; set; }
|
|
|
+ public string ItemName { get; set; }
|
|
|
+ }
|
|
|
}
|