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