refactor: 细化用户维护界面
This commit is contained in:
parent
840a78db95
commit
accc58a6b0
|
@ -102,13 +102,10 @@ namespace BootstrapAdmin.DataAccess.Models
|
|||
public int IsReset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获得/设置 默认格式为 UserName (DisplayName)
|
||||
/// 获得/设置 默认格式为 DisplayName (UserName)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0} ({1})", UserName, DisplayName);
|
||||
}
|
||||
public override string ToString() => $"{DisplayName} ({UserName})";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
[Parameter]
|
||||
[NotNull]
|
||||
[EditorRequired]
|
||||
public string? UserName { get; set; }
|
||||
public string? UserId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
[Parameter]
|
||||
[NotNull]
|
||||
[EditorRequired]
|
||||
public string? UserName { get; set; }
|
||||
public string? UserId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
@page "/Admin/Users"
|
||||
|
||||
<BlazorTable TItem="DataAccess.Models.User">
|
||||
<BlazorTable TItem="DataAccess.Models.User" ExtendButtonColumnWidth="260">
|
||||
<TableToolbarTemplate>
|
||||
<TableToolbarButton TItem="DataAccess.Models.User" IsEnableWhenSelectedOneRow="true" Color="Color.Warning" Icon="fa fa-bank" Text="分配部门" OnClickCallback="users => OnAssignmentDept(users.First())" />
|
||||
<TableToolbarButton TItem="DataAccess.Models.User" IsEnableWhenSelectedOneRow="true" Color="Color.Warning" Icon="fa fa-bank" Text="分配部门" OnClickCallback="users => OnAssignmentGroups(users.First())" />
|
||||
<TableToolbarButton TItem="DataAccess.Models.User" IsEnableWhenSelectedOneRow="true" Color="Color.Info" Icon="fa fa-sitemap" Text="分配角色" OnClickCallback="users => OnAssignmentRoles(users.First())" />
|
||||
</TableToolbarTemplate>
|
||||
<ColumnsTemplete>
|
||||
|
@ -14,7 +14,7 @@
|
|||
<TableColumn @bind-Field="@context.Description" Sortable="true" Filterable="true"></TableColumn>
|
||||
</ColumnsTemplete>
|
||||
<RowButtonTemplate>
|
||||
<TableCellButton Size="Size.ExtraSmall" Color="Color.Warning" Icon="fa fa-bank" Text="分配部门" OnClick="() => OnAssignmentDept(context)" />
|
||||
<TableCellButton Size="Size.ExtraSmall" Color="Color.Warning" Icon="fa fa-bank" Text="分配部门" OnClick="() => OnAssignmentGroups(context)" />
|
||||
<TableCellButton Size="Size.ExtraSmall" Color="Color.Info" Icon="fa fa-sitemap" Text="分配角色" OnClick="() => OnAssignmentRoles(context)" />
|
||||
</RowButtonTemplate>
|
||||
</BlazorTable>
|
||||
|
|
|
@ -12,14 +12,14 @@ namespace BootstrapAdmin.Web.Pages.Admin
|
|||
[NotNull]
|
||||
private DialogService? DialogService { get; set; }
|
||||
|
||||
private async Task OnAssignmentDept(User user)
|
||||
private async Task OnAssignmentGroups(User user)
|
||||
{
|
||||
var option = new DialogOption()
|
||||
{
|
||||
Title = $"分配部门 - {user}",
|
||||
Component = BootstrapDynamicComponent.CreateComponent<UserGroup>(new Dictionary<string, object>
|
||||
{
|
||||
[nameof(UserGroup.UserName)] = user.UserName
|
||||
[nameof(UserGroup.UserId)] = user.Id!
|
||||
})
|
||||
};
|
||||
|
||||
|
@ -33,7 +33,7 @@ namespace BootstrapAdmin.Web.Pages.Admin
|
|||
Title = $"分配角色 - {user}",
|
||||
Component = BootstrapDynamicComponent.CreateComponent<UserRole>(new Dictionary<string, object>
|
||||
{
|
||||
[nameof(UserGroup.UserName)] = user.UserName
|
||||
[nameof(UserGroup.UserId)] = user.Id!
|
||||
})
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue