Browse Source

修改测试结果查询

ltwork 1 year ago
parent
commit
90906d8428

+ 2 - 2
BlankApp1/BlankApp1/Controls/Resources/DatagridStyle.xaml

@@ -52,8 +52,8 @@
         <Style.Triggers>
             <Trigger Property="IsSelected" Value="true">
                 <Setter Property="Background" Value="White"/>
-                <Setter Property="BorderThickness" Value="1"/>
-                <Setter Property="BorderBrush" Value="#8596dc"/>
+                <Setter Property="BorderThickness" Value="2"/>
+                <Setter Property="BorderBrush" Value="#409EFF"/>
             </Trigger>
             <!--隔行换色-->
             <Trigger Property="AlternationIndex" Value="0" >

+ 72 - 29
BlankApp1/BlankApp1/ViewModels/BusinessManageViewModel/ResultQueryViewModel.cs

@@ -232,14 +232,18 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
                 var deviceMsg = _iBasicDeviceService.Find(((int)deviceId));
                 if(deviceMsg != null)
                 {
+                    string deviceKind = _iBasicDeviceKindService.Find((int)deviceMsg.device_kind_id)?.devicekind_name;
+                    string projectName = _iBasicProjectService.Find((int)deviceMsg.project_id)?.project_name;
+                    //记录设备下的方案通过个数
+                    int deviceCountResult = 0;
+                    string deviceTestResult = string.Empty;
                     //查找哦记录有的方案
-
+                   
                     var recordMsgs=_iBizTestRecordService.FindRecordByDeviceId(deviceId);
                     foreach ( var sch in recordMsgs)
                     {
-                        string deviceKindName = _iBasicDeviceKindService.Find((int)deviceMsg.device_kind_id)?.devicekind_name;
-                        string projectName = _iBasicProjectService.Find((int)deviceMsg.project_id)?.project_name;
-                        long schId=(long)_basicPlcTestSchemeService.FindByNameAndType(sch.scheme_name, deviceKindName)?.scheme_id;
+                   
+                        long schId=(long)_basicPlcTestSchemeService.FindByNameAndType(sch.scheme_name, deviceKind)?.scheme_id;
                         //计算测试结果
                         string testResult = string.Empty;
                         int countResult = 0;
@@ -273,34 +277,73 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
                         }
 
                         
-                        allDeviceList.Add(new DeviceDtlWithResultModel()
-                        {
-                            RecordId = sch.record_id,
-                            DeviceId = deviceMsg.device_id,
-                            DeviceNo = deviceMsg.device_no,
-                            DeviceName = deviceMsg.device_name,
-                            DeviceKindName = deviceKindName,
-                            ProjectName = projectName,
-                            SchemeName = sch.scheme_name,
-                            SchemeId= schId,
-                            StartTestTime = sch.start_test_time.Value,
-                            TestResult=testResult
-                        }); 
-                        conditionDevices.Add(new DeviceDtlWithResultModel()
+                        //allDeviceList.Add(new DeviceDtlWithResultModel()
+                        //{
+                        //    RecordId = sch.record_id,
+                        //    DeviceId = deviceMsg.device_id,
+                        //    DeviceNo = deviceMsg.device_no,
+                        //    DeviceName = deviceMsg.device_name,
+                        //    DeviceKindName = deviceKindName,
+                        //    ProjectName = projectName,
+                        //    SchemeName = sch.scheme_name,
+                        //    SchemeId= schId,
+                        //    StartTestTime = sch.start_test_time.Value,
+                        //    TestResult=testResult
+                        //}); 
+                        //conditionDevices.Add(new DeviceDtlWithResultModel()
+                        //{
+                        //    RecordId = sch.record_id,
+                        //    DeviceId = deviceMsg.device_id,
+                        //    DeviceNo = deviceMsg.device_no,
+                        //    DeviceName = deviceMsg.device_name,
+                        //    DeviceKindName = deviceKindName,
+                        //    ProjectName = projectName,
+                        //    SchemeName = sch.scheme_name,
+                        //    SchemeId = schId,
+                        //    StartTestTime = sch.start_test_time.Value,
+                        //    TestResult = testResult
+                        //});
+                        //计算这个设备是否通过
+                        if(testResult == "通过")
                         {
-                            RecordId = sch.record_id,
-                            DeviceId = deviceMsg.device_id,
-                            DeviceNo = deviceMsg.device_no,
-                            DeviceName = deviceMsg.device_name,
-                            DeviceKindName = deviceKindName,
-                            ProjectName = projectName,
-                            SchemeName = sch.scheme_name,
-                            SchemeId = schId,
-                            StartTestTime = sch.start_test_time.Value,
-                            TestResult = testResult
-                        });
+                            deviceCountResult++;
+                        }
+
+
+                       
+
                     }
+                    //计算这个设备是否所有的方案都通过
+                    if ((deviceCountResult!=0)&&(deviceCountResult == recordMsgs.Count))
+                    {
+                        deviceTestResult = "通过";
+                    }
+                    else
+                    {
+                        deviceTestResult = "不通过";
+                    }
+                    //这里不添加方案名称
+                    allDeviceList.Add(new DeviceDtlWithResultModel()
+                    {
+                   
+                        DeviceId = deviceMsg.device_id,
+                        DeviceNo = deviceMsg.device_no,
+                        DeviceName = deviceMsg.device_name,
+                        DeviceKindName = deviceKindName,
+                        ProjectName = projectName,
+                        TestResult = deviceTestResult
+                    });
+                    conditionDevices.Add(new DeviceDtlWithResultModel()
+                    {
                   
+                        DeviceId = deviceMsg.device_id,
+                        DeviceNo = deviceMsg.device_no,
+                        DeviceName = deviceMsg.device_name,
+                        DeviceKindName = deviceKindName,
+                        ProjectName = projectName,
+    
+                        TestResult = deviceTestResult
+                    });
                 }
 
             }

+ 153 - 46
BlankApp1/BlankApp1/ViewModels/BusinessManageViewModel/RetryTestViewModel.cs

@@ -25,6 +25,10 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         private readonly IDialogService _dialog;
         private readonly IEventAggregator _aggregator;
         private readonly IOptionConfigService _optionConfigService;
+        private readonly IBasicDeviceService _iBasicDeviceService;
+        private readonly IBasicDeviceKindService _iBasicDeviceKindService;
+        private readonly IBasicProjectService _iBasicProjectService;
+        private readonly IBasicPlcTestSchemeDtlService _iBasicPlcTestSchemeDtlService;
         private readonly IBasicPlcTestSchemeService _basicPlcTestSchemeService;
         private readonly IBasicPlcTestSchemeDtlService _basicPlcTestSchemeDtlService;
         private readonly IBizTestRecordService _iBizTestRecordService;
@@ -37,18 +41,22 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         private DateTime endTime = DateTime.Now;
         private int testStatus = 0;  //测试状态 
         private int testResult = 0; //测试结果
-        private long schId = 0; //方案ID
+        private long globalSchID = 0; //方案ID
         private long globalSchDetailId = 0; //测试方案明细ID
         private long globalDeviceId = 0; //设备ID
         private BizTestRecordDtlDto bizTestRecordDtlDto = new BizTestRecordDtlDto(); //测试方案明细表
         private const string TestMode = "重新测试";
 
         private int delayTime = 20;
