corp-app/CORP-MAUI/Pages/EmployeesPage.xaml

208 lines
9.0 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:models="clr-namespace:CORP_MAUI.Models"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="CORP_MAUI.Pages.EmployeesPage"
Title="Сотрудники"
BackgroundColor="White">
<Grid RowDefinitions="Auto,Auto,*">
<!-- Шапка -->
<Grid
Grid.Row="0"
ColumnDefinitions="50,*,50"
Padding="15,10"
BackgroundColor="#E5E5E5">
<!-- Пустое место слева -->
<BoxView Grid.Column="0" Color="Transparent"/>
<!-- Заголовок -->
<Label
Grid.Column="1"
Text="Сотрудники"
FontSize="18"
FontAttributes="Bold"
TextColor="{StaticResource Gray900}"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<!-- Пустое место справа -->
<BoxView Grid.Column="2" Color="Transparent"/>
</Grid>
<!-- Поиск с серым фоном -->
<Grid
Grid.Row="1"
ColumnDefinitions="Auto,*"
Padding="15,5,15,15"
BackgroundColor="#E5E5E5">
<!-- Круглая кнопка поиска -->
<Border
Grid.Column="0"
WidthRequest="45"
HeightRequest="45"
StrokeShape="RoundRectangle 22.5"
BackgroundColor="{StaticResource Primary}"
Stroke="Transparent"
Margin="0,0,10,0">
<Image
Source="search.png"
WidthRequest="24"
HeightRequest="24"
HorizontalOptions="Center"
VerticalOptions="Center">
<Image.Behaviors>
<toolkit:IconTintColorBehavior TintColor="White"/>
</Image.Behaviors>
</Image>
</Border>
<!-- Поле поиска с серым фоном -->
<Border
Grid.Column="1"
StrokeShape="RoundRectangle 22.5"
BackgroundColor="{StaticResource Gray300}"
Stroke="Transparent"
HeightRequest="45"
Padding="15,0">
<Entry
x:Name="SearchEntry"
Placeholder="Поиск сотрудников..."
PlaceholderColor="{StaticResource Gray500}"
TextColor="{StaticResource Gray900}"
BackgroundColor="Transparent"
VerticalOptions="Center"
TextChanged="OnSearchTextChanged"/>
</Border>
</Grid>
<!-- Список сотрудников -->
<RefreshView
Grid.Row="2"
x:Name="RefreshView"
IsRefreshing="False"
Refreshing="OnRefreshing">
<CollectionView
x:Name="EmployeesCollectionView"
SelectionMode="Single"
SelectionChanged="EmployeesCollectionView_SelectionChanged"
ItemsLayout="VerticalList"
BackgroundColor="Transparent"
VerticalOptions="FillAndExpand"
Margin="0">
<CollectionView.EmptyView>
<VerticalStackLayout Style="{StaticResource EmptyStateContainer}">
<Label Text="👥" Style="{StaticResource EmptyStateIcon}"/>
<Label
Text="Нет сотрудников"
Style="{StaticResource EmptyStateTitle}"
Margin="0,10,0,0"/>
<Label
Text="Попробуйте изменить параметры поиска"
Style="{StaticResource EmptyStateText}"/>
</VerticalStackLayout>
</CollectionView.EmptyView>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:User">
<Border
Style="{StaticResource CardBorder}"
Margin="6,4">
<Border.GestureRecognizers>
<TapGestureRecognizer Tapped="OnEmployeeCardTapped" CommandParameter="{Binding .}"/>
</Border.GestureRecognizers>
<Grid ColumnDefinitions="50,*,44">
<!-- Аватар -->
<Border
Grid.Column="0"
Style="{StaticResource AvatarMedium}"
WidthRequest="50"
HeightRequest="50">
<Grid>
<Image
Source="{Binding DisplayAvatarSource}"
Aspect="AspectFill"
WidthRequest="48"
HeightRequest="48"/>
<!-- Индикатор онлайн статуса -->
<Border
Style="{StaticResource OnlineIndicatorMedium}"
IsVisible="{Binding IsOnline}"/>
</Grid>
</Border>
<!-- Информация о пользователе -->
<VerticalStackLayout
Grid.Column="1"
VerticalOptions="Center"
Spacing="3"
Margin="8,0">
<Label
Text="{Binding FullName}"
Style="{StaticResource CardSubtitle}"/>
<Label
Text="{Binding PositionName}"
Style="{StaticResource CardText}"
FontSize="13"/>
<Label
Text="{Binding DepartmentName}"
Style="{StaticResource CardMeta}"/>
</VerticalStackLayout>
<!-- Кнопка чата -->
<Border
Grid.Column="2"
Style="{StaticResource IconButton}"
VerticalOptions="Center"
WidthRequest="44"
HeightRequest="44">
<Border.GestureRecognizers>
<TapGestureRecognizer Tapped="OnChatIconTapped" CommandParameter="{Binding .}"/>
</Border.GestureRecognizers>
<Image
Source="chats.png"
WidthRequest="22"
HeightRequest="22"
HorizontalOptions="Center"
VerticalOptions="Center">
<Image.Behaviors>
<toolkit:IconTintColorBehavior TintColor="White"/>
</Image.Behaviors>
</Image>
</Border>
</Grid>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</RefreshView>
<!-- Индикатор загрузки -->
<ActivityIndicator
Grid.Row="2"
x:Name="LoadingIndicator"
IsRunning="False"
IsVisible="False"
Color="{StaticResource Primary}"
VerticalOptions="Center"
HorizontalOptions="Center"/>
</Grid>
</ContentPage>