schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<UserControl x:Class="XHandler.View.MoveLiquidReport.MoveLiquidResult"
             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:XHandler.View.MoveLiquidReport"
             xmlns:str="clr-namespace:XHandler.Properties"
             xmlns:page="clr-namespace:XHandler.View.Page"
             xmlns:ctrls="clr-namespace:XHandler.Controls" 
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="1920" Loaded="UserControl_Loaded">
<UserControl.Resources>
        <Style x:Key="rowStyle" TargetType="DataGridRow">
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="Background" Value="White" />
            <Setter Property="Height" Value="40"/>
            <Setter Property="FontSize" Value="16" />
            <Setter Property="Foreground" Value="Black" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{DynamicResource lightBlueBrush}"/>
                    <Setter Property="Foreground" Value="Black"/>
                </Trigger>
            </Style.Triggers>
        </Style>
        <!--单元格样式触发-->
        <Style x:Key="cellStyle" TargetType="DataGridCell">
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="DataGridCell">
                        <TextBlock TextAlignment="Left" VerticalAlignment="Center" Foreground="Black" >
                           <ContentPresenter />
                        </TextBlock>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <EventSetter Event="PreviewMouseDoubleClick" Handler="DataGridCell_PreviewMouseDoubleClick"/>
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Foreground" Value="Black"/>
                </Trigger>
            </Style.Triggers>
        </Style>
 
        <Style x:Key="headerStyle" TargetType="DataGridColumnHeader">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="DataGridColumnHeader">
                        <Grid Margin="{TemplateBinding Padding}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
 
                            <ContentPresenter />
                            <Thumb x:Name="PART_RightHeaderGripper" Grid.Column="1" HorizontalAlignment="Right" Width="0.8" BorderThickness="0.08" 
                                   BorderBrush="{Binding VerticalGridLinesBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}}" Cursor="SizeWE"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
 
        <Style x:Key="dataGridHeaderStyle" TargetType="DataGridColumnHeader">
            <Setter Property="SnapsToDevicePixels" Value="True" />
            <Setter Property="MinWidth" Value="0" />
            <Setter Property="MinHeight" Value="28" />
            <Setter Property="Foreground" Value="#323433" />
            <Setter Property="FontSize" Value="16" />
            <Setter Property="Cursor" Value="Hand" />
            <Setter Property="Height" Value="40"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="DataGridColumnHeader">
                        <Border x:Name="BackgroundBorder" BorderThickness="0.8,0.8,0.8,0.8" BorderBrush="LightGray" Width="Auto" Background="{DynamicResource lightGrayBrush}">
                            <Grid >
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <ContentPresenter  Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left"/>
                                <Thumb x:Name="PART_RightHeaderGripper" Grid.Column="1" HorizontalAlignment="Right" Width="0.8" BorderThickness="0.08" 
                                       BorderBrush="{Binding VerticalGridLinesBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}}" Cursor="SizeWE"/>
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
 
        <Style TargetType="{x:Type Button}">
            <Setter Property="Width" Value="22"/>
            <Setter Property="Height" Value="22"/>
        </Style>
    </UserControl.Resources>
    <Grid>
        <Border Background="White" CornerRadius="0,10,10,0" Margin="0,0,10,0" >
            <Grid Margin="20 10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"/>
                    <RowDefinition Height="40"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="50"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
 
                <StackPanel Orientation="Horizontal" Grid.Row="0">
                    <!--#region 运行期间 -->
                    <TextBlock Text="运行期间" VerticalAlignment="Center" FontSize="16"/>
                    <ctrls:PromptTextBox x:Name="txtStart" Height="30" Width="90" FontSize="16" VerticalContentAlignment="Center" Background="{DynamicResource lightGrayBrush}"
                             BorderThickness="0" Text="" Margin="20 0 0 0" Watermark="{x:Static str:Resources.strBeginDate}"/>
 
                    <TextBox Height="30" Width="30" FontSize="16" VerticalContentAlignment="Center" Background="{DynamicResource lightGrayBrush}"
                             BorderThickness="0" Text=" - " Margin="0 0 0 0" IsReadOnly="True"/>
 
                    <ctrls:PromptTextBox x:Name="txtEnd" Height="30" Width="90" FontSize="16" VerticalContentAlignment="Center" Background="{DynamicResource lightGrayBrush}"
                             BorderThickness="0" Text="" Margin="0 0 0 0" Watermark="{x:Static str:Resources.strEndDate}"/>
                    <ctrls:ImageButton x:Name="btnDatePick" Width="30" Height="30"  Click="btnDatePick_Click" BorderThickness="0" NormalImage="../../Assets/calendar.png">
                    </ctrls:ImageButton>
                    <!--#endregion-->
                    <StackPanel Orientation="Horizontal">
                    <!--#region 来源码 -->
                    <TextBlock Text="{x:Static str:Resources.strSrcBarcode}" VerticalAlignment="Center" Margin="30 0 0 0"
                               FontSize="16"/>
                    <TextBox Height="30" Width="150" x:Name="txtSrcBarcode" FontSize="16" VerticalContentAlignment="Center" Background="{DynamicResource lightGrayBrush}"
                             BorderThickness="0" Text="{Binding bacteria_name, Mode=TwoWay}" Margin="20 0 0 0"/>
                    <!--#endregion-->
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <!--#region 目标码 -->
                        <TextBlock Text="{x:Static str:Resources.strTarBarcode}" VerticalAlignment="Center" Margin="30 0 0 0"
                               FontSize="16"/>
                        <TextBox Height="30" Width="150" x:Name="txtTarBarcode" FontSize="16" VerticalContentAlignment="Center" Background="{DynamicResource lightGrayBrush}"
                             BorderThickness="0" Text="{Binding bacteria_name, Mode=TwoWay}" Margin="20 0 0 0"/>
                        <!--#endregion-->
                    </StackPanel>
                    
                    <StackPanel Orientation="Horizontal" Grid.Row="1">
                        <!--查询-->
                        <Button x:Name="btnSearch" Content="{x:Static str:Resources.strBtnSearch}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="150 0 0 0" FontSize="16" Width="80" Height="30"
                            Foreground="White" Style="{DynamicResource BlueButtonStyle}" Background="{DynamicResource blueBrush}" Click="btnSearch_Click"/>
                    </StackPanel>
                </StackPanel>
 
                <!--#region 运行实验移液结果 -->
                <ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" CanContentScroll="True">
                    <DataGrid x:Name="dgResult" AutoGenerateColumns="False" BorderThickness="0" FontSize="16" RowHeaderWidth="0" 
                          BorderBrush="LightGray" CanUserResizeColumns="True" CanUserResizeRows="False" Margin="10 20" Background="White" 
                          CanUserSortColumns="False" CanUserReorderColumns="False" CanUserAddRows="False" ColumnHeaderStyle="{DynamicResource dataGridHeaderStyle}" 
                          GridLinesVisibility="None" IsReadOnly="True" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}"
                          PreviewMouseDoubleClick="DataGridCell_PreviewMouseDoubleClick" Width="1700">
                        <DataGrid.Columns>
                            <!--编号-->
                            <DataGridTextColumn Width="80" Binding="{Binding indexNum}" Header="{x:Static str:Resources.strNo}" />
                            <!--实验名称-->
                            <DataGridTextColumn Width="200" Binding="{Binding ExperimentName}" Header="{x:Static str:Resources.strExperimentFolderName}" />
                            <!--#region 实验脚本路径 -->
                            <DataGridTextColumn Width="*" Binding="{Binding ExperimentFile}" Header="{x:Static str:Resources.strFilePath}" />
                            <!--#endregion-->
                            <!--来源板码集合-->
                            <DataGridTextColumn Width="*" Binding="{Binding SourceBarcodes}" Header="{x:Static str:Resources.strSrcBarcode}" />
                            <!--目标板码集合-->
                            <DataGridTextColumn Width="*" Binding="{Binding TargetBarcodes}" Header="{x:Static str:Resources.strTarBarcode}" />
                            <!--运行开始时间-->
                            <DataGridTextColumn Width="200" Binding="{Binding LunchTime,StringFormat='yyyy/MM/dd HH:mm:ss'}" Header="{x:Static str:Resources.strSrcStartTime}" />
                            <!--运行终止时间-->
                            <DataGridTextColumn Width="200" Binding="{Binding EndTime,StringFormat='yyyy/MM/dd HH:mm:ss'}" Header="{x:Static str:Resources.strTarEndTime}" />
 
                            <DataGridTemplateColumn Header="{x:Static str:Resources.strOperation}" Width="100" >
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal" Margin="4 0 0 0">
                                            <!--运行详情-->
                                            <Button x:Name="btnRunDetail" Content="{x:Static str:Resources.strPickDetail}" Width="45" Height="25" Style="{DynamicResource LinkButton}"
                                                 Tag="{Binding ExperimentId}" Foreground="{DynamicResource blueBrush}" Click="btnRunDetail_Click"/>
                                            <!--运行报告导出-->
                                            <Button x:Name="btnExportReport" Content="{x:Static str:Resources.strExportData}" Width="45" Height="25" Style="{DynamicResource LinkButton}"
                                                 Tag="{Binding ExperimentId}" Foreground="{DynamicResource blueBrush}" Click="btnExportReport_Click"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                            <!--#endregion-->
                        </DataGrid.Columns>
 
                    </DataGrid>
                </ScrollViewer>
                <!--#endregion-->
                <page:PagerToolsControl Grid.Row="3" x:Name="pagerToolsControl_paging" VerticalAlignment="Top" Margin="15,20,0,0" 
                                                PageCntChanged="pagerToolsControl_paging_PageCntChanged" OnePageRowCntChanged="pagerToolsControl_paging_OnePageRowCntChanged" />
                <Calendar Grid.Row="1" Grid.RowSpan="3" x:Name="calendar" HorizontalAlignment="Left" Margin="120 10 0 0" SelectionMode="SingleRange"
                           SelectedDatesChanged ="calendar_SelectedDatesChanged" Visibility="Collapsed" VerticalAlignment="Top"/>
            </Grid>
        </Border>
    </Grid>
</UserControl>