189 lines
11 KiB
Plaintext
189 lines
11 KiB
Plaintext
|
|
<UserControl x:Class="InSituLaboratory.Views.Pages.UserManagementView"
|
||
|
|
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:InSituLaboratory.Views.Pages"
|
||
|
|
mc:Ignorable="d" Template="{StaticResource PageTempalte}">
|
||
|
|
<Grid Grid.IsSharedSizeScope="True" Margin="0,5,0,10">
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="30"/>
|
||
|
|
<RowDefinition/>
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
<Border Background="#EEE" Height="1" VerticalAlignment="Bottom"/>
|
||
|
|
|
||
|
|
<Grid TextBlock.FontSize="12" TextBlock.FontWeight="Bold" TextBlock.Foreground="#666">
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="40"/>
|
||
|
|
<ColumnDefinition Width="70"/>
|
||
|
|
<ColumnDefinition Width="70"/>
|
||
|
|
<ColumnDefinition Width="120"/>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
<ColumnDefinition Width="60"/>
|
||
|
|
<ColumnDefinition/>
|
||
|
|
<ColumnDefinition Width="60"/>
|
||
|
|
<ColumnDefinition Width="120"/>
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
<TextBlock Text="序号" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||
|
|
<TextBlock Text="头像" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||
|
|
<TextBlock Text="用户名" Grid.Column="2" VerticalAlignment="Center" Margin="5,0"/>
|
||
|
|
<TextBlock Text="姓名" Grid.Column="3" VerticalAlignment="Center" Margin="5,0"/>
|
||
|
|
<TextBlock Text="地址" Grid.Column="4" VerticalAlignment="Center" Margin="5,0"/>
|
||
|
|
<TextBlock Text="性别" Grid.Column="5" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||
|
|
<TextBlock Text="角色" Grid.Column="6" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||
|
|
<TextBlock Text="状态" Grid.Column="7" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||
|
|
<TextBlock Text="操作" Grid.Column="8" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||
|
|
<!--编辑、分配权限、重置密码、删除-->
|
||
|
|
</Grid>
|
||
|
|
|
||
|
|
<ListBox ItemsSource="{Binding Users}" Grid.Row="1" BorderThickness="0" Background="Transparent">
|
||
|
|
<ListBox.ItemContainerStyle>
|
||
|
|
<Style TargetType="ListBoxItem">
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="ListBoxItem">
|
||
|
|
<Border>
|
||
|
|
<ContentPresenter/>
|
||
|
|
</Border>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Style>
|
||
|
|
</ListBox.ItemContainerStyle>
|
||
|
|
<ListBox.ItemTemplate>
|
||
|
|
<DataTemplate>
|
||
|
|
<Grid Background="Transparent" Name="root">
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="40"/>
|
||
|
|
<ColumnDefinition Width="70"/>
|
||
|
|
<ColumnDefinition Width="70"/>
|
||
|
|
<ColumnDefinition Width="120"/>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
<ColumnDefinition Width="60"/>
|
||
|
|
<ColumnDefinition/>
|
||
|
|
<ColumnDefinition Width="60"/>
|
||
|
|
<ColumnDefinition Width="120"/>
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
<!--间隔线-->
|
||
|
|
<Border BorderBrush="#EEE" BorderThickness="0,0,0,1" Height="1" VerticalAlignment="Bottom" Grid.ColumnSpan="10" SnapsToDevicePixels="True"/>
|
||
|
|
|
||
|
|
<!--序号-->
|
||
|
|
<TextBlock Text="{Binding Index}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||
|
|
<!--头像-->
|
||
|
|
<Border Grid.Column="1" Width="38" Height="38"
|
||
|
|
CornerRadius="5" BorderBrush="White" BorderThickness="1"
|
||
|
|
Margin="0,8">
|
||
|
|
<Border.Effect>
|
||
|
|
<DropShadowEffect BlurRadius="10" ShadowDepth="0" Direction="0"
|
||
|
|
Color="Gray" Opacity="0.1"/>
|
||
|
|
</Border.Effect>
|
||
|
|
<Border.Background>
|
||
|
|
<ImageBrush ImageSource="{Binding UserIcon}"/>
|
||
|
|
</Border.Background>
|
||
|
|
</Border>
|
||
|
|
|
||
|
|
|
||
|
|
<!--用户Name-->
|
||
|
|
<TextBlock Text="{Binding UserName}" VerticalAlignment="Center"
|
||
|
|
FontWeight="Bold" Foreground="#555"
|
||
|
|
Grid.Column="2" Margin="5,0"/>
|
||
|
|
<!--姓名-->
|
||
|
|
<TextBlock Text="{Binding RealName}" VerticalAlignment="Center"
|
||
|
|
Foreground="#555" Grid.Column="3" Margin="5,0"/>
|
||
|
|
<!--地址-->
|
||
|
|
<TextBlock Text="{Binding Address}" FontSize="12" Foreground="#888"
|
||
|
|
VerticalAlignment="Center" Margin="5,0"
|
||
|
|
Grid.Column="4"/>
|
||
|
|
<!--性别-->
|
||
|
|
<TextBlock Text="女" Name="tb_gender" Grid.Column="5" Foreground="#888"
|
||
|
|
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||
|
|
FontSize="12"/>
|
||
|
|
<!--权限列表-->
|
||
|
|
<ItemsControl Grid.Column="6" ItemsSource="{Binding Roles}"
|
||
|
|
VerticalAlignment="Center" HorizontalAlignment="Center">
|
||
|
|
<ItemsControl.ItemsPanel>
|
||
|
|
<ItemsPanelTemplate>
|
||
|
|
<WrapPanel/>
|
||
|
|
</ItemsPanelTemplate>
|
||
|
|
</ItemsControl.ItemsPanel>
|
||
|
|
<ItemsControl.ItemTemplate>
|
||
|
|
<DataTemplate>
|
||
|
|
<Border Background="#77409EFE" Margin="3" CornerRadius="5">
|
||
|
|
<TextBlock Text="{Binding RoleName}" FontSize="12"
|
||
|
|
Margin="5,2" Foreground="White"/>
|
||
|
|
</Border>
|
||
|
|
</DataTemplate>
|
||
|
|
</ItemsControl.ItemTemplate>
|
||
|
|
</ItemsControl>
|
||
|
|
<!--状态-->
|
||
|
|
<TextBlock Text="锁定" Name="tb_status" Grid.Column="7" Foreground="#888"
|
||
|
|
VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12"/>
|
||
|
|
|
||
|
|
<!--操作-->
|
||
|
|
<StackPanel Grid.Column="8" VerticalAlignment="Center"
|
||
|
|
HorizontalAlignment="Center"
|
||
|
|
Orientation="Horizontal">
|
||
|
|
<TextBlock VerticalAlignment="Center">
|
||
|
|
<Hyperlink Command="{Binding DataContext.ModifyCommand,RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||
|
|
CommandParameter="{Binding}"
|
||
|
|
TextDecorations="None" Foreground="#409EFE">编辑</Hyperlink>
|
||
|
|
</TextBlock>
|
||
|
|
<TextBlock Margin="5,3">
|
||
|
|
<Hyperlink Command="{Binding DataContext.DeleteCommand,RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||
|
|
CommandParameter="{Binding}"
|
||
|
|
TextDecorations="None" Foreground="#409EFE">删除</Hyperlink>
|
||
|
|
</TextBlock>
|
||
|
|
<ToggleButton Content="" FontFamily="{StaticResource Icons}"
|
||
|
|
Style="{StaticResource MoreButtonStyle}"
|
||
|
|
Name="tb_more"/>
|
||
|
|
</StackPanel>
|
||
|
|
|
||
|
|
<Popup StaysOpen="False" IsOpen="{Binding ElementName=tb_more,Path=IsChecked}"
|
||
|
|
PlacementTarget="{Binding ElementName=tb_more}"
|
||
|
|
AllowsTransparency="True"
|
||
|
|
HorizontalOffset="-100" VerticalOffset="2">
|
||
|
|
<Border Width="120" Background="#F0F6FB" CornerRadius="3" Margin="5">
|
||
|
|
<Border.Effect>
|
||
|
|
<DropShadowEffect BlurRadius="10" ShadowDepth="0" Direction="0" Color="Gray" Opacity="0.1"/>
|
||
|
|
</Border.Effect>
|
||
|
|
<Grid Margin="2">
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition/>
|
||
|
|
<RowDefinition/>
|
||
|
|
<RowDefinition Height="auto"/>
|
||
|
|
<RowDefinition/>
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
<Border Height="1" Background="#DDD" Grid.Row="2" Margin="0,3"/>
|
||
|
|
<Button Content="编辑角色" Style="{StaticResource MoreMenuButtonStyle}"
|
||
|
|
Command="{Binding DataContext.SelectRoleCommand,RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||
|
|
CommandParameter="{Binding}"/>
|
||
|
|
<Button Content="重置密码" Grid.Row="1" Style="{StaticResource MoreMenuButtonStyle}"
|
||
|
|
Command="{Binding DataContext.ResetPasswordCommand,RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||
|
|
CommandParameter="{Binding}"/>
|
||
|
|
<Button Content="{Binding LockButtonText}" Grid.Row="3" Style="{StaticResource MoreMenuButtonStyle}"
|
||
|
|
Command="{Binding DataContext.LockUserCommand,RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||
|
|
CommandParameter="{Binding}"/>
|
||
|
|
</Grid>
|
||
|
|
</Border>
|
||
|
|
</Popup>
|
||
|
|
</Grid>
|
||
|
|
<DataTemplate.Triggers>
|
||
|
|
<Trigger Property="IsMouseOver" Value="True">
|
||
|
|
<Setter TargetName="root" Property="Background" Value="#F7F9FA"/>
|
||
|
|
</Trigger>
|
||
|
|
<DataTrigger Binding="{Binding Gender}" Value="1">
|
||
|
|
<Setter TargetName="tb_gender" Property="Text" Value="男"/>
|
||
|
|
</DataTrigger>
|
||
|
|
<DataTrigger Binding="{Binding Status}" Value="1">
|
||
|
|
<Setter TargetName="tb_status" Property="Text" Value="正常"/>
|
||
|
|
</DataTrigger>
|
||
|
|
</DataTemplate.Triggers>
|
||
|
|
</DataTemplate>
|
||
|
|
</ListBox.ItemTemplate>
|
||
|
|
|
||
|
|
|
||
|
|
</ListBox>
|
||
|
|
|
||
|
|
</Grid>
|
||
|
|
</UserControl>
|