|
- <UserControl
- x:Class="BPASmartClient.CustomResource.Pages.View.UserLogView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls"
- xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
- d:DesignHeight="450"
- d:DesignWidth="800"
- mc:Ignorable="d">
-
- <UserControl.DataContext>
- <vm:UserLogViewModel />
- </UserControl.DataContext>
-
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary>
- <!--<convert:TextDisplayConvert x:Key="textDisplayConvert" />
- <convert:IsEnableConvert x:Key="isEnableConvert" />
- <convert:AnalogAlarmConvert x:Key="analogAlarmConvert" />
- <convert:DiscreteAlarmConvert x:Key="discreteAlarmConvert" />
- <convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />-->
- <SolidColorBrush x:Key="BorderSolid" Color="#332AB2E7" />
- <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
- <SolidColorBrush x:Key="TitleFontColor" Color="#FF2AB2E7" />
- <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
- <SolidColorBrush x:Key="TitleBorderColor" Color="#332AB2E7" />
-
- <Style x:Key="TextBlockStyle" TargetType="TextBlock">
- <Setter Property="FontFamily" Value="楷体" />
- <Setter Property="FontSize" Value="18" />
- <Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="HorizontalAlignment" Value="Center" />
- </Style>
-
- <Style x:Key="TextBoxStyle" TargetType="TextBox">
- <Setter Property="FontFamily" Value="楷体" />
- <Setter Property="FontSize" Value="22" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
- <Setter Property="BorderBrush" Value="#FF23CACA" />
- <Setter Property="CaretBrush" Value="Aqua" />
- <Setter Property="VerticalAlignment" Value="Center" />
- </Style>
-
- <Style x:Key="DataTextBlockStyle" TargetType="TextBlock">
- <Setter Property="HorizontalAlignment" Value="Center" />
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Foreground" Value="#20FDFA" />
- <Setter Property="FontSize" Value="14" />
- </Style>
-
- <ControlTemplate x:Key="ButTemplate" TargetType="Button">
- <Border
- x:Name="br"
- Background="Transparent"
- BorderBrush="#FF19B7EC"
- BorderThickness="2">
- <StackPanel
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <ContentControl
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}"
- Foreground="{TemplateBinding Foreground}" />
- </StackPanel>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
- </Trigger>
-
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
- </Trigger>
-
- </ControlTemplate.Triggers>
- </ControlTemplate>
-
- <!--#region 用户输入框样式-->
- <Style x:Key="SearchTextBoxStyle" TargetType="TextBox">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="CaretBrush" Value="#009DFF" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="TextBox">
- <Border
- x:Name="border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="0"
- SnapsToDevicePixels="true">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="40" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <TextBlock
- x:Name="PasswordTextBlock"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontFamily="../../Fonts/#iconfont"
- FontSize="16"
- Foreground="{TemplateBinding BorderBrush}"
- Text="" />
-
- <TextBlock
- Name="markText"
- Grid.Column="1"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#88009dff"
- Text="请输入账号名称"
- Visibility="Collapsed" />
-
- <ScrollViewer
- x:Name="PART_ContentHost"
- Grid.Column="1"
- MinHeight="20"
- VerticalAlignment="Center"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Grid>
-
- </Border>
-
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="border" Property="Opacity" Value="0.56" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="border" Property="BorderBrush" Value="#FF7EB4EA" />
- </Trigger>
- <Trigger Property="IsKeyboardFocused" Value="true">
- <Setter TargetName="border" Property="BorderBrush" Value="#FF569DE5" />
- </Trigger>
- <DataTrigger Binding="{Binding Path=Text, RelativeSource={RelativeSource Mode=self}}" Value="">
- <Setter TargetName="markText" Property="Visibility" Value="Visible" />
- </DataTrigger>
- </ControlTemplate.Triggers>
-
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--#endregion-->
-
- </ResourceDictionary>
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </UserControl.Resources>
-
- <Grid Margin="10">
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="30" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <StackPanel
- Margin="0,8"
- HorizontalAlignment="Right"
- Orientation="Horizontal">
-
- <TextBox
- Width="200"
- Margin="20,0"
- BorderBrush="#009DFF"
- FontSize="16"
- Foreground="#aadddddd"
- Style="{DynamicResource SearchTextBoxStyle}"
- TabIndex="1"
- Text="{Binding SearchUser}"
- Visibility="{Binding IsVisibility}" />
-
- <DatePicker
- Background="Transparent"
- BorderBrush="#aa3aa7f3"
- BorderThickness="2"
- SelectedDate="{Binding StartDateTime}"
- Style="{StaticResource PickerStyle}"
- Text="请输入开始时间"
- Visibility="{Binding IsVisibility}" />
-
- <DatePicker
- Margin="20,0,20,0"
- Background="Transparent"
- BorderBrush="#aa3aa7f3"
- BorderThickness="2"
- SelectedDate="{Binding EndDateTime}"
- Style="{StaticResource PickerStyle}"
- Text="请输入结束时间"
- Visibility="{Binding IsVisibility}" />
-
- <Button
- Width="140"
- Height="30"
- Background="#FF19B7EC"
- Command="{Binding ControlCommand}"
- Content="{Binding ControlButText}"
- FontFamily="楷体"
- FontSize="18"
- Template="{StaticResource ButTemplate}"
- Visibility="{Binding IsVisibility}">
- <Button.Foreground>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="#FFBB662A" />
- <GradientStop Offset="1" Color="White" />
- </LinearGradientBrush>
- </Button.Foreground>
- </Button>
-
- <Button
- Width="140"
- Height="30"
- Margin="20,0,0,0"
- Background="#FF19B7EC"
- Command="{Binding SwitchCommand}"
- Content="{Binding ButContent}"
- FontFamily="楷体"
- FontSize="18"
- Template="{StaticResource ButTemplate}">
- <Button.Foreground>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="#FFBB662A" />
- <GradientStop Offset="1" Color="White" />
- </LinearGradientBrush>
- </Button.Foreground>
- </Button>
-
- </StackPanel>
-
- <!--#region 表格标题栏设置-->
- <Grid Grid.Row="1" Margin="0 0 17 0" Background="#ff0C255F">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <TextBlock
- Grid.Column="0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="日期" />
-
- <Grid Grid.Column="1">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="时间" />
-
- <Border
- BorderBrush="{StaticResource TitleBorderColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
-
- <TextBlock
- Grid.Column="2"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="操作权限" />
-
-
- <Grid Grid.Column="3">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="用户名" />
-
- <Border
- BorderBrush="{StaticResource TitleBorderColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <TextBlock
- Grid.Column="4"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="消息日志" />
-
- </Grid>
- <!--#endregion-->
-
- <!--#region 表格数据显示-->
- <ScrollViewer
- Grid.Row="2"
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="Visible">
-
- <Grid>
- <!--#region 实时报警信息-->
- <ItemsControl ItemsSource="{Binding UserLogs}" Visibility="{Binding CurrentDataVis}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid x:Name="gr" Height="30">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <TextBlock
- Grid.Column="0"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding Date}" />
-
- <Grid Grid.Column="1">
- <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Time}" />
- <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
- </Grid>
-
- <TextBlock
- Grid.Column="2"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding Permission}" />
-
- <Grid Grid.Column="3">
- <TextBlock
- Margin="10,0,0,0"
- HorizontalAlignment="Center"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding UserName}" />
- <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
- </Grid>
-
- <TextBlock
- Grid.Column="4"
- Margin="10,0,0,0"
- HorizontalAlignment="Left"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding LogInfo}" />
-
- <Border
- Grid.ColumnSpan="6"
- BorderBrush="{StaticResource BorderSolid}"
- BorderThickness="1" />
-
- </Grid>
-
- <DataTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
- </Trigger>
- </DataTemplate.Triggers>
-
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- <!--#endregion-->
-
- <!--#region 历史报警信息-->
- <ItemsControl ItemsSource="{Binding HistoryUserLog}" Visibility="{Binding HistoryDataVis}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid x:Name="gr" Height="30">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <TextBlock
- Grid.Column="0"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding Date}" />
-
- <Grid Grid.Column="1">
- <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Time}" />
- <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
- </Grid>
-
- <TextBlock
- Grid.Column="2"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding Permission}" />
-
- <Grid Grid.Column="3">
- <TextBlock
- Margin="10,0,0,0"
- HorizontalAlignment="Left"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding UserName}" />
- <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
- </Grid>
-
- <TextBlock
- Grid.Column="4"
- Margin="10,0,0,0"
- HorizontalAlignment="Left"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding LogInfo}"
- TextWrapping="Wrap"
- />
-
- <Border
- Grid.ColumnSpan="6"
- BorderBrush="{StaticResource BorderSolid}"
- BorderThickness="1" />
-
- </Grid>
-
- <DataTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
- </Trigger>
- </DataTemplate.Triggers>
-
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- <!--#endregion-->
- </Grid>
- </ScrollViewer>
- <!--#endregion-->
-
-
- </Grid>
-
- </UserControl>
|