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

269 lines
12 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.DocumentsPage"
Title="Документы"
BackgroundColor="White">
<Grid RowDefinitions="Auto,Auto,Auto,*">
<!-- Шапка -->
<Grid
Grid.Row="0"
ColumnDefinitions="50,*,50"
Padding="15,10"
BackgroundColor="White">
<!-- Кнопка назад (для навигации) -->
<ImageButton
x:Name="BackButton"
Grid.Column="0"
Source="arrow_back.png"
WidthRequest="40"
HeightRequest="40"
BackgroundColor="Transparent"
Clicked="OnBackClicked"
IsVisible="False">
<ImageButton.Behaviors>
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
</ImageButton.Behaviors>
</ImageButton>
<!-- Заголовок -->
<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="FilterAcknowledged"
Style="{StaticResource ChipButton}">
<Border.GestureRecognizers>
<TapGestureRecognizer Tapped="OnFilterAcknowledgedTapped"/>
</Border.GestureRecognizers>
<Label Text="✅ Ознакомлен" FontSize="14" TextColor="{StaticResource Gray700}"/>
</Border>
<Border
x:Name="FilterNotAcknowledged"
Style="{StaticResource ChipButton}">
<Border.GestureRecognizers>
<TapGestureRecognizer Tapped="OnFilterNotAcknowledgedTapped"/>
</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="DocumentsCollectionView"
SelectionMode="Single"
SelectionChanged="OnDocumentSelected"
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:Document">
<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 FileIcon}" Style="{StaticResource IconContainerText}"/>
</Border>
<!-- Название документа -->
<Label
Grid.Column="1"
Grid.Row="0"
Text="{Binding Title}"
Style="{StaticResource CardTitle}"
LineBreakMode="TailTruncation"
MaxLines="2"/>
<!-- Статус ознакомления (бейдж) -->
<Border
Grid.Column="2"
Grid.Row="0"
Style="{StaticResource Badge}"
BackgroundColor="{Binding AcknowledgedColor}"
VerticalOptions="Center">
<Label Text="{Binding AcknowledgedText}" Style="{StaticResource BadgeText}"/>
</Border>
<!-- Описание / Тип документа -->
<Label
Grid.Column="1"
Grid.ColumnSpan="2"
Grid.Row="1"
Text="{Binding ShortDescription}"
Style="{StaticResource CardSubtitle}"
LineBreakMode="TailTruncation"
MaxLines="2"
Margin="0,5,0,0"/>
<!-- Информация о загрузке -->
<HorizontalStackLayout
Grid.Column="1"
Grid.ColumnSpan="2"
Grid.Row="2"
Spacing="10"
Margin="0,8,0,0">
<!-- Кто загрузил -->
<HorizontalStackLayout Spacing="5">
<Label
Text="👤"
FontSize="12"
VerticalOptions="Center"/>
<Label
Text="{Binding UploaderName}"
FontSize="12"
TextColor="{StaticResource Gray500}"
VerticalOptions="Center"
LineBreakMode="TailTruncation"
MaxLines="1"/>
</HorizontalStackLayout>
<!-- Разделитель -->
<Label
Text="•"
FontSize="12"
TextColor="{StaticResource Gray400}"
VerticalOptions="Center"/>
<!-- Дата загрузки -->
<Label
Text="{Binding DisplayUploadedAt}"
FontSize="12"
TextColor="{StaticResource Gray500}"
VerticalOptions="Center"/>
</HorizontalStackLayout>
</Grid>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</RefreshView>
<!-- Индикатор загрузки -->
<ActivityIndicator
x:Name="LoadingIndicator"
Grid.Row="3"
IsRunning="False"
IsVisible="False"
Color="{StaticResource Primary}"
WidthRequest="50"
HeightRequest="50"
HorizontalOptions="Center"
VerticalOptions="Center"/>
</Grid>
</ContentPage>