ltwork преди 1 година
родител
ревизия
a619a6ba0a

+ 4 - 1
BlankApp1/BizService/BizTestRecordDtlService.cs

@@ -14,6 +14,9 @@ namespace BizService
             return base.GetFirst(x => x.scheme_dtl_id == schDtlID);
             return base.GetFirst(x => x.scheme_dtl_id == schDtlID);
         }
         }
 
 
-       
+        public List<biz_test_record_dtl> FindRecordDetailByRecordID(long recordId)
+        {
+            return base.GetList(x => x.record_id == recordId);
+        }
     }
     }
 }
 }

+ 1 - 1
BlankApp1/BizService/IBizTestRecordDtlService.cs

@@ -16,6 +16,6 @@ namespace BizService
         public biz_test_record_dtl FindRecordDetailBySchDtlID(long schDtlID);
         public biz_test_record_dtl FindRecordDetailBySchDtlID(long schDtlID);
 
 
 
 
-        
+        public List<biz_test_record_dtl> FindRecordDetailByRecordID(long recordId);
     }
     }
 }
 }

+ 0 - 1
BlankApp1/BlankApp1/ViewModels/BusinessManageViewModel/DeviceTestViewModel.cs

@@ -44,7 +44,6 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             QueryCommand = new DelegateCommand<object>(Query);
             QueryCommand = new DelegateCommand<object>(Query);
           
           
             ExportCommand = new DelegateCommand<string>(Export);
             ExportCommand = new DelegateCommand<string>(Export);
-;
             ResetCommand = new DelegateCommand<object>(Reset);
             ResetCommand = new DelegateCommand<object>(Reset);
             OnLoadCommand = new DelegateCommand(OnLoad);
             OnLoadCommand = new DelegateCommand(OnLoad);
             //手动  自动测试
             //手动  自动测试

+ 26 - 6
BlankApp1/BlankApp1/ViewModels/BusinessManageViewModel/ResultQueryViewModel.cs

@@ -45,7 +45,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             QueryCommand = new DelegateCommand<object>(Query);
             QueryCommand = new DelegateCommand<object>(Query);
 
 
             ExportCommand = new DelegateCommand<string>(Export);
             ExportCommand = new DelegateCommand<string>(Export);
-            ;
+            CheckDetailCommand = new DelegateCommand<object>(CheckDetail);
             ResetCommand = new DelegateCommand<object>(Reset);
             ResetCommand = new DelegateCommand<object>(Reset);
             OnLoadCommand = new DelegateCommand(OnLoad);
             OnLoadCommand = new DelegateCommand(OnLoad);
       
       
@@ -77,8 +77,28 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
 
 
         }
         }
 
 
+        /// <summary>
+        /// 查看详情
+        /// </summary>
+        /// <param name="obj"></param>
+        private void CheckDetail(object obj)
+        {
+            //测试方案明细主键ID
+            long id = Convert.ToInt64(obj);
+            DialogParameters parm = new DialogParameters();
+            parm.Add("Key", id);
+            //弹出详情对话框
+            //弹出详情对话框
+            _dialog.ShowDialog("TestResultDetailView", parm, async callback =>
+            {
+                if (callback.Result == ButtonResult.OK)
+                {
+                    //更新表格,重新获取
+                    //GetContent();
+                }
 
 
-    
+            });
+        }
 
 
         /// <summary>
         /// <summary>
         /// 查询
         /// 查询
@@ -151,9 +171,6 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             //测试记录中的所有设备
             //测试记录中的所有设备
             var deviceIds=_iBizTestRecordService.QueryList().Select(X => X.device_id).Distinct();
             var deviceIds=_iBizTestRecordService.QueryList().Select(X => X.device_id).Distinct();
 
 
-         
-
-
             foreach (var deviceId in deviceIds)
             foreach (var deviceId in deviceIds)
             {
             {
                 var deviceMsg = _iBasicDeviceService.Find(((int)deviceId));
                 var deviceMsg = _iBasicDeviceService.Find(((int)deviceId));
@@ -166,6 +183,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
                     {
                     {
                         allDeviceList.Add(new DeviceDtlWithResultModel()
                         allDeviceList.Add(new DeviceDtlWithResultModel()
                         {
                         {
+                            RecordId = sch.record_id,
                             DeviceId = deviceMsg.device_id,
                             DeviceId = deviceMsg.device_id,
                             DeviceNo = deviceMsg.device_no,
                             DeviceNo = deviceMsg.device_no,
                             DeviceName = deviceMsg.device_name,
                             DeviceName = deviceMsg.device_name,
@@ -173,9 +191,10 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
                             ProjectName = _iBasicProjectService.Find((int)deviceMsg.project_id)?.project_name,
                             ProjectName = _iBasicProjectService.Find((int)deviceMsg.project_id)?.project_name,
                             SchemeName = sch.scheme_name,
                             SchemeName = sch.scheme_name,
                             StartTestTime = sch.start_test_time.Value,
                             StartTestTime = sch.start_test_time.Value,
-                        }); ;
+                        }); ; ;
                         conditionDevices.Add(new DeviceDtlWithResultModel()
                         conditionDevices.Add(new DeviceDtlWithResultModel()
                         {
                         {
+                            RecordId = sch.record_id,
                             DeviceId = deviceMsg.device_id,
                             DeviceId = deviceMsg.device_id,
                             DeviceNo = deviceMsg.device_no,
                             DeviceNo = deviceMsg.device_no,
                             DeviceName = deviceMsg.device_name,
                             DeviceName = deviceMsg.device_name,
@@ -231,6 +250,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         public DelegateCommand<object> ResetCommand { set; get; }
         public DelegateCommand<object> ResetCommand { set; get; }
 
 
         public DelegateCommand OnLoadCommand { set; get; }
         public DelegateCommand OnLoadCommand { set; get; }
+        public DelegateCommand<object> CheckDetailCommand { set; get; }
 
 
         #endregion
         #endregion
 
 

+ 165 - 103
BlankApp1/BlankApp1/ViewModels/BusinessManageViewModel/TestResultDetailViewModel.cs

@@ -31,13 +31,13 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         private readonly IBizTestRecordDtlService _iBizTestRecordDtlService;
         private readonly IBizTestRecordDtlService _iBizTestRecordDtlService;
         private readonly IMapper _mapper;
         private readonly IMapper _mapper;
         private readonly ILogger _logger;
         private readonly ILogger _logger;
-        private List<OptionConfigDto> _optionConfigs;
-
+        private List<OptionConfigDto> _optionConfigs=new List<OptionConfigDto>();
+        private List<BizTestRecordDtlDto> conditionRecordList = new List<BizTestRecordDtlDto>();
         private DateTime startTime = DateTime.Now;
         private DateTime startTime = DateTime.Now;
         private DateTime endTime = DateTime.Now;
         private DateTime endTime = DateTime.Now;
         private int testStatus = 0;  //测试状态 
         private int testStatus = 0;  //测试状态 
         private int testResult = 0; //测试结果
         private int testResult = 0; //测试结果
-        private long schDetailId = 0; //测试方案明细ID
+
 
 
 
 
         public TestResultDetailViewModel(IDialogService dialog, IEventAggregator aggregator, IOptionConfigService optionConfigService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBasicPlcTestSchemeDtlService basicPlcTestSchemeDtlService, IBizTestRecordService iBizTestRecordService, IBizTestRecordDtlService iBizTestRecordDtlService, IMapper mapper)
         public TestResultDetailViewModel(IDialogService dialog, IEventAggregator aggregator, IOptionConfigService optionConfigService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBasicPlcTestSchemeDtlService basicPlcTestSchemeDtlService, IBizTestRecordService iBizTestRecordService, IBizTestRecordDtlService iBizTestRecordDtlService, IMapper mapper)
@@ -55,10 +55,11 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             BeforeConList = new ObservableCollection<BasPlcItemConfigDto>();
             BeforeConList = new ObservableCollection<BasPlcItemConfigDto>();
             InConList = new ObservableCollection<BasPlcItemConfigDto>();
             InConList = new ObservableCollection<BasPlcItemConfigDto>();
             OutConList = new ObservableCollection<BasPlcItemConfigDto>();
             OutConList = new ObservableCollection<BasPlcItemConfigDto>();
+            ItemChangeCommand = new DelegateCommand(ItemChange);
             GetConfigOption();
             GetConfigOption();
         }
         }
 
 
-
+     
 
 
 
 
         #region idialog接口实现
         #region idialog接口实现
@@ -78,6 +79,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
 
 
         public void OnDialogOpened(IDialogParameters parameters)
         public void OnDialogOpened(IDialogParameters parameters)
         {
         {
+        
+            
             //编辑
             //编辑
             var getMsg = parameters.GetValues<long>("Key");
             var getMsg = parameters.GetValues<long>("Key");
             ///值不为空,表示修改
             ///值不为空,表示修改
@@ -87,107 +90,27 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
                 {
                 {
                     foreach (var item in getMsg)
                     foreach (var item in getMsg)
                     {
                     {
-                        schDetailId = item; //测试方案明细ID
-                        int schDtlId = Convert.ToInt32(item);
-                        //根据 测试方案明细主键ID 查找测试方案id 及方案名和设备名
-                        var findEntity = _basicPlcTestSchemeDtlService.Find(schDtlId);
-                        var findresult = _mapper.Map<bas_plc_test_scheme_dtl, BasicPlcTestSchemeDtlDto>(findEntity);
-                        if (findresult != null)
+                        long recordId = item;
+                        var records = _iBizTestRecordDtlService.FindRecordDetailByRecordID(recordId).OrderBy(x => x.record_dtl_id).ToList(); ;
+                        foreach (var record in records)
                         {
                         {
-                            //根据方案id 在方案表中查找方案名 设备名
-                            int schID = Convert.ToInt32(findresult.SchemeId);
-                            var findSch = _basicPlcTestSchemeService.Find(schID);
-                            if (findSch != null)
+                            long dtlId = record.scheme_dtl_id;
+                            string itemName= _basicPlcTestSchemeDtlService.Find((int)dtlId)?.item_name;
+                            SchItems.Add(itemName);
+                            //在集合中添加满足条件的测试结果
+                            conditionRecordList.Add(new BizTestRecordDtlDto()
                             {
                             {
-                                ScheduleName = findSch.scheme_name;
-                                DeviceKindName = findSch.devicekind_name;
-
-                            }
-                            TestName = findresult.ItemName;
-                            SelectTest = findresult.ItemType;
-
-                            //这里是测试项 结果和 测试记录明细状态
-                            //根据测试方案明细id查找结果
-                            var recordDetail = _iBizTestRecordDtlService.FindRecordDetailBySchDtlID(schDtlId);
-                            if (recordDetail != null)
-                            {       //前置项结果解析
-                                string preconStr = recordDetail.precondition_final?.ToString();
-                                if (!string.IsNullOrEmpty(preconStr))
-                                {
-                                    JsonModel preconditionModel = JsonConvert.DeserializeObject<JsonModel>(preconStr);
-                                    BeforeSelectJudge = preconditionModel.ItemType;
-                                    SelectLogic = preconditionModel.ItemLogical;
-                                    BeforeDetail = preconditionModel.Description;
-                                    BeforeConList.Clear();
-                                    foreach (var detail in preconditionModel.DetailInfo)
-                                    {
-                                        BasPlcItemConfigDto basPlcItemConfigDto = new BasPlcItemConfigDto();
-                                        basPlcItemConfigDto.Id = detail.Id;
-                                        basPlcItemConfigDto.PlcAddress = detail.PlcAddress;
-                                        basPlcItemConfigDto.PlcItem = detail.PlcItem;
-                                        basPlcItemConfigDto.PlcValue = detail.PlcValue;
-                                        basPlcItemConfigDto.Remark = detail.Remark;
-                                        basPlcItemConfigDto.TestTime = detail.TestTime;
-                                        basPlcItemConfigDto.RealValue = detail.RealValue;
-                                        basPlcItemConfigDto.TestResult = detail.TestResult;
-                                        beforeConList.Add(basPlcItemConfigDto);
-                                    }
-                                }
-
-                                //输入项解析
-                                string inStr = recordDetail.action_final?.ToString();
-                                if (!string.IsNullOrEmpty(inStr))
-                                {
-                                    JsonModel inModel = JsonConvert.DeserializeObject<JsonModel>(inStr);
-                                    SelectInJudge = inModel.ItemType;
-                                    InSelectLogic = inModel.ItemLogical;
-                                    InDetail = inModel.Description;
-                                    InConList.Clear();
-                                    foreach (var detail in inModel.DetailInfo)
-                                    {
-                                        BasPlcItemConfigDto basPlcItemConfigDto = new BasPlcItemConfigDto();
-                                        basPlcItemConfigDto.Id = detail.Id;
-                                        basPlcItemConfigDto.PlcAddress = detail.PlcAddress;
-                                        basPlcItemConfigDto.PlcItem = detail.PlcItem;
-                                        basPlcItemConfigDto.PlcValue = detail.PlcValue;
-                                        basPlcItemConfigDto.Remark = detail.Remark;
-                                        basPlcItemConfigDto.TestTime = detail.TestTime;
-                                        basPlcItemConfigDto.RealValue = detail.RealValue;
-                                        basPlcItemConfigDto.TestResult = detail.TestResult;
-                                        InConList.Add(basPlcItemConfigDto);
-                                    }
-                                }
-
-                                //输出项解析
-                                string outStr = recordDetail.judgement_result_final?.ToString();
-                                if (!string.IsNullOrEmpty(outStr))
-                                {
-                                    JsonModel outModel = JsonConvert.DeserializeObject<JsonModel>(outStr);
-                                    SelectOutJudge = outModel.ItemType;
-                                    OutSelectLogic = outModel.ItemLogical;
-                                    OutDetail = outModel.Description;
-                                    OutConList.Clear();
-                                    foreach (var detail in outModel.DetailInfo)
-                                    {
-                                        BasPlcItemConfigDto basPlcItemConfigDto = new BasPlcItemConfigDto();
-                                        basPlcItemConfigDto.Id = detail.Id;
-                                        basPlcItemConfigDto.PlcAddress = detail.PlcAddress;
-                                        basPlcItemConfigDto.PlcItem = detail.PlcItem;
-                                        basPlcItemConfigDto.PlcValue = detail.PlcValue;
-                                        basPlcItemConfigDto.Remark = detail.Remark;
-                                        basPlcItemConfigDto.TestTime = detail.TestTime;
-                                        basPlcItemConfigDto.RealValue = detail.RealValue;
-                                        basPlcItemConfigDto.TestResult = detail.TestResult;
-                                        OutConList.Add(basPlcItemConfigDto);
-                                    }
-                                }
-                            }
-
-
-
-
+                                RecordDtlId = record.record_dtl_id,
+                                SchemeDtlId=record.scheme_dtl_id,
+                            });
                         }
                         }
 
 
+                        //默认显示第一个测试项
+                        int schDtlId = Convert.ToInt32((long)records?.First().scheme_dtl_id);
+                        int recordDtlId = Convert.ToInt32((long)records?.First().record_dtl_id);
+                        //显示
+                        DisplayDetail(schDtlId, recordDtlId);
+                       
                     }
                     }
                 }
                 }
                 catch(Exception ex)
                 catch(Exception ex)
@@ -196,6 +119,113 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
                 }
                 }
                 
                 
 
 
+            }
+        }
+        /// <summary>
+        /// 根据 测试方案明细主键ID 查找测试方案id 及方案名和设备名
+        /// </summary>
+        /// <param name="schDtlId"></param>
+        //
+        private void DisplayDetail(int schDtlId,int recordDtlId)
+        {
+           
+            //根据 测试方案明细主键ID 查找测试方案id 及方案名和设备名
+            var findEntity = _basicPlcTestSchemeDtlService.Find(schDtlId);
+            var findresult = _mapper.Map<bas_plc_test_scheme_dtl, BasicPlcTestSchemeDtlDto>(findEntity);
+            if (findresult != null)
+            {
+                //根据方案id 在方案表中查找方案名 设备名
+                int schID = Convert.ToInt32(findresult.SchemeId);
+                var findSch = _basicPlcTestSchemeService.Find(schID);
+                if (findSch != null)
+                {
+                    ScheduleName = findSch.scheme_name;
+                    DeviceKindName = findSch.devicekind_name;
+
+                }
+                TestName = findresult.ItemName;
+                SelectTest = findresult.ItemType;
+
+                //这里是测试项 结果和 测试记录明细状态
+                //根据测试方案明细id查找结果
+                var recordDetail = _iBizTestRecordDtlService.Find(recordDtlId);
+                if (recordDetail != null)
+                {       //前置项结果解析
+                    string preconStr = recordDetail.precondition_final?.ToString();
+                    if (!string.IsNullOrEmpty(preconStr))
+                    {
+                        JsonModel preconditionModel = JsonConvert.DeserializeObject<JsonModel>(preconStr);
+                        BeforeSelectJudge = preconditionModel.ItemType;
+                        SelectLogic = preconditionModel.ItemLogical;
+                        BeforeDetail = preconditionModel.Description;
+                        BeforeConList.Clear();
+                        foreach (var detail in preconditionModel.DetailInfo)
+                        {
+                            BasPlcItemConfigDto basPlcItemConfigDto = new BasPlcItemConfigDto();
+                            basPlcItemConfigDto.Id = detail.Id;
+                            basPlcItemConfigDto.PlcAddress = detail.PlcAddress;
+                            basPlcItemConfigDto.PlcItem = detail.PlcItem;
+                            basPlcItemConfigDto.PlcValue = detail.PlcValue;
+                            basPlcItemConfigDto.Remark = detail.Remark;
+                            basPlcItemConfigDto.TestTime = detail.TestTime;
+                            basPlcItemConfigDto.RealValue = detail.RealValue;
+                            basPlcItemConfigDto.TestResult = detail.TestResult;
+                            beforeConList.Add(basPlcItemConfigDto);
+                        }
+                    }
+
+                    //输入项解析
+                    string inStr = recordDetail.action_final?.ToString();
+                    if (!string.IsNullOrEmpty(inStr))
+                    {
+                        JsonModel inModel = JsonConvert.DeserializeObject<JsonModel>(inStr);
+                        SelectInJudge = inModel.ItemType;
+                        InSelectLogic = inModel.ItemLogical;
+                        InDetail = inModel.Description;
+                        InConList.Clear();
+                        foreach (var detail in inModel.DetailInfo)
+                        {
+                            BasPlcItemConfigDto basPlcItemConfigDto = new BasPlcItemConfigDto();
+                            basPlcItemConfigDto.Id = detail.Id;
+                            basPlcItemConfigDto.PlcAddress = detail.PlcAddress;
+                            basPlcItemConfigDto.PlcItem = detail.PlcItem;
+                            basPlcItemConfigDto.PlcValue = detail.PlcValue;
+                            basPlcItemConfigDto.Remark = detail.Remark;
+                            basPlcItemConfigDto.TestTime = detail.TestTime;
+                            basPlcItemConfigDto.RealValue = detail.RealValue;
+                            basPlcItemConfigDto.TestResult = detail.TestResult;
+                            InConList.Add(basPlcItemConfigDto);
+                        }
+                    }
+
+                    //输出项解析
+                    string outStr = recordDetail.judgement_result_final?.ToString();
+                    if (!string.IsNullOrEmpty(outStr))
+                    {
+                        JsonModel outModel = JsonConvert.DeserializeObject<JsonModel>(outStr);
+                        SelectOutJudge = outModel.ItemType;
+                        OutSelectLogic = outModel.ItemLogical;
+                        OutDetail = outModel.Description;
+                        OutConList.Clear();
+                        foreach (var detail in outModel.DetailInfo)
+                        {
+                            BasPlcItemConfigDto basPlcItemConfigDto = new BasPlcItemConfigDto();
+                            basPlcItemConfigDto.Id = detail.Id;
+                            basPlcItemConfigDto.PlcAddress = detail.PlcAddress;
+                            basPlcItemConfigDto.PlcItem = detail.PlcItem;
+                            basPlcItemConfigDto.PlcValue = detail.PlcValue;
+                            basPlcItemConfigDto.Remark = detail.Remark;
+                            basPlcItemConfigDto.TestTime = detail.TestTime;
+                            basPlcItemConfigDto.RealValue = detail.RealValue;
+                            basPlcItemConfigDto.TestResult = detail.TestResult;
+                            OutConList.Add(basPlcItemConfigDto);
+                        }
+                    }
+                }
+
+
+
+
             }
             }
         }
         }
 
 
@@ -203,10 +233,24 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
 
 
         #region 私有发方法
         #region 私有发方法
 
 
+        /// <summary>
+        /// 点击测试项
+        /// </summary>
+        /// <exception cref="NotImplementedException"></exception>
+        private void ItemChange()
+        {
+            //获取选择的recordid
+            if(SelectIndex<conditionRecordList.Count)
+            {
+                int schDtlId = (int)conditionRecordList[SelectIndex].SchemeDtlId;
+                int recordDtlId = (int)conditionRecordList[SelectIndex].RecordDtlId;
+                DisplayDetail(schDtlId, recordDtlId);
+            }
+        }
+
+
 
 
-   
 
 
-      
         /// <summary>
         /// <summary>
         /// 开始检测
         /// 开始检测
         /// </summary>
         /// </summary>
@@ -498,6 +542,24 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             get { return stepIndex; }
             get { return stepIndex; }
             set { stepIndex = value; RaisePropertyChanged(); }
             set { stepIndex = value; RaisePropertyChanged(); }
         }
         }
