<pi:UserControlBase x:Class="智慧物流软件系统.DataListWarnInfoView"
             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:智慧物流软件系统"
             mc:Ignorable="d"
             xmlns:hc="https://handyorg.github.io/handycontrol"
             xmlns:pi="https://github.com/ping9719/wpfex"
             d:DesignHeight="450" d:DesignWidth="800" LoadedVisibleFirst="loadFirst">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
        <!--条件区-->
        <Grid Margin="5,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <UniformGrid Grid.Column="0" Columns="4">
                <hc:DateTimePicker SelectedDateTime="{Binding TimeGo}" Margin="5" Style="{StaticResource DateTimePickerExtend}" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="开始时间" VerticalAlignment="Center"/>
                <hc:DateTimePicker SelectedDateTime="{Binding TimeTo}" Margin="5" Style="{StaticResource DateTimePickerExtend}" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="结束时间" VerticalAlignment="Center"/>
                <hc:TextBox Text="{Binding Info1}" Margin="5" Style="{StaticResource TextBoxExtend}" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="来源" hc:InfoElement.Placeholder="模糊匹配" VerticalAlignment="Center"/>
                <hc:TextBox Text="{Binding Info2}" Margin="5" Style="{StaticResource TextBoxExtend}" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="级别" hc:InfoElement.Placeholder="模糊匹配" VerticalAlignment="Center"/>
            </UniformGrid>
            <hc:UniformSpacingPanel Grid.Column="1" Spacing="5">
                <ToggleButton Content="导出Excel" Command="{Binding ExportExcelCommand}" Style="{StaticResource ToggleButtonLoadingSuccess}" IsChecked="{Binding IsLoad1}" Width="80"></ToggleButton>
                <ToggleButton Content="查询" Command="{Binding UpdateListCommand}" Style="{StaticResource ToggleButtonLoadingPrimary}" IsChecked="{Binding IsLoad2}" Width="70"></ToggleButton>
            </hc:UniformSpacingPanel>
        </Grid>
        <!--内容区-->
        <Border Grid.Row="1" Style="{StaticResource BorderRegion}" BorderThickness="1" Background="#EEEEEE" Margin="3,0,3,3" Padding="0" >
            <DataGrid RowHeaderWidth="50" HeadersVisibility="All" AutoGenerateColumns="False" ItemsSource="{Binding DataList}" hc:DataGridAttach.CanUnselectAllWithBlankArea="False" hc:DataGridAttach.ShowSelectAllButton="False" hc:DataGridAttach.ShowRowNumber="True">
                <DataGrid.Columns>
                    <DataGridTextColumn IsReadOnly="True" Width="100" Binding="{Binding Source}" Header="来源" CanUserSort="False"/>
                    <DataGridTextColumn IsReadOnly="True" Width="200" Binding="{Binding Text}" Header="信息" CanUserSort="False"/>
                    <DataGridTextColumn IsReadOnly="True" Width="100" Binding="{Binding Level}" Header="级别" CanUserSort="False"/>
                    <DataGridTextColumn IsReadOnly="True" Width="200" Binding="{Binding Solution}" Header="解决方案" CanUserSort="False"/>
                    <DataGridTextColumn IsReadOnly="True" Width="100" Binding="{Binding WarnType}" Header="警告类型" CanUserSort="False"/>
                    <DataGridTextColumn IsReadOnly="True" Width="200" Binding="{Binding TimeGo,StringFormat=yyyy-MM-dd HH:mm}" Header="开始时间" CanUserSort="False"/>
                    <DataGridTextColumn IsReadOnly="True" Width="160" Binding="{Binding DuraTime}" Header="持续时间" CanUserSort="False"/>
                    <!--<DataGridTemplateColumn CanUserResize="False" Width="auto">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button Style="{StaticResource ButtonSuccess}" IsEnabled="True" Content="详情" Width="70" Command="{Binding DataContext.SeeCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding }"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>-->
                </DataGrid.Columns>
            </DataGrid>
        </Border>
        <!--页码区-->
        <hc:Pagination Grid.Row="2" AutoHiding="True" MaxPageCount="{Binding MaxPageCount}" PageIndex="{Binding PageIndex}" DataCountPerPage="{Binding DataCountPerPage}" IsJumpEnabled="False" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,3" FontSize="16" >
            <hc:Interaction.Triggers>
                <hc:EventTrigger EventName="PageUpdated">
                    <hc:EventToCommand Command="{Binding PageUpdateCommand}" PassEventArgsToCommand="True" />
                </hc:EventTrigger>
            </hc:Interaction.Triggers>
        </hc:Pagination>
    </Grid>
</pi:UserControlBase>
