Сделал заглушку на пустые списки местоположений

This commit is contained in:
HK committed 2026-06-08 16:06:45 +09:00
1 parent a96cd0e113
commit 90f944d2de
2 files changed
+28 -4

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
}
},
"ConnectionStrings": {
"SQL": "Data Source = C:\\Users\\Hukuta\\Videos\\db.db"
"SQL": "Data Source = C:\\Users\\hk\\Documents\\db.db"
},
"PrinterScanner": {
"IntervalMinutes": 1
@@ -22,7 +22,7 @@
<RadzenFab Icon="add" Text="Добавить принтер" Click="AddPrinterClick" />
}
<RadzenStack AlignItems="AlignItems.Stretch">
<RadzenStack Orientation="Orientation.Vertical" Style="height: 100%; flex: 1; min-height: 0;">
<RadzenCard Style="padding: 8px;">
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.SpaceBetween">
<RadzenText Text="Местоположения" TextStyle="TextStyle.DisplayH5" />
@@ -32,6 +32,28 @@
}
</RadzenStack>
</RadzenCard>
@if (IsDataLoading)
{
<div style="display: flex; flex-wrap: wrap; gap: 8px;">
@for (int i = 0; i < 10; i++)
{
<RadzenSkeleton Style="width: 100px; height: 100px;" />
}
</div>
}
else if (locationItems.Count == 0)
{
<RadzenCard Style="flex: 1; display: flex; align-items: center; justify-content: center;" Variant="Variant.Text">
<RadzenStack Orientation="Orientation.Vertical" AlignItems="AlignItems.Center" Gap="8">
<RadzenIcon Icon="location_disabled" Style="font-size: 64px;" />
<RadzenText Text="Нет ни одного местоположения..." Style="font-size: 18px"/>
</RadzenStack>
</RadzenCard>
}
else
{
<div style="flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0;">
@foreach (var location in locationItems)
{
<RadzenPanel AllowCollapse="true" Collapsed="true" Style="padding: 8px;">
@@ -56,18 +78,20 @@
</ChildContent>
</RadzenPanel>
}
</div>
}
</RadzenStack>
@code {
List<Shared.Models.Location.LocationItem> locationItems = new();
bool isPhone = false;
bool IsDataLoading = true;
protected override async Task OnInitializedAsync()
{
isPhone = await JS.InvokeAsync<bool>("getDeviceInfo");
await GetLocations();
IsDataLoading = false;
}
async Task GetLocations()
{