From bd2c4823ae65cde40372ca25543039449f9a77bb Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 3 Mar 2020 15:58:30 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=20Modal=20Toast?= =?UTF-8?q?=20=E7=AD=89=E7=BB=84=E4=BB=B6=E7=A7=BB=E5=8A=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/Components/ModalBase.cs | 12 -- .../Pages/Components/ToastBase.cs | 4 - .../Pages/Extensions/JSRuntimeExtensions.cs | 14 -- .../Views/Admin/Exceptions.cshtml | 148 +++++++++--------- .../Views/Admin/Healths.cshtml | 34 ++-- .../Bootstrap.Admin/Views/Admin/Logs.cshtml | 44 +++--- .../Views/Admin/Settings.cshtml | 80 +++++----- .../Bootstrap.Admin/Views/Admin/Traces.cshtml | 44 +++--- .../Views/Shared/_Admin.cshtml | 3 - .../Views/Shared/_Bootstrap.cshtml | 1 - .../Views/Shared/_Default.cshtml | 72 +++++---- .../wwwroot/css/site-responsive.css | 2 +- .../Bootstrap.Admin/wwwroot/js/ba.blazor.js | 6 - 13 files changed, 206 insertions(+), 258 deletions(-) diff --git a/src/admin/Bootstrap.Admin/Pages/Components/ModalBase.cs b/src/admin/Bootstrap.Admin/Pages/Components/ModalBase.cs index b7f199a9..defa8de2 100644 --- a/src/admin/Bootstrap.Admin/Pages/Components/ModalBase.cs +++ b/src/admin/Bootstrap.Admin/Pages/Components/ModalBase.cs @@ -64,18 +64,6 @@ namespace Bootstrap.Admin.Pages.Components [Parameter] public bool ShowFooter { get; set; } = true; - /// - /// OnAfterRender 方法 - /// - /// - protected override void OnAfterRender(bool firstRender) - { - if (firstRender) - { - JSRuntime.InitModal(Id); - } - } - /// /// SetParametersAsync 方法 /// diff --git a/src/admin/Bootstrap.Admin/Pages/Components/ToastBase.cs b/src/admin/Bootstrap.Admin/Pages/Components/ToastBase.cs index 68ba052d..e137fb2e 100644 --- a/src/admin/Bootstrap.Admin/Pages/Components/ToastBase.cs +++ b/src/admin/Bootstrap.Admin/Pages/Components/ToastBase.cs @@ -63,10 +63,6 @@ namespace Bootstrap.Admin.Pages.Components /// protected override void OnAfterRender(bool firstRender) { - if (firstRender) - { - JSRuntime.InitToast(Id); - } if (_show) { _show = false; diff --git a/src/admin/Bootstrap.Admin/Pages/Extensions/JSRuntimeExtensions.cs b/src/admin/Bootstrap.Admin/Pages/Extensions/JSRuntimeExtensions.cs index a03475ef..e2230f6a 100644 --- a/src/admin/Bootstrap.Admin/Pages/Extensions/JSRuntimeExtensions.cs +++ b/src/admin/Bootstrap.Admin/Pages/Extensions/JSRuntimeExtensions.cs @@ -46,20 +46,6 @@ namespace Microsoft.JSInterop /// public static void InitDocument(this IJSRuntime? jSRuntime) => jSRuntime.InvokeVoidAsync("$.initDocument"); - /// - /// 修复 Modal 组件 - /// - /// - /// - public static void InitModal(this IJSRuntime? jSRuntime, string id) => jSRuntime.InvokeVoidAsync("$.initModal", id); - - /// - /// 修复 Modal 组件 - /// - /// - /// - public static void InitToast(this IJSRuntime? jSRuntime, string id) => jSRuntime.InvokeVoidAsync("$.initToast", id); - /// /// 弹出 Modal 组件 /// diff --git a/src/admin/Bootstrap.Admin/Views/Admin/Exceptions.cshtml b/src/admin/Bootstrap.Admin/Views/Admin/Exceptions.cshtml index cf8d8e70..c823924f 100644 --- a/src/admin/Bootstrap.Admin/Views/Admin/Exceptions.cshtml +++ b/src/admin/Bootstrap.Admin/Views/Admin/Exceptions.cshtml @@ -52,91 +52,89 @@
-@section modal { -