-        public RetryTestViewModel(IDialogService dialog, IEventAggregator aggregator, IOptionConfigService optionConfigService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBasicPlcTestSchemeDtlService basicPlcTestSchemeDtlService, IBizTestRecordService iBizTestRecordService, IBizTestRecordDtlService iBizTestRecordDtlService, IMapper mapper, ILogger logger)
+        public RetryTestViewModel(IDialogService dialog, IEventAggregator aggregator, IOptionConfigService optionConfigService, IBasicDeviceService iBasicDeviceService, IBasicDeviceKindService iBasicDeviceKindService, IBasicProjectService iBasicProjectService, IBasicPlcTestSchemeDtlService iBasicPlcTestSchemeDtlService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBasicPlcTestSchemeDtlService basicPlcTestSchemeDtlService, IBizTestRecordService iBizTestRecordService, IBizTestRecordDtlService iBizTestRecordDtlService, IMapper mapper, ILogger logger)
         {
             _dialog = dialog;
             _aggregator = aggregator;
             _optionConfigService = optionConfigService;
+            _iBasicDeviceService = iBasicDeviceService;
+            _iBasicDeviceKindService = iBasicDeviceKindService;
+            _iBasicProjectService = iBasicProjectService;
+            _iBasicPlcTestSchemeDtlService = iBasicPlcTestSchemeDtlService;
             _basicPlcTestSchemeService = basicPlcTestSchemeService;
             _basicPlcTestSchemeDtlService = basicPlcTestSchemeDtlService;
             _iBizTestRecordDtlService = iBizTestRecordDtlService;
@@ -61,6 +69,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             NextCommand = new DelegateCommand<object>(Next);
             DoneCommand = new DelegateCommand<object>(Done);
             ItemChangeCommand = new DelegateCommand(ItemChange);
+            DgSelectChangeCommand = new DelegateCommand<object>(DgSelect);
             BeforeConList = new ObservableCollection<BasPlcItemConfigDto>();
             InConList = new ObservableCollection<BasPlcItemConfigDto>();
             OutConList = new ObservableCollection<BasPlcItemConfigDto>();
@@ -72,7 +81,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         /// </summary>
         private void ItemChange()
         {
-            var findDtlMsg = _basicPlcTestSchemeDtlService.FindAllBySchId(schId)?.FirstOrDefault(X => X.item_name == SelectItem);
+            var findDtlMsg = _basicPlcTestSchemeDtlService.FindAllBySchId(globalSchID)?.FirstOrDefault(X => X.item_name == SelectItem);
             if (findDtlMsg != null)
             {
                 int id = Convert.ToInt32(findDtlMsg.scheme_dtl_id);
@@ -109,42 +118,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             {
                 foreach (var item in getMsg)
                 {
-                    //测试方案号
-                    schId = item;
-                    var schDtls = _basicPlcTestSchemeDtlService.FindAllBySchId(schId).OrderBy(x => x.scheme_dtl_id).ToList(); ;
-                    //不合格项目集合
-                    List<bas_plc_test_scheme_dtl> reTrysList = new List<bas_plc_test_scheme_dtl>();
-                    //查找不合格项目
-                    foreach (var sch in schDtls)
-                    {
-                      
-                        long dtlId = sch.scheme_dtl_id;
-                        var dtlResult = _iBizTestRecordDtlService.FindRecordDetailBySchDtlID(dtlId)?.OrderByDescending(x => x.start_test_time)?.ToArray();
-                        if((dtlResult!=null)&&(dtlResult.Length!=0))
-                        {
-                            //时间最新的结果 ,不通过
-                            if (dtlResult[0].test_result==0)
-                            {
-                                SchItems.Add(sch.item_name);
-
-                                reTrysList.Add(sch);
-                            }
-
-
-                        }
-                       
-                    }
-                    //默认显示第一个测试项的信息
-                    if (reTrysList.Count != 0)
-                    {
-                        int id = Convert.ToInt32(reTrysList[0].scheme_dtl_id);
-                        globalSchDetailId = id;
-                        // 根据 测试方案明细主键ID 查找测试方案id 及方案名和设备名
-                        GetDetailInfo(id);
-                        SelectItemIndex = 0;
-                    }
-
-
+                 
                 }
 
             }
@@ -155,6 +129,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
                 foreach (var item in getDes)
                 {
                     globalDeviceId = item;
+                    GetSchByDeviceID(globalDeviceId);
                 }
             }
         }
@@ -171,7 +146,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             if (findresult != null)
             {
                 //根据方案id 在方案表中查找方案名 设备名
-                schId = findresult.SchemeId.Value; //方案id,方便下一步查找
+                //globalSchID = findresult.SchemeId.Value; //方案id,方便下一步查找
                 int intSchId = Convert.ToInt32(findresult.SchemeId);
 
                 var findSch = _basicPlcTestSchemeService.Find(intSchId);
@@ -255,6 +230,133 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
 
         #region 私有发方法
         /// <summary>
+        /// 获取不合格项
+        /// </summary>
+        /// <param name="schId"></param>
+        private void GetNoPass(long schId)
+        {
+            SchItems.Clear();
+                //测试方案号
+           var schDtls = _basicPlcTestSchemeDtlService.FindAllBySchId(schId).OrderBy(x => x.scheme_dtl_id).ToList(); ;
+            //不合格项目集合
+            List<bas_plc_test_scheme_dtl> reTrysList = new List<bas_plc_test_scheme_dtl>();
+            //查找不合格项目
+            foreach (var sch in schDtls)
+            {
+
+                long dtlId = sch.scheme_dtl_id;
+                var dtlResult = _iBizTestRecordDtlService.FindRecordDetailBySchDtlID(dtlId)?.OrderByDescending(x => x.start_test_time)?.ToArray();
+                if ((dtlResult != null) && (dtlResult.Length != 0))
+                {
+                    //时间最新的结果 ,不通过
+                    if (dtlResult[0].test_result == 0)
+                    {
+                        SchItems.Add(sch.item_name);
+
+                        reTrysList.Add(sch);
+                    }
+
+
+                }
+
+            }
+            //默认显示第一个测试项的信息
+            if (reTrysList.Count != 0)
+            {
+                int id = Convert.ToInt32(reTrysList[0].scheme_dtl_id);
+                globalSchDetailId = id;
+                // 根据 测试方案明细主键ID 查找测试方案id 及方案名和设备名
+                GetDetailInfo(id);
+                SelectItemIndex = 0;
+            }
+
+
+            
+        }
+        /// <summary>
+        /// datagrid变化
+        /// </summary>
+        /// <param name="obj"></param>
+        private void DgSelect(object obj)
+        {
+            DeviceDtlWithResultModel dtlMsg = (DeviceDtlWithResultModel)obj;
+            GetNoPass(dtlMsg.SchemeId);
+            globalSchID=dtlMsg.SchemeId;
+        }
+        /// <summary>
+        /// 根据设备id获取所有测试方案
+        /// </summary>
+        /// <param name="deviceId"></param>
+        private void GetSchByDeviceID(long deviceId)
+        {
+            DeviceResultItemList.Clear();
+            var deviceMsg = _iBasicDeviceService.Find(((int)deviceId));
+            if (deviceMsg != null)
+            {
+                string deviceKindName = _iBasicDeviceKindService.Find((int)deviceMsg.device_kind_id)?.devicekind_name;
+                string projectName = _iBasicProjectService.Find((int)deviceMsg.project_id)?.project_name;
+                //记录设备下的方案通过个数
+                int deviceCountResult = 0;
+                string deviceTestResult = string.Empty;
+                //查找哦记录有的方案
+
+                var recordMsgs = _iBizTestRecordService.FindRecordByDeviceId(deviceId);
+                foreach (var sch in recordMsgs)
+                {
+
+                    long schId = (long)_basicPlcTestSchemeService.FindByNameAndType(sch.scheme_name, deviceKindName)?.scheme_id;
+                    //计算测试结果
+                    string testResult = string.Empty;
+                    int countResult = 0;
+                    var records = _iBizTestRecordDtlService.FindRecordDetailByRecordID(sch.record_id);
+                    //
+                    var schDtls = _iBasicPlcTestSchemeDtlService.FindAllBySchId(schId);
+                    //循环所有测试项,有一个不合格,则整个测试方案不合格
+                    foreach (var dtl in schDtls)
+                    {
+                        //选取开始时间最大的一个数据,查看测试结果
+                        long schDtId = dtl.scheme_dtl_id;
+                        var findRecords = records.FindAll(x => x.scheme_dtl_id == schDtId).OrderByDescending(x => x.start_test_time).ToArray();
+                        if (findRecords.Length > 0)
+                        {
+                            int result = (int)findRecords[0]?.test_result.Value;
+                            if (result == 0)
+                            {
+                                testResult = "不通过";
+                                break;
+                            }
+                            else
+                            {
+                                countResult++;
+                            }
+                        }
+                    }
+                    //测试结果
+                    if (countResult == schDtls.Count)
+                    {
+                        testResult = "通过";
+                    }
+
+
+                    DeviceResultItemList.Add(new DeviceDtlWithResultModel()
+                    {
+                        RecordId = sch.record_id,
+                        DeviceId = deviceMsg.device_id,
+                        DeviceNo = deviceMsg.device_no,
+                        DeviceName = deviceMsg.device_name,
+                        DeviceKindName = deviceKindName,
+                        ProjectName = projectName,
+                        SchemeName = sch.scheme_name,
+                        SchemeId = schId,
+                        StartTestTime = sch.start_test_time.Value,
+                        TestResult = testResult
+                    });
+
+                }
+
+            }
+        }
+        /// <summary>
         /// 增加或更新测试记录
         /// </summary>
         private void AddTestRecord()
@@ -493,7 +595,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         {
             StepIndex = 0;
             ///查找方案下的所有方案明细,并排序,
-            var basicSchDtls = _basicPlcTestSchemeDtlService.FindAllBySchId(schId)?.OrderBy(x => x.scheme_dtl_id);
+            var basicSchDtls = _basicPlcTestSchemeDtlService.FindAllBySchId(globalSchID)?.OrderBy(x => x.scheme_dtl_id);
             foreach (var item in basicSchDtls)
             {
                 //在测试结果明细中查看
@@ -523,7 +625,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         {
             StepIndex = 0;
             ///查找方案下的所有方案明细,并排序,
-            var basicSchDtls = _basicPlcTestSchemeDtlService.FindAllBySchId(schId)?.OrderByDescending(x => x.scheme_dtl_id);
+            var basicSchDtls = _basicPlcTestSchemeDtlService.FindAllBySchId(globalSchID)?.OrderByDescending(x => x.scheme_dtl_id);
             foreach (var item in basicSchDtls)
             {
                 //在测试结果明细中查看
@@ -1218,7 +1320,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
 
         public DelegateCommand<object> DoneCommand { set; get; }
         public DelegateCommand ItemChangeCommand { set; get; }
-
+        public DelegateCommand<object> DgSelectChangeCommand { set; get; }
         #endregion
         #region 变量绑定
         /// <summary>
@@ -1417,8 +1519,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             set { startEnalbe = value; RaisePropertyChanged(); }
         }
         //所有测试项列表
-        private List<string> schItems = new List<string>();
-        public List<string> SchItems
+        private ObservableCollection<string> schItems = new ObservableCollection<string>();
+        public ObservableCollection<string> SchItems
         {
             get { return schItems; }
             set { schItems = value; RaisePropertyChanged(); }
@@ -1437,7 +1539,12 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             get { return selectItemIndex; }
             set { selectItemIndex = value; RaisePropertyChanged(); }
         }
-
+        private ObservableCollection<DeviceDtlWithResultModel> deviceResultItemList = new ObservableCollection<DeviceDtlWithResultModel>();
+        public ObservableCollection<DeviceDtlWithResultModel> DeviceResultItemList
+        {
+            get { return deviceResultItemList; }
+            set { deviceResultItemList = value; RaisePropertyChanged(); }
+        }
         #endregion
 
     }

+ 154 - 47
BlankApp1/BlankApp1/ViewModels/BusinessManageViewModel/TestResultDetailViewModel.cs

@@ -25,6 +25,10 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         private readonly IDialogService _dialog;
         private readonly IEventAggregator _aggregator;
         private readonly IOptionConfigService _optionConfigService;
+        private readonly IBasicDeviceService _iBasicDeviceService;
+        private readonly IBasicDeviceKindService _iBasicDeviceKindService;
+        private readonly IBasicProjectService _iBasicProjectService;
+        private readonly IBasicPlcTestSchemeDtlService _iBasicPlcTestSchemeDtlService;
         private readonly IBasicPlcTestSchemeService _basicPlcTestSchemeService;
         private readonly IBasicPlcTestSchemeDtlService _basicPlcTestSchemeDtlService;
         private readonly IBizTestRecordService _iBizTestRecordService;
@@ -40,10 +44,14 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
 
         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)
+        public TestResultDetailViewModel(IDialogService dialog, IEventAggregator aggregator, IBasicDeviceService iBasicDeviceService, IBasicDeviceKindService iBasicDeviceKindService, IBasicProjectService iBasicProjectService, IBasicPlcTestSchemeDtlService iBasicPlcTestSchemeDtlService, IOptionConfigService optionConfigService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBasicPlcTestSchemeDtlService basicPlcTestSchemeDtlService, IBizTestRecordService iBizTestRecordService, IBizTestRecordDtlService iBizTestRecordDtlService, IMapper mapper)
         {
             _dialog = dialog;
             _aggregator = aggregator;
+            _iBasicDeviceService = iBasicDeviceService;
+            _iBasicDeviceKindService = iBasicDeviceKindService;
+            _iBasicProjectService = iBasicProjectService;
+            _iBasicPlcTestSchemeDtlService = iBasicPlcTestSchemeDtlService;
             _optionConfigService = optionConfigService;
             _basicPlcTestSchemeService = basicPlcTestSchemeService;
             _basicPlcTestSchemeDtlService = basicPlcTestSchemeDtlService;
@@ -56,11 +64,10 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             InConList = new ObservableCollection<BasPlcItemConfigDto>();
             OutConList = new ObservableCollection<BasPlcItemConfigDto>();
             ItemChangeCommand = new DelegateCommand(ItemChange);
+            DgSelectChangeCommand = new DelegateCommand<object>(DgSelect);
             GetConfigOption();
         }
 
-     
-
 
         #region idialog接口实现
         public string Title { set; get; } = "测试结果查询";
@@ -90,55 +97,148 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
                 {
                     foreach (var item in getMsg)
                     {
-                        long recordId = item;
-                        var records = _iBizTestRecordDtlService.FindRecordDetailByRecordID(recordId).OrderBy(x => x.record_dtl_id).ToList() ;
-                        List<biz_test_record_dtl> recordNotNulls = new List<biz_test_record_dtl>(); //测试项名称不是空的集合
-                        foreach (var record in records)
+                        long deviceId = item;
+                        GetSchByDeviceID(deviceId);
+                    }
+                }
+                catch(Exception ex)
+                {
+                    _logger.LogError(ex.ToString());
+                }
+                
+
+            }
+        }
+
+        private void DgSelect(object obj)
+        {
+            DeviceDtlWithResultModel dtlMsg = (DeviceDtlWithResultModel)obj;
+            GetDetailsByRecordId(dtlMsg.RecordId);
+        }
+        /// <summary>
+        /// 获取测试项的详细测试信息
+        /// </summary>
+        /// <param name="recordId"></param>
+        private void GetDetailsByRecordId(long recordId)
+        {
+            SchItems.Clear();
+            conditionRecordList.Clear();
+                var records = _iBizTestRecordDtlService.FindRecordDetailByRecordID(recordId).OrderBy(x => x.record_dtl_id).ToList();
+                List<biz_test_record_dtl> recordNotNulls = new List<biz_test_record_dtl>(); //测试项名称不是空的集合
+                foreach (var record in records)
+                {
+                    long dtlId = record.scheme_dtl_id;
+                    string itemName = _basicPlcTestSchemeDtlService.Find((int)dtlId)?.item_name;
+                    if (!String.IsNullOrEmpty(itemName))
+                    {
+
+                        //在左侧listbox中添加测试项
+                        //查找测试结果
+                        int result = (int)_iBizTestRecordDtlService.Find((int)record.record_dtl_id)?.test_result;
+
+                        SchItems.Add(new ImageAndItemModel()
                         {
-                            long dtlId = record.scheme_dtl_id;
-                            string itemName= _basicPlcTestSchemeDtlService.Find((int)dtlId)?.item_name;
-                            if(!String.IsNullOrEmpty(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()
-                                {
-                                    RecordDtlId = record.record_dtl_id,
-                                    SchemeDtlId = record.scheme_dtl_id,
-                                });
-                                //默认显示第一个测试项
-                                int schDtlId = Convert.ToInt32((long)recordNotNulls?.First()?.scheme_dtl_id);
-                                int recordDtlId = Convert.ToInt32((long)recordNotNulls?.First()?.record_dtl_id);
-                                //显示
-                                DisplayDetail(schDtlId, recordDtlId);
+                            ImgSource = result == 1 ? passPath : noPassPath,
+                            ItemName = itemName
+                        });
 
-                            }
-                            
-                         
-                        }
+                        recordNotNulls.Add(record);
+                        //在集合中添加满足条件的测试结果
+                        conditionRecordList.Add(new BizTestRecordDtlDto()
+                        {
+                            RecordDtlId = record.record_dtl_id,
+                            SchemeDtlId = record.scheme_dtl_id,
+                        });
+                        //默认显示第一个测试项
+                        int schDtlId = Convert.ToInt32((long)recordNotNulls?.First()?.scheme_dtl_id);
+                        int recordDtlId = Convert.ToInt32((long)recordNotNulls?.First()?.record_dtl_id);
+                        //显示
+                        DisplayDetail(schDtlId, recordDtlId);
 
-              
-                       
                     }
+
+
                 }
-                catch(Exception ex)
+
+
+
+            
+        }
+
+
+        private void GetSchByDeviceID(long deviceId)
+        {
+            DeviceResultItemList.Clear();
+            var deviceMsg = _iBasicDeviceService.Find(((int)deviceId));
+            if (deviceMsg != null)
+            {
+                string deviceKindName = _iBasicDeviceKindService.Find((int)deviceMsg.device_kind_id)?.devicekind_name;
+                string projectName = _iBasicProjectService.Find((int)deviceMsg.project_id)?.project_name;
+                //记录设备下的方案通过个数
+                int deviceCountResult = 0;
+                string deviceTestResult = string.Empty;
+                //查找哦记录有的方案
+
+                var recordMsgs = _iBizTestRecordService.FindRecordByDeviceId(deviceId);
+                foreach (var sch in recordMsgs)
                 {
-                    _logger.LogError(ex.ToString());
+
+                    long schId = (long)_basicPlcTestSchemeService.FindByNameAndType(sch.scheme_name, deviceKindName)?.scheme_id;
+                    //计算测试结果
+                    string testResult = string.Empty;
+                    int countResult = 0;
+                    var records = _iBizTestRecordDtlService.FindRecordDetailByRecordID(sch.record_id);
+                    //
+                    var schDtls = _iBasicPlcTestSchemeDtlService.FindAllBySchId(schId);
+                    //循环所有测试项,有一个不合格,则整个测试方案不合格
+                    foreach (var dtl in schDtls)
+                    {
+                        //选取开始时间最大的一个数据,查看测试结果
+                        long schDtId = dtl.scheme_dtl_id;
+                        var findRecords = records.FindAll(x => x.scheme_dtl_id == schDtId).OrderByDescending(x => x.start_test_time).ToArray();
+                        if (findRecords.Length > 0)
+                        {
+                            int result = (int)findRecords[0]?.test_result.Value;
+                            if (result == 0)
+                            {
+                                testResult = "不通过";
+                                break;
+                            }
+                            else
+                            {
+                                countResult++;
+                            }
+                        }
+                    }
+                    //测试结果
+                    if (countResult == schDtls.Count)
+                    {
+                        testResult = "通过";
+                    }
+
+
+                    DeviceResultItemList.Add(new DeviceDtlWithResultModel()
+                    {
+                        RecordId = sch.record_id,
+                        DeviceId = deviceMsg.device_id,
+                        DeviceNo = deviceMsg.device_no,
+                        DeviceName = deviceMsg.device_name,
+                        DeviceKindName = deviceKindName,
+                        ProjectName = projectName,
+                        SchemeName = sch.scheme_name,
+                        SchemeId = schId,
+                        StartTestTime = sch.start_test_time.Value,
+                        TestResult = testResult
+                    });
+
+
+
+
+
+
                 }
                 
-
             }
         }
         /// <summary>
@@ -272,7 +372,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         private void ItemChange()
         {
             //获取选择的recordid
-            if(SelectIndex<conditionRecordList.Count)
+            if((SelectIndex!=-1)&&(SelectIndex < conditionRecordList.Count))
             {
                 int schDtlId = (int)conditionRecordList[SelectIndex].SchemeDtlId;
                 int recordDtlId = (int)conditionRecordList[SelectIndex].RecordDtlId;
@@ -576,8 +676,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         }
 
         //所有测试项列表
-        private List<ImageAndItemModel> schItems = new List<ImageAndItemModel>();
-        public List<ImageAndItemModel> SchItems
+        private ObservableCollection<ImageAndItemModel> schItems = new ObservableCollection<ImageAndItemModel>();
+        public ObservableCollection<ImageAndItemModel> SchItems
         {
             get { return schItems; }
             set { schItems = value; RaisePropertyChanged(); }
@@ -598,10 +698,17 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             get { return testDtlResult; }
             set { testDtlResult = value; RaisePropertyChanged(); }
         }
-        
+        private ObservableCollection<DeviceDtlWithResultModel> deviceResultItemList = new ObservableCollection<DeviceDtlWithResultModel>();
+        public ObservableCollection<DeviceDtlWithResultModel> DeviceResultItemList
+        {
+            get { return deviceResultItemList; }
+            set { deviceResultItemList = value; RaisePropertyChanged(); }
+        }
         #endregion
         #region 命令绑定
         public DelegateCommand ItemChangeCommand { set; get; }
+        public DelegateCommand<object> DgSelectChangeCommand { set; get; }
+        
         #endregion
 
     }

+ 2 - 3
BlankApp1/BlankApp1/Views/BusinessManageView/ResultQueryView.xaml

@@ -76,12 +76,11 @@
        ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}"  RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}"  AlternationCount="2"
       ItemsSource="{Binding DeviceResultItemList}" IsReadOnly="True" Padding="0"  >
             <DataGrid.Columns >
-                <DataGridTextColumn Header="序号" Width="50" Binding="{Binding DeviceId}" CellStyle="{StaticResource MyDataGridCellStyle}" />
+                <!--<DataGridTextColumn Header="序号" Width="50" Binding="{Binding DeviceId}" CellStyle="{StaticResource MyDataGridCellStyle}" />-->
                 <DataGridTextColumn Header="设备编号" Binding="{Binding DeviceNo}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
                 <DataGridTextColumn Header="设备名称" Binding="{Binding DeviceName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
                 <DataGridTextColumn Header="项目名称" Binding="{Binding ProjectName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
                 <DataGridTextColumn Header="设备类型" Binding="{Binding DeviceKindName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                <DataGridTextColumn Header="测试方案名称" Binding="{Binding SchemeName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
                
                 <DataGridTextColumn Header="测试时间" Width="150" Binding="{Binding StartTestTime,StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
                 <DataGridTextColumn Header="测试结果" Binding="{Binding TestResult}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
@@ -90,7 +89,7 @@
                         <DataTemplate>
                             <UniformGrid Columns="3">
                                 <Button  Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
-                       Command="{Binding DataContext.CheckDetailCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding RecordId}"  Cursor="Hand" Margin="0,0,5,0" >
+                       Command="{Binding DataContext.CheckDetailCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding DeviceId}"  Cursor="Hand" Margin="0,0,5,0" >
                                     
                                     <StackPanel Orientation="Horizontal">
                                         <TextBlock  Text="查看详情" VerticalAlignment="Center" Foreground="Blue"/>

+ 289 - 257
BlankApp1/BlankApp1/Views/BusinessManageView/RetryTestView.xaml

@@ -9,7 +9,7 @@
              xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
              xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
              BorderBrush="#CBCBCB" BorderThickness="1"
-             Height="600" Width="1100" >
+             Height="800" Width="1100" >
 
     <UserControl.Resources>
         <Style TargetType="TextBlock" x:Key="textBlockStyle">
@@ -32,288 +32,320 @@
     </UserControl.Resources>
 
     <Grid>
-        <Grid.ColumnDefinitions>
-            <ColumnDefinition Width="90"/>
-            <ColumnDefinition/>
-        </Grid.ColumnDefinitions>
-        <DockPanel Grid.Column="0" LastChildFill="True">
-            <TextBlock Text="测试项列表:"  Style="{StaticResource NormalTextBlockStyle}" Margin="5,0,5,0" DockPanel.Dock="Top"/>
-            <ListBox ItemsSource="{Binding SchItems}" SelectedValue="{Binding SelectItem}" SelectedIndex="{Binding SelectItemIndex}" >
-
+        <Grid.RowDefinitions>
+            <RowDefinition Height="200"/>
+            <RowDefinition/>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0">
+            <DataGrid  Grid.Row="2"  ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False"  SelectionUnit="FullRow" SelectionMode="Single"   RowHeaderWidth="0"
+ ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}"  RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}"  AlternationCount="2"
+ItemsSource="{Binding DeviceResultItemList}" IsReadOnly="True" Padding="0"  >
                 <b:Interaction.Triggers>
                     <b:EventTrigger EventName="SelectionChanged">
-                        <b:InvokeCommandAction Command="{Binding ItemChangeCommand}"/>
+                        <b:InvokeCommandAction  Command="{Binding DataContext.DgSelectChangeCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" 
+                                                CommandParameter="{Binding Path=SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"/>
                     </b:EventTrigger>
                 </b:Interaction.Triggers>
