支持导出空文档

This commit is contained in:
lzh 2025-11-11 15:54:53 +08:00
parent 3ec9dcfc1e
commit 9967e57883

View File

@ -516,10 +516,6 @@ func BalanceMetricsExport(ctx *gin.Context) {
}
func exportStructToExcel[T any](data []T, headers []string, filename string, fns ...func(data []T, headers []string, f *excelize.File)) error {
if len(data) == 0 {
return fmt.Errorf("没有数据")
}
f := excelize.NewFile()
sheet := f.GetSheetName(f.GetActiveSheetIndex())