!800 docs(#I2AMFG): add layout settings use drawer components in templates page

* docs: settings box support back drop
* refactor: avoid assembly is null
* style: update title color
* docs: change off color
* docs: update docs for table
* docs: update Scroll IsAutoHide property default value
This commit is contained in:
Argo 2020-12-24 00:16:25 +08:00
parent 03a5c22cda
commit 30e998d968
7 changed files with 87 additions and 7 deletions

View File

@ -27,4 +27,82 @@
///
/// </summary>
protected static IEnumerable<BindItem> Items { get; } = GenerateItems();
/// <summary>
///
/// </summary>
public class BindItem
{
// 列头信息支持 ColumnName Display DisplayName 三种标签
/// <summary>
///
/// </summary>
[Display(Name = "主键")]
[AutoGenerateColumn(Ignore = true)]
public int Id { get; set; }
/// <summary>
///
/// </summary>
[Required(ErrorMessage = "{0}不能为空")]
[AutoGenerateColumn(Order = 10)]
[ColumnName(Name = "姓名", ResourceName = "Name", ResourceType = typeof(BindItem))]
public string? Name { get; set; }
/// <summary>
///
/// </summary>
[AutoGenerateColumn(Order = 1, FormatString = "yyyy-MM-dd", Width = 180)]
[ColumnName(Name = "日期", ResourceName = "DateTime", ResourceType = typeof(BindItem))]
public DateTime? DateTime { get; set; }
/// <summary>
///
/// </summary>
[ColumnName(Name = "地址", ResourceName = "Address", ResourceType = typeof(BindItem))]
[Required(ErrorMessage = "{0}不能为空")]
[AutoGenerateColumn(Order = 20)]
public string? Address { get; set; }
/// <summary>
///
/// </summary>
[ColumnName(Name = "数量", ResourceName = "Count", ResourceType = typeof(BindItem))]
[AutoGenerateColumn(Order = 40)]
public int Count { get; set; }
/// <summary>
///
/// </summary>
[ColumnName(Name = "是/否", ResourceName = "Complete", ResourceType = typeof(BindItem))]
[AutoGenerateColumn(Order = 50)]
public bool Complete { get; set; }
/// <summary>
///
/// </summary>
[Required(ErrorMessage = "请选择{0}")]
[ColumnName(Name = "学历", ResourceName = "Education", ResourceType = typeof(BindItem))]
[AutoGenerateColumn(Order = 60)]
public EnumEducation? Education { get; set; }
}
/// <summary>
///
/// </summary>
public enum EnumEducation
{
/// <summary>
///
/// </summary>
[Description("小学")]
Primary,
/// <summary>
///
/// </summary>
[Description("中学")]
Middel
}
}

View File

@ -35,8 +35,9 @@
</div>
</Footer>
</Layout>
<Drawer Placement="Placement.Right" @bind-IsOpen="@IsOpen">
<Drawer Placement="Placement.Right" @bind-IsOpen="@IsOpen" IsBackdrop="true">
<div class="layout-drawer-body">
<div class="btn btn-info w-100" @onclick="@(e => IsOpen = false)">点击关闭</div>
<div class="page-layout-demo-option">
<p>布局调整</p>
<div class="row">
@ -90,7 +91,7 @@
</div>
<div class="row mt-3">
<div class="col-6 d-flex align-items-center">
<Switch @bind-Value="@ShowFooter" OnColor="@Color.Success" OffColor="@Color.Primary"></Switch>
<Switch @bind-Value="@ShowFooter" OnColor="@Color.Success" OffColor="@Color.Secondary"></Switch>
</div>
<div class="col-6 text-right">
<span>显示页脚</span>

View File

@ -48,7 +48,7 @@ namespace BootstrapBlazor.Components
public string Width { get; set; } = "auto";
/// <summary>
/// 获得/设置 是否自动隐藏
/// 获得/设置 是否自动隐藏 默认为 true
/// </summary>
[Parameter]
public bool IsAutoHide { get; set; } = true;

View File

@ -207,8 +207,8 @@ namespace BootstrapBlazor.Components
private async Task InitRouteTable()
{
var apps = AdditionalAssemblies == null ? new[] { Assembly.GetEntryAssembly() } : new[] { Assembly.GetEntryAssembly() }.Concat(AdditionalAssemblies).Where(a => a != null);
var componentTypes = apps.SelectMany(a => a!.ExportedTypes.Where(t => typeof(IComponent).IsAssignableFrom(t)));
var apps = AdditionalAssemblies == null ? new[] { Assembly.GetEntryAssembly() } : new[] { Assembly.GetEntryAssembly() }.Concat(AdditionalAssemblies).Distinct();
var componentTypes = apps.SelectMany(a => a?.ExportedTypes.Where(t => typeof(IComponent).IsAssignableFrom(t)) ?? Array.Empty<Type>());
foreach (var componentType in componentTypes)
{

File diff suppressed because one or more lines are too long

View File

@ -4911,6 +4911,7 @@ input:disabled,
flex: 1 1 auto;
opacity: 1;
transition: opacity .3s linear;
color: #e9ecef;
}
.layout.is-page .is-collapsed .layout-title {

File diff suppressed because one or more lines are too long