diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs index 55fb94d..e011fc4 100644 --- a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs @@ -33,8 +33,6 @@ public class ZbxBase { private readonly IRepository _repository; - private readonly IMapper _mapper; - private Func _mapFunc; protected IStringLocalizer _localizer => LazyServiceProvider.LazyGetRequiredService>(); @@ -42,7 +40,6 @@ public class ZbxBase LazyServiceProvider.LazyGetRequiredService(); - public ZbxBase(IRepository repository) : base(repository) { _repository = repository; @@ -61,6 +58,8 @@ public class ZbxBase> GetPageListByFilterAsync(SfsRequestInputBase sfsRequestInputBase, bool includeDetails = false, CancellationToken cancellationToken = default) { + await CheckGetListPolicyAsync(); + var expression = sfsRequestInputBase.Condition.Filters?.Count > 0 ? sfsRequestInputBase.Condition.Filters.ToLambda() : p => true; @@ -286,7 +285,10 @@ public class ZbxBase p.Name == "Details"); - //从表 + // 子表 var detailList = (IEnumerable)mainAllProperties[detailsIndex].GetValue(mainDto); var startMainRowIndex = rowIndex; for (var datailCount = 0; datailCount < detailList.Count(); datailCount++) @@ -408,13 +412,17 @@ public class ZbxBase /// /// - private static ICellStyle SetExcelDetailsColor(IWorkbook workbook) + private static ICellStyle SetExcelDetailsCellStyle(IWorkbook workbook) + { + var cellStyle = workbook.CreateCellStyle(); + cellStyle.FillBackgroundColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillForegroundColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillPattern = FillPattern.SolidForeground; + return cellStyle; + } + + /// + /// 导出设置只有主表时的交替行 单元格样式 + /// + /// + /// + private static ICellStyle SetExcelOnlyMainCellStyle(IWorkbook workbook) + { + var cellStyle = workbook.CreateCellStyle(); + cellStyle.FillBackgroundColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillForegroundColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillPattern = FillPattern.SolidForeground; + return cellStyle; + } + + /// + /// 设置分割单元格的演示 + /// + /// + /// + private static ICellStyle SetSplitCellStyle(IWorkbook workbook) + { + var cellStyle = workbook.CreateCellStyle(); + cellStyle.BorderLeft = BorderStyle.MediumDashed; + cellStyle.BorderRight = BorderStyle.MediumDashed; + cellStyle.LeftBorderColor = IndexedColors.BrightGreen.Index; + cellStyle.RightBorderColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillBackgroundColor = IndexedColors.White.Index; + cellStyle.FillForegroundColor = IndexedColors.White.Index; + cellStyle.FillPattern = FillPattern.ThickVerticalBands; + return cellStyle; + } + + /// + /// 导出设置表头单元格样式 + /// + /// + /// + private static ICellStyle SetExcelHeadCellStyle(IWorkbook workbook) { var cellStyle = workbook.CreateCellStyle(); cellStyle.FillBackgroundColor = IndexedColors.LightOrange.Index; @@ -559,4 +621,5 @@ public class ZbxBase