<Page x:Class="CCDCountWpf.WpfPage.AuditTrailPage"
      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:CCDCountWpf.WpfPage" xmlns:wpf="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="AuditTrailPage">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Button x:Name="BatchRecordBtn" Content="批记录" Grid.Column="0" Click="BatchRecordBtn_Click"></Button>
            <Button x:Name="FormulationRecordBtn" Content="生产配方记录" Grid.Column="1" Click="FormulationRecordBtn_Click"></Button>
            <Button x:Name="ValueChangeRecordBtd" Content="参数修改记录" Grid.Column="2" Click="ValueChangeRecordBtd_Click"></Button>
            <Button x:Name="ErrorRecordBtn" Content="异常记录" Grid.Column="3" Click="ErrorRecordBtn_Click"></Button>
        </Grid>
        <Grid Grid.Row="1">
            <Grid x:Name="BatchRecordGrid" Visibility="Visible">
                <Grid.RowDefinitions>
                    <RowDefinition Height="50" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Label Content="日期筛选:" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,0,0,0" />
                <DatePicker x:Name="BatchMinTime" Width="120" Height="25"  HorizontalAlignment="Left" VerticalAlignment="Center" SelectedDateChanged="BatchMinTime_SelectedDateChanged" Margin="65,0,0,0"/>
                <Label Content="-" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="190,0,0,0" />
                <DatePicker x:Name="BatchMaxTime" Width="120" Height="25"  HorizontalAlignment="Left" Margin="210,0,0,0" VerticalAlignment="Center" SelectedDateChanged="BatchMaxTime_SelectedDateChanged"/>
                <Label Content="记录间隔:" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,350,0" />
                <ComboBox x:Name="TimeIntervalComBox" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,270,0" Width="80" SelectionChanged="TimeIntervalComBox_SelectionChanged" />
                <Label Content="批次选择:" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,200,0" />
                <ComboBox Grid.Row="0" x:Name="BatchNumComBox" ItemsSource="{Binding BatchItems}" MaxDropDownHeight="100" Background="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Center" Height="30" Width="180" FontSize="12" HorizontalContentAlignment="Center" Padding="6,6,5,3" Margin="0,0,10,0" SelectionChanged="BatchNumComBox_SelectionChanged"/>
                <wpf:WebView2 x:Name="BatchRecordWebBrowser" Grid.Row="1" />
            </Grid>
            <Grid x:Name="FormulationRecordGrid" Visibility="Collapsed">
                <Grid.RowDefinitions>
                    <RowDefinition Height="50" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Label Content="配方选择:" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,200,0" />
                <ComboBox Grid.Row="0" x:Name="FormulationRecordComBox" ItemsSource="{Binding FormulationItems}" MaxDropDownHeight="100" Background="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Center" Height="30" Width="180" FontSize="12" HorizontalContentAlignment="Center" Padding="6,6,5,3" Margin="0,0,10,0" SelectionChanged="FormulationRecordComBox_SelectionChanged"/>
                <wpf:WebView2 x:Name="FormulationRecordWebBrowser" Grid.Row="1" />
            </Grid>
            <Grid x:Name="ValueChangeRecordGrid" Visibility="Collapsed">
                <Grid.RowDefinitions>
                    <RowDefinition Height="50" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Label Content="日期筛选:" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,0,0,0" />
                <DatePicker x:Name="ValueChangeRecordMinTime" Width="120" Height="25"  HorizontalAlignment="Left" VerticalAlignment="Center" SelectedDateChanged="ValueChangeRecordMinTime_SelectedDateChanged" Margin="65,0,0,0"/>
                <Label Content="-" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="190,0,0,0" />
                <DatePicker x:Name="ValueChangeRecordMaxTime" Width="120" Height="25"  HorizontalAlignment="Left" Margin="210,0,0,0" VerticalAlignment="Center" SelectedDateChanged="ValueChangeRecordMaxTime_SelectedDateChanged"/>
                <Label Content="日期选择:" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,200,0" />
                <ComboBox Grid.Row="0" x:Name="ValueChangeDateComBox" ItemsSource="{Binding ValueChangeItems}" MaxDropDownHeight="100" Background="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Center" Height="30" Width="180" FontSize="12" HorizontalContentAlignment="Center" Padding="6,6,5,3" Margin="0,0,10,0" SelectionChanged="ValueChangeRecordComBox_SelectionChanged"/>
                <wpf:WebView2 x:Name="ValueChangeRecordWebBrowser" Grid.Row="1" />
            </Grid>
            <Grid x:Name="ErrorRecordGrid" Visibility="Collapsed">
                <Grid.RowDefinitions>
                    <RowDefinition Height="50" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Label Content="日期筛选:" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,0,0,0" />
                <DatePicker x:Name="ErrorMessageRecordMinTime" Width="120" Height="25"  HorizontalAlignment="Left" VerticalAlignment="Center" SelectedDateChanged="ErrorMessageRecordMinTime_SelectedDateChanged" Margin="65,0,0,0"/>
                <Label Content="-" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="190,0,0,0" />
                <DatePicker x:Name="ErrorMessageRecordMaxTime" Width="120" Height="25"  HorizontalAlignment="Left" Margin="210,0,0,0" VerticalAlignment="Center" SelectedDateChanged="ErrorMessageRecordMaxTime_SelectedDateChanged"/>
                <Label Content="日期选择:" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,200,0" />
                <ComboBox Grid.Row="0" x:Name="ErrorMessageDateComBox" ItemsSource="{Binding ErrorMessItems}" MaxDropDownHeight="100" Background="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Center" Height="30" Width="180" FontSize="12" HorizontalContentAlignment="Center" Padding="6,6,5,3" Margin="0,0,10,0" SelectionChanged="ErrorMessageRecordComBox_SelectionChanged"/>
                <wpf:WebView2 x:Name="ErrorMessageRecordWebBrowser" Grid.Row="1" />
            </Grid>
        </Grid>
    </Grid>
</Page>
