From 90f944d2de28bb36e9d02f09241788c616ea10ec Mon Sep 17 00:00:00 2001 From: HK Date: Mon, 8 Jun 2026 16:06:45 +0900 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B3=D0=BB=D1=83=D1=88=D0=BA=D1=83=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=83=D1=81=D1=82=D1=8B=D0=B5=20=D1=81=D0=BF=D0=B8=D1=81?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=BC=D0=B5=D1=81=D1=82=D0=BE=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CartriX.Api/appsettings.json | 2 +- .../Pages/PrintersPage/PrintersPage.razor | 150 ++++++++++-------- 2 files changed, 88 insertions(+), 64 deletions(-) diff --git a/CartriX.Api/appsettings.json b/CartriX.Api/appsettings.json index fe7bef1..9c37dc2 100644 --- a/CartriX.Api/appsettings.json +++ b/CartriX.Api/appsettings.json @@ -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 diff --git a/CartriX.Web/Pages/PrintersPage/PrintersPage.razor b/CartriX.Web/Pages/PrintersPage/PrintersPage.razor index 73756b9..380d29e 100644 --- a/CartriX.Web/Pages/PrintersPage/PrintersPage.razor +++ b/CartriX.Web/Pages/PrintersPage/PrintersPage.razor @@ -8,76 +8,100 @@ АИС КартрИКС | Принтеры @if (isPhone) { - + } - - - - - @if (!isPhone) - { - - } - - - @foreach (var location in locationItems) - { - - - - - - - - - - - - - -
- @foreach (var printer in location.Printers) - { - - } -
-
-
- } + + + + + @if (!isPhone) + { + + } + + + @if (IsDataLoading) + { +
+ @for (int i = 0; i < 10; i++) + { + + } +
+ } + else if (locationItems.Count == 0) + { + + + + + + + + } + else + { +
+ @foreach (var location in locationItems) + { + + + + + + + + + + + + + +
+ @foreach (var printer in location.Printers) + { + + } +
+
+
+ } +
+ }
- @code { - List locationItems = new(); - bool isPhone = false; +@code { + List locationItems = new(); + bool isPhone = false; + bool IsDataLoading = true; - - protected override async Task OnInitializedAsync() - { - isPhone = await JS.InvokeAsync("getDeviceInfo"); - await GetLocations(); - - } - async Task GetLocations() - { - var responce = await http.GetAsync(Shared.Classes.ApiRoutes.Location.List); - var json = await responce.Content.ReadAsStringAsync(); - var result = JsonConvert.DeserializeObject>(json); - locationItems = result!; - } - async Task AddPrinterClick() - { - var result = await DialogService.OpenAsync(""); - } + protected override async Task OnInitializedAsync() + { + isPhone = await JS.InvokeAsync("getDeviceInfo"); + await GetLocations(); + IsDataLoading = false; + } + async Task GetLocations() + { + var responce = await http.GetAsync(Shared.Classes.ApiRoutes.Location.List); + var json = await responce.Content.ReadAsStringAsync(); + var result = JsonConvert.DeserializeObject>(json); + locationItems = result!; + } + async Task AddPrinterClick() + { + var result = await DialogService.OpenAsync(""); + } }