diff --git a/src/admin/Bootstrap.Admin/Components/EditPageBase.cs b/src/admin/Bootstrap.Admin/Components/EditPageBase.cs index 1eed51e6..751b31f7 100644 --- a/src/admin/Bootstrap.Admin/Components/EditPageBase.cs +++ b/src/admin/Bootstrap.Admin/Components/EditPageBase.cs @@ -78,6 +78,12 @@ namespace Bootstrap.Admin.Components [Parameter] public RenderFragment? EditTemplate { get; set; } + /// + /// 获得/设置 SearchTemplate 实例 + /// + [Parameter] + public RenderFragment? SearchTemplate { get; set; } + /// /// 获得/设置 是否固定表头 默认为 false 不固定表头 /// diff --git a/src/admin/Bootstrap.Admin/Components/TableBase.cs b/src/admin/Bootstrap.Admin/Components/TableBase.cs index 7f8313fe..b2cd2937 100644 --- a/src/admin/Bootstrap.Admin/Components/TableBase.cs +++ b/src/admin/Bootstrap.Admin/Components/TableBase.cs @@ -49,6 +49,12 @@ namespace Bootstrap.Admin.Components [Parameter] public RenderFragment? EditTemplate { get; set; } + /// + /// 获得/设置 SearchTemplate 实例 + /// + [Parameter] + public RenderFragment? SearchTemplate { get; set; } + /// /// 获得/设置 表格 Toolbar 按钮模板 /// @@ -143,6 +149,15 @@ namespace Bootstrap.Admin.Components [Parameter] public Action? OnEdit { get; set; } + /// + /// 高级查询按钮点击时调用此方法 + /// + protected void AdvancedSearchClick() + { + // 弹出高级查询弹窗 + SearchModal?.Toggle(); + } + /// /// 保存按钮回调方法 /// @@ -178,11 +193,22 @@ namespace Bootstrap.Admin.Components /// protected Modal? ConfirmModal { get; set; } + /// + /// 高级查询弹窗 + /// + protected Modal? SearchModal { get; set; } + #nullable disable /// /// 获得/设置 EditModel 实例 /// protected TItem EditModel { get; set; } + + /// + /// 获得/设置 QueryModel 实例 + /// + [Parameter] + public TItem QueryModel { get; set; } #nullable restore /// @@ -196,6 +222,12 @@ namespace Bootstrap.Admin.Components [Parameter] public string SubmitModalTitle { get; set; } = ""; + /// + /// 查询组件模板 + /// + [Parameter] + public RenderFragment? SearchContent { get; set; } + /// /// OnInitialized 方法 /// @@ -389,5 +421,15 @@ namespace Bootstrap.Admin.Components /// 获取 Id 字符串 /// public string RetrieveId() => $"{Id}_table"; + + protected void OnSearch() + { + + } + + protected void ResetSearchClick() + { + + } } } diff --git a/src/admin/Bootstrap.Admin/Shared/EditPage.razor b/src/admin/Bootstrap.Admin/Shared/EditPage.razor index 614dba6c..40ddc254 100644 --- a/src/admin/Bootstrap.Admin/Shared/EditPage.razor +++ b/src/admin/Bootstrap.Admin/Shared/EditPage.razor @@ -9,7 +9,7 @@ 查询结果
- +
@TableToolbarTemplate @@ -29,6 +29,9 @@ @EditTemplate?.Invoke(context) + + @SearchTemplate?.Invoke(context) +
diff --git a/src/admin/Bootstrap.Admin/Shared/Table.razor b/src/admin/Bootstrap.Admin/Shared/Table.razor index d7f28abb..3d6d55e0 100644 --- a/src/admin/Bootstrap.Admin/Shared/Table.razor +++ b/src/admin/Bootstrap.Admin/Shared/Table.razor @@ -14,14 +14,14 @@
- +
- -
@@ -169,4 +169,24 @@ + + + +
+ @SearchContent?.Invoke(QueryModel) +
+
+
+ + + + +
+