feat: 格式化用户显示名称
This commit is contained in:
parent
36d71bfb89
commit
e510054076
|
@ -40,7 +40,7 @@
|
|||
|
||||
<AssignModal @ref="AssignUserModal" TItem="Bootstrap.DataAccess.User" Id="role-user" Title="用户授权窗口" OnSave="SaveUsers">
|
||||
<ItemTemplate>
|
||||
<Checkbox TItem="Bootstrap.DataAccess.User" Item="@context" Text="@context.DisplayName" SetCheckCallback="SetUserCheck" OnClick="OnUserClick" />
|
||||
<Checkbox TItem="Bootstrap.DataAccess.User" Item="@context" Text="@FormatDisplayName(context)" SetCheckCallback="SetUserCheck" OnClick="OnUserClick" />
|
||||
</ItemTemplate>
|
||||
</AssignModal>
|
||||
|
||||
|
|
|
@ -60,6 +60,16 @@ namespace Bootstrap.Admin.Pages.Views.Admin.Components
|
|||
/// </summary>
|
||||
protected AssignModalBase<User>? AssignUserModal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获得/设置 Modal 实例
|
||||
/// </summary>
|
||||
protected string FormatDisplayName(User item)
|
||||
{
|
||||
var displayName = item.DisplayName;
|
||||
if (string.IsNullOrEmpty(displayName)) displayName = item.UserName;
|
||||
return displayName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 弹窗分配角色方法
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue