正在显示
1 个修改的文件
包含
4 行增加
和
1 行删除
@@ -83,8 +83,11 @@ func (querySetService *QuerySetService) CalculateSetExport(ctx *domain.Context, | @@ -83,8 +83,11 @@ func (querySetService *QuerySetService) CalculateSetExport(ctx *domain.Context, | ||
83 | var fields []string | 83 | var fields []string |
84 | filename := fmt.Sprintf("%v_%v.xlsx", querySet.Name, time.Now().Format("060102150405")) | 84 | filename := fmt.Sprintf("%v_%v.xlsx", querySet.Name, time.Now().Format("060102150405")) |
85 | path := fmt.Sprintf("public/%v", filename) | 85 | path := fmt.Sprintf("public/%v", filename) |
86 | + for _, f := range dataTable.Fields { | ||
87 | + fields = append(fields, f.Name) | ||
88 | + } | ||
86 | excelWriter := excel.NewXLXSWriterTo(fields, dataTable.Data) | 89 | excelWriter := excel.NewXLXSWriterTo(fields, dataTable.Data) |
87 | - excelWriter.IgnoreTitle = true | 90 | + excelWriter.IgnoreTitle = false |
88 | if err = excelWriter.Save(path); err != nil { | 91 | if err = excelWriter.Save(path); err != nil { |
89 | return nil, factory.FastError(err) | 92 | return nil, factory.FastError(err) |
90 | } | 93 | } |
-
请 注册 或 登录 后发表评论