mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 20:40:55 +00:00
Сделал заглушку на пустые списки местоположений
This commit is contained in:
1 parent
a96cd0e113
commit
90f944d2de
2 files changed
+29
-5
No files matched your search
@@ -7,7 +7,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"SQL": "Data Source = C:\\Users\\Hukuta\\Videos\\db.db"
|
"SQL": "Data Source = C:\\Users\\hk\\Documents\\db.db"
|
||||||
},
|
},
|
||||||
"PrinterScanner": {
|
"PrinterScanner": {
|
||||||
"IntervalMinutes": 1
|
"IntervalMinutes": 1
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<RadzenFab Icon="add" Text="Добавить принтер" Click="AddPrinterClick" />
|
<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;">
|
<RadzenCard Style="padding: 8px;">
|
||||||
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.SpaceBetween">
|
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.SpaceBetween">
|
||||||
<RadzenText Text="Местоположения" TextStyle="TextStyle.DisplayH5" />
|
<RadzenText Text="Местоположения" TextStyle="TextStyle.DisplayH5" />
|
||||||
@@ -32,6 +32,28 @@
|
|||||||
}
|
}
|
||||||
</RadzenStack>
|
</RadzenStack>
|
||||||
</RadzenCard>
|
</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)
|
@foreach (var location in locationItems)
|
||||||
{
|
{
|
||||||
<RadzenPanel AllowCollapse="true" Collapsed="true" Style="padding: 8px;">
|
<RadzenPanel AllowCollapse="true" Collapsed="true" Style="padding: 8px;">
|
||||||
@@ -56,18 +78,20 @@
|
|||||||
</ChildContent>
|
</ChildContent>
|
||||||
</RadzenPanel>
|
</RadzenPanel>
|
||||||
}
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</RadzenStack>
|
</RadzenStack>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
List<Shared.Models.Location.LocationItem> locationItems = new();
|
List<Shared.Models.Location.LocationItem> locationItems = new();
|
||||||
bool isPhone = false;
|
bool isPhone = false;
|
||||||
|
bool IsDataLoading = true;
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
isPhone = await JS.InvokeAsync<bool>("getDeviceInfo");
|
isPhone = await JS.InvokeAsync<bool>("getDeviceInfo");
|
||||||
await GetLocations();
|
await GetLocations();
|
||||||
|
IsDataLoading = false;
|
||||||
}
|
}
|
||||||
async Task GetLocations()
|
async Task GetLocations()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user