refactor: Table 组件整理属性排序

This commit is contained in:
Argo Zhang 2020-02-04 14:30:30 +08:00
parent 37e54d121a
commit 626d0c6cc1
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 39 additions and 41 deletions

View File

@ -14,6 +14,12 @@ namespace Bootstrap.Admin.Pages.Components
/// </summary>
public class TableBase<TItem> : ComponentBase
{
/// <summary>
/// 获得 IJSRuntime 实例
/// </summary>
[Inject]
protected IJSRuntime? JSRuntime { get; set; }
/// <summary>
/// 每页数据数量 默认 20 行
/// </summary>
@ -73,12 +79,6 @@ namespace Bootstrap.Admin.Pages.Components
[Parameter]
public bool FixedHeader { get; set; }
/// <summary>
/// 获得 IJSRuntime 实例
/// </summary>
[Inject]
protected IJSRuntime? JSRuntime { get; set; }
/// <summary>
/// 获得/设置 是否自适应高度 默认为 false 不自适应高度
/// </summary>
@ -173,15 +173,6 @@ namespace Bootstrap.Admin.Pages.Components
[Parameter]
public Action<TItem>? OnEdit { get; set; }
/// <summary>
/// 高级查询按钮点击时调用此方法
/// </summary>
protected void AdvancedSearchClick()
{
// 弹出高级查询弹窗
SearchModal?.Toggle();
}
/// <summary>
/// 保存按钮回调方法
/// </summary>
@ -200,34 +191,12 @@ namespace Bootstrap.Admin.Pages.Components
[Parameter]
public Func<IEnumerable<TItem>, bool>? OnDelete { get; set; }
/// <summary>
/// 获得/设置 数据总条目
/// </summary>
[Parameter]
public int TotalCount { get; set; }
/// <summary>
/// 获得/设置 当前页码
/// </summary>
[Parameter]
public int PageIndex { get; set; } = 1;
/// <summary>
/// 获得/设置 每页数据数量
/// </summary>
[Parameter]
public int PageItems { get; set; } = DefaultPageItems;
/// <summary>
/// 确认删除弹窗
/// </summary>
protected Modal? ConfirmModal { get; set; }
/// <summary>
/// 高级查询弹窗
/// </summary>
protected Modal? SearchModal { get; set; }
#nullable disable
/// <summary>
/// 获得/设置 EditModel 实例
@ -242,16 +211,36 @@ namespace Bootstrap.Admin.Pages.Components
public TItem QueryModel { get; set; }
#nullable restore
/// <summary>
/// 编辑数据弹窗 Title
/// </summary>
[Parameter]
public string SubmitModalTitle { get; set; } = "";
/// <summary>
/// 编辑数据弹窗
/// </summary>
protected SubmitModal<TItem>? EditModal { get; set; }
/// <summary>
/// 编辑数据弹窗 Title
/// 确认删除弹窗
/// </summary>
[Parameter]
public string SubmitModalTitle { get; set; } = "";
protected Modal? ConfirmModal { get; set; }
/// <summary>
/// 高级查询弹窗
/// </summary>
protected Modal? SearchModal { get; set; }
/// <summary>
/// 获得/设置 数据总条目
/// </summary>
protected int TotalCount { get; set; }
/// <summary>
/// 获得/设置 当前页码
/// </summary>
protected int PageIndex { get; set; } = 1;
/// <summary>
/// 获得/设置 当前排序字段名称
@ -283,7 +272,7 @@ namespace Bootstrap.Admin.Pages.Components
}
/// <summary>
/// OnInitialized 方法
/// OnAfterRenderAsync 方法
/// </summary>
protected override async System.Threading.Tasks.Task OnAfterRenderAsync(bool firstRender)
{
@ -489,6 +478,15 @@ namespace Bootstrap.Admin.Pages.Components
Query();
}
/// <summary>
/// 高级查询按钮点击时调用此方法
/// </summary>
protected void AdvancedSearchClick()
{
// 弹出高级查询弹窗
SearchModal?.Toggle();
}
/// <summary>
/// 获得/设置 搜索关键字
/// </summary>