337 lines
22 KiB
XML
337 lines
22 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"
|
|
Name="AlarmRecordPage"
|
|
d:DesignHeight="750" d:DesignWidth="1600">
|
|
<UserControl.Resources>
|
|
<Style TargetType="DataGridColumnHeader">
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
|
<Setter Property="Background" Value="#FF003562"/>
|
|
<Setter Property="FontFamily" Value="{StaticResource SourceHanSansCNBold}"/>
|
|
<Setter Property="FontSize" Value="14"/>
|
|
<Setter Property="Foreground" Value="#FF00BAFF"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
|
|
<Grid>
|
|
<Border x:Name="columnHeaderBorder" BorderThickness="0"
|
|
BorderBrush="#EEE"
|
|
Background="{TemplateBinding Background}">
|
|
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
TextBlock.TextAlignment="Center"
|
|
TextBlock.FontSize="14"
|
|
TextBlock.Foreground="#FF00BAFF"/>
|
|
</Border>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style TargetType="ToolTip">
|
|
<Setter Property="Foreground" Value="White"/>
|
|
<!-- 设置ToolTip字体颜色为白色 -->
|
|
<Setter Property="FontSize" Value="12"/>
|
|
<!-- 设置ToolTip字体大小为14 -->
|
|
<!--<Setter Property="FontWeight" Value="Bold"/>-->
|
|
<!-- 设置ToolTip字体为粗体 -->
|
|
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
|
<!-- 设置ToolTip背景颜色为浅灰色 -->
|
|
<Setter Property="FontFamily" Value="{StaticResource SourceHanSansCNLight}"/>
|
|
<!-- 设置ToolTip字体为方正楷体简体 -->
|
|
<Setter Property="TextOptions.TextFormattingMode" Value="Ideal"/>
|
|
<!-- 设置ToolTip中文本的格式化模式 -->
|
|
<Setter Property="TextOptions.TextRenderingMode" Value="ClearType"/>
|
|
<!-- 设置ToolTip中文本的渲染模式 -->
|
|
<Setter Property="ToolTipService.ShowDuration" Value="10000"/>
|
|
<!--设置ToolTip中数据的显示时间-->
|
|
</Style>
|
|
|
|
<Style TargetType="Button">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border CornerRadius="8" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<LinearGradientBrush x:Key="AlternatingBackgroundBrush" StartPoint="0,0" EndPoint="1,0">
|
|
<GradientStop Color="#330D6EFF" Offset="0"/>
|
|
<GradientStop Color="#33094895" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</UserControl.Resources>
|
|
|
|
<Grid Margin="10,0,18,18">
|
|
<Grid.Background>
|
|
<ImageBrush ImageSource="../Assets/Images/JunctionBoxEnviron/Background.png"/>
|
|
</Grid.Background>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="30"/>
|
|
<RowDefinition Height="0.13*"/>
|
|
<RowDefinition Height="10"/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<TextBlock Text="告警记录展示" FontSize="16" FontFamily="{StaticResource SourceHanSansCNBold}"
|
|
Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Top"
|
|
Margin="20,7,0,0"/>
|
|
|
|
<Grid Grid.Row="1">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="0.2*"/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid Grid.Row="1">
|
|
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left"
|
|
Orientation="Horizontal" Margin="40,0,0,0">
|
|
<TextBlock Text="选择时间" Foreground="#FF63829B" FontSize="14"
|
|
FontFamily="{StaticResource SourceHanSansCNRegular}"
|
|
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
<hc:DateTimePicker hc:InfoElement.ShowClearButton="True"
|
|
hc:InfoElement.TitleWidth="0" hc:InfoElement.TitlePlacement="Left"
|
|
Style="{StaticResource DateTimePickerPlus}" HorizontalContentAlignment="Center"
|
|
Foreground="#FF99B9D0" CaretBrush="#FF63829B" Height="40"
|
|
FontSize="14" Width="220" Margin="20,0,0,0" Background="Transparent"
|
|
BorderBrush="#FF63829B" SelectedDateTime="{Binding StartDateTime}"/>
|
|
<TextBlock Text="——" Foreground="#FF879AA9" HorizontalAlignment="Center"
|
|
VerticalAlignment="Center" Margin="20,0,0,0"/>
|
|
<hc:DateTimePicker hc:InfoElement.ShowClearButton="True"
|
|
hc:InfoElement.TitleWidth="0" hc:InfoElement.TitlePlacement="Left"
|
|
Style="{StaticResource DateTimePickerPlus}" HorizontalContentAlignment="Center"
|
|
Foreground="#FF99B9D0" CaretBrush="#FF63829B" Height="40"
|
|
FontSize="14" Width="220" Margin="20,0,0,0" Background="Transparent"
|
|
BorderBrush="#FF63829B" SelectedDateTime="{Binding EndDateTime}"/>
|
|
<Button Width="90" Height="40" Background="#FF006FBE" Margin="30,0,0,0"
|
|
Command="{Binding SearchEnvironDataCommand}" BorderThickness="0">
|
|
<Button.Content>
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Source="/Assets/Images/JunctionBoxEnviron/Search.png" Stretch="Fill" Width="15" Height="15"/>
|
|
<TextBlock Text="查询" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
Margin="10,0,0,0" FontSize="14" Foreground="White"
|
|
FontFamily="{StaticResource SourceHanSansCNLight}"/>
|
|
</StackPanel>
|
|
</Button.Content>
|
|
</Button>
|
|
<Button Width="90" Height="40" Background="Transparent" Margin="20,0,0,0"
|
|
BorderBrush="#FF006FBE" Command="{Binding ResetSearchCommand}">
|
|
<Button.Content>
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Source="/Assets/Images/JunctionBoxEnviron/Reset.png" Stretch="Fill" Width="15" Height="15"/>
|
|
<TextBlock Text="重置" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
Margin="10,0,0,0" FontSize="14" Foreground="#FF006FBE"
|
|
FontFamily="{StaticResource SourceHanSansCNLight}"/>
|
|
</StackPanel>
|
|
</Button.Content>
|
|
</Button>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
|
|
<Border Grid.Row="2" BorderThickness="1" BorderBrush="#FF4282B8" Height="0.6"
|
|
Width="1580" Margin="10,0,0,0"/>
|
|
|
|
<Grid Grid.Row="3">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="0.9*"/>
|
|
<RowDefinition Height="9*"/>
|
|
<RowDefinition Height="0.9*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right"
|
|
Margin="0,0,40,4">
|
|
<Button Width="110" Height="40" Background="#55052945"
|
|
BorderBrush="#FF10CAFF" Command="{Binding RefreshDataCommand}">
|
|
<Button.Content>
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Source="/Assets/Images/JunctionBoxEnviron/Refresh.png" Stretch="Fill" Width="18" Height="18"/>
|
|
<TextBlock Text="刷新数据" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
Margin="10,0,0,0" FontSize="14" Foreground="#FF00AEFF"
|
|
FontFamily="{StaticResource SourceHanSansCNLight}"/>
|
|
</StackPanel>
|
|
</Button.Content>
|
|
</Button>
|
|
<!--<Button Width="110" Height="40" Background="#55052945" Margin="30,0,0,0"
|
|
BorderBrush="#FF10CAFF" Command="{Binding DownloadDataCommand}">
|
|
<Button.Content>
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Source="/Assets/Images/JunctionBoxEnviron/Down.png" Stretch="Fill" Width="18" Height="18"/>
|
|
<TextBlock Text="下载数据" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
Margin="10,0,0,0" FontSize="14" Foreground="#FF00AEFF"
|
|
FontFamily="{StaticResource SourceHanSansCNLight}"/>
|
|
</StackPanel>
|
|
</Button.Content>
|
|
</Button>-->
|
|
</StackPanel>
|
|
|
|
<Grid Margin="10,0,10,10" Grid.Row="1">
|
|
<DataGrid x:Name="AlarmRecordDataGrid" ItemsSource="{Binding AlarmRecordList}"
|
|
AutoGenerateColumns="False" Margin="5,0,5,0"
|
|
CanUserAddRows="False" CanUserDeleteRows="False" Background="Transparent"
|
|
CanUserReorderColumns="False" CanUserResizeColumns="False"
|
|
CanUserResizeRows="False" CanUserSortColumns="False" BorderThickness="0" Grid.RowSpan="2">
|
|
<DataGrid.RowStyle>
|
|
<Style TargetType="DataGridRow">
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Style.Triggers>
|
|
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
</Trigger>
|
|
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
|
<Setter Property="Background" Value="{StaticResource AlternatingBackgroundBrush}"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</DataGrid.RowStyle>
|
|
<DataGrid.Resources>
|
|
<Style TargetType="DataGridCell" x:Key="DataGridCellCenter">
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="Foreground" Value="White"/>
|
|
<Setter Property="BorderBrush" Value="Transparent"/>
|
|
<Setter Property="FontSize" Value="14"/>
|
|
<Setter Property="FontFamily" Value="{StaticResource SourceHanSansCNRegular}"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="DataGridCell">
|
|
<Border x:Name="border" BorderBrush="#A0A0A0" BorderThickness="0"
|
|
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 RecordTime, StringFormat='yyyy/MM/dd HH:mm:ss'}" Width="4*" Header="告警时间"
|
|
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
|
|
<!--<DataGridTextColumn Binding="{Binding ParaName}" Width="3*" Header="故障名称"
|
|
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
|
|
<DataGridTemplateColumn Header="故障名称" Width="3*" CellStyle="{StaticResource DataGridCellCenter}">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding ParaName}" HorizontalAlignment="Left" ToolTipService.ToolTip="{Binding ParaName}">
|
|
<TextBlock.Resources>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="FontSize" Value="14"/>
|
|
</Style>
|
|
</TextBlock.Resources>
|
|
</TextBlock>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
<!--<DataGridTextColumn Binding="{Binding ParaNum}" Width="3*" Header="故障次数"
|
|
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
|
|
<!--<DataGridTextColumn Binding="{Binding ParaContent}" Width="4*" Header="故障信息"
|
|
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
|
|
<DataGridTemplateColumn Header="故障信息" Width="4*" CellStyle="{StaticResource DataGridCellCenter}">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding ParaContent}" HorizontalAlignment="Left" ToolTipService.ToolTip="{Binding ParaContent}">
|
|
<TextBlock.Resources>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="FontSize" Value="14"/>
|
|
</Style>
|
|
</TextBlock.Resources>
|
|
</TextBlock>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
<!--<DataGridTextColumn Binding="{Binding ProcessingMethod}" Width="6*" Header="推荐处理方式"
|
|
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
|
|
<!--<DataGridTemplateColumn Header="推荐处理方式" Width="6*" CellStyle="{StaticResource DataGridCellCenter}">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding ProcessingMethod}" HorizontalAlignment="Left" ToolTipService.ToolTip="{Binding ProcessingMethod}">
|
|
<TextBlock.Resources>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="FontSize" Value="14"/>
|
|
</Style>
|
|
</TextBlock.Resources>
|
|
</TextBlock>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
<DataGridTemplateColumn Header="紧急程度" Width="2*" CellStyle="{StaticResource DataGridCellCenter}">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<Image Source="{Binding UrgencyLevel}" Width="20" Height="20"/>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>-->
|
|
<!--<DataGridTextColumn Binding="{Binding IsHandled}" Width="2*" Header="处理状态"
|
|
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
|
|
<DataGridTemplateColumn Header="处理状态" Width="3*" CellStyle="{StaticResource DataGridCellCenter}">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<Image Source="{Binding IsHandled}" HorizontalAlignment="Left" Width="45"/>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</Grid>
|
|
|
|
<StackPanel Orientation="Horizontal" Grid.Row="2" VerticalAlignment="Top"
|
|
HorizontalAlignment="Right" Margin="0,0,10,0">
|
|
<TextBlock Text="共计" FontSize="14" Foreground="White" HorizontalAlignment="Center"
|
|
VerticalAlignment="Center" FontFamily="{StaticResource SourceHanSansCNRegular}"/>
|
|
<TextBlock VerticalAlignment="Center" FontSize="14" Foreground="#FF2A97CA"
|
|
Margin="5,0,5,0" Text="{Binding AlarmTotalPage}"
|
|
FontFamily="{StaticResource SourceHanSansCNBold}"/>
|
|
<TextBlock Text="页 , 当前第" FontSize="14" Foreground="White" HorizontalAlignment="Center"
|
|
VerticalAlignment="Center" FontFamily="{StaticResource SourceHanSansCNRegular}"/>
|
|
<TextBlock VerticalAlignment="Center" FontSize="14" Foreground="#FF2A97CA"
|
|
Margin="5,0,5,0" Text="{Binding AlarmNowPage}"
|
|
FontFamily="{StaticResource SourceHanSansCNBold}"/>
|
|
<TextBlock Text="页" FontSize="14" Foreground="White" HorizontalAlignment="Center" Margin="0,0,20,0"
|
|
VerticalAlignment="Center" FontFamily="{StaticResource SourceHanSansCNRegular}"/>
|
|
<Button FontSize="16" Command="{Binding ForwordAlarmCommand}"
|
|
Background="Transparent" BorderBrush="#FF93C1E2"
|
|
Style="{StaticResource ButtonStyle}"
|
|
Foreground="White" Width="35" Height="35">
|
|
<Button.Content>
|
|
<Image Source="../Assets/Images/JunctionBoxEnviron/Left.png" Height="15" Width="15"/>
|
|
</Button.Content>
|
|
<Button.Resources>
|
|
<Style TargetType="{x:Type Border}">
|
|
<Setter Property="CornerRadius" Value="4"/>
|
|
</Style>
|
|
</Button.Resources>
|
|
</Button>
|
|
<Button FontSize="16" Margin="20,0,20,0"
|
|
Command="{Binding NextAlarmCommand}"
|
|
Background="Transparent" BorderBrush="#FF93C1E2"
|
|
Style="{StaticResource ButtonStyle}"
|
|
Foreground="White" Width="35" Height="35">
|
|
<Button.Content>
|
|
<Image Source="../Assets/Images/JunctionBoxEnviron/Right.png" Height="15" Width="15"/>
|
|
</Button.Content>
|
|
<Button.Resources>
|
|
<Style TargetType="{x:Type Border}">
|
|
<Setter Property="CornerRadius" Value="4"/>
|
|
</Style>
|
|
</Button.Resources>
|
|
</Button>
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|