fix xiang.table.export bug
This commit is contained in:
parent
2926ec99f5
commit
4d497dd980
1 changed files with 5 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ import (
|
|||
"github.com/xuri/excelize/v2"
|
||||
"github.com/yaoapp/gou"
|
||||
"github.com/yaoapp/gou/helper"
|
||||
"github.com/yaoapp/kun/any"
|
||||
"github.com/yaoapp/kun/exception"
|
||||
"github.com/yaoapp/kun/log"
|
||||
"github.com/yaoapp/kun/maps"
|
||||
|
|
@ -303,6 +304,10 @@ func (table *Table) Export(filename string, data interface{}, page int, chunkSiz
|
|||
for _, row := range values {
|
||||
rows = append(rows, maps.Of(row).Dot())
|
||||
}
|
||||
} else if values, ok := data.([]interface{}); ok {
|
||||
for _, row := range values {
|
||||
rows = append(rows, any.Of(row).MapStr().Dot())
|
||||
}
|
||||
}
|
||||
|
||||
columns, err := table.exportSetting()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue