...
|
...
|
@@ -94,7 +94,12 @@ func (d *FilePreviewDto) Load(fileId int, m *domain.DataLoadDataTable, file *red |
|
|
d.TableType = domain.ExcelTable.ToString()
|
|
|
d.Fields = m.Fields
|
|
|
var fields []*domain.Field
|
|
|
mapData := domain.ToFieldData(m.Fields, m.Data, true)
|
|
|
mapData := domain.ToFieldData(m.Fields, formatData(m.Data, func(s string) string {
|
|
|
if s == "<NA>" {
|
|
|
return ""
|
|
|
}
|
|
|
return s
|
|
|
}), true)
|
|
|
d.Data = domain.GripData(mapData, int64(m.Total))
|
|
|
d.PageNumber = m.PageNumber
|
|
|
|
...
|
...
|
@@ -115,6 +120,15 @@ func (ptr *PreviewDataTableService) GetFileId() int { |
|
|
return ptr.FileId
|
|
|
}
|
|
|
|
|
|
func formatData(data [][]string, f func(s string) string) [][]string {
|
|
|
for i := 0; i < len(data); i++ {
|
|
|
for j := 0; j < len(data[i]); j++ {
|
|
|
data[i][j] = f(data[i][j])
|
|
|
}
|
|
|
}
|
|
|
return data
|
|
|
}
|
|
|
|
|
|
func NewLoadDataTableService(transactionContext *pgTransaction.TransactionContext) (*PreviewDataTableService, error) {
|
|
|
if transactionContext == nil {
|
|
|
return nil, fmt.Errorf("transactionContext参数不能为nil")
|
...
|
...
|
|