Files
Sleep-Multi-functionality/ReportWindow6.xaml
2026-05-04 14:46:58 +08:00

166 lines
9.7 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<Window x:Class="ShanghaiEnvironmentalTechnology.ReportWindow6"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="CO2重复呼吸测试报表" Height="768" Width="1024" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen">
<Window.Resources>
<Style x:Key="MyButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#4A90E2"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Margin" Value="10"/>
<Setter Property="Padding" Value="10,5"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Height" Value="40"/>
<Setter Property="Width" Value="120"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="20">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#3A7BBE"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#2A5E9A"/>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="18"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Margin" Value="5"/>
</Style>
<Style TargetType="DataGrid" x:Key="CustomDataGridStyle">
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="#4A90E2"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="RowHeight" Value="35"/>
<Setter Property="AlternatingRowBackground" Value="#F0F8FF"/>
<Setter Property="GridLinesVisibility" Value="All"/>
<Setter Property="ColumnHeaderStyle">
<Setter.Value>
<Style TargetType="DataGridColumnHeader">
<Setter Property="Background" Value="#4A90E2"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Padding" Value="10"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
</Setter.Value>
</Setter>
<Setter Property="RowStyle">
<Setter.Value>
<Style TargetType="DataGridRow">
<Setter Property="Background" Value="White"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="5"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#E0E0E0"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4A90E2"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<StackPanel Margin="10">
<TextBlock FontSize="20" FontWeight="Bold" Text="CO2重复呼吸测试报表" HorizontalAlignment="Center" Margin="0,0,0,20"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,0,0,20">
<TextBlock Text="起始时间:" VerticalAlignment="Center" Foreground="Black"/>
<DatePicker x:Name="StartDatePicker" Margin="5,0" Height="30" />
<TextBlock Text="终止时间:" VerticalAlignment="Center" Foreground="Black"/>
<DatePicker x:Name="EndDatePicker" Margin="5,0" Height="30"/>
<Button Content="查询" Click="QueryButton_Click" Margin="5,0" Style="{StaticResource MyButtonStyle}"/>
<Button Content="全选" Click="SelectAllButton_Click" Margin="5,0" Style="{StaticResource MyButtonStyle}"/>
<Button Content="批量删除" Click="BatchDeleteButton_Click" Margin="5,0" Style="{StaticResource MyButtonStyle}"/>
<Button Content="导出" Click="Export_Click" Margin="5,0" Style="{StaticResource MyButtonStyle}"/>
</StackPanel>
<DataGrid x:Name="DataGridReport" AutoGenerateColumns="False" Height="400" Margin="0,0,0,20" Style="{StaticResource CustomDataGridStyle}">
<DataGrid.Columns>
<DataGridCheckBoxColumn Header="选择" Binding="{Binding IsSelected}" Width="50">
</DataGridCheckBoxColumn>
<DataGridTextColumn Header="序号" Binding="{Binding Id}" Width="*"/>
<DataGridTextColumn Header="二氧化碳浓度(%" Binding="{Binding Flow}" Width="*"/>
<DataGridTextColumn Header="压力pa" Binding="{Binding Pressure}" Width="*"/>
<!--<DataGridTextColumn Header="开始CO2浓度%" Binding="{Binding BeginCO2}" Width="*"/>
<DataGridTextColumn Header="终CO2浓度%" Binding="{Binding EndCO2}" Width="*"/>
<DataGridTextColumn Header="CO2浓度相对增加%" Binding="{Binding CO2Added}" Width="*"/>-->
<DataGridTextColumn Header="时间" Binding="{Binding RecordTime}" Width="*"/>
<DataGridTemplateColumn Header="操作" Width="100">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="删除"
Click="DeleteButton_Click"
Background="#FF5252"
Foreground="White"
Padding="5"
Margin="2"
FontSize="14"
Height="30"
Tag="{Binding Id}">
<Button.Style>
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="5">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#D32F2F"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#B71C1C"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Content="主页" Click="HomePage_Click" HorizontalAlignment="Left" Style="{StaticResource MyButtonStyle}"/>
<Button Content="上一页" Click="PreviousPage_Click" Margin="5" Style="{StaticResource MyButtonStyle}"/>
<TextBlock x:Name="PageInfo" VerticalAlignment="Center" Margin="5"/>
<Button Content="下一页" Click="NextPage_Click" Margin="5" Style="{StaticResource MyButtonStyle}"/>
</StackPanel>
</StackPanel>
</Grid>
</Window>