Add accounts page
This commit is contained in:
59
Hcs.WebApp/Components/Pages/Objects/Accounts.razor
Normal file
59
Hcs.WebApp/Components/Pages/Objects/Accounts.razor
Normal file
@ -0,0 +1,59 @@
|
||||
@page "/objects/accounts"
|
||||
|
||||
@using Hcs.WebApp.Services
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using System.Security.Claims
|
||||
|
||||
@inherits DataPageBase<Account>
|
||||
|
||||
@attribute [Authorize]
|
||||
|
||||
@inject AccountService AccountService
|
||||
|
||||
<PageTitle>Лицевые счета</PageTitle>
|
||||
|
||||
<AuthorizedContent Roles="@($"{AppRole.ADMINISTRATOR_TYPE},{AppRole.OPERATOR_TYPE}")">
|
||||
<Content>
|
||||
<RadzenStack>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="12" SizeMD="6">
|
||||
<RadzenText Text="Лицевые счета" TextStyle="TextStyle.H5" class="rz-m-0" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="12" SizeMD="6">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.End" Gap="0.5rem">
|
||||
<RadzenButton Icon="upload_file" Text="@parseButtonText" Disabled="@(state != DataPageState.Idle)" Click="@ParseDataAsync" ButtonStyle="ButtonStyle.Primary" />
|
||||
<RadzenButton Icon="sync" Text="@syncButtonText" Disabled="@(state != DataPageState.Idle)" Click="@SyncDataAsync" ButtonStyle="ButtonStyle.Primary" />
|
||||
</RadzenStack>
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow>
|
||||
<RadzenColumn SizeMD="12">
|
||||
<RadzenDataGrid TItem="Account" Data="@data" IsLoading="@(state != DataPageState.Idle)" AllowFiltering="true" AllowPaging="true" ShowPagingSummary="true" PageSizeOptions=@(new int[] { 5, 10, 20, 30 }) AllowSorting="true">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn TItem="Account" Property="@nameof(SupplyContract.Id)" Title="ID" SortOrder="SortOrder.Descending" Resizable="false" Width="100px" MaxWidth="100px" />
|
||||
<RadzenDataGridColumn TItem="Account" Property="@nameof(SupplyContract.HcsId)" Title="ID ГИС ЖКХ" />
|
||||
<RadzenDataGridColumn TItem="Account" Property="@nameof(SupplyContract.ThirdPartyId)" Title="ID интеграции" />
|
||||
<RadzenDataGridColumn TItem="Account" Property="@nameof(SupplyContract.SyncedAt)" Title="Дата синхронизации" />
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
</RadzenStack>
|
||||
</Content>
|
||||
</AuthorizedContent>
|
||||
|
||||
@code {
|
||||
protected override Campaign.CampaignType? SyncCampaignType => Campaign.CampaignType.ExportSupplyContracts_15_7_0_1;
|
||||
|
||||
protected override Campaign.CampaignType? ParseCampaignType => null;
|
||||
|
||||
protected override bool HasPermission(ClaimsPrincipal user)
|
||||
{
|
||||
return user.IsOperatorOrHigher();
|
||||
}
|
||||
|
||||
protected override Task<IEnumerable<Account>> GetDataAsync()
|
||||
{
|
||||
return AccountService.GetAllAccountsAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user