-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡ refactor(role-edit): improve the performance (#1263)
* ⚡ refactor(role-edit): improve the performance * upgrade Masa.Stack.Components
- Loading branch information
Showing
22 changed files
with
45 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 35 additions & 16 deletions
51
src/Web/Masa.Auth.Web.Admin.Rcl/Pages/Component/Permissions/RoleOwner.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,55 @@ | ||
@inherits AdminCompontentBase | ||
|
||
<SGroupBox Class="@Class" Style="Style" Title="@T("RoleOwner")"> | ||
<SGroupBox Class="@Class" Style="@Style" Title="@T("RoleOwner")"> | ||
<div style="min-height:48px;"> | ||
@if (Role.Users.Count > 0) | ||
@if (Role.Users.Count > 0) | ||
{ | ||
<div class="caption">@T("Member")</div> | ||
<div class="ml-4 mt-3"> | ||
@foreach (var user in Role.Users) | ||
@foreach (var user in Role.Users.Take(5)) | ||
{ | ||
<MChip Class="mr-3 pl-0" Style="height:28px;"> | ||
<MAvatar Size=24> | ||
<img src="@user.Avatar" /> | ||
</MAvatar> | ||
<span class="body2 regular--text ml-1">@user.DisplayName</span> | ||
</MChip> | ||
@RenderChip(user.Avatar, user.DisplayName) | ||
} | ||
|
||
@RenderMore(Role.Users.Count) | ||
</div> | ||
} | ||
|
||
@if (Role.Teams.Count > 0) | ||
{ | ||
<div class="caption mt-3">@T("Team")</div> | ||
<div class="ml-4 mt-3"> | ||
@foreach (var team in Role.Teams) | ||
@foreach (var team in Role.Teams.Take(5)) | ||
{ | ||
<MChip Class="mr-3" Style="height:28px;"> | ||
<MAvatar Left Size=24> | ||
<img src="@team.Avatar" /> | ||
</MAvatar> | ||
<span class="body2 regular--text">@team.Name</span> | ||
</MChip> | ||
@RenderChip(team.Avatar, team.Name) | ||
} | ||
|
||
@RenderMore(Role.Teams.Count) | ||
</div> | ||
} | ||
</div> | ||
</SGroupBox> | ||
|
||
@code { | ||
|
||
private RenderFragment RenderChip(string avatar, string displayName) => __builder => | ||
{ | ||
<MChip Class="mr-3 pl-0" Style="height:28px;"> | ||
<MAvatar Size=24> | ||
<img src="@avatar" /> | ||
</MAvatar> | ||
<span class="body2 regular--text ml-1">@displayName</span> | ||
</MChip> | ||
}; | ||
|
||
private RenderFragment RenderMore(int count) => __builder => | ||
{ | ||
if (count > 5) | ||
{ | ||
<span class="grey--text text-caption"> | ||
(+@(count - 5) @T("More")) | ||
</span> | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters