145 lines
5.8 KiB
XML
145 lines
5.8 KiB
XML
<local:BaseWindow
|
|
x:Class="SamplePre.UIWpf.ParamManager.chirld.ImportSampleWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
Title="导入历史样品"
|
|
Width="900"
|
|
Height="650"
|
|
ResizeMode="NoResize"
|
|
WindowStartupLocation="CenterScreen"
|
|
mc:Ignorable="d">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="40" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<StackPanel Margin="10,0" Orientation="Horizontal">
|
|
<FrameworkElement x:Name="DataContextProxy" Visibility="Collapsed" />
|
|
|
|
<TextBlock VerticalAlignment="Center" Text="时间:" />
|
|
<DatePicker
|
|
Width="140"
|
|
Height="40"
|
|
Margin="10,0"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
SelectedDate="{Binding StartDate}" />
|
|
<TextBlock VerticalAlignment="Center" Text="—" />
|
|
<DatePicker
|
|
Width="140"
|
|
Height="40"
|
|
Margin="10,0"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
SelectedDate="{Binding EndDate}" />
|
|
|
|
|
|
<Button
|
|
x:Name="btnFind"
|
|
Width="100"
|
|
Height="30"
|
|
Margin="15,0,5,0"
|
|
Command="{Binding FindClickCommand}"
|
|
Content="查询" />
|
|
<Button
|
|
x:Name="btnImport"
|
|
Width="100"
|
|
Height="30"
|
|
Margin="5,0"
|
|
Command="{Binding ImportClickCommand}"
|
|
Content="导入" />
|
|
</StackPanel>
|
|
<!-- 样品列表 -->
|
|
<DataGrid
|
|
x:Name="dg_samples"
|
|
Grid.Row="1"
|
|
Margin="5"
|
|
AutoGenerateColumns="False"
|
|
Background="White"
|
|
CanUserAddRows="False"
|
|
CanUserSortColumns="True"
|
|
FrozenColumnCount="1"
|
|
HorizontalScrollBarVisibility="Auto"
|
|
ItemsSource="{Binding SampleList}"
|
|
SelectionMode="Extended"
|
|
VerticalScrollBarVisibility="Auto">
|
|
|
|
|
|
|
|
<!-- 分组样式 -->
|
|
<DataGrid.GroupStyle>
|
|
<GroupStyle>
|
|
<GroupStyle.HeaderTemplate>
|
|
<DataTemplate>
|
|
<DockPanel Height="25" LastChildFill="True">
|
|
<Border Background="Transparent">
|
|
<CheckBox
|
|
Command="{Binding DataContext.CheckBoxClickCommand, Source={x:Reference DataContextProxy}}"
|
|
CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
|
|
Content="{Binding Name}"
|
|
FontWeight="Bold"
|
|
IsChecked="{Binding DataContext.IsGroupSelected, Source={x:Reference DataContextProxy}}" />
|
|
</Border>
|
|
|
|
<!--<TextBlock
|
|
Margin="5,0"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center"
|
|
FontWeight="Bold"
|
|
Text="{Binding Name}" />-->
|
|
</DockPanel>
|
|
</DataTemplate>
|
|
</GroupStyle.HeaderTemplate>
|
|
</GroupStyle>
|
|
</DataGrid.GroupStyle>
|
|
|
|
<DataGrid.Columns>
|
|
<!-- 列头复选框样式 -->
|
|
<DataGridCheckBoxColumn Binding="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}">
|
|
<DataGridCheckBoxColumn.Header>
|
|
<Border Background="Transparent">
|
|
<CheckBox IsChecked="{Binding DataContext.IsAllItems1Selected, Source={x:Reference DataContextProxy}}" />
|
|
</Border>
|
|
</DataGridCheckBoxColumn.Header>
|
|
<DataGridCheckBoxColumn.HeaderStyle>
|
|
<Style BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}" TargetType="{x:Type DataGridColumnHeader}">
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
</Style>
|
|
</DataGridCheckBoxColumn.HeaderStyle>
|
|
</DataGridCheckBoxColumn>
|
|
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding qrcode}"
|
|
Header="二维码"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding item_name}"
|
|
Header="样品名称"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding standrad}"
|
|
Header="标准"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding input_date}"
|
|
Header="录入日期"
|
|
IsReadOnly="False" />
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding bach_no}"
|
|
Header="批次"
|
|
IsReadOnly="True" />
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
|
|
</Grid>
|
|
</local:BaseWindow>
|