修改导出文件名

This commit is contained in:
2022-04-12 09:35:42 +08:00
parent 1a2dbd150a
commit eefe406b99
7 changed files with 30 additions and 18 deletions
@@ -7,7 +7,7 @@ namespace IRaCIS.Core.Application.Service;
public static class ExcelExportHelper
{
//MiniExcel_Export
public static async Task<IActionResult> DataExportAsync(string code, object data, IRepository<CommonDocument> _commonDocumentRepository, IWebHostEnvironment _hostEnvironment)
public static async Task<IActionResult> DataExportAsync(string code, object data, string exportFileNamePrefix, IRepository<CommonDocument> _commonDocumentRepository, IWebHostEnvironment _hostEnvironment)
{
var doc = _commonDocumentRepository.AsQueryable(true).FirstOrDefault(t => t.Code == code);
@@ -38,7 +38,7 @@ public static class ExcelExportHelper
return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
{
FileDownloadName = $"{doc.Name}_{DateTime.Now.ToString("yyyy-MM-dd:hh:mm:ss")}.xlsx"
FileDownloadName = $"{exportFileNamePrefix}_{doc.Name}_{DateTime.Now.ToString("yyyy-MM-dd:hh:mm:ss")}.xlsx"
};
#endregion