20240301_JSEQ_upperpc/JiangsuEarthquakeJM/JiangsuEarthquake/Views/AlarmRecordView.xaml
春风过客 d7f51483a7 新增功能:
1 将地震仪数据读取功能单独成一个页面;
2024-05-13 18:51:05 +08:00

262 lines
17 KiB
XML

<UserControl x:Class="JiangsuEarthquake.Views.AlarmRecordView"
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:JiangsuEarthquake.Views"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
FontFamily="{StaticResource DigitalDisplay}"
Name="AlarmRecordPage"
d:DesignHeight="850" d:DesignWidth="1550">
<UserControl.Resources>
<Style TargetType="GroupBox">
<Setter Property="Margin" Value="10,5"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="GroupBox">
<Grid>
<!--左上角-->
<Polyline HorizontalAlignment="Left" VerticalAlignment="Top"
Points="0 30,0 10,10 0,30 0" Stroke="#9918AABD" StrokeThickness="1"/>
<!--左上角点-->
<Ellipse Width="4" Height="4" VerticalAlignment="Top" HorizontalAlignment="Left"
Fill="#9918AABD" Margin="24,-2,0,0"/>
<Ellipse Width="4" Height="4" VerticalAlignment="Top" HorizontalAlignment="Left"
Fill="#9918AABD" Margin="-2,24,0,0"/>
<!--右上角-->
<Path Data="M0 0, 3 3, 30 3, 33 0, 68 0, 73 7,78 7, 78 10M8 0, 25 0"
Stroke="#5518AABD" VerticalAlignment="Top" HorizontalAlignment="Right"/>
<!--左下角-->
<Polyline Points="0,0 0,15 10,15" Stroke="#5518AABD" VerticalAlignment="Bottom"
HorizontalAlignment="Left"/>
<!--右下角-->
<Polyline Points="10,0 0,10" Stroke="#5518AABD" VerticalAlignment="Bottom"
HorizontalAlignment="Right"/>
<!--右下角图表-->
<Polyline Points="0,7 7 7 7 0" Fill="#9918AABD" VerticalAlignment="Bottom"
HorizontalAlignment="Right"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,1,0,0" VerticalAlignment="Top"
Margin="30,-0.5,78,0"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,0,1,0" HorizontalAlignment="Right"
Margin="0,10"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,1,0,0" VerticalAlignment="Bottom"
Margin="10,0"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,0,1,0" HorizontalAlignment="Left"
Margin="-0.5,15"/>
<!--箭头-->
<Path Data="M0 0,3 0,5 4,3 8,0 8,3 4" Fill="#9918AABD" VerticalAlignment="Top"
HorizontalAlignment="Left" Margin="10,13"/>
<Path Data="M0 0,3 0,5 4,3 8,0 8,3 4" Fill="#5518AABD" VerticalAlignment="Top"
HorizontalAlignment="Left" Margin="16,13"/>
<!--字体-->
<TextBlock Text="{TemplateBinding Header}" Foreground="#18AABD"
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="25,12"/>
<!-- 占位对象 -->
<ContentPresenter />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
<Grid>
<Border x:Name="columnHeaderBorder" BorderThickness="0,0,0,1"
BorderBrush="#EEE"
Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
TextBlock.TextAlignment="Center"
TextBlock.FontSize="18"
TextBlock.Foreground="White"/>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.15*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<GroupBox Header="告警记录查询条件">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.2*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2.5*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left"
Orientation="Horizontal" Margin="40,0,0,0">
<CheckBox Content="时间筛选:" Foreground="White" FontSize="18"
IsChecked="{Binding IsChecked}" VerticalAlignment="Center"/>
<hc:DateTimePicker hc:InfoElement.ShowClearButton="True"
hc:InfoElement.TitleWidth="80" hc:InfoElement.TitlePlacement="Left"
Style="{StaticResource DateTimePickerPlus}" hc:InfoElement.Title="起始时间:"
Foreground="White" CaretBrush="White"
FontSize="14" Width="260" Margin="10,0,0,0" Background="Transparent"
BorderBrush="White" SelectedDateTime="{Binding StartDateTime}"/>
<TextBlock Text="-" Foreground="White" HorizontalAlignment="Center"
VerticalAlignment="Center" Margin="10,0,0,0"/>
<hc:DateTimePicker hc:InfoElement.ShowClearButton="True"
hc:InfoElement.TitleWidth="80" hc:InfoElement.TitlePlacement="Left"
Style="{StaticResource DateTimePickerPlus}" hc:InfoElement.Title="结束时间:"
Foreground="White" CaretBrush="White"
FontSize="14" Width="260" Margin="10,0,0,0" Background="Transparent"
BorderBrush="White" SelectedDateTime="{Binding EndDateTime}"/>
</StackPanel>
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right"
Orientation="Horizontal" Margin="0,0,40,0">
<!--<TextBlock Text="排序方式:" Foreground="White" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<ListBox x:Name="RadioButtonGroupChoiceChipPrimary" Margin="10,0,0,0"
Style="{StaticResource MaterialDesignChoiceChipPrimaryListBox}">
<ListBoxItem Content="时间正序" FontSize="14"/>
<ListBoxItem Content="时间倒序" IsSelected="True" FontSize="14" Margin="20,0"/>
</ListBox>-->
</StackPanel>
</Grid>
</Grid>
</GroupBox>
</Grid>
<Grid Grid.Row="1">
<GroupBox Header="告警记录展示">
<hc:TransitioningContentControl>
<Grid Margin="10,35,10,10">
<Grid.RowDefinitions>
<RowDefinition Height="12*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<DataGrid x:Name="AlarmRecordDataGrid" ItemsSource="{Binding AlarmRecordList}"
AutoGenerateColumns="False" IsHitTestVisible="False" Margin="10,0,10,0"
CanUserAddRows="False" CanUserDeleteRows="False" Background="Transparent"
CanUserReorderColumns="False" CanUserResizeColumns="False"
CanUserResizeRows="False" CanUserSortColumns="False" BorderThickness="0" Grid.RowSpan="2">
<DataGrid.Resources>
<Style TargetType="DataGridCell" x:Key="DataGridCellCenter">
<Setter Property="Background" Value="#FF14273A"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="#A0A0A0"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<Border x:Name="border" BorderBrush="#A0A0A0" BorderThickness="0,0,0,1"
Background="{TemplateBinding Background}">
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Index}" Width="*" Header="编号"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
<DataGridTextColumn Binding="{Binding DataTime, StringFormat='yyyy/MM/dd HH:mm:ss'}" Width="4*" Header="告警时间"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
<DataGridTextColumn Binding="{Binding ParaName}" Width="6*" Header="告警指标"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
<DataGridTextColumn Binding="{Binding ParaState}" Width="3*" Header="异常信息"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
<DataGridTextColumn Binding="{Binding ProcessingMethod}" Width="6*" Header="推荐处理方式"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
<DataGridTemplateColumn Header="紧急程度" Width="2*" CellStyle="{StaticResource DataGridCellCenter}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Source="{Binding UrgencyLevel}" Width="20" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<StackPanel Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Center"
HorizontalAlignment="Right" Margin="0,0,10,0">
<TextBlock VerticalAlignment="Center" FontSize="17" Foreground="White"
Margin="0,0,20,0" Text="{Binding AlarmMsg}"/>
<Button Content="上一页" FontSize="16" Command="{Binding ForwordAlarmCommand}"
Background="Transparent" BorderBrush="White"/>
<Button Content="下一页" FontSize="16" Margin="20,0,20,0"
Command="{Binding NextAlarmCommand}"
Background="Transparent" BorderBrush="White"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="1" Margin="20,0,0,0"
HorizontalAlignment="Left" VerticalAlignment="Center">
<StackPanel Orientation="Vertical">
<TextBlock Name="DownloadDataMsg" Text="{Binding DownloadDataMsg}"
Foreground="{Binding DownloadDataMsgForeground}" FontSize="12" HorizontalAlignment="Left"
VerticalAlignment="Bottom" Margin="15,0,0,0"
Visibility="{Binding DownloadDataMsgVisibility}"/>
<Button Name="DownloadDataBtn" HorizontalAlignment="Left" VerticalAlignment="Center" Height="40"
BorderThickness="0" Command="{Binding DownloadDataCommand}"
Style="{StaticResource ButtonBaseStyle}" Background="Transparent"
IsEnabled="{Binding DownloadDataBtnIsEnabled}">
<Button.Content>
<Image Source="/Assets/Images/Download.png" Height="25"
HorizontalAlignment="Left" VerticalAlignment="Center"/>
</Button.Content>
<Button.ToolTip>
<ToolTip Content="下载数据"/>
</Button.ToolTip>
</Button>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="20,0,0,0">
<TextBlock Name="RefreshDataMsg" Text="{Binding RefreshDataMsg}"
Foreground="{Binding RefreshDataMsgForeground}" FontSize="12" HorizontalAlignment="Left"
VerticalAlignment="Bottom" Margin="15,0,0,0"
Visibility="{Binding RefreshDataMsgVisibility}"/>
<Button Name="RefreshDataBtn" HorizontalAlignment="Left" VerticalAlignment="Center" Height="40"
BorderThickness="0" Command="{Binding RefreshDataCommand}"
Style="{StaticResource ButtonBaseStyle}" Background="Transparent">
<Button.Content>
<Image Source="/Assets/Images/Refresh.png" Height="25"
HorizontalAlignment="Left" VerticalAlignment="Center"/>
</Button.Content>
<Button.ToolTip>
<ToolTip Content="刷新数据"/>
</Button.ToolTip>
</Button>
</StackPanel>
</StackPanel>
</Grid>
</hc:TransitioningContentControl>
</GroupBox>
</Grid>
</Grid>
</UserControl>