mirror of https://github.com/abpframework/abp.git
6 changed files with 55 additions and 22 deletions
@ -1,32 +1,38 @@ |
|||||
using System; |
using System; |
||||
|
using Blazorise.Extensions; |
||||
using Blazorise.DataGrid; |
using Blazorise.DataGrid; |
||||
using Microsoft.AspNetCore.Components; |
using Microsoft.AspNetCore.Components; |
||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
|
using JetBrains.Annotations; |
||||
using Volo.Abp.AspNetCore.Components.Extensibility.TableColumns; |
using Volo.Abp.AspNetCore.Components.Extensibility.TableColumns; |
||||
|
|
||||
namespace Volo.Abp.BlazoriseUI.Components |
namespace Volo.Abp.BlazoriseUI.Components |
||||
{ |
{ |
||||
public partial class AbpExtensibleDataGrid<TItem> : ComponentBase |
public partial class AbpExtensibleDataGrid<TItem> : ComponentBase |
||||
{ |
{ |
||||
protected Dictionary<string, DataGridEntityActionsColumn<TItem>> ActionColumns = new Dictionary<string, DataGridEntityActionsColumn<TItem>>(); |
protected Dictionary<string, DataGridEntityActionsColumn<TItem>> ActionColumns = |
||||
|
new Dictionary<string, DataGridEntityActionsColumn<TItem>>(); |
||||
|
|
||||
[Parameter] |
[Parameter] public IEnumerable<TItem> Data { get; set; } |
||||
public IEnumerable<TItem> Data { get; set; } |
|
||||
|
|
||||
[Parameter] |
[Parameter] public EventCallback<DataGridReadDataEventArgs<TItem>> ReadData { get; set; } |
||||
public EventCallback<DataGridReadDataEventArgs<TItem>> ReadData { get; set; } |
|
||||
|
|
||||
[Parameter] |
[Parameter] public int? TotalItems { get; set; } |
||||
public int? TotalItems { get; set; } |
|
||||
|
|
||||
[Parameter] |
[Parameter] public bool ShowPager { get; set; } |
||||
public bool ShowPager { get; set; } |
|
||||
|
|
||||
[Parameter] |
[Parameter] public int PageSize { get; set; } |
||||
public int PageSize { get; set; } |
|
||||
|
|
||||
[Parameter] |
[Parameter] public IEnumerable<TableColumn> Columns { get; set; } |
||||
public IEnumerable<TableColumn> Columns { get; set; } |
|
||||
|
|
||||
|
protected RenderFragment RenderCustomTableColumnComponent(Type type, object data) |
||||
|
{ |
||||
|
return (builder) => |
||||
|
{ |
||||
|
builder.OpenComponent(type); |
||||
|
builder.AddAttribute(0, "Data", data); |
||||
|
builder.CloseComponent(); |
||||
|
}; |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
@using System; |
||||
|
@using Volo.Abp.Identity |
||||
|
@using Microsoft.Extensions.Localization |
||||
|
@using Volo.Abp.Identity.Localization |
||||
|
|
||||
|
@inject IStringLocalizer<IdentityResource> L |
||||
|
|
||||
|
@(Data.As<IdentityRoleDto>().Name) |
||||
|
@if (Data.As<IdentityRoleDto>().IsDefault) |
||||
|
{ |
||||
|
<Badge Color="Color.Primary" Margin="Margin.Is1.FromLeft">@L["DisplayName:IsDefault"]</Badge> |
||||
|
} |
||||
|
@if (Data.As<IdentityRoleDto>().IsPublic) |
||||
|
{ |
||||
|
<Badge Color="Color.Light" Margin="Margin.Is1.FromLeft">@L["DisplayName:IsPublic"]</Badge> |
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
using Microsoft.AspNetCore.Components; |
||||
|
|
||||
|
namespace Volo.Abp.Identity.Blazor.Pages.Identity |
||||
|
{ |
||||
|
public partial class RoleNameComponent : ComponentBase |
||||
|
{ |
||||
|
[Parameter] public object Data { get; set; } |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue