Skip to content

Commit 3abc920

Browse files
authored
fix(TableExport): default file extension always csv (#2201)
* fix: 修复扩展名错误问题 * chore: bump version 7.5.1-beta02 * chore: 更新依赖包 * chore: bump version 7.11.0
1 parent 07ebddc commit 3abc920

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/BootstrapBlazor.Shared/BootstrapBlazor.Shared.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<PackageReference Include="BootstrapBlazor.SignaturePad" Version="7.0.3" />
4545
<PackageReference Include="BootstrapBlazor.Splitting" Version="7.0.0" />
4646
<PackageReference Include="BootstrapBlazor.SummerNote" Version="7.3.4" />
47-
<PackageReference Include="BootstrapBlazor.TableExport" Version="7.5.1-beta01" />
47+
<PackageReference Include="BootstrapBlazor.TableExport" Version="7.5.1-beta02" />
4848
<PackageReference Include="BootstrapBlazor.Topology" Version="7.4.5" />
4949
<PackageReference Include="BootstrapBlazor.VideoPlayer" Version="7.0.4" />
5050
<PackageReference Include="BootstrapBlazor.MouseFollower" Version="7.0.0" />

src/BootstrapBlazor/BootstrapBlazor.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>7.10.8-beta15</Version>
4+
<Version>7.10.8</Version>
55
</PropertyGroup>
66

77
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">

src/Extensions/Components/BootstrapBlazor.TableExport/BootstrapBlazor.TableExport.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>7.5.1-beta01</Version>
4+
<Version>7.5.1-beta02</Version>
55
<PackageTags>Bootstrap Blazor WebAssembly wasm UI Components Table Export</PackageTags>
66
<Description>Bootstrap UI components extensions of export</Description>
77
</PropertyGroup>

src/Extensions/Components/BootstrapBlazor.TableExport/ExcelExport.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ private async Task<bool> InternalExportAsync<TModel>(IEnumerable<TModel> items,
5151
using var stream = new MemoryStream();
5252
await MiniExcel.SaveAsAsync(stream, value, excelType: excelType);
5353

54-
fileName ??= $"ExportData_{DateTime.Now:yyyyMMddHHmmss}.csv";
54+
fileName ??= $"ExportData_{DateTime.Now:yyyyMMddHHmmss}.{GetExtension()}";
5555
stream.Position = 0;
5656
var downloadService = ServiceProvider.GetRequiredService<DownloadService>();
5757
await downloadService.DownloadFromStreamAsync(fileName, stream);
5858
return true;
59+
60+
string GetExtension() => excelType == ExcelType.XLSX ? "xlsx" : "csv";
5961
}
6062

6163
private static async Task<object?> FormatValue(ITableColumn col, object? value)

0 commit comments

Comments
 (0)