mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-12-04 21:20:16 +08:00
!1694 fix(#I44GIG): table filter support double and decimal data type
* chore: bump version to 5.5.2 * fix: NumberFilter 更改为泛型支持多种数据类型
This commit is contained in:
parent
ac91d53091
commit
12066f50fe
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>5.5.2-beta01</Version>
|
||||
<Version>5.5.2</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
|
||||
|
@ -1,4 +1,5 @@
|
||||
@namespace BootstrapBlazor.Components
|
||||
@typeparam TValue
|
||||
@inherits FilterBase
|
||||
|
||||
@if (IsHeaderRow)
|
||||
|
@ -12,13 +12,13 @@ namespace BootstrapBlazor.Components
|
||||
/// <summary>
|
||||
/// 数字类型过滤条件
|
||||
/// </summary>
|
||||
public partial class NumberFilter
|
||||
public partial class NumberFilter<TValue>
|
||||
{
|
||||
private int? Value1 { get; set; }
|
||||
private TValue? Value1 { get; set; }
|
||||
|
||||
private FilterAction Action1 { get; set; } = FilterAction.GreaterThanOrEqual;
|
||||
|
||||
private int? Value2 { get; set; }
|
||||
private TValue? Value2 { get; set; }
|
||||
|
||||
private FilterAction Action2 { get; set; } = FilterAction.LessThanOrEqual;
|
||||
|
||||
@ -52,8 +52,8 @@ namespace BootstrapBlazor.Components
|
||||
/// </summary>
|
||||
public override void Reset()
|
||||
{
|
||||
Value1 = null;
|
||||
Value2 = null;
|
||||
Value1 = default;
|
||||
Value2 = default;
|
||||
Action1 = FilterAction.GreaterThanOrEqual;
|
||||
Action2 = FilterAction.LessThanOrEqual;
|
||||
Count = 0;
|
||||
|
@ -56,9 +56,13 @@ else
|
||||
<DateTimeFilter Count="Count" />
|
||||
break;
|
||||
case nameof(Int32):
|
||||
<NumberFilter TValue="int" Count="Count" />
|
||||
break;
|
||||
case nameof(Double):
|
||||
<NumberFilter TValue="double" Count="Count" />
|
||||
break;
|
||||
case nameof(Decimal):
|
||||
<NumberFilter Count="Count" />
|
||||
<NumberFilter TValue="Decimal" Count="Count" />
|
||||
break;
|
||||
case nameof(String):
|
||||
<StringFilter Count="Count" />
|
||||
|
Loading…
Reference in New Issue
Block a user