From 5a9dd7a4d5d39e2d50132af1bd350c5dca428fde Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Fri, 13 Dec 2019 14:36:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=AD=E5=BF=83=E6=9B=B4=E6=96=B0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/DefaultLayoutComponentBase.cs | 22 +++++++++---------- .../Bootstrap.Admin/Components/HeaderBase.cs | 16 +++++--------- .../Bootstrap.Admin/Components/SideBarBase.cs | 10 ++------- .../Shared/DefaultLayout.razor | 2 +- src/admin/Bootstrap.Admin/Shared/Header.razor | 6 ++--- .../Bootstrap.Admin/wwwroot/css/blazor.css | 5 +++++ 6 files changed, 27 insertions(+), 34 deletions(-) diff --git a/src/admin/Bootstrap.Admin/Components/DefaultLayoutComponentBase.cs b/src/admin/Bootstrap.Admin/Components/DefaultLayoutComponentBase.cs index 74145d0b..0a67ca09 100644 --- a/src/admin/Bootstrap.Admin/Components/DefaultLayoutComponentBase.cs +++ b/src/admin/Bootstrap.Admin/Components/DefaultLayoutComponentBase.cs @@ -12,47 +12,47 @@ using System.Threading.Tasks; namespace Bootstrap.Admin.Components { /// - /// + /// /// public class DefaultLayoutComponentBase : LayoutComponentBase { /// - /// + /// /// [Inject] public AuthenticationStateProvider AuthenticationStateProvider { get; set; } = new ServerAuthenticationStateProvider(); /// - /// + /// /// [Inject] public NavigationManager? NavigationManager { get; set; } /// - /// + /// /// [Inject] public IJSRuntime? JSRuntime { get; set; } /// - /// + /// /// public NavigatorBarModel Model { get; set; } = new NavigatorBarModel(""); /// - /// + /// /// public string UserName { get; set; } = ""; /// - /// + /// /// public string DisplayName { get; set; } = ""; /// - /// + /// /// - protected bool IsAdmin { get; set; } + public bool IsAdmin { get; set; } /// /// 获得/设置 系统首页 @@ -103,7 +103,7 @@ namespace Bootstrap.Admin.Components } /// - /// + /// /// public void OnDisplayNameChanged(string displayName) { @@ -113,7 +113,7 @@ namespace Bootstrap.Admin.Components } /// - /// + /// /// /// protected override void OnAfterRender(bool firstRender) diff --git a/src/admin/Bootstrap.Admin/Components/HeaderBase.cs b/src/admin/Bootstrap.Admin/Components/HeaderBase.cs index 104dbc7b..639c753b 100644 --- a/src/admin/Bootstrap.Admin/Components/HeaderBase.cs +++ b/src/admin/Bootstrap.Admin/Components/HeaderBase.cs @@ -4,36 +4,30 @@ using Microsoft.AspNetCore.Components; namespace Bootstrap.Admin.Components { /// - /// + /// /// public class HeaderBase : ComponentBase { /// - /// - /// - [Parameter] - public bool IsAdmin { get; set; } - - /// - /// + /// /// [Parameter] public string Title { get; set; } = ""; /// - /// + /// /// [CascadingParameter(Name = "Default")] public DefaultLayout RootLayout { get; protected set; } = new DefaultLayout(); /// - /// + /// /// [Parameter] public string Icon { get; set; } = ""; /// - /// + /// /// public void UpdateDisplayName() { diff --git a/src/admin/Bootstrap.Admin/Components/SideBarBase.cs b/src/admin/Bootstrap.Admin/Components/SideBarBase.cs index d1a9ec83..e0ae44d0 100644 --- a/src/admin/Bootstrap.Admin/Components/SideBarBase.cs +++ b/src/admin/Bootstrap.Admin/Components/SideBarBase.cs @@ -16,19 +16,13 @@ namespace Bootstrap.Admin.Components public NavigatorBarModel Model { get; set; } = new NavigatorBarModel(""); /// - /// 侧边栏绑定 Model 改变事件 - /// - [Parameter] - public EventCallback ModelChanged { get; set; } - - /// - /// + /// /// [CascadingParameter(Name = "Default")] public DefaultLayout RootLayout { get; protected set; } = new DefaultLayout(); /// - /// + /// /// public void UpdateDisplayName() { diff --git a/src/admin/Bootstrap.Admin/Shared/DefaultLayout.razor b/src/admin/Bootstrap.Admin/Shared/DefaultLayout.razor index 84c026e8..973d0290 100644 --- a/src/admin/Bootstrap.Admin/Shared/DefaultLayout.razor +++ b/src/admin/Bootstrap.Admin/Shared/DefaultLayout.razor @@ -1,7 +1,7 @@ @inherits DefaultLayoutComponentBase -
+
@Body
diff --git a/src/admin/Bootstrap.Admin/Shared/Header.razor b/src/admin/Bootstrap.Admin/Shared/Header.razor index be05bb6f..7f5b8950 100644 --- a/src/admin/Bootstrap.Admin/Shared/Header.razor +++ b/src/admin/Bootstrap.Admin/Shared/Header.razor @@ -3,12 +3,12 @@
- + @Title diff --git a/src/admin/Bootstrap.Admin/wwwroot/css/blazor.css b/src/admin/Bootstrap.Admin/wwwroot/css/blazor.css index f3b85f7c..fc0b1d8f 100644 --- a/src/admin/Bootstrap.Admin/wwwroot/css/blazor.css +++ b/src/admin/Bootstrap.Admin/wwwroot/css/blazor.css @@ -2,6 +2,10 @@ z-index: 9999 !important; } +.userinfo .username { + max-width: 120px; +} + .nav-link-bar { border: 1px solid #dee2e6; border-top-left-radius: 0.25rem; @@ -69,6 +73,7 @@ nav .dropdown .nav-link-close.dropdown-toggle:after { .table th, .table td { padding: 0.5rem; + white-space: nowrap; } .table .btn.btn-sm {