feat: 根据最新组件更改 SortList 为 SortString
This commit is contained in:
parent
0d609c41b0
commit
434e7ab82b
|
@ -4,7 +4,7 @@
|
|||
IsPagination="IsPagination" PageItemsSource="PageItemsSource" IsFixedHeader="IsFixedHeader"
|
||||
IsTree="IsTree" OnTreeExpand="OnTreeExpand!" TreeIcon="fa-chevron-circle-right"
|
||||
ShowDefaultButtons="ShowDefaultButtons" ShowAdvancedSearch="ShowAdvancedSearch"
|
||||
ShowEmpty="ShowEmpty" EmptyText="暂无数据" EmptyImage="images/empty.svg" SortList="SortList"
|
||||
ShowEmpty="ShowEmpty" EmptyText="暂无数据" EmptyImage="images/empty.svg" SortString="@SortString"
|
||||
OnQueryAsync="OnQueryAsync!" OnDeleteAsync="OnDeleteAsync!" OnSaveAsync="OnSaveAsync!"
|
||||
ShowSkeleton="true" ShowLoading="ShowLoading" ShowSearch="ShowSearch"
|
||||
ShowToolbar="ShowToolbar" ShowExtendButtons="ShowExtendButtons" ShowAddButton="@AuthorizeButton("add")"
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace BootstrapAdmin.Web.Components
|
|||
///
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public List<string>? SortList { get; set; }
|
||||
public string? SortString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@page "/Admin/Dicts"
|
||||
|
||||
<AdminTable TItem="DataAccess.Models.Dict" CustomerSearchModel="DictsSearchModel" SortList="SortList">
|
||||
<AdminTable TItem="DataAccess.Models.Dict" CustomerSearchModel="DictsSearchModel" SortString="Define, Category, Name">
|
||||
<TableColumns>
|
||||
<TableColumn @bind-Field="context.Category" Filterable="true" Searchable="true" Sortable="true"></TableColumn>
|
||||
<TableColumn @bind-Field="context.Name" Filterable="true" Searchable="true" Sortable="true"></TableColumn>
|
||||
|
|
|
@ -7,8 +7,6 @@ namespace BootstrapAdmin.Web.Pages.Admin
|
|||
/// </summary>
|
||||
public partial class Dicts
|
||||
{
|
||||
private ITableSearchModel DictsSearchModel { get; set; } = new DictsSearchModel();
|
||||
|
||||
private List<string> SortList { get; } = new List<string> { "Define", "Category", "Name" };
|
||||
private ITableSearchModel DictsSearchModel { get; } = new DictsSearchModel();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@page "/admin/logins"
|
||||
|
||||
<AdminTable TItem="LoginLog" IsPagination="true" CustomerSearchModel="@TableSearchModel" SortList="SortList"
|
||||
<AdminTable TItem="LoginLog" IsPagination="true" CustomerSearchModel="@TableSearchModel" SortString="LoginTime desc"
|
||||
ShowDefaultButtons="false" ShowExtendButtons="false">
|
||||
<TableColumns>
|
||||
<TableColumn @bind-Field="@context.UserName" Filterable="true" Searchable="true"></TableColumn>
|
||||
|
|
|
@ -10,7 +10,5 @@ public partial class Logins
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public ITableSearchModel TableSearchModel { get; set; } = new LoginLogModel();
|
||||
|
||||
private List<string> SortList { get; set; } = new List<string>() { "LoginTime desc" };
|
||||
public ITableSearchModel TableSearchModel { get; } = new LoginLogModel();
|
||||
}
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
|
||||
<AdminAlert Text="演示系统禁止修改内置后台任务" IsShow="IsDemo" />
|
||||
|
||||
<AdminTable TItem="TasksModel" ExtendButtonColumnWidth="270" IsFixedHeader="false" SortList="SortList"
|
||||
SelectedRows="SelectedRows"
|
||||
ShowEditButtonCallback="OnShowButtonCallback" ShowDeleteButtonCallback="OnShowButtonCallback"
|
||||
OnQueryAsync="OnQueryAsync" OnDeleteAsync="OnDeleteAsync" OnSaveAsync="OnSaveAsync">
|
||||
<AdminTable TItem="TasksModel" ExtendButtonColumnWidth="270" IsFixedHeader="false" SortString="Status, LastRuntime desc"
|
||||
SelectedRows="SelectedRows"
|
||||
ShowEditButtonCallback="OnShowButtonCallback" ShowDeleteButtonCallback="OnShowButtonCallback"
|
||||
OnQueryAsync="OnQueryAsync" OnDeleteAsync="OnDeleteAsync" OnSaveAsync="OnSaveAsync">
|
||||
<TableColumns>
|
||||
<TableColumn @bind-Field="@context.Name" Sortable="true" Filterable="true" Searchable="true" Width="80"></TableColumn>
|
||||
<TableColumn @bind-Field="@context.CreateTime" Sortable="true" Filterable="true" Searchable="true" FormatString="yyyy-MM-dd HH:mm:ss"></TableColumn>
|
||||
|
|
|
@ -30,8 +30,6 @@ public partial class Tasks
|
|||
|
||||
private bool IsDemo { get; set; }
|
||||
|
||||
private List<string> SortList { get; } = new List<string>() { "Name", "LastRuntime desc" };
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
@ -45,6 +43,10 @@ public partial class Tasks
|
|||
private Task<QueryData<TasksModel>> OnQueryAsync(QueryPageOptions options)
|
||||
{
|
||||
var tasks = TaskServicesManager.ToList().ToTasksModelList();
|
||||
if (options.SortList != null && options.SortList.Any())
|
||||
{
|
||||
tasks = tasks.Sort(options.SortList).ToList();
|
||||
}
|
||||
var model = tasks.FirstOrDefault(i => i.Name == SelectedRows.FirstOrDefault()?.Name);
|
||||
SelectedRows.Clear();
|
||||
if (model != null)
|
||||
|
@ -83,7 +85,7 @@ public partial class Tasks
|
|||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
private bool OnShowButtonCallback(TasksModel model) => !IsDemo || !Jobs.Any(i => i == model.Name);
|
||||
private bool OnShowButtonCallback(TasksModel model) => !IsDemo && !Jobs.Any(i => i == model.Name);
|
||||
|
||||
private static Color GetResultColor(TriggerResult result) => result switch
|
||||
{
|
||||
|
@ -122,7 +124,8 @@ public partial class Tasks
|
|||
private static string GetStatusIcon(SchedulerStatus status) => status switch
|
||||
{
|
||||
SchedulerStatus.Running => "fa fa-play-circle",
|
||||
SchedulerStatus.Ready => "fa fa-times-circle",
|
||||
SchedulerStatus.Ready => "fa fa-stop-circle",
|
||||
SchedulerStatus.Disabled => "fa fa-times-circle",
|
||||
_ => "未知状态"
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@page "/admin/traces"
|
||||
|
||||
<AdminTable TItem="DataAccess.Models.Trace" IsPagination="true" PageItemsSource="PageItemsSource" SortList="SortList"
|
||||
<AdminTable TItem="DataAccess.Models.Trace" IsPagination="true" PageItemsSource="PageItemsSource" SortString="LogTime desc"
|
||||
ShowDefaultButtons="false" ShowExtendButtons="false" CustomerSearchModel="TraceSearchModel"
|
||||
OnQueryAsync="OnQueryAsync">
|
||||
<TableColumns>
|
||||
|
|
|
@ -11,9 +11,7 @@ public partial class Traces
|
|||
{
|
||||
private List<int> PageItemsSource { get; } = new List<int> { 20, 40, 80, 100, 200 };
|
||||
|
||||
private TraceSearchModel TraceSearchModel { get; set; } = new();
|
||||
|
||||
private List<string> SortList { get; } = new() { "LogTime desc" };
|
||||
private TraceSearchModel TraceSearchModel { get; } = new();
|
||||
|
||||
[Inject]
|
||||
[NotNull]
|
||||
|
|
Loading…
Reference in New Issue