Добавьте файлы проекта.

This commit is contained in:
zxckawory
2026-09-03 20:49:08 +03:00
parent b76a11ae22
commit e221eda36a
35 changed files with 975 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
<NavigationPage xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="zooManagerPro.HomeView">
<Grid RowDefinitions="*,*,*,*">
<Grid Background="#32a852" ColumnDefinitions="*,*">
<TextBlock Text="ZooManagerPro" VerticalAlignment="Center" FontSize="20" FontWeight="Bold" Foreground="White" Margin="10,0,0,0"/>
<Button Grid.Column="1" HorizontalAlignment="Right" Content="Обновить" Margin="0,0,10,0"/>
</Grid>
<Grid Grid.Row="1" ColumnDefinitions="*,*,*,*" Margin="16,14,16,4">
<Border>
<StackPanel>
<TextBlock Text="Зарегистрировано животных"/>
<TextBlock Text="0" Foreground="#2980B9"/>
</StackPanel>
</Border>
<Border Grid.Column="1">
<StackPanel>
<TextBlock Text="Количество видов"/>
<TextBlock Text="0" Foreground="#27AE60"/>
</StackPanel>
</Border>
<Border Grid.Column="2">
<StackPanel>
<TextBlock Text="Свободные вольеры"/>
<TextBlock Text="0" Foreground="#E67E22"/>
</StackPanel>
</Border>
<Border Grid.Column="3">
<StackPanel>
<TextBlock Text="Осмотр у ветеринара (7 дней)"/>
<TextBlock Text="0" Foreground="#E74C3C"/>
</StackPanel>
</Border>
</Grid>
</Grid>
</NavigationPage>
+13
View File
@@ -0,0 +1,13 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace zooManagerPro;
public partial class HomeView : UserControl
{
public HomeView()
{
InitializeComponent();
}
}
+23
View File
@@ -0,0 +1,23 @@
<ContentPage xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodels="using:zooManagerPro.ViewModels"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="zooManagerPro.LoginView"
x:DataType="viewmodels:LoginViewModel"
Header="Вход">
<Grid ColumnDefinitions="*,*,*" RowDefinitions="*,*,*">
<StackPanel Grid.Column="1" Grid.Row="1">
<StackPanel Margin="5">
<TextBlock Text="Login"/>
<TextBox Name="LoginTextBox" PlaceholderText="ivan" Text="{Binding Login}"/>
</StackPanel>
<StackPanel Margin="5">
<TextBlock Text="Password"/>
<TextBox Name="PasswordTextBox" PlaceholderText="1234" Text="{Binding Password}"/>
</StackPanel>
<Button Name="ButtonTextBox" Margin="5" HorizontalAlignment="Center" Content="Войти" Command="{Binding EntranceCommand}"/>
</StackPanel>
</Grid>
</ContentPage>
+13
View File
@@ -0,0 +1,13 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace zooManagerPro;
public partial class LoginView : ContentPage
{
public LoginView()
{
InitializeComponent();
}
}
+7
View File
@@ -0,0 +1,7 @@
<NavigationPage xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="zooManagerPro.MainView">
</NavigationPage>
+28
View File
@@ -0,0 +1,28 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using zooManagerPro.ViewModels;
namespace zooManagerPro;
public partial class MainView : NavigationPage
{
public static MainView Current { get; private set; } = null!;
public MainView()
{
InitializeComponent();
Current = this;
Loaded += async (_, _) =>
{
await PushAsync(new LoginView()
{
DataContext = new LoginViewModel()
});
};
}
}
+21
View File
@@ -0,0 +1,21 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:zooManagerPro.ViewModels"
xmlns:zoomanagerpro="using:zooManagerPro"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="zooManagerPro.Views.MainWindow"
x:DataType="vm:MainWindowViewModel"
Icon="/Assets/avalonia-logo.ico"
Title="zooManagerPro">
<Design.DataContext>
<!-- This only sets the DataContext for the previewer in an IDE,
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
<vm:MainWindowViewModel/>
</Design.DataContext>
<zoomanagerpro:MainView/>
</Window>
+12
View File
@@ -0,0 +1,12 @@
using Avalonia.Controls;
namespace zooManagerPro.Views
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
+166
View File
@@ -0,0 +1,166 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="zooManagerPro.Window1"
Title="ZooManager Pro"
Width="1200" Height="720" MinWidth="1000" MinHeight="620"
WindowStartupLocation="CenterScreen"
FontSize="13" Background="#F4F6F8">
<Window.Styles>
<!-- карточки аналитики -->
<Style Selector="Border.card">
<Setter Property="Background" Value="White"/>
<Setter Property="CornerRadius" Value="10"/>
<Setter Property="Padding" Value="16,12"/>
<Setter Property="Margin" Value="6,0"/>
<Setter Property="BoxShadow" Value="0 2 12 0 #22000000"/>
</Style>
<Style Selector="TextBlock.cardTitle">
<Setter Property="FontSize" Value="12"/>
<Setter Property="Foreground" Value="#7A8794"/>
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
<Style Selector="TextBlock.cardValue">
<Setter Property="FontSize" Value="28"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Margin" Value="0,2,0,0"/>
</Style>
<!-- кнопки -->
<Style Selector="Button.tool">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Padding" Value="14,8"/>
<Setter Property="CornerRadius" Value="6"/>
<Setter Property="Cursor" Value="Hand"/>
</Style>
<!-- DataGrid -->
<!-- пилюля статуса здоровья: цвет через классы -->
<Style Selector="Border.pill">
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Padding" Value="8,3"/>
<Setter Property="Margin" Value="4,0"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Background" Value="#95A5A6"/>
</Style>
<Style Selector="Border.pill > TextBlock">
<Setter Property="FontSize" Value="11"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<Style Selector="Border.pill.healthy"><Setter Property="Background" Value="#27AE60"/></Style>
<Style Selector="Border.pill.sick">
<Setter Property="Background" Value="#F4D03F"/>
</Style>
<Style Selector="Border.pill.sick > TextBlock"><Setter Property="Foreground" Value="#5C4A00"/></Style>
<Style Selector="Border.pill.quarantine"><Setter Property="Background" Value="#E74C3C"/></Style>
<!-- иконка рациона: текст через классы -->
<Style Selector="TextBlock.diet">
<Setter Property="Text" Value="🥗 всеядное"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="6,0"/>
</Style>
<Style Selector="TextBlock.diet.meat"><Setter Property="Text" Value="🥩 хищник"/></Style>
<Style Selector="TextBlock.diet.grass"><Setter Property="Text" Value="🌿 травоядное"/></Style>
</Window.Styles>
<DockPanel>
<!-- ===== Шапка: название системы + кнопка обновления ===== -->
<Border DockPanel.Dock="Top" Background="#2C3E50" Padding="20,14">
<Grid ColumnDefinitions="*,Auto">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="🦁" FontSize="26" Margin="0,0,12,0"/>
<StackPanel>
<TextBlock Text="ZooManager Pro" FontSize="20" FontWeight="Bold" Foreground="White"/>
<TextBlock Text="Система учёта животных зоопарка" FontSize="11" Foreground="#AEB6BF"/>
</StackPanel>
</StackPanel>
<Button x:Name="BtnRefresh" Grid.Column="1"
Classes="tool" Background="#34495E"
Content="🔄 Обновить данные"
ToolTip.Tip="Перезагрузить все списки из базы данных без перезапуска"
VerticalAlignment="Center"/>
</Grid>
</Border>
<!-- ===== Четыре карточки сводной аналитики ===== -->
<UniformGrid DockPanel.Dock="Top" Columns="4" Margin="16,14,16,4">
<Border Classes="card">
<StackPanel>
<TextBlock Classes="cardTitle" Text="🐾 Зарегистрировано животных"/>
<TextBlock Classes="cardValue" x:Name="TxtTotalAnimals" Text="0" Foreground="#2980B9"/>
</StackPanel>
</Border>
<Border Classes="card">
<StackPanel>
<TextBlock Classes="cardTitle" Text="🔬 Количество видов"/>
<TextBlock Classes="cardValue" x:Name="TxtSpeciesCount" Text="0" Foreground="#27AE60"/>
</StackPanel>
</Border>
<Border Classes="card">
<StackPanel>
<TextBlock Classes="cardTitle" Text="🏠 Свободные вольеры"/>
<TextBlock Classes="cardValue" x:Name="TxtFreeEnclosures" Text="0" Foreground="#E67E22"/>
</StackPanel>
</Border>
<Border Classes="card">
<StackPanel>
<TextBlock Classes="cardTitle" Text="💉 Осмотр у ветеринара (7 дней)"/>
<TextBlock Classes="cardValue" x:Name="TxtVetSoon" Text="0" Foreground="#E74C3C"/>
</StackPanel>
</Border>
</UniformGrid>
<!-- ===== Панель инструментов над таблицей ===== -->
<Border DockPanel.Dock="Top" Background="White" CornerRadius="8" Padding="12"
Margin="16,12,16,0" BorderBrush="#E3E7EB" BorderThickness="1">
<Grid ColumnDefinitions="*,Auto">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Spacing="10">
<TextBox x:Name="TxtSearch" Width="280"
Watermark="🔍 Поиск: кличка, вид, вольер, статус…"/>
<TextBlock Text="Вид:" VerticalAlignment="Center" Foreground="#566573"/>
<ComboBox x:Name="CmbSpecies" Width="170"
ToolTip.Tip="Фильтр по виду животного"/>
<TextBlock Text="Статус:" VerticalAlignment="Center" Foreground="#566573"/>
<ComboBox x:Name="CmbHealth" Width="150"
ToolTip.Tip="Фильтр по статусу здоровья"/>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<Button x:Name="BtnAdd" Classes="tool" Background="#27AE60"
Content=" Добавить" />
<Button x:Name="BtnEdit" Classes="tool" Background="#2980B9"
Content="✏️ Редактировать" IsEnabled="False" />
<Button x:Name="BtnDelete" Classes="tool" Background="#C0392B"
Content="🗑 Удалить" IsEnabled="False" />
</StackPanel>
</Grid>
</Border>
<!-- ===== Таблица животных ===== -->
<Border Background="White" CornerRadius="8" Margin="16,12,16,16"
BorderBrush="#E3E7EB" BorderThickness="1">
</Border>
</DockPanel>
</Window>
+13
View File
@@ -0,0 +1,13 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace zooManagerPro;
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
}