Browse Source

修改提示信息和测试界面样式

ltwork 1 year ago
parent
commit
9e48d80ece

+ 6 - 13
BlankApp1/BlankApp1/ViewModels/BasicConfigViewModel/AddOrEditSchViewModel.cs

@@ -617,7 +617,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
             }
             if (string.IsNullOrEmpty(DeviceKindName))
             {
-                MessageBox.Show("请填写设备名称!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
+                MessageBox.Show("请填写设备类型名称!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                 return;
             }
             if (string.IsNullOrEmpty(SelectTest))
@@ -732,19 +732,12 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
                 GetExistSchs();
                 //清空已填写的内容
            
-                DeviceKindName = string.Empty;
-                SelectTest = string.Empty;
+    
                 TestName = string.Empty;
-                BeforeSelectJudge = string.Empty;
-        
-                SelectLogic = string.Empty;
-                SelectInJudge = string.Empty;
-                InSelectLogic = string.Empty;
-                SelectOutJudge = string.Empty;
-                OutSelectLogic = string.Empty;
-                BeforeConList = null;
-                InConList = null;
-                OutConList = null;
+      
+                BeforeConList =new ObservableCollection<BasPlcItemConfigDto>();
+                InConList = new ObservableCollection<BasPlcItemConfigDto>();
+                OutConList = new ObservableCollection<BasPlcItemConfigDto>();
             }
             catch (Exception ex)
             {

+ 5 - 5
BlankApp1/BlankApp1/ViewModels/BasicConfigViewModel/DeviceKindViewModel.cs

@@ -115,8 +115,8 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
                         {
                             //重新读取PLC
                             GetPprojectConfig();
-                            _logger.LogInformation($"修改项目成功");
-                            MessageBox.Show("修改项目成功", "确认", MessageBoxButton.OK, MessageBoxImage.Information);
+                            _logger.LogInformation($"修改设备类型成功");
+                            MessageBox.Show("修改设备类型成功", "确认", MessageBoxButton.OK, MessageBoxImage.Information);
                         }
                     }
                 }
@@ -220,7 +220,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
                         var findPlc = allDeviceKindList.FirstOrDefault(x => (x.DeviceKindName == returnValue.DeviceKindName) || (x.DeviceKindNo == returnValue.DeviceKindNo));
                         if (findPlc != null)
                         {
-                            MessageBox.Show("已有此项目名称或编号,请更改!", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
+                            MessageBox.Show("已有此设备类型名称或编号,请更改!", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
                             return;
                         }
                         bool isSucc = _iBasicDeviceKindService.Add(deviceKindCon);
@@ -228,8 +228,8 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
                         {
                             //重新读取PLC
                             GetPprojectConfig();
-                            _logger.LogInformation($"添加项目成功");
-                            MessageBox.Show("添加项目成功!", "确认", MessageBoxButton.OK, MessageBoxImage.Information);
+                            _logger.LogInformation($"添加设备类型成功");
+                            MessageBox.Show("添加设备类型成功!", "确认", MessageBoxButton.OK, MessageBoxImage.Information);
                         }
                     }
                 }

+ 5 - 5
BlankApp1/BlankApp1/ViewModels/BasicConfigViewModel/DeviceViewModel.cs

@@ -128,8 +128,8 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
                         {
                             //重新读取PLC
                             GetPprojectConfig();
-                            _logger.LogInformation($"修改项目成功");
-                            MessageBox.Show("修改项目成功", "确认", MessageBoxButton.OK, MessageBoxImage.Information);
+                            _logger.LogInformation($"修改设备信息成功");
+                            MessageBox.Show("修改设备信息成功", "确认", MessageBoxButton.OK, MessageBoxImage.Information);
                         }
                     }
                 }
@@ -234,7 +234,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
                         var findPlc = allDeviceList.FirstOrDefault(x => (x.DeviceName == returnValue.DeviceName) || (x.DeviceNo == returnValue.DeviceNo));
                         if (findPlc != null)
                         {
-                            MessageBox.Show("已有此项目名称或编号,请更改!", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
+                            MessageBox.Show("已有此设备名称或编号,请更改!", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
                             return;
                         }
                         bool isSucc = _iBasicDeviceService.Add(deviceCon);
@@ -242,8 +242,8 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
                         {
                             //重新读取PLC
                             GetPprojectConfig();
-                            _logger.LogInformation($"添加项目成功");
-                            MessageBox.Show("添加项目成功!", "确认", MessageBoxButton.OK, MessageBoxImage.Information);
+                            _logger.LogInformation($"添加设备成功");
+                            MessageBox.Show("添加设备成功!", "确认", MessageBoxButton.OK, MessageBoxImage.Information);
                         }
                     }
                 }

+ 1 - 6
BlankApp1/BlankApp1/Views/BasicConfigView/DeviceKindView.xaml

@@ -86,12 +86,7 @@
                                         <TextBlock  Text="删除" VerticalAlignment="Center" Foreground="Blue"/>
                                     </StackPanel>
                                 </Button>
-                                <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 DeviceKindId}" Cursor="Hand" Margin="0,0,10,0" >
-                                    <StackPanel Orientation="Horizontal">
-                                        <TextBlock  Text="查看测试方案" VerticalAlignment="Center" Foreground="Blue"/>
-                                    </StackPanel>
-                                </Button>
+                                
                             </StackPanel>
                         </DataTemplate>
                     </DataGridTemplateColumn.CellTemplate>

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

@@ -26,7 +26,7 @@
             </b:EventTrigger>
         </b:Interaction.Triggers>
         <Grid.ColumnDefinitions>
-            <ColumnDefinition Width="90"/>
+            <ColumnDefinition Width="auto"/>
             <ColumnDefinition/>
         </Grid.ColumnDefinitions>
         <DockPanel Grid.Column="0" LastChildFill="True">
@@ -277,7 +277,7 @@ ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}"  RowHeaderStyle="{StaticR
 
                 </Grid>
             </Grid>
-            <Border Grid.Row="3"  BorderBrush="#CBCBCB" BorderThickness="0,1,0,0" />
+            <Border Grid.Row="3"  BorderBrush="#CBCBCB" BorderThickness="0,1,0,1" />
             <Grid Grid.Row="4">
                 <hc:StepBar  StepIndex="{Binding StepIndex}" VerticalAlignment="Center" x:Name="ProSetpBar"  >
                     <hc:StepBarItem Content="开始"/>

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

@@ -33,7 +33,7 @@
 
     <Grid>
         <Grid.ColumnDefinitions>
-            <ColumnDefinition Width="90"/>
+            <ColumnDefinition Width="auto"/>
             <ColumnDefinition/>
         </Grid.ColumnDefinitions>
         <DockPanel Grid.Column="0" LastChildFill="True">
@@ -288,7 +288,7 @@
 
                 </Grid>
             </Grid>
-            <Border Grid.Row="3"  BorderBrush="#CBCBCB" BorderThickness="0,1,0,0" />
+            <Border Grid.Row="3"  BorderBrush="#CBCBCB" BorderThickness="0,1,0,1" />
             <Grid Grid.Row="4">
                 <hc:StepBar  StepIndex="{Binding StepIndex}" VerticalAlignment="Center" x:Name="ProSetpBar"  >
                     <hc:StepBarItem Content="开始"/>