Add registry element data view

This commit is contained in:
2025-11-04 17:17:53 +09:00
parent 9799086b53
commit 48cab2cde9
5 changed files with 50 additions and 4 deletions

View File

@ -0,0 +1,28 @@
@using Hcs.WebApp.Services
@using Newtonsoft.Json
@inject RegistryService RegistryService
<RadzenTextArea @bind-Value="@content" Style="width: 370px; height:500px; resize: none; display: block; margin-left: auto; margin-right: auto;" ReadOnly="true" />
@code {
string? content;
[Parameter]
public required RegistryElement RegistryElement { get; set; }
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
if (string.IsNullOrEmpty(RegistryElement.Json))
{
RegistryElement.Json = await RegistryService.GetRegistryElementJsonAsync(RegistryElement.Id);
}
if (!string.IsNullOrEmpty(RegistryElement.Json))
{
content = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(RegistryElement.Json!), Formatting.Indented);
}
}
}

View File

@ -109,8 +109,8 @@
"Редактирование пользователя",
new Dictionary<string, object>()
{
{ nameof(Dialogs.EditUser.CurrentUserId), currentUserId },
{ nameof(Dialogs.EditUser.UserWithRole), userWithRole }
{ nameof(EditUser.CurrentUserId), currentUserId },
{ nameof(EditUser.UserWithRole), userWithRole }
},
new DialogOptions()
{

View File

@ -134,7 +134,17 @@
async Task ShowElementAsync(RegistryElement registryElement)
{
// TODO
await DialogService.OpenAsync<ViewRegistryElement>(
"Просмотр записи",
new Dictionary<string, object>()
{
{ nameof(ViewRegistryElement.RegistryElement), registryElement }
},
new DialogOptions()
{
Width = "420px",
Height = "600px"
});
}
void ChangeState(CommonPageState state)