驳回修改-导表初次提交

This commit is contained in:
2026-08-12 17:19:55 +08:00
parent 3850be9ab8
commit a962b8843f
7 changed files with 224 additions and 21 deletions
@@ -28,7 +28,7 @@ public static class ExcelExportHelper
/// <param name="translateType"></param>
/// <param name="criterionType"></param>
/// <returns></returns>
public static async Task<IActionResult> DataExportAsync(string code, ExcelExportInfo data, string exportFileNamePrefix, IRepository<CommonDocument> _commonDocumentRepository, IWebHostEnvironment _hostEnvironment, IDictionaryService? _dictionaryService = null, Type? translateType = null, CriterionType? criterionType = null)
public static async Task<IActionResult> DataExportAsync(string code, ExcelExportInfo data, string exportFileNamePrefix, IRepository<CommonDocument> _commonDocumentRepository, IWebHostEnvironment _hostEnvironment, IDictionaryService? _dictionaryService = null, Type? translateType = null, CriterionType? criterionType = null, List<int> removeExcelIndexList = null)
{
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
@@ -158,6 +158,17 @@ public static class ExcelExportHelper
workbook.Worksheets.Delete(2); // 删除第2个(索引2
}
if (removeExcelIndexList != null)
{
var worksheet = workbook.Worksheet(1); // 索引从1开始
foreach (int colIndex in removeExcelIndexList.OrderByDescending(t=>t))
{
// 删除整列
worksheet.Column(colIndex).Delete();
}
}
//中文替换项目术语
if (data.TrialObjectNameList?.Count > 0)
{
@@ -932,14 +943,14 @@ public static class ExcelExportHelper
//if (sheetCount == 2)
//{
if (inDto.IsEnglish)
{
workbook.Worksheet(1).Delete(); // 删除第一个工作表
}
else
{
workbook.Worksheet(2).Delete(); // 删除第二个工作表
}
if (inDto.IsEnglish)
{
workbook.Worksheet(1).Delete(); // 删除第一个工作表
}
else
{
workbook.Worksheet(2).Delete(); // 删除第二个工作表
}
//}
#endregion