-
-
Notifications
You must be signed in to change notification settings - Fork 382
Table组件+BootstrapBlazor.TableExport+ToastService行为异常 #3348
Copy link
Copy link
Closed
Labels
questionQuestion that needs to be answeredQuestion that needs to be answered
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
在使用Table组件时,使用自定义导出下拉框按钮去导出数据,会出现Toast卡住,等到导出数据结束后才显示的异常行为。
以下为Razor代码:
<ExportButtonDropdownTemplate Context="ExportContext">
<div class="dropdown-item" @onclick="() => ExcelExportAllAsync(ExportContext)">
<i class="fa-regular fa-file-excel"></i>
<span>导出全部数据 Excel</span>
</div>
</ExportButtonDropdownTemplate>
private async Task ExcelExportAllAsync(ITableExportContext<ProcessNodeDto> context)
{
// 以下这个toast会卡住,直到导出完成才会和下面的toast一起显示
await ToastService.Information("数据导出", "开始导出,请等候...");
var data = Items;
// await Task.Delay(3000); // 假设这里需要好几秒才能完成
var ret = await TableExport.ExportExcelAsync(data, context.Columns, $"Test_{DateTime.Now:yyyyMMddHHmmss}.xlsx");
await ToastService.Success("数据导出", "导出完成");
}
### Expected Behavior
正常应该是先显示“开始导出” toast ,然后进行导出,导出完成再显示“导出完成"的toast 才对。
另外 ,
如果把
await ToastService.Information("数据导出", "开始导出,请等候...");
这个替换成:
await MessageService.Show(new MessageOption()
{
Content = "开始导出,请等候...",
Icon = "fa-solid fa-circle-info"
});
那message的行为是正常的。
### Steps To Reproduce
_No response_
### Exceptions (if any)
_No response_
### .NET Version
8.0.204
### Anything else?
_No response_Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionQuestion that needs to be answeredQuestion that needs to be answered