305 lines
20 KiB
XML
305 lines
20 KiB
XML
<UserControl x:Class="JiangsuEarthquake.Views.LogRecordView"
|
|
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"
|
|
xmlns:core="clr-namespace:System;assembly=mscorlib"
|
|
xmlns:model="clr-namespace:JiangsuEarthquake.Models"
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
mc:Ignorable="d"
|
|
FontFamily="{StaticResource DigitalDisplay}"
|
|
Name="LogRecordPage"
|
|
Background="Transparent"
|
|
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>
|
|
|
|
<Style TargetType="ToolTip">
|
|
<Setter Property="Foreground" Value="White"/>
|
|
<!-- 设置ToolTip字体颜色为白色 -->
|
|
<Setter Property="FontSize" Value="13"/>
|
|
<!-- 设置ToolTip字体大小为14 -->
|
|
<!--<Setter Property="FontWeight" Value="Bold"/>-->
|
|
<!-- 设置ToolTip字体为粗体 -->
|
|
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
|
<!-- 设置ToolTip背景颜色为浅灰色 -->
|
|
<Setter Property="FontFamily" Value="{StaticResource DigitalDisplay}"/>
|
|
<!-- 设置ToolTip字体为方正楷体简体 -->
|
|
<Setter Property="TextOptions.TextFormattingMode" Value="Ideal"/>
|
|
<!-- 设置ToolTip中文本的格式化模式 -->
|
|
<Setter Property="TextOptions.TextRenderingMode" Value="ClearType"/>
|
|
<!-- 设置ToolTip中文本的渲染模式 -->
|
|
<Setter Property="ToolTipService.ShowDuration" Value="10000"/>
|
|
<!--设置ToolTip中数据的显示时间-->
|
|
</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" Name="TimeCheckBox"
|
|
VerticalAlignment="Center" IsChecked="{Binding IsChecked}"/>
|
|
<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="LogRecordDataGrid" ItemsSource="{Binding LogRecordList}"
|
|
AutoGenerateColumns="False"
|
|
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="150" Header="编号"
|
|
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
|
|
<DataGridTextColumn Binding="{Binding RecordTime, StringFormat='yyyy/MM/dd HH:mm:ss'}" Width="300" Header="记录时间"
|
|
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
|
|
<DataGridTextColumn Binding="{Binding Device_Name}" Width="200" Header="设备名称"
|
|
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
|
|
<DataGridTextColumn Binding="{Binding Operation_Type}" Width="200" Header="操作类型"
|
|
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
|
|
<!--<DataGridTextColumn Binding="{Binding Record}" Width="*" Header="记录内容"
|
|
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
|
|
<DataGridTemplateColumn Header="记录内容" Width="*" CellStyle="{StaticResource DataGridCellCenter}">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Record}" HorizontalAlignment="Left" ToolTipService.ToolTip="{Binding Record}">
|
|
<TextBlock.Resources>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="FontSize" Value="14"/>
|
|
</Style>
|
|
</TextBlock.Resources>
|
|
</TextBlock>
|
|
</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 LogMsg}"/>
|
|
<Button Content="上一页" FontSize="16" Command="{Binding ForwordLogCommand}"
|
|
Background="Transparent" BorderBrush="White" Style="{StaticResource ButtonStyle}"
|
|
Foreground="White" Width="85" Height="35">
|
|
<Button.Resources>
|
|
<Style TargetType="{x:Type Border}">
|
|
<Setter Property="CornerRadius" Value="8"/>
|
|
</Style>
|
|
</Button.Resources>
|
|
</Button>
|
|
<Button Content="下一页" FontSize="16" Margin="20,0,20,0"
|
|
Command="{Binding NextLogCommand}"
|
|
Background="Transparent" BorderBrush="White" Style="{StaticResource ButtonStyle}"
|
|
Foreground="White" Width="85" Height="35">
|
|
<Button.Resources>
|
|
<Style TargetType="{x:Type Border}">
|
|
<Setter Property="CornerRadius" Value="8"/>
|
|
</Style>
|
|
</Button.Resources>
|
|
</Button>
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Horizontal" Grid.Row="1" Margin="20,0,0,0"
|
|
HorizontalAlignment="Left" VerticalAlignment="Center">
|
|
<StackPanel Orientation="Vertical">
|
|
<TextBlock Name="RefreshDataMsg" Text=""
|
|
Foreground="Green" FontSize="12" HorizontalAlignment="Left"
|
|
VerticalAlignment="Bottom" Margin="15,0,0,0"
|
|
Visibility="Visible"/>
|
|
<Button Name="RefreshDataBtn" HorizontalAlignment="Left" VerticalAlignment="Center" Height="34"
|
|
BorderThickness="0" Command="{Binding RefreshDataCommand}" Width="34"
|
|
Style="{StaticResource ButtonStyle}" Background="Transparent">
|
|
<Button.Content>
|
|
<Image Source="/Assets/Images/Refresh.png" Height="27"
|
|
HorizontalAlignment="Left" VerticalAlignment="Center" />
|
|
</Button.Content>
|
|
<Button.ToolTip>
|
|
<ToolTip Content="刷新数据"/>
|
|
</Button.ToolTip>
|
|
</Button>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Vertical" Margin="20,0,0,0">
|
|
<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="34"
|
|
BorderThickness="0" Command="{Binding DownloadDataCommand}" Width="34"
|
|
Style="{StaticResource ButtonStyle}" Background="Transparent"
|
|
IsEnabled="{Binding DownloadDataBtnIsEnabled}">
|
|
<Button.Content>
|
|
<Image Source="/Assets/Images/Download.png" Height="28"
|
|
HorizontalAlignment="Left" VerticalAlignment="Center"/>
|
|
</Button.Content>
|
|
<Button.ToolTip>
|
|
<ToolTip Content="下载数据"/>
|
|
</Button.ToolTip>
|
|
</Button>
|
|
</StackPanel>
|
|
|
|
|
|
</StackPanel>
|
|
</Grid>
|
|
</hc:TransitioningContentControl>
|
|
</GroupBox>
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|