diff --git a/src/admin/Bootstrap.Admin/Components/ModalBase.cs b/src/admin/Bootstrap.Admin/Components/ModalBase.cs
new file mode 100644
index 00000000..7ef3b54b
--- /dev/null
+++ b/src/admin/Bootstrap.Admin/Components/ModalBase.cs
@@ -0,0 +1,60 @@
+using Bootstrap.Admin.Extensions;
+using Microsoft.AspNetCore.Components;
+using Microsoft.JSInterop;
+
+namespace Bootstrap.Admin.Components
+{
+ ///
+ /// 模态框组件类
+ ///
+ public class ModalBase : ComponentBase
+ {
+ ///
+ ///
+ ///
+ [Inject]
+ protected IJSRuntime? JSRuntime { get; set; }
+
+ ///
+ ///
+ ///
+ [Parameter]
+ public string Id { get; set; } = "";
+
+ ///
+ ///
+ ///
+ [Parameter]
+ public string Title { get; set; } = "未设置";
+
+ ///
+ ///
+ ///
+ [Parameter]
+ public RenderFragment? ModalBody { get; set; }
+
+ ///
+ ///
+ ///
+ [Parameter]
+ public bool Backdrop { get; set; }
+
+ ///
+ ///
+ ///
+ [Parameter]
+ public RenderFragment? ModalFooter { get; set; }
+
+ ///
+ ///
+ ///
+ ///
+ protected override void OnAfterRender(bool firstRender)
+ {
+ if (firstRender)
+ {
+ JSRuntime.InitModal();
+ }
+ }
+ }
+}
diff --git a/src/admin/Bootstrap.Admin/Pages/Admin/Dicts.razor b/src/admin/Bootstrap.Admin/Pages/Admin/Dicts.razor
index 67b70c64..a54886c4 100644
--- a/src/admin/Bootstrap.Admin/Pages/Admin/Dicts.razor
+++ b/src/admin/Bootstrap.Admin/Pages/Admin/Dicts.razor
@@ -57,7 +57,49 @@
-
+
+
+
+
+
+
+
+
+
+
+
@code {
diff --git a/src/admin/Bootstrap.Admin/Shared/Modal.razor b/src/admin/Bootstrap.Admin/Shared/Modal.razor
index 8b4f0f1f..98a5e570 100644
--- a/src/admin/Bootstrap.Admin/Shared/Modal.razor
+++ b/src/admin/Bootstrap.Admin/Shared/Modal.razor
@@ -1,36 +1,25 @@
-@inject IJSRuntime JSRuntime
-
-
+@inherits ModalBase
-
-
+
@code {
- protected override void OnAfterRender(bool firstRender)
- {
- if (firstRender)
- {
- JSRuntime.InitModal();
- }
- }
+
}