删除多余代码
This commit is contained in:
@@ -153,16 +153,7 @@
|
||||
<!-- 筛选栏 -->
|
||||
<Border Grid.Row="1" Background="White" Padding="16,12" Margin="0,0,0,8">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<TextBlock Text="工位:" VerticalAlignment="Center" FontWeight="SemiBold" Foreground="#475569" Margin="0,0,8,0"/>
|
||||
<ComboBox x:Name="StationFilter" Width="90" Height="32" SelectedIndex="0"
|
||||
Background="White" BorderBrush="#CBD5E1" BorderThickness="1">
|
||||
<ComboBoxItem Content="全部"/>
|
||||
<ComboBoxItem Content="1"/>
|
||||
<ComboBoxItem Content="2"/>
|
||||
<ComboBoxItem Content="3"/>
|
||||
</ComboBox>
|
||||
<Button x:Name="RefreshButton" Content="🔍 查询" Style="{StaticResource ActionButton}"
|
||||
Width="80" Click="RefreshButton_Click" Margin="20,0,0,0"/>
|
||||
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
|
||||
@@ -24,26 +24,10 @@ namespace TabletTester2025
|
||||
private void LoadData()
|
||||
{
|
||||
_allData = _dbService.GetBatches(null, 10000);
|
||||
ApplyFilter();
|
||||
|
||||
}
|
||||
|
||||
private void ApplyFilter()
|
||||
{
|
||||
int? station = null;
|
||||
if (StationFilter.SelectedIndex == 1) station = 1;
|
||||
else if (StationFilter.SelectedIndex == 2) station = 2;
|
||||
else if (StationFilter.SelectedIndex == 3) station = 3;
|
||||
|
||||
var filtered = _allData.AsEnumerable();
|
||||
if (station.HasValue)
|
||||
filtered = filtered.Where(b => b.StationId == station.Value);
|
||||
|
||||
// 为每个标签页绑定对应测试类型的数据
|
||||
HardnessGrid.ItemsSource = filtered.Where(b => b.TestType == "硬度").OrderByDescending(b => b.TestTime).ToList();
|
||||
FriabilityGrid.ItemsSource = filtered.Where(b => b.TestType == "脆碎度").OrderByDescending(b => b.TestTime).ToList();
|
||||
DisintegrationGrid.ItemsSource = filtered.Where(b => b.TestType == "崩解").OrderByDescending(b => b.TestTime).ToList();
|
||||
DissolutionGrid.ItemsSource = filtered.Where(b => b.TestType == "溶出").OrderByDescending(b => b.TestTime).ToList();
|
||||
}
|
||||
|
||||
|
||||
private void RefreshButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user