feat: 基础 table 是否显示添加删除编辑按钮
This commit is contained in:
parent
cacea459c1
commit
3a0525f11f
|
@ -7,7 +7,8 @@
|
|||
ShowEmpty="ShowEmpty" EmptyText="暂无数据" EmptyImage="images/empty.svg" SortList="SortList"
|
||||
OnQueryAsync="OnQueryAsync!" OnDeleteAsync="OnDeleteAsync!" OnSaveAsync="OnSaveAsync!"
|
||||
ShowSkeleton="true" ShowLoading="ShowLoading" ShowSearch="ShowSearch"
|
||||
ShowToolbar="ShowToolbar" ShowExtendButtons="ShowExtendButtons"
|
||||
ShowToolbar="ShowToolbar" ShowExtendButtons="ShowExtendButtons" ShowAddButton="@AuthorizeButton("add")"
|
||||
ShowDeleteButton="@AuthorizeButton("del")" ShowEditButton="@AuthorizeButton("edit")"
|
||||
ShowCardView="true" ShowColumnList="true" ExtendButtonColumnWidth="@ExtendButtonColumnWidth"
|
||||
CustomerSearchModel="CustomerSearchModel" SelectedRows="SelectedRows"
|
||||
ShowEditButtonCallback="ShowEditButtonCallback!" ShowDeleteButtonCallback="ShowDeleteButtonCallback!"
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
using BootstrapAdmin.Web.Models;
|
||||
using BootstrapAdmin.Web.Core;
|
||||
using BootstrapAdmin.Web.Models;
|
||||
using BootstrapAdmin.Web.Services;
|
||||
|
||||
namespace BootstrapAdmin.Web.Components
|
||||
{
|
||||
|
@ -189,5 +191,24 @@ namespace BootstrapAdmin.Web.Components
|
|||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public Task QueryAsync() => Instance.QueryAsync();
|
||||
|
||||
[Inject]
|
||||
[NotNull]
|
||||
private INavigation? NavigationService { get; set; }
|
||||
|
||||
[Inject]
|
||||
[NotNull]
|
||||
private NavigationManager? NavigationManager { get; set; }
|
||||
|
||||
[Inject]
|
||||
[NotNull]
|
||||
private BootstrapAppContext? AppContext { get; set; }
|
||||
|
||||
private bool AuthorizeButton(string operate)
|
||||
{
|
||||
var url = NavigationManager.ToBaseRelativePath(NavigationManager.Uri);
|
||||
|
||||
return NavigationService.AuthorizationBlock(url, AppContext.UserName, operate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue