diff --git a/src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs b/src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs index 071a3effd8ddd5be383a87d2fc4fdd7a70969d8c..de5aade48c08cf335f9c08ddc95a228b01af3f0e 100644 --- a/src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs +++ b/src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs @@ -155,6 +155,11 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu /// public int Rows { get; set; } + /// + /// 获得/设置 控件跨列数量 + /// + public int ColSpan { get; set; } + /// /// 获得/设置 列过滤器 /// diff --git a/src/BootstrapBlazor/Components/EditorForm/EditorForm.razor.cs b/src/BootstrapBlazor/Components/EditorForm/EditorForm.razor.cs index 26cb0204802d9e4091adf6560f28e6e53b4840e6..956a1bc6caf3cc9d227ad8db3068e59c40668715 100644 --- a/src/BootstrapBlazor/Components/EditorForm/EditorForm.razor.cs +++ b/src/BootstrapBlazor/Components/EditorForm/EditorForm.razor.cs @@ -25,7 +25,7 @@ public partial class EditorForm : IShowLabel /// /// private string? GetCssString(IEditorItem item) => CssBuilder.Default("col-12") - .AddClass($"col-sm-6 col-md-{Math.Floor(12d / (ItemsPerRow ?? 1))}", item.Items == null && ItemsPerRow != null && item.Rows == 0) + .AddClass($"col-sm-6 col-md-{Math.Floor(12d / ((ItemsPerRow ?? 1) / (item.ColSpan == 0 ? 1 : item.ColSpan)))}", item.Items == null && ItemsPerRow != null && item.Rows == 0) .Build(); private string? FormClassString => CssBuilder.Default("row g-3") diff --git a/src/BootstrapBlazor/Components/EditorForm/EditorItem.cs b/src/BootstrapBlazor/Components/EditorForm/EditorItem.cs index 76b4280f50dc1b47d8a2acbbda7a611c6aaa3231..82d5009b2e2d799ded218b22d2e8fae8a668e2ee 100644 --- a/src/BootstrapBlazor/Components/EditorForm/EditorItem.cs +++ b/src/BootstrapBlazor/Components/EditorForm/EditorItem.cs @@ -94,6 +94,12 @@ public class EditorItem : ComponentBase, IEditorItem [Parameter] public int Rows { get; set; } + /// + /// 获得/设置 控件跨列数量 + /// + [Parameter] + public int ColSpan { get; set; } + /// /// 获得/设置 编辑模板 /// diff --git a/src/BootstrapBlazor/Components/EditorForm/IEditorItem.cs b/src/BootstrapBlazor/Components/EditorForm/IEditorItem.cs index 031b0145021add08604926c7462b483048b2d1a9..386af1e70f6fb2242cfd20afb86df3aa106f8ce4 100644 --- a/src/BootstrapBlazor/Components/EditorForm/IEditorItem.cs +++ b/src/BootstrapBlazor/Components/EditorForm/IEditorItem.cs @@ -139,4 +139,9 @@ public interface IEditorItem /// 获得/设置 当前属性分组排序 默认 0 /// int GroupOrder { get; set; } + + /// + /// 获得/设置 控件跨列数量 + /// + int ColSpan { get; set; } } diff --git a/src/BootstrapBlazor/Components/Table/InternalTableColumn.cs b/src/BootstrapBlazor/Components/Table/InternalTableColumn.cs index 0c89cc98f0d32da8fbc524f3023cc4d958d86c20..36812a280940f6060ef38bcf344f8adce2578314 100644 --- a/src/BootstrapBlazor/Components/Table/InternalTableColumn.cs +++ b/src/BootstrapBlazor/Components/Table/InternalTableColumn.cs @@ -88,6 +88,8 @@ internal class InternalTableColumn : ITableColumn public int Rows { get; set; } + public int ColSpan { get; set; } + [NotNull] public string? Text { get; set; } diff --git a/src/BootstrapBlazor/Components/Table/TableColumn.cs b/src/BootstrapBlazor/Components/Table/TableColumn.cs index aafb23ece134fa1d013c49304ff7d381f34ce8bd..6c6305f6872ab74e3886811e337e1578855587a4 100644 --- a/src/BootstrapBlazor/Components/Table/TableColumn.cs +++ b/src/BootstrapBlazor/Components/Table/TableColumn.cs @@ -123,6 +123,12 @@ public class TableColumn : BootstrapComponentBase, ITableColumn [Parameter] public int Rows { get; set; } + /// + /// 获得/设置 控件跨列数量 + /// + [Parameter] + public int ColSpan { get; set; } + /// /// 获得/设置 是否为默认排序规则 默认为 SortOrder.Unset ///