+
+        //所有测试项列表
+        private List<string> schItems = new List<string>();
+        public List<string> SchItems
+        {
+            get { return schItems; }
+            set { schItems = value; RaisePropertyChanged(); }
+        }
+        //所选测试项目
+        private int selectIndex;
+        public int SelectIndex
+        {
+            get { return selectIndex; }
+            set { selectIndex = value; RaisePropertyChanged(); }
+        }
+        #endregion
+        #region 命令绑定
+        public DelegateCommand ItemChangeCommand { set; get; }
         #endregion
         #endregion
 
 
     }
     }

+ 1 - 1
BlankApp1/BlankApp1/Views/BusinessManageView/AutoTestView.xaml

@@ -30,7 +30,7 @@
             <ColumnDefinition/>
             <ColumnDefinition/>
         </Grid.ColumnDefinitions>
         </Grid.ColumnDefinitions>
         <DockPanel Grid.Column="0" LastChildFill="True">
         <DockPanel Grid.Column="0" LastChildFill="True">
-            <TextBlock Text="方案名称列表:"  Style="{StaticResource NormalTextBlockStyle}" Margin="5,0,5,0" DockPanel.Dock="Top"/>
+            <TextBlock Text="测试项列表:"  Style="{StaticResource NormalTextBlockStyle}" Margin="5,0,5,0" DockPanel.Dock="Top"/>
             <ListBox ItemsSource="{Binding SchItems}" SelectedValue="{Binding SelectItem}" SelectedIndex="{Binding SelectItemIndex}" >
             <ListBox ItemsSource="{Binding SchItems}" SelectedValue="{Binding SelectItem}" SelectedIndex="{Binding SelectItemIndex}" >
 
 
                 <b:Interaction.Triggers>
                 <b:Interaction.Triggers>

+ 1 - 1
BlankApp1/BlankApp1/Views/BusinessManageView/ManualTestView.xaml

@@ -37,7 +37,7 @@
             <ColumnDefinition/>
             <ColumnDefinition/>
         </Grid.ColumnDefinitions>
         </Grid.ColumnDefinitions>
         <DockPanel Grid.Column="0" LastChildFill="True">
         <DockPanel Grid.Column="0" LastChildFill="True">
-            <TextBlock Text="方案名称列表:"  Style="{StaticResource NormalTextBlockStyle}" Margin="5,0,5,0" DockPanel.Dock="Top"/>
+            <TextBlock Text="测试项列表:"  Style="{StaticResource NormalTextBlockStyle}" Margin="5,0,5,0" DockPanel.Dock="Top"/>
             <ListBox ItemsSource="{Binding SchItems}" SelectedValue="{Binding SelectItem}" SelectedIndex="{Binding SelectItemIndex}" >
             <ListBox ItemsSource="{Binding SchItems}" SelectedValue="{Binding SelectItem}" SelectedIndex="{Binding SelectItemIndex}" >
                
                
                 <b:Interaction.Triggers>
                 <b:Interaction.Triggers>

+ 13 - 4
BlankApp1/BlankApp1/Views/BusinessManageView/ResultQueryView.xaml

@@ -8,8 +8,12 @@
              xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
              xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
              xmlns:myContr="clr-namespace:BlankApp1.Controls"
              xmlns:myContr="clr-namespace:BlankApp1.Controls"
              xmlns:wpfdev="https://github.com/WPFDevelopersOrg/WPFDevelopers"
              xmlns:wpfdev="https://github.com/WPFDevelopersOrg/WPFDevelopers"
+             xmlns:cvt="clr-namespace:PLCTool.Controls.Convert"
              mc:Ignorable="d" 
              mc:Ignorable="d" 
              d:DesignHeight="450" d:DesignWidth="800">
              d:DesignHeight="450" d:DesignWidth="800">
+    <UserControl.Resources>
+        <cvt:TwoParConverter x:Key="TwoParConverter"/>
+    </UserControl.Resources>
     <Grid >
     <Grid >
         <b:Interaction.Triggers>
         <b:Interaction.Triggers>
             <b:EventTrigger EventName="Loaded">
             <b:EventTrigger EventName="Loaded">
@@ -87,15 +91,20 @@
                         <DataTemplate>
                         <DataTemplate>
                             <UniformGrid Columns="2">
                             <UniformGrid Columns="2">
                                 <Button  Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
                                 <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 SchemeId}" Cursor="Hand" Margin="0,0,5,0" >
-
+                       Command="{Binding DataContext.CheckDetailCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding RecordId}"  Cursor="Hand" Margin="0,0,5,0" >
+                                    
                                     <StackPanel Orientation="Horizontal">
                                     <StackPanel Orientation="Horizontal">
                                         <TextBlock  Text="查看详情" VerticalAlignment="Center" Foreground="Blue"/>
                                         <TextBlock  Text="查看详情" VerticalAlignment="Center" Foreground="Blue"/>
                                     </StackPanel>
                                     </StackPanel>
                                 </Button>
                                 </Button>
                                 <Button  Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
                                 <Button  Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
-Command="{Binding DataContext.PdfReportCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding SchemeId}" Cursor="Hand" >
-
+Command="{Binding DataContext.PdfReportCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" Cursor="Hand" >
+                                    <Button.CommandParameter>
+                                        <MultiBinding Converter="{ StaticResource ResourceKey=TwoParConverter}">
+                                            <Binding Path="SchemeId"  ></Binding>
+                                            <Binding Path="DeviceId"></Binding>
+                                        </MultiBinding>
+                                    </Button.CommandParameter>
                                     <StackPanel Orientation="Horizontal">
                                     <StackPanel Orientation="Horizontal">
                                         <TextBlock  Text="生成pdf报表" VerticalAlignment="Center" Foreground="Blue"/>
                                         <TextBlock  Text="生成pdf报表" VerticalAlignment="Center" Foreground="Blue"/>
                                     </StackPanel>
                                     </StackPanel>

+ 234 - 212
BlankApp1/BlankApp1/Views/BusinessManageView/TestResultDetailView.xaml

@@ -5,6 +5,7 @@
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:local="clr-namespace:PLCTool.Views.BusinessManageView"
              xmlns:local="clr-namespace:PLCTool.Views.BusinessManageView"
              xmlns:prism="http://prismlibrary.com/" 
              xmlns:prism="http://prismlibrary.com/" 
+             xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
              BorderBrush="#CBCBCB" BorderThickness="1"
              BorderBrush="#CBCBCB" BorderThickness="1"
              Height="600" Width="1000" >
              Height="600" Width="1000" >
 
 
@@ -19,245 +20,266 @@
     </UserControl.Resources>
     </UserControl.Resources>
 
 
     <Grid>
     <Grid>
-        <Grid.RowDefinitions>
 
 
-            <RowDefinition Height="50" />
-            <RowDefinition />
-            <RowDefinition />
-            <RowDefinition />
-            
-        </Grid.RowDefinitions>
+        <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}"  SelectedIndex="{Binding SelectIndex}" >
 
 
-        <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="2.2*"/>
-            </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.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>
+                <b:Interaction.Triggers>
+                    <b:EventTrigger EventName="SelectionChanged">
+                        <b:InvokeCommandAction Command="{Binding ItemChangeCommand}"/>
+                    </b:EventTrigger>
+                </b:Interaction.Triggers>
+            </ListBox>
 
 
-                        </RichTextBox>
-                    </DockPanel>
-                </Grid>
-            </Grid>
-            <Grid Grid.Column="2" >
-                <Grid.RowDefinitions>
-                    <RowDefinition Height="30"/>
-                    <RowDefinition/>
-                </Grid.RowDefinitions>
-                <DockPanel LastChildFill="False">
-                    <TextBlock Text="前置项明细:"   Style="{StaticResource textBlockStyle}" />
+        </DockPanel>
+        <Border Grid.Column="0"  BorderBrush="#CBCBCB" BorderThickness="1,0" />
+        <Grid Grid.Column="1">
+            <Grid.RowDefinitions>
 
 
-                </DockPanel>
-                <DataGrid Grid.Row="1"  ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False"  SelectionUnit="FullRow" SelectionMode="Single"   RowHeaderWidth="0" 
-                  ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}" x:Name="DeviceDataGrid" RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}"  AlternationCount="2"
-                    ItemsSource="{Binding BeforeConList}"  IsReadOnly="True" Padding="0" HorizontalScrollBarVisibility="Hidden">
-                    <DataGrid.Columns >
+                <RowDefinition Height="50" />
+                <RowDefinition />
+                <RowDefinition />
+                <RowDefinition />
 
 
-                        <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}"/>
+            </Grid.RowDefinitions>
 
 
-                    </DataGrid.Columns>
+            <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>
 
 
-                </DataGrid>
+            </StackPanel>
+            <Border Grid.Row="0"  BorderBrush="#CBCBCB" BorderThickness="0,1" />
+            <Grid Grid.Row="1">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="80"/>
+                    <ColumnDefinition/>
+                    <ColumnDefinition Width="2.2*"/>
+                </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.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>
 
 
-            </Grid>
-        </Grid>
-        <Grid Grid.Row="2">
-            <Grid.ColumnDefinitions>
-                <ColumnDefinition Width="80"/>
-                <ColumnDefinition/>
-                <ColumnDefinition Width="2.2*"/>
-            </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 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.Column="2" >
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="30"/>
+                        <RowDefinition/>
+                    </Grid.RowDefinitions>
+                    <DockPanel LastChildFill="False">
+                        <TextBlock Text="前置项明细:"   Style="{StaticResource textBlockStyle}" />
 
 
-                        </RichTextBox>
                     </DockPanel>
                     </DockPanel>
-                </Grid>
-            </Grid>
-            <Grid Grid.Column="2" >
-                <Grid.RowDefinitions>
-                    <RowDefinition Height="30"/>
-                    <RowDefinition/>
-                </Grid.RowDefinitions>
-                <DockPanel LastChildFill="False">
-                    <TextBlock Text="输入项明细:"   Style="{StaticResource textBlockStyle}" />
+                    <DataGrid Grid.Row="1"  ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False"  SelectionUnit="FullRow" SelectionMode="Single"   RowHeaderWidth="0" 
+             ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}" x:Name="DeviceDataGrid" RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}"  AlternationCount="2"
+               ItemsSource="{Binding BeforeConList}"  IsReadOnly="True" Padding="0" HorizontalScrollBarVisibility="Hidden">
+                        <DataGrid.Columns >
 
 
-                </DockPanel>
-                <DataGrid Grid.Row="1"  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 InConList}"  IsReadOnly="True"  Padding="0" HorizontalScrollBarVisibility="Hidden">
-                    <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>
-        <Border Grid.Row="2"  BorderBrush="#CBCBCB" BorderThickness="0,1,0,0" />
-        <Grid Grid.Row="3">
-            <Grid.ColumnDefinitions>
-                <ColumnDefinition Width="80"/>
-                <ColumnDefinition/>
-                <ColumnDefinition Width="2.2*"/>
-            </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 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">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="80"/>
+                    <ColumnDefinition/>
+                    <ColumnDefinition Width="2.2*"/>
+                </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>
+
+                            </RichTextBox>
+                        </DockPanel>
+                    </Grid>
                 </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>
+                <Grid Grid.Column="2" >
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="30"/>
+                        <RowDefinition/>
+                    </Grid.RowDefinitions>
+                    <DockPanel LastChildFill="False">
+                        <TextBlock Text="输入项明细:"   Style="{StaticResource textBlockStyle}" />
 
 
-                        </RichTextBox>
                     </DockPanel>
                     </DockPanel>
+                    <DataGrid Grid.Row="1"  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 InConList}"  IsReadOnly="True"  Padding="0" HorizontalScrollBarVisibility="Hidden">
+                        <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>
-            <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" 
-       ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}"  RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}"  AlternationCount="2"
-         ItemsSource="{Binding OutConList}"  IsReadOnly="True" Padding="0" HorizontalScrollBarVisibility="Hidden">
-                    <DataGrid.Columns >
+            <Border Grid.Row="2"  BorderBrush="#CBCBCB" BorderThickness="0,1,0,0" />
+            <Grid Grid.Row="3">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="80"/>
+                    <ColumnDefinition/>
+                    <ColumnDefinition Width="2.2*"/>
+                </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>
+
+                            </RichTextBox>
+                        </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" 
+  ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}"  RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}"  AlternationCount="2"
+    ItemsSource="{Binding OutConList}"  IsReadOnly="True" Padding="0" HorizontalScrollBarVisibility="Hidden">
+                        <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>
-        <Border Grid.Row="3"  BorderBrush="#CBCBCB" BorderThickness="0,1,0,0" />
+     
     
     
       
       
     </Grid>
     </Grid>