-            </ListBox>
-
-        </DockPanel>
-        <Border Grid.Column="0"  BorderBrush="#CBCBCB" BorderThickness="1,0" />
-        <Grid Grid.Column="1">
-            <Grid.RowDefinitions>
-
-                <RowDefinition Height="50" />
-                <RowDefinition />
-                <RowDefinition />
-                <RowDefinition />
-                <RowDefinition Height="50" />
-                <RowDefinition Height="50" />
-            </Grid.RowDefinitions>
-
-            <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="10">
-                <StackPanel Orientation="Horizontal">
-                    <TextBlock Text="测试方案名称:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
-                    <TextBox  Height="28" Width="120" Text="{Binding ScheduleName}" IsReadOnly="True" />
-                </StackPanel>
-                <StackPanel Orientation="Horizontal">
-                    <TextBlock Text="设备类型:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
-                    <TextBox  Height="28" Width="120" Text="{Binding DeviceKindName}" IsReadOnly="True" />
-                </StackPanel>
-                <StackPanel Orientation="Horizontal" >
-                    <TextBlock Text="测试项类型:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
-                    <TextBox  Height="28" Width="120"  Text="{Binding SelectTest}" IsReadOnly="True"  />
-                </StackPanel>
-                <StackPanel Orientation="Horizontal">
-                    <TextBlock Text="测试项名称:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
-                    <TextBox  Height="28" Width="160"  Text="{Binding TestName}" IsReadOnly="True" />
+                <DataGrid.Columns >
+
+                    <DataGridTextColumn Header="设备编号" Binding="{Binding DeviceNo}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                    <DataGridTextColumn Header="设备名称" Binding="{Binding DeviceName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                    <DataGridTextColumn Header="项目名称" Binding="{Binding ProjectName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                    <DataGridTextColumn Header="设备类型" Binding="{Binding DeviceKindName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                    <DataGridTextColumn Header="测试方案名称" Binding="{Binding SchemeName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+
+                    <DataGridTextColumn Header="测试时间" Width="150" Binding="{Binding StartTestTime,StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                    <DataGridTextColumn Header="测试结果" Binding="{Binding TestResult}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+
+                </DataGrid.Columns>
+
+            </DataGrid>
+        </Grid>
+        <Grid Grid.Row="1">
+ 
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="auto"/>
+                <ColumnDefinition/>
+            </Grid.ColumnDefinitions>
+            <DockPanel Grid.Column="0" LastChildFill="True">
+                <TextBlock Text="测试项列表:"  Style="{StaticResource NormalTextBlockStyle}" Margin="5,0,5,0" DockPanel.Dock="Top"/>
+                <ListBox ItemsSource="{Binding SchItems}" SelectedValue="{Binding SelectItem}" SelectedIndex="{Binding SelectItemIndex}" >
+
+                    <b:Interaction.Triggers>
+                        <b:EventTrigger EventName="SelectionChanged">
+                            <b:InvokeCommandAction Command="{Binding ItemChangeCommand}"/>
+                        </b:EventTrigger>
+                    </b:Interaction.Triggers>
+                </ListBox>
+
+            </DockPanel>
+            <Border Grid.Column="0"  BorderBrush="#CBCBCB" BorderThickness="1,0" />
+            <Grid Grid.Column="1">
+                <Grid.RowDefinitions>
+
+                    <RowDefinition Height="50" />
+                    <RowDefinition />
+                    <RowDefinition />
+                    <RowDefinition />
+                    <RowDefinition Height="50" />
+                    <RowDefinition Height="50" />
+                </Grid.RowDefinitions>
+
+                <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="10">
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Text="测试方案名称:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
+                        <TextBox  Height="28" Width="120" Text="{Binding ScheduleName}" IsReadOnly="True" />
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Text="设备类型:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
+                        <TextBox  Height="28" Width="120" Text="{Binding DeviceKindName}" IsReadOnly="True" />
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal" >
+                        <TextBlock Text="测试项类型:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
+                        <TextBox  Height="28" Width="120"  Text="{Binding SelectTest}" IsReadOnly="True"  />
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Text="测试项名称:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
+                        <TextBox  Height="28" Width="160"  Text="{Binding TestName}" IsReadOnly="True" />
+                    </StackPanel>
+
                 </StackPanel>
+                <Border Grid.Row="0"  BorderBrush="#CBCBCB" BorderThickness="0,1" />
+                <Grid Grid.Row="1">
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="80"/>
+                        <ColumnDefinition/>
+                        <ColumnDefinition Width="1.6*"/>
+                    </Grid.ColumnDefinitions>
+                    <TextBlock Grid.Column="0" Text="前置项" Style="{StaticResource NormalTextBlockStyle}" TextAlignment="Center">
+                    </TextBlock>
+                    <Border Grid.Column="1"  BorderBrush="#CBCBCB" BorderThickness="1,0" />
+                    <Grid Grid.Column="1">
+                        <Grid.RowDefinitions>
+                            <RowDefinition/>
+                            <RowDefinition/>
+                            <RowDefinition Height="2*"/>
+                        </Grid.RowDefinitions>
+                        <Grid Grid.Row="0">
+                            <StackPanel Orientation="Horizontal" >
+                                <TextBlock Text="测试项类型:"  Style="{StaticResource textBlockStyle}"/>
+                                <TextBox  Height="28" Width="150"  Text="{Binding BeforeSelectJudge}" IsReadOnly="True"  />
+                            </StackPanel>
+                        </Grid>
+                        <Grid Grid.Row="1"  >
+                            <StackPanel Orientation="Horizontal" >
+                                <TextBlock Text="明细判定逻辑:"  Style="{StaticResource textBlockStyle}"/>
+                                <TextBox  Height="28" Width="150" Text="{Binding SelectLogic}" IsReadOnly="True" />
+                            </StackPanel>
+                        </Grid>
+                        <Grid Grid.Row="2">
+                            <DockPanel LastChildFill="True" >
+                                <TextBlock Text="前置项描述:"   Style="{StaticResource textBlockStyle}" />
+                                <RichTextBox  Margin="0,5,5,5" IsReadOnly="True" >
+                                    <FlowDocument>
+                                        <Paragraph>
+                                            <Run Text="{Binding BeforeDetail,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
+                                        </Paragraph>
+                                    </FlowDocument>
 
-            </StackPanel>
-            <Border Grid.Row="0"  BorderBrush="#CBCBCB" BorderThickness="0,1" />
-            <Grid Grid.Row="1">
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="80"/>
-                    <ColumnDefinition/>
-                    <ColumnDefinition Width="1.6*"/>
-                </Grid.ColumnDefinitions>
-                <TextBlock Grid.Column="0" Text="前置项" Style="{StaticResource NormalTextBlockStyle}" TextAlignment="Center">
-                </TextBlock>
-                <Border Grid.Column="1"  BorderBrush="#CBCBCB" BorderThickness="1,0" />
-                <Grid Grid.Column="1">
-                    <Grid.RowDefinitions>
-                        <RowDefinition/>
-                        <RowDefinition/>
-                        <RowDefinition Height="2*"/>
-                    </Grid.RowDefinitions>
-                    <Grid Grid.Row="0">
-                        <StackPanel Orientation="Horizontal" >
-                            <TextBlock Text="测试项类型:"  Style="{StaticResource textBlockStyle}"/>
-                            <TextBox  Height="28" Width="150"  Text="{Binding BeforeSelectJudge}" IsReadOnly="True"  />
-                        </StackPanel>
-                    </Grid>
-                    <Grid Grid.Row="1"  >
-                        <StackPanel Orientation="Horizontal" >
-                            <TextBlock Text="明细判定逻辑:"  Style="{StaticResource textBlockStyle}"/>
-                            <TextBox  Height="28" Width="150" Text="{Binding SelectLogic}" IsReadOnly="True" />
-                        </StackPanel>
+                                </RichTextBox>
+                            </DockPanel>
+                        </Grid>
                     </Grid>
-                    <Grid Grid.Row="2">
-                        <DockPanel LastChildFill="True" >
-                            <TextBlock Text="前置项描述:"   Style="{StaticResource textBlockStyle}" />
-                            <RichTextBox  Margin="0,5,5,5" IsReadOnly="True" >
-                                <FlowDocument>
-                                    <Paragraph>
-                                        <Run Text="{Binding BeforeDetail,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
-                                    </Paragraph>
-                                </FlowDocument>
-
-                            </RichTextBox>
+                    <Grid Grid.Column="2" >
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="30"/>
+                            <RowDefinition/>
+                        </Grid.RowDefinitions>
+                        <DockPanel LastChildFill="False">
+                            <TextBlock Text="前置项明细:"   Style="{StaticResource textBlockStyle}" />
+
                         </DockPanel>
+                        <DataGrid Grid.Row="1"  ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False"  SelectionUnit="FullRow" SelectionMode="Single"   RowHeaderWidth="0" HorizontalScrollBarVisibility="Disabled"
+                ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}" x:Name="DeviceDataGrid" RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}"  AlternationCount="2"
+                  ItemsSource="{Binding BeforeConList}"  IsReadOnly="True" Padding="0" >
+                            <DataGrid.Columns >
+                                <DataGridTextColumn Header="序号" Width="40" Binding="{Binding Id}" CellStyle="{StaticResource MyDataGridCellStyle}" />
+                                <DataGridTextColumn Header="PLC地址" Binding="{Binding PlcAddress}" CellStyle="{StaticResource MyDataGridCellStyle}" />
+                                <DataGridTextColumn Header="PLC变量名" Binding="{Binding PlcItem}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="判定值" Binding="{Binding PlcValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="描述" Binding="{Binding Remark}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="测试时间" Width="160" Binding="{Binding TestTime,StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="实际值" Binding="{Binding RealValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="结果" Binding="{Binding TestResult}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+
+                            </DataGrid.Columns>
+
+                        </DataGrid>
+
                     </Grid>
                 </Grid>
-                <Grid Grid.Column="2" >
-                    <Grid.RowDefinitions>
-                        <RowDefinition Height="30"/>
-                        <RowDefinition/>
-                    </Grid.RowDefinitions>
-                    <DockPanel LastChildFill="False">
-                        <TextBlock Text="前置项明细:"   Style="{StaticResource textBlockStyle}" />
-
-                    </DockPanel>
-                    <DataGrid Grid.Row="1"  ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False"  SelectionUnit="FullRow" SelectionMode="Single"   RowHeaderWidth="0" HorizontalScrollBarVisibility="Disabled"
-            ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}" x:Name="DeviceDataGrid" RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}"  AlternationCount="2"
-              ItemsSource="{Binding BeforeConList}"  IsReadOnly="True" Padding="0" >
-                        <DataGrid.Columns >
-                            <DataGridTextColumn Header="序号" Width="40" Binding="{Binding Id}" CellStyle="{StaticResource MyDataGridCellStyle}" />
-                            <DataGridTextColumn Header="PLC地址" Binding="{Binding PlcAddress}" CellStyle="{StaticResource MyDataGridCellStyle}" />
-                            <DataGridTextColumn Header="PLC变量名" Binding="{Binding PlcItem}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="判定值" Binding="{Binding PlcValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="描述" Binding="{Binding Remark}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="测试时间" Width="160" Binding="{Binding TestTime,StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="实际值" Binding="{Binding RealValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="结果" Binding="{Binding TestResult}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-
-                        </DataGrid.Columns>
-
-                    </DataGrid>
+                <Grid Grid.Row="2">
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="80"/>
+                        <ColumnDefinition/>
+                        <ColumnDefinition Width="1.6*"/>
+                    </Grid.ColumnDefinitions>
+                    <TextBlock Grid.Column="0" Text="输入项" Style="{StaticResource NormalTextBlockStyle}" TextAlignment="Center">
+                    </TextBlock>
+                    <Border Grid.Column="1"  BorderBrush="#CBCBCB" BorderThickness="1,0" />
+                    <Grid Grid.Column="1">
+                        <Grid.RowDefinitions>
+                            <RowDefinition/>
+                            <RowDefinition/>
+                            <RowDefinition Height="2*"/>
+                        </Grid.RowDefinitions>
+                        <Grid Grid.Row="0">
+                            <StackPanel Orientation="Horizontal" >
+                                <TextBlock Text="测试项类型:"  Style="{StaticResource textBlockStyle}"/>
+                                <TextBox  Height="28" Width="150"  Text="{Binding SelectInJudge}" IsReadOnly="True" />
+                            </StackPanel>
+                        </Grid>
+                        <Grid Grid.Row="1"  >
+                            <StackPanel Orientation="Horizontal" >
+                                <TextBlock Text="明细判定逻辑:"  Style="{StaticResource textBlockStyle}"/>
+                                <TextBox  Height="28" Width="150"  Text="{Binding InSelectLogic}" IsReadOnly="True" />
+                            </StackPanel>
+                        </Grid>
+                        <Grid Grid.Row="2">
+                            <DockPanel LastChildFill="True" >
+                                <TextBlock Text="输入项描述:"   Style="{StaticResource textBlockStyle}" />
+                                <RichTextBox  Margin="0,5,5,5" IsReadOnly="True"  >
+                                    <FlowDocument>
+                                        <Paragraph>
+                                            <Run Text="{Binding InDetail,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
+                                        </Paragraph>
+                                    </FlowDocument>
 
-                </Grid>
-            </Grid>
-            <Grid Grid.Row="2">
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="80"/>
-                    <ColumnDefinition/>
-                    <ColumnDefinition Width="1.6*"/>
-                </Grid.ColumnDefinitions>
-                <TextBlock Grid.Column="0" Text="输入项" Style="{StaticResource NormalTextBlockStyle}" TextAlignment="Center">
-                </TextBlock>
-                <Border Grid.Column="1"  BorderBrush="#CBCBCB" BorderThickness="1,0" />
-                <Grid Grid.Column="1">
-                    <Grid.RowDefinitions>
-                        <RowDefinition/>
-                        <RowDefinition/>
-                        <RowDefinition Height="2*"/>
-                    </Grid.RowDefinitions>
-                    <Grid Grid.Row="0">
-                        <StackPanel Orientation="Horizontal" >
-                            <TextBlock Text="测试项类型:"  Style="{StaticResource textBlockStyle}"/>
-                            <TextBox  Height="28" Width="150"  Text="{Binding SelectInJudge}" IsReadOnly="True" />
-                        </StackPanel>
-                    </Grid>
-                    <Grid Grid.Row="1"  >
-                        <StackPanel Orientation="Horizontal" >
-                            <TextBlock Text="明细判定逻辑:"  Style="{StaticResource textBlockStyle}"/>
-                            <TextBox  Height="28" Width="150"  Text="{Binding InSelectLogic}" IsReadOnly="True" />
-                        </StackPanel>
+                                </RichTextBox>
+                            </DockPanel>
+                        </Grid>
                     </Grid>
-                    <Grid Grid.Row="2">
-                        <DockPanel LastChildFill="True" >
-                            <TextBlock Text="输入项描述:"   Style="{StaticResource textBlockStyle}" />
-                            <RichTextBox  Margin="0,5,5,5" IsReadOnly="True"  >
-                                <FlowDocument>
-                                    <Paragraph>
-                                        <Run Text="{Binding InDetail,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
-                                    </Paragraph>
-                                </FlowDocument>
-
-                            </RichTextBox>
+                    <Grid Grid.Column="2" >
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="30"/>
+                            <RowDefinition/>
+                        </Grid.RowDefinitions>
+                        <DockPanel LastChildFill="False">
+                            <TextBlock Text="输入项明细:"   Style="{StaticResource textBlockStyle}" />
+
                         </DockPanel>
+                        <DataGrid Grid.Row="1"  ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False"  SelectionUnit="FullRow" SelectionMode="Single"   RowHeaderWidth="0" HorizontalScrollBarVisibility="Disabled"
+     ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}" RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}"  AlternationCount="2"
+       ItemsSource="{Binding InConList}"  IsReadOnly="True" Padding="0">
+                            <DataGrid.Columns >
+                                <DataGridTextColumn Header="序号" Width="40" Binding="{Binding Id}" CellStyle="{StaticResource MyDataGridCellStyle}" />
+                                <DataGridTextColumn Header="PLC地址" Binding="{Binding PlcAddress}" CellStyle="{StaticResource MyDataGridCellStyle}" />
+                                <DataGridTextColumn Header="PLC变量名" Binding="{Binding PlcItem}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="判定值" Binding="{Binding PlcValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="描述" Binding="{Binding Remark}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="测试时间" Width="160" Binding="{Binding TestTime,StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="实际值" Binding="{Binding RealValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="结果" Binding="{Binding TestResult}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+
+                            </DataGrid.Columns>
+
+                        </DataGrid>
+
                     </Grid>
                 </Grid>
-                <Grid Grid.Column="2" >
-                    <Grid.RowDefinitions>
-                        <RowDefinition Height="30"/>
-                        <RowDefinition/>
-                    </Grid.RowDefinitions>
-                    <DockPanel LastChildFill="False">
-                        <TextBlock Text="输入项明细:"   Style="{StaticResource textBlockStyle}" />
-
-                    </DockPanel>
-                    <DataGrid Grid.Row="1"  ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False"  SelectionUnit="FullRow" SelectionMode="Single"   RowHeaderWidth="0" HorizontalScrollBarVisibility="Disabled"
- ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}" RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}"  AlternationCount="2"
-   ItemsSource="{Binding InConList}"  IsReadOnly="True" Padding="0">
-                        <DataGrid.Columns >
-                            <DataGridTextColumn Header="序号" Width="40" Binding="{Binding Id}" CellStyle="{StaticResource MyDataGridCellStyle}" />
-                            <DataGridTextColumn Header="PLC地址" Binding="{Binding PlcAddress}" CellStyle="{StaticResource MyDataGridCellStyle}" />
-                            <DataGridTextColumn Header="PLC变量名" Binding="{Binding PlcItem}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="判定值" Binding="{Binding PlcValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="描述" Binding="{Binding Remark}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="测试时间" Width="160" Binding="{Binding TestTime,StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="实际值" Binding="{Binding RealValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="结果" Binding="{Binding TestResult}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-
-                        </DataGrid.Columns>
-
-                    </DataGrid>
+                <Border Grid.Row="2"  BorderBrush="#CBCBCB" BorderThickness="0,1,0,0" />
+                <Grid Grid.Row="3">
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="80"/>
+                        <ColumnDefinition/>
+                        <ColumnDefinition Width="1.6*"/>
+                    </Grid.ColumnDefinitions>
+                    <TextBlock Grid.Column="0" Text="结果项" Style="{StaticResource NormalTextBlockStyle}" TextAlignment="Center">
+                    </TextBlock>
+                    <Border Grid.Column="1"  BorderBrush="#CBCBCB" BorderThickness="1,0" />
+                    <Grid Grid.Column="1">
+                        <Grid.RowDefinitions>
+                            <RowDefinition/>
+                            <RowDefinition/>
+                            <RowDefinition Height="2*"/>
+                        </Grid.RowDefinitions>
+                        <Grid Grid.Row="0">
+                            <StackPanel Orientation="Horizontal" >
+                                <TextBlock Text="测试项类型:"  Style="{StaticResource textBlockStyle}"/>
+                                <TextBox  Height="28" Width="150"  Text="{Binding SelectOutJudge}" IsReadOnly="True" />
+                            </StackPanel>
+                        </Grid>
+                        <Grid Grid.Row="1"  >
+                            <StackPanel Orientation="Horizontal" >
+                                <TextBlock Text="明细判定逻辑:"  Style="{StaticResource textBlockStyle}"/>
+                                <TextBox  Height="28" Width="150"  Text="{Binding OutSelectLogic}" IsReadOnly="True" />
+                            </StackPanel>
+                        </Grid>
+                        <Grid Grid.Row="2">
+                            <DockPanel LastChildFill="True" >
+                                <TextBlock Text="结果项描述:"   Style="{StaticResource textBlockStyle}" />
+                                <RichTextBox  Margin="0,5,5,5" IsReadOnly="True" >
+                                    <FlowDocument>
+                                        <Paragraph>
+                                            <Run Text="{Binding OutDetail,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
+                                        </Paragraph>
+                                    </FlowDocument>
 
-                </Grid>
-            </Grid>
-            <Border Grid.Row="2"  BorderBrush="#CBCBCB" BorderThickness="0,1,0,0" />
-            <Grid Grid.Row="3">
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="80"/>
-                    <ColumnDefinition/>
-                    <ColumnDefinition Width="1.6*"/>
-                </Grid.ColumnDefinitions>
-                <TextBlock Grid.Column="0" Text="结果项" Style="{StaticResource NormalTextBlockStyle}" TextAlignment="Center">
-                </TextBlock>
-                <Border Grid.Column="1"  BorderBrush="#CBCBCB" BorderThickness="1,0" />
-                <Grid Grid.Column="1">
-                    <Grid.RowDefinitions>
-                        <RowDefinition/>
-                        <RowDefinition/>
-                        <RowDefinition Height="2*"/>
-                    </Grid.RowDefinitions>
-                    <Grid Grid.Row="0">
-                        <StackPanel Orientation="Horizontal" >
-                            <TextBlock Text="测试项类型:"  Style="{StaticResource textBlockStyle}"/>
-                            <TextBox  Height="28" Width="150"  Text="{Binding SelectOutJudge}" IsReadOnly="True" />
-                        </StackPanel>
-                    </Grid>
-                    <Grid Grid.Row="1"  >
-                        <StackPanel Orientation="Horizontal" >
-                            <TextBlock Text="明细判定逻辑:"  Style="{StaticResource textBlockStyle}"/>
-                            <TextBox  Height="28" Width="150"  Text="{Binding OutSelectLogic}" IsReadOnly="True" />
-                        </StackPanel>
+                                </RichTextBox>
+                            </DockPanel>
+                        </Grid>
                     </Grid>
-                    <Grid Grid.Row="2">
-                        <DockPanel LastChildFill="True" >
-                            <TextBlock Text="结果项描述:"   Style="{StaticResource textBlockStyle}" />
-                            <RichTextBox  Margin="0,5,5,5" IsReadOnly="True" >
-                                <FlowDocument>
-                                    <Paragraph>
-                                        <Run Text="{Binding OutDetail,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
-                                    </Paragraph>
-                                </FlowDocument>
-
-                            </RichTextBox>
+                    <Grid Grid.Column="2" >
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="30"/>
+                            <RowDefinition/>
+                        </Grid.RowDefinitions>
+                        <DockPanel LastChildFill="False">
+                            <TextBlock Text="输出项明细:"   Style="{StaticResource textBlockStyle}" />
                         </DockPanel>
-                    </Grid>
-                </Grid>
-                <Grid Grid.Column="2" >
-                    <Grid.RowDefinitions>
-                        <RowDefinition Height="30"/>
-                        <RowDefinition/>
-                    </Grid.RowDefinitions>
-                    <DockPanel LastChildFill="False">
-                        <TextBlock Text="输出项明细:"   Style="{StaticResource textBlockStyle}" />
-                    </DockPanel>
-                    <DataGrid Grid.Row="1"  ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False"  SelectionUnit="FullRow" SelectionMode="Single"   RowHeaderWidth="0" HorizontalScrollBarVisibility="Disabled"
- ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}"  RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}"  AlternationCount="2"
-   ItemsSource="{Binding OutConList}"  IsReadOnly="True" Padding="0">
-                        <DataGrid.Columns >
+                        <DataGrid Grid.Row="1"  ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False"  SelectionUnit="FullRow" SelectionMode="Single"   RowHeaderWidth="0" HorizontalScrollBarVisibility="Disabled"
+     ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}"  RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}"  AlternationCount="2"
+       ItemsSource="{Binding OutConList}"  IsReadOnly="True" Padding="0">
+                            <DataGrid.Columns >
 
-                            <DataGridTextColumn Header="序号" Width="40" Binding="{Binding Id}" CellStyle="{StaticResource MyDataGridCellStyle}" />
-                            <DataGridTextColumn Header="PLC地址" Binding="{Binding PlcAddress}" CellStyle="{StaticResource MyDataGridCellStyle}" />
-                            <DataGridTextColumn Header="PLC变量名" Binding="{Binding PlcItem}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="判定值" Binding="{Binding PlcValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="描述" Binding="{Binding Remark}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="测试时间" Width="160" Binding="{Binding TestTime,StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="实际值" Binding="{Binding RealValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                            <DataGridTextColumn Header="结果" Binding="{Binding TestResult}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="序号" Width="40" Binding="{Binding Id}" CellStyle="{StaticResource MyDataGridCellStyle}" />
+                                <DataGridTextColumn Header="PLC地址" Binding="{Binding PlcAddress}" CellStyle="{StaticResource MyDataGridCellStyle}" />
+                                <DataGridTextColumn Header="PLC变量名" Binding="{Binding PlcItem}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="判定值" Binding="{Binding PlcValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="描述" Binding="{Binding Remark}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="测试时间" Width="160" Binding="{Binding TestTime,StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="实际值" Binding="{Binding RealValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                                <DataGridTextColumn Header="结果" Binding="{Binding TestResult}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
 
-                        </DataGrid.Columns>
+                            </DataGrid.Columns>
 
-                    </DataGrid>
+                        </DataGrid>
 
+                    </Grid>
                 </Grid>
-            </Grid>
-            <Border Grid.Row="3"  BorderBrush="#CBCBCB" BorderThickness="0,1,0,0" />
-            <Grid Grid.Row="4">
-                <hc:StepBar  StepIndex="{Binding StepIndex}" VerticalAlignment="Center" x:Name="ProSetpBar"  >
-                    <hc:StepBarItem Content="开始"/>
-                    <hc:StepBarItem Content="前置条件满足"/>
-                    <hc:StepBarItem Content="输入明细完成"/>
-                    <hc:StepBarItem Content="结果判定完成"/>
+                <Border Grid.Row="3"  BorderBrush="#CBCBCB" BorderThickness="0,1,0,0" />
+                <Grid Grid.Row="4">
+                    <hc:StepBar  StepIndex="{Binding StepIndex}" VerticalAlignment="Center" x:Name="ProSetpBar"  >
+                        <hc:StepBarItem Content="开始"/>
+                        <hc:StepBarItem Content="前置条件满足"/>
+                        <hc:StepBarItem Content="输入明细完成"/>
+                        <hc:StepBarItem Content="结果判定完成"/>
 
 
-                </hc:StepBar>
-            </Grid>
-            <UniformGrid  Grid.Row="5" Columns="4">
-                <Button  Content="开始检测" Width="80" IsEnabled="{Binding StartEnalbe}" Height="30" FontSize="12"   Command="{Binding StartCommand}" Style="{DynamicResource WD.PrimaryButton}" />
-                <Button  Content="上一项" Width="80" IsEnabled="{Binding StartEnalbe}" Height="30" FontSize="12"   Command="{Binding PreviousCommand}" Style="{DynamicResource WD.PrimaryButton}" />
-                <Button  Content="下一项" Width="80" IsEnabled="{Binding StartEnalbe}" Height="30" FontSize="12"   Command="{Binding NextCommand}" Style="{DynamicResource WD.PrimaryButton}" />
-                <Button  Content="完成" Width="80"  IsEnabled="{Binding StartEnalbe}" Height="30" FontSize="12"  Command="{Binding DoneCommand}" Style="{DynamicResource WD.PrimaryButton}" />
-            </UniformGrid>
-            <Grid Grid.Row="2">
-                <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
-                    <hc:CircleProgressBar IsIndeterminate="True" Visibility="{Binding ProVisibility }" Value="50"  Margin="16,0,0,0" Width="100" Height="100" ArcThickness="10" Style="{StaticResource ProgressBarInfoCircle}">
-
-                    </hc:CircleProgressBar>
-                    <TextBlock  Text="判定中..." Foreground="#409EFF" FontSize="30" Visibility="{Binding ProVisibility }"  Width="AUTO" Margin="0,5"/>
-                </StackPanel>
+                    </hc:StepBar>
+                </Grid>
+                <UniformGrid  Grid.Row="5" Columns="4">
+                    <Button  Content="开始检测" Width="80" IsEnabled="{Binding StartEnalbe}" Height="30" FontSize="12"   Command="{Binding StartCommand}" Style="{DynamicResource WD.PrimaryButton}" />
+                    <!--<Button  Content="上一项" Width="80" IsEnabled="{Binding StartEnalbe}" Height="30" FontSize="12"   Command="{Binding PreviousCommand}" Style="{DynamicResource WD.PrimaryButton}" />
+                    <Button  Content="下一项" Width="80" IsEnabled="{Binding StartEnalbe}" Height="30" FontSize="12"   Command="{Binding NextCommand}" Style="{DynamicResource WD.PrimaryButton}" />-->
+                    <Button  Content="完成" Width="80"  IsEnabled="{Binding StartEnalbe}" Height="30" FontSize="12"  Command="{Binding DoneCommand}" Style="{DynamicResource WD.PrimaryButton}" />
+                </UniformGrid>
+                <Grid Grid.Row="2">
+                    <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
+                        <hc:CircleProgressBar IsIndeterminate="True" Visibility="{Binding ProVisibility }" Value="50"  Margin="16,0,0,0" Width="100" Height="100" ArcThickness="10" Style="{StaticResource ProgressBarInfoCircle}">
+
+                        </hc:CircleProgressBar>
+                        <TextBlock  Text="判定中..." Foreground="#409EFF" FontSize="30" Visibility="{Binding ProVisibility }"  Width="AUTO" Margin="0,5"/>
+                    </StackPanel>
+                </Grid>
             </Grid>
-        </Grid>
 
+        </Grid>
     </Grid>
 </UserControl>

+ 43 - 15
BlankApp1/BlankApp1/Views/BusinessManageView/TestResultDetailView.xaml

@@ -24,7 +24,37 @@
     </UserControl.Resources>
 
     <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="200"/>
+            <RowDefinition/>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0">
+            <DataGrid  Grid.Row="2"  ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False"  SelectionUnit="FullRow" SelectionMode="Single"   RowHeaderWidth="0"
+ ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}"  RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}"  AlternationCount="2"
+ItemsSource="{Binding DeviceResultItemList}" IsReadOnly="True" Padding="0"  >
+                <b:Interaction.Triggers>
+                    <b:EventTrigger EventName="SelectionChanged">
+                        <b:InvokeCommandAction  Command="{Binding DataContext.DgSelectChangeCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" 
+                                                CommandParameter="{Binding Path=SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"/>
+                    </b:EventTrigger>
+                </b:Interaction.Triggers>
+                <DataGrid.Columns >
+                   
+                    <DataGridTextColumn Header="设备编号" Binding="{Binding DeviceNo}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                    <DataGridTextColumn Header="设备名称" Binding="{Binding DeviceName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                    <DataGridTextColumn Header="项目名称" Binding="{Binding ProjectName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                    <DataGridTextColumn Header="设备类型" Binding="{Binding DeviceKindName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                    <DataGridTextColumn Header="测试方案名称" Binding="{Binding SchemeName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
 
+                    <DataGridTextColumn Header="测试时间" Width="150" Binding="{Binding StartTestTime,StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                    <DataGridTextColumn Header="测试结果" Binding="{Binding TestResult}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                 
+                </DataGrid.Columns>
+
+            </DataGrid>
+        </Grid>
+        <Grid Grid.Row="1">
+   
         <Grid.ColumnDefinitions>
             <ColumnDefinition Width="auto"/>
             <ColumnDefinition/>
@@ -32,19 +62,16 @@
         <DockPanel Grid.Column="0" LastChildFill="True">
             <TextBlock Text="测试项列表:"  Style="{StaticResource NormalTextBlockStyle}" Margin="5,0,5,0" DockPanel.Dock="Top"/>
             <ListBox ItemsSource="{Binding SchItems}"  SelectedIndex="{Binding SelectIndex}" >
-                <ListBox.ItemTemplate>
-                    <DataTemplate>
-                        <StackPanel Orientation="Horizontal">
-                            <Image Source="{Binding Path=ImgSource,Converter={StaticResource MyImageConverter}}" Stretch="Fill" Margin="0,0,5,0"/>
-                            <TextBlock Text="{Binding ItemName}"/>
-                        </StackPanel>
-  
-                    </DataTemplate>
-                </ListBox.ItemTemplate>
+                    <ListBox.ItemTemplate>
+                        <DataTemplate>
+                            <StackPanel Orientation="Horizontal">
+                                <Image Source="{Binding Path=ImgSource,Converter={StaticResource MyImageConverter}}" Stretch="Fill" Margin="0,0,5,0"/>
+                                <TextBlock Text="{Binding ItemName}"/>
+                            </StackPanel>
 
-
-                        
-                <b:Interaction.Triggers>
+                        </DataTemplate>
+                    </ListBox.ItemTemplate>
+                    <b:Interaction.Triggers>
                     <b:EventTrigger EventName="SelectionChanged">
                         <b:InvokeCommandAction Command="{Binding ItemChangeCommand}"/>
                     </b:EventTrigger>
@@ -294,8 +321,9 @@
             </Grid>
             <Border Grid.Row="3"  BorderBrush="#CBCBCB" BorderThickness="0,1,0,0" />
         </Grid>
-     
-    
-      
+
+
+        </Grid>
+
     </Grid>
 </UserControl>