Browse Source

添加测试时间

ltwork 1 year ago
parent
commit
8dccb08404

+ 29 - 3
BlankApp1/BlankApp1/ViewModels/BasicConfigViewModel/AddItemDetailViewModel.cs

@@ -16,6 +16,7 @@ using Prism.Services.Dialogs;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Collections.ObjectModel;
+using System.Configuration;
 using System.Linq;
 using System.Linq;
 using System.Text;
 using System.Text;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
@@ -39,7 +40,8 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
         private List<OptionConfigDto> _optionConfigs;
         private List<OptionConfigDto> _optionConfigs;
         private bas_plc_test_scheme bas_Plc_Test_Scheme;//测试方案
         private bas_plc_test_scheme bas_Plc_Test_Scheme;//测试方案
         private int schDtlMainId = 0;//测试方案明细主键id
         private int schDtlMainId = 0;//测试方案明细主键id
-   
+        private int delayTime = Convert.ToInt32(ConfigurationManager.AppSettings["DelayTime"]);
+        private int longDelayTime = Convert.ToInt32(ConfigurationManager.AppSettings["LongDelayTime"]);
         public AddItemDetailViewModel(IDialogService dialog, IEventAggregator aggregator, IRegionManager regionManager, IOptionConfigService optionConfigService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBasicPlcTestSchemeDtlService basicPlcTestSchemeDtlService, IBasicDeviceKindService iBasicDeviceKindService, IMapper mapper, ILogger logger)
         public AddItemDetailViewModel(IDialogService dialog, IEventAggregator aggregator, IRegionManager regionManager, IOptionConfigService optionConfigService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBasicPlcTestSchemeDtlService basicPlcTestSchemeDtlService, IBasicDeviceKindService iBasicDeviceKindService, IMapper mapper, ILogger logger)
         {
         {
             _dialog = dialog;
             _dialog = dialog;
@@ -279,6 +281,13 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
 
 
             }
             }
 
 
+            //测试时间
+            TestTimeList.Clear();
+
+            TestTimeList.Add(delayTime.ToString());
+            TestTimeList.Add(longDelayTime.ToString());
+            SelectTime = delayTime.ToString();
+
         }
         }
 
 
 
 
@@ -487,6 +496,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
             schDtlDto.ItemName = TestName;
             schDtlDto.ItemName = TestName;
 
 
             schDtlDto.ItemType = SelectTest;
             schDtlDto.ItemType = SelectTest;
+            schDtlDto.ItemTime = Convert.ToInt32(SelectTime);
             schDtlDto.Precondition = prefixJsonStr;
             schDtlDto.Precondition = prefixJsonStr;
             schDtlDto.PreconditionDescribe = BeforeDetail;
             schDtlDto.PreconditionDescribe = BeforeDetail;
             schDtlDto.Action = inJsonStr;
             schDtlDto.Action = inJsonStr;
@@ -650,11 +660,27 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
     
     
        
        
         public DelegateCommand<object> EditDetailCommand { set; get; }
         public DelegateCommand<object> EditDetailCommand { set; get; }
-     
- 
+
+
 
 
         #endregion
         #endregion
         #region 变量绑定
         #region 变量绑定
+
+        /// <summary>
+        /// 测试时间
+        /// </summary>
+        private string selectTime;
+        public string SelectTime
+        {
+            get { return selectTime; }
+            set { selectTime = value; RaisePropertyChanged(); }
+        }
+        private ObservableCollection<string> testTimeList = new ObservableCollection<string>();
+        public ObservableCollection<string> TestTimeList
+        {
+            get { return testTimeList; }
+            set { testTimeList = value; RaisePropertyChanged(); }
+        }
         /// <summary>
         /// <summary>
         /// 测试方案编码
         /// 测试方案编码
         /// </summary>
         /// </summary>

+ 5 - 0
BlankApp1/BlankApp1/Views/BasicConfigView/AddItemDetailView.xaml

@@ -100,6 +100,11 @@
                                 <TextBlock Text="测试项类型:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
                                 <TextBlock Text="测试项类型:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
                                 <ComboBox  Height="28" Width="160" ItemsSource="{Binding TestKinds}" SelectedItem="{Binding SelectTest}" />
                                 <ComboBox  Height="28" Width="160" ItemsSource="{Binding TestKinds}" SelectedItem="{Binding SelectTest}" />
                             </StackPanel>
                             </StackPanel>
+                            <StackPanel Orientation="Horizontal" >
+                                <TextBlock Text="测试项时间:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
+                                <ComboBox  Height="28" Width="80" ItemsSource="{Binding TestTimeList}" SelectedItem="{Binding SelectTime}" />
+                                <TextBlock Text="S"  Style="{StaticResource NormalTextBlockStyle}" Margin="5,0,5,0"/>
+                            </StackPanel>
                         </StackPanel>
                         </StackPanel>
 
 
                         <Border Grid.Row="1"  BorderBrush="#CBCBCB" BorderThickness="1" />
                         <Border Grid.Row="1"  BorderBrush="#CBCBCB" BorderThickness="1" />

+ 3 - 3
BlankApp1/BlankApp1/Views/BasicConfigView/EditSchView.xaml

@@ -121,16 +121,16 @@ ItemsSource="{Binding SchProjectList}" VerticalScrollBarVisibility="Visible" >
                                 <DataGridTextColumn Header="前置项描述" Binding="{Binding BeforeDetail}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
                                 <DataGridTextColumn Header="前置项描述" Binding="{Binding BeforeDetail}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
                                 <DataGridTextColumn Header="输入项描述" Binding="{Binding InDetail}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
                                 <DataGridTextColumn Header="输入项描述" Binding="{Binding InDetail}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
                                 <DataGridTextColumn Header="输出项描述" Binding="{Binding OutDetail}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
                                 <DataGridTextColumn Header="输出项描述" Binding="{Binding OutDetail}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                                <DataGridTemplateColumn Header="操作" Width="240" CellStyle="{StaticResource MyDataGridCellStyle}">
+                                <DataGridTemplateColumn Header="操作" Width="200" CellStyle="{StaticResource MyDataGridCellStyle}">
                                     <DataGridTemplateColumn.CellTemplate>
                                     <DataGridTemplateColumn.CellTemplate>
                                         <DataTemplate>
                                         <DataTemplate>
                                             <StackPanel Orientation="Horizontal">
                                             <StackPanel Orientation="Horizontal">
-                                                <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.DetailCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding SchDtlId}" Cursor="Hand" Margin="0,0,10,0" >
         Command="{Binding DataContext.DetailCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding SchDtlId}" Cursor="Hand" Margin="0,0,10,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.EditCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding SchDtlId}" Cursor="Hand" Margin="0,0,10,0" >
 Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding SchDtlId}" Cursor="Hand" Margin="0,0,10,0" >
                                                 <StackPanel Orientation="Horizontal">
                                                 <StackPanel Orientation="Horizontal">