259 lines
12 KiB
XML
259 lines
12 KiB
XML
<?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.RequestsPage"
|
||
Title="Заявления"
|
||
BackgroundColor="White">
|
||
|
||
<Grid RowDefinitions="Auto,Auto,Auto,*">
|
||
|
||
<!-- Шапка -->
|
||
<Grid
|
||
Grid.Row="0"
|
||
ColumnDefinitions="50,*,50"
|
||
Padding="15,10"
|
||
BackgroundColor="White">
|
||
|
||
<!-- Пустое место слева -->
|
||
<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,10"
|
||
BackgroundColor="White">
|
||
|
||
<!-- Круглая кнопка поиска -->
|
||
<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>
|
||
|
||
<!-- Фильтры по статусу -->
|
||
<ScrollView
|
||
Grid.Row="2"
|
||
Orientation="Horizontal"
|
||
HorizontalScrollBarVisibility="Never"
|
||
BackgroundColor="White">
|
||
<HorizontalStackLayout
|
||
Padding="15,5,15,15"
|
||
Spacing="10"
|
||
x:Name="FilterButtons">
|
||
|
||
<Border
|
||
x:Name="FilterAll"
|
||
Style="{StaticResource ChipButtonActive}">
|
||
<Border.GestureRecognizers>
|
||
<TapGestureRecognizer Tapped="OnFilterAllTapped"/>
|
||
</Border.GestureRecognizers>
|
||
<Label Text="Все" FontSize="14" TextColor="White"/>
|
||
</Border>
|
||
|
||
<Border
|
||
x:Name="FilterPending"
|
||
Style="{StaticResource ChipButton}">
|
||
<Border.GestureRecognizers>
|
||
<TapGestureRecognizer Tapped="OnFilterPendingTapped"/>
|
||
</Border.GestureRecognizers>
|
||
<Label Text="⏳ На рассмотрении" FontSize="14" TextColor="{StaticResource Gray700}"/>
|
||
</Border>
|
||
|
||
<Border
|
||
x:Name="FilterApproved"
|
||
Style="{StaticResource ChipButton}">
|
||
<Border.GestureRecognizers>
|
||
<TapGestureRecognizer Tapped="OnFilterApprovedTapped"/>
|
||
</Border.GestureRecognizers>
|
||
<Label Text="✅ Одобрено" FontSize="14" TextColor="{StaticResource Gray700}"/>
|
||
</Border>
|
||
|
||
<Border
|
||
x:Name="FilterRejected"
|
||
Style="{StaticResource ChipButton}">
|
||
<Border.GestureRecognizers>
|
||
<TapGestureRecognizer Tapped="OnFilterRejectedTapped"/>
|
||
</Border.GestureRecognizers>
|
||
<Label Text="❌ Отклонено" FontSize="14" TextColor="{StaticResource Gray700}"/>
|
||
</Border>
|
||
|
||
</HorizontalStackLayout>
|
||
</ScrollView>
|
||
|
||
<!-- Список заявлений -->
|
||
<RefreshView
|
||
Grid.Row="3"
|
||
x:Name="RefreshView"
|
||
IsRefreshing="False"
|
||
Refreshing="OnRefreshing">
|
||
|
||
<CollectionView
|
||
x:Name="RequestsCollectionView"
|
||
SelectionMode="Single"
|
||
SelectionChanged="OnRequestSelected"
|
||
BackgroundColor="Transparent">
|
||
|
||
<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:Request">
|
||
<Border
|
||
Style="{StaticResource CardBorder}"
|
||
Margin="10,5"
|
||
StrokeShape="RoundRectangle 12">
|
||
|
||
<Grid ColumnDefinitions="50,*,Auto" RowDefinitions="Auto,Auto,Auto">
|
||
|
||
<!-- Иконка типа -->
|
||
<Border
|
||
Grid.Column="0"
|
||
Grid.RowSpan="3"
|
||
Style="{StaticResource IconContainer}"
|
||
VerticalOptions="Start"
|
||
Margin="0,0,10,0">
|
||
<Label Text="{Binding TypeIcon}" Style="{StaticResource IconContainerText}"/>
|
||
</Border>
|
||
|
||
<!-- Тип заявления -->
|
||
<Label
|
||
Grid.Column="1"
|
||
Grid.Row="0"
|
||
Text="{Binding DisplayType}"
|
||
Style="{StaticResource CardSubtitle}"/>
|
||
|
||
<!-- Статус (бейдж) -->
|
||
<Border
|
||
Grid.Column="2"
|
||
Grid.Row="0"
|
||
Style="{StaticResource Badge}"
|
||
BackgroundColor="{Binding StatusColor}"
|
||
VerticalOptions="Center">
|
||
<Label Text="{Binding DisplayStatus}" Style="{StaticResource BadgeText}"/>
|
||
</Border>
|
||
|
||
<!-- Период / Описание -->
|
||
<Label
|
||
Grid.Column="1"
|
||
Grid.ColumnSpan="2"
|
||
Grid.Row="1"
|
||
Text="{Binding DisplayDescription}"
|
||
Style="{StaticResource CardText}"
|
||
Margin="0,5,0,0"
|
||
LineBreakMode="TailTruncation"
|
||
MaxLines="2"/>
|
||
|
||
<!-- Нижняя строка: дата и период -->
|
||
<HorizontalStackLayout
|
||
Grid.Column="1"
|
||
Grid.ColumnSpan="2"
|
||
Grid.Row="2"
|
||
Spacing="15"
|
||
Margin="0,8,0,0">
|
||
|
||
<!-- Дата создания -->
|
||
<HorizontalStackLayout Spacing="5">
|
||
<Label Text="📅" Style="{StaticResource CardMeta}"/>
|
||
<Label Text="{Binding DisplayCreatedAt}" Style="{StaticResource CardMeta}"/>
|
||
</HorizontalStackLayout>
|
||
|
||
<!-- Период (если есть) -->
|
||
<HorizontalStackLayout Spacing="5">
|
||
<Label Text="⏰" Style="{StaticResource CardMeta}"/>
|
||
<Label Text="{Binding DisplayPeriod}" Style="{StaticResource CardMeta}"/>
|
||
</HorizontalStackLayout>
|
||
|
||
<!-- Сотрудник -->
|
||
<HorizontalStackLayout Spacing="5">
|
||
<Label Text="👤" Style="{StaticResource CardMeta}"/>
|
||
<Label
|
||
Text="{Binding EmployeeName}"
|
||
Style="{StaticResource CardMeta}"
|
||
LineBreakMode="TailTruncation"
|
||
MaxLines="1"/>
|
||
</HorizontalStackLayout>
|
||
|
||
</HorizontalStackLayout>
|
||
|
||
</Grid>
|
||
</Border>
|
||
|
||
</DataTemplate>
|
||
</CollectionView.ItemTemplate>
|
||
</CollectionView>
|
||
</RefreshView>
|
||
|
||
<!-- Индикатор загрузки -->
|
||
<ActivityIndicator
|
||
Grid.Row="3"
|
||
x:Name="LoadingIndicator"
|
||
IsRunning="False"
|
||
IsVisible="False"
|
||
Color="{StaticResource Primary}"
|
||
VerticalOptions="Center"
|
||
HorizontalOptions="Center"/>
|
||
|
||
</Grid>
|
||
|
||
</ContentPage>
|