Compare commits
No commits in common. "aede8cbe97afa86ff61782d60ddc8de9797eb2e1" and "3afabc639b1cf4fb89f599116c617f5b3b801783" have entirely different histories.
aede8cbe97
...
3afabc639b
@ -518,6 +518,10 @@ 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 {
|
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()
|
f := excelize.NewFile()
|
||||||
sheet := f.GetSheetName(f.GetActiveSheetIndex())
|
sheet := f.GetSheetName(f.GetActiveSheetIndex())
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user