You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
8.6 KiB
Plaintext

<UserControl x:Class="MaterialTraceabilityUI.LogRecordControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:MaterialTraceabilityUI"
mc:Ignorable="d"
d:DesignHeight="452" d:DesignWidth="640" Background="Transparent" Loaded="UserControl_Loaded">
<Border CornerRadius="10" Background="White">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="100"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#007DFA" BorderThickness="1" CornerRadius="10" Background="Transparent">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<StackPanel Margin="15,0" Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center">
<Label Content="开始时间" Foreground="#007DFA" Height="30" HorizontalAlignment="Left"/>
<DatePicker x:Name="beginTime" Width="150" HorizontalAlignment="Left" Height="30"/>
<Label Margin="20,0,0,0" Content="日志类型" Foreground="#007DFA" Height="30" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<ComboBox x:Name="logType" Width="150" Foreground="#007DFA" HorizontalAlignment="Left" VerticalAlignment="Center" Height="30"/>
<Label Margin="20,0,0,0" Content="是否异常" Foreground="#007DFA" Height="30" HorizontalAlignment="Left"/>
<ComboBox x:Name="isAlarm" Width="150" Foreground="#007DFA" HorizontalAlignment="Left" VerticalAlignment="Center" Height="30"/>
<!--<RadioButton Content="查询" Style="{StaticResource NavRadioButtonStyle}" Background="Blue"/>-->
<Button x:Name="seach" Content="查询" Background="#007DFA" Foreground="White" Margin="20,0,0,0" Height="30" BorderBrush="DeepSkyBlue" BorderThickness="1" Width="80" Click="Seach_Click"/>
</StackPanel>
<StackPanel Margin="15,0" Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center">
<Label Content="结束时间" Foreground="#007DFA" Height="30" HorizontalAlignment="Left"/>
<DatePicker x:Name="endTime" Width="150" HorizontalAlignment="Left" Height="30"/>
</StackPanel>
</Grid>
</Border>
<Border Grid.Row="1" Margin="0,5,0,0" BorderBrush="#007DFA" BorderThickness="1" CornerRadius="0" Background="Transparent">
<DataGrid x:Name="LogRecordDataGrid" Style="{DynamicResource DataGridStyle}" ColumnHeaderHeight="22" RowHeight="20" AutoGenerateColumns="False" RowHeaderWidth="0" GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0">
<DataGrid.Resources>
<Style x:Key="DataGridStyle" TargetType="DataGrid">
<Setter Property="AlternationCount" Value="2"/>
<Setter Property="ColumnHeaderStyle" Value="{DynamicResource DataGridColumnHeaderStyle}"/>
<Setter Property="CellStyle" Value="{DynamicResource DataGridCellStyle}"/>
<Setter Property="RowStyle" Value="{DynamicResource DataGridRowStyle}"/>
</Style>
<Style x:Key="DataGridColumnHeaderStyle" TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="White"/>
</Style>
<Style x:Key="DataGridRowStyle" TargetType="{x:Type DataGridRow}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridRow}">
<Grid x:Name="DGR_Border" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1"/>
<DataGridCellsPresenter Grid.Column="1" ItemsPanel="{TemplateBinding ItemsPanel}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderBrush" Value="#00BCD4"/>
</Trigger>
<Trigger Property="AlternationIndex" Value="0">
<Setter Property="Background" Value="#E9F3FD"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsNewItem" Value="True">
<Setter Property="Margin" Value="{Binding NewItemMargin, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="DataGridCellStyle" TargetType="{x:Type DataGridCell}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="Gray"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding machineId}" Header="设备编号" Width="60"/>
<DataGridTextColumn Binding="{Binding processId}" Header="工序" Width="*"/>
<!--<DataGridTextColumn Binding="{Binding rfid}" Header="RFID" Width="*"/>
<DataGridTextColumn Binding="{Binding sdc}" Header="SFC" Width="*"/>-->
<DataGridTextColumn Binding="{Binding alarmType}" Header="日志类型" Width="*"/>
<DataGridTextColumn Binding="{Binding alarmInfo}" Header="日志信息" Width="*"/>
<DataGridTextColumn Binding="{Binding recordTime}" Header="记录时间" Width="*"/>
</DataGrid.Columns>
</DataGrid>
</Border>
</Grid>
</Border>
</UserControl>