From 6e594b08a78b680f90a942c712ea0c97f5b6e586 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Thu, 20 Feb 2020 13:26:11 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=20Exception=20?= =?UTF-8?q?=E4=B8=8E=20=E4=BB=BB=E5=8A=A1=E7=AE=A1=E7=90=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bootstrap.Admin/Pages/Components/TableBase.cs | 6 ++++++ src/admin/Bootstrap.Admin/Pages/Shared/Table.razor | 13 ++++++++----- .../Pages/Views/Admin/Exceptions.razor | 8 +++----- .../Pages/Views/Components/ExceptionsBase.cs | 8 -------- .../Pages/Views/Components/TasksBase.cs | 2 +- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/admin/Bootstrap.Admin/Pages/Components/TableBase.cs b/src/admin/Bootstrap.Admin/Pages/Components/TableBase.cs index 457e819b..1f8110dd 100644 --- a/src/admin/Bootstrap.Admin/Pages/Components/TableBase.cs +++ b/src/admin/Bootstrap.Admin/Pages/Components/TableBase.cs @@ -91,6 +91,12 @@ namespace Bootstrap.Admin.Pages.Components [Parameter] public bool ShowSearch { get; set; } + /// + /// 获得/设置 是否显示高级搜索按钮 默认显示 + /// + [Parameter] + public bool ShowAdvancedSearch { get; set; } = true; + /// /// 获得/设置 数据集合 /// diff --git a/src/admin/Bootstrap.Admin/Pages/Shared/Table.razor b/src/admin/Bootstrap.Admin/Pages/Shared/Table.razor index 79117ebb..b25c9e9b 100644 --- a/src/admin/Bootstrap.Admin/Pages/Shared/Table.razor +++ b/src/admin/Bootstrap.Admin/Pages/Shared/Table.razor @@ -36,9 +36,12 @@ - + @if (ShowAdvancedSearch) + { + + } @@ -194,7 +197,7 @@ } -@if (OnSave != null) +@if (OnSave != null || OnAdd != null) { @@ -203,7 +206,7 @@ } -@if (ShowSearch) +@if (ShowSearch && ShowAdvancedSearch) { diff --git a/src/admin/Bootstrap.Admin/Pages/Views/Admin/Exceptions.razor b/src/admin/Bootstrap.Admin/Pages/Views/Admin/Exceptions.razor index 07c79d70..96fc33ee 100644 --- a/src/admin/Bootstrap.Admin/Pages/Views/Admin/Exceptions.razor +++ b/src/admin/Bootstrap.Admin/Pages/Views/Admin/Exceptions.razor @@ -1,11 +1,11 @@ -@inherits ExceptionsBase +@inherits ExceptionsBase
查询结果
- +
@@ -25,8 +25,6 @@ - -
@@ -35,7 +33,7 @@
- @foreach(var item in Items) + @foreach (var item in Items) {
@item diff --git a/src/admin/Bootstrap.Admin/Pages/Views/Components/ExceptionsBase.cs b/src/admin/Bootstrap.Admin/Pages/Views/Components/ExceptionsBase.cs index 32c7e24d..54f7ce7e 100644 --- a/src/admin/Bootstrap.Admin/Pages/Views/Components/ExceptionsBase.cs +++ b/src/admin/Bootstrap.Admin/Pages/Views/Components/ExceptionsBase.cs @@ -43,14 +43,6 @@ namespace Bootstrap.Admin.Pages.Views.Admin.Components return data.ToQueryData(); } - /// - /// 重置搜索方法 - /// - protected void ResetSearch() - { - - } - /// /// 获得 错误日志文件集合 /// diff --git a/src/admin/Bootstrap.Admin/Pages/Views/Components/TasksBase.cs b/src/admin/Bootstrap.Admin/Pages/Views/Components/TasksBase.cs index 006531ee..b870164f 100644 --- a/src/admin/Bootstrap.Admin/Pages/Views/Components/TasksBase.cs +++ b/src/admin/Bootstrap.Admin/Pages/Views/Components/TasksBase.cs @@ -26,7 +26,7 @@ namespace Bootstrap.Admin.Pages.Views.Admin.Components /// protected QueryData Query(QueryPageOptions options) { - var data = TaskServicesManager.ToList().OrderBy(s => s.Name).Select(s => new DefaultScheduler() + var data = (string.IsNullOrEmpty(options.SearchText) ? TaskServicesManager.ToList() : TaskServicesManager.ToList().Where(t => t.Name.Contains(options.SearchText, StringComparison.OrdinalIgnoreCase))).OrderBy(s => s.Name).Select(s => new DefaultScheduler() { Name = s.Name, Status = s.Status,