作者 yangfu

计算集导出修改

@@ -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 }