Documentation
¶
Index ¶
- func InjectGoexcelFrame(s *GoexcelFrame)
- func InjectGoexcelImport(s *GoexcelImport)
- func InjectGoexcelStyle(s *GoexcelStyle)
- func InjectGoexcelTemplate(s *GoexcelTemplate)
- func LoadGoexcelFrame() baseiface.ISingleton
- func LoadGoexcelImport() baseiface.ISingleton
- func LoadGoexcelStyle() baseiface.ISingleton
- func LoadGoexcelTemplate() baseiface.ISingleton
- type GoexcelFrame
- func (self *GoexcelFrame) DefaultHeaders(table schema.Tabler)
- func (self *GoexcelFrame) DownloadFile(ctx *gin.Context)
- func (self *GoexcelFrame) ExportFile(c *gin.Context) error
- func (self *GoexcelFrame) ExportFile2Ret(c *gin.Context, models []*map[string]any, tableface gotag2.IreportTable) *basedto.IchubResult
- func (self *GoexcelFrame) ExportFileCtx(ctx *gin.Context, table schema.Tabler, list []*map[string]any) *basedto.IchubResult
- func (self *GoexcelFrame) ExportFileDefault(table schema.Tabler, list []*map[string]any) *basedto.IchubResult
- func (self *GoexcelFrame) ExportFileTabler(list []any) *basedto.IchubResult
- func (self *GoexcelFrame) ExportHttpExcel(f excelize.File, w http.ResponseWriter, r *http.Request)
- func (self *GoexcelFrame) FilterHeaders() []*goexcel2.ExcelHeader
- func (self *GoexcelFrame) GetRowField(row map[string]any, key string) any
- func (self *GoexcelFrame) KeyNames() []string
- func (self *GoexcelFrame) MakeStyle(file *excelize.File) (int, error)
- func (self *GoexcelFrame) MakeStyleBody(file *excelize.File) (int, error)
- func (self *GoexcelFrame) MakeStyleBodyNumeric(file *excelize.File) (int, error)
- func (self *GoexcelFrame) NewFile() *excelize.File
- func (self *GoexcelFrame) Prepare(table schema.Tabler, list []*map[string]any) error
- func (self *GoexcelFrame) PrepareTabler(table schema.Tabler, list []any) error
- func (self *GoexcelFrame) PutBoolOnly(key, name string) *goexcel2.ExcelHeader
- func (self *GoexcelFrame) PutDate(key, name string) *goexcel2.ExcelHeader
- func (self *GoexcelFrame) PutDateOnly(key, name string) *goexcel2.ExcelHeader
- func (self *GoexcelFrame) PutDatetime(key, name string) *goexcel2.ExcelHeader
- func (self *GoexcelFrame) PutDatetimeOnly(key, name string) *goexcel2.ExcelHeader
- func (self *GoexcelFrame) PutDecimal(key, name string) *goexcel2.ExcelHeader
- func (self *GoexcelFrame) PutDecimalOnly(key, name string) *goexcel2.ExcelHeader
- func (self *GoexcelFrame) PutInt(key, name string) *goexcel2.ExcelHeader
- func (self *GoexcelFrame) PutIntOnly(key, name string) *goexcel2.ExcelHeader
- func (self *GoexcelFrame) PutKey(key string, nameany any, dataType ...string) *goexcel2.ExcelHeader
- func (self *GoexcelFrame) PutKeyExportColumn(column *gotag2.ExportColumn) *goexcel2.ExcelHeader
- func (self *GoexcelFrame) PutKeyExportColumns(columns []*gotag2.ExportColumn)
- func (self *GoexcelFrame) PutKeyOnly(propKeyName string, propTitle any, dataType ...string) *goexcel2.ExcelHeader
- func (self *GoexcelFrame) PutString(key string, nameany any, dataType ...string) *goexcel2.ExcelHeader
- func (self *GoexcelFrame) PutStringOnly(key string, nameany any, dataType ...string) *goexcel2.ExcelHeader
- func (self *GoexcelFrame) Rows() []map[string]any
- func (self *GoexcelFrame) SaveBefore(list []*map[string]any) error
- func (self *GoexcelFrame) SaveExport2Db() *basedto.IchubResult
- func (self *GoexcelFrame) SaveExportFile2Db(objectType string, filepath string) *basedto.IchubResult
- func (self *GoexcelFrame) SaveFile(c *gin.Context) error
- func (self *GoexcelFrame) SaveFileAs(file *excelize.File, ctx *gin.Context) error
- func (self *GoexcelFrame) SetKeyNames(keyNames []string)
- func (self *GoexcelFrame) SetRows(rows []map[string]any)
- func (self *GoexcelFrame) SetTitles(titles []string)
- func (self *GoexcelFrame) Titles() []string
- func (self *GoexcelFrame) TransBody() error
- func (self *GoexcelFrame) UploadExport2Db() *basedto.IchubResult
- func (self *GoexcelFrame) WriteBody(file *excelize.File)
- func (self *GoexcelFrame) WriteHead(file *excelize.File)
- type GoexcelImport
- type GoexcelStyle
- type GoexcelTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InjectGoexcelFrame ¶
func InjectGoexcelFrame(s *GoexcelFrame)
func InjectGoexcelImport ¶
func InjectGoexcelImport(s *GoexcelImport)
func InjectGoexcelStyle ¶
func InjectGoexcelStyle(s *GoexcelStyle)
func InjectGoexcelTemplate ¶
func InjectGoexcelTemplate(s *GoexcelTemplate)
func LoadGoexcelFrame ¶
func LoadGoexcelFrame() baseiface.ISingleton
func LoadGoexcelImport ¶
func LoadGoexcelImport() baseiface.ISingleton
func LoadGoexcelStyle ¶
func LoadGoexcelStyle() baseiface.ISingleton
func LoadGoexcelTemplate ¶
func LoadGoexcelTemplate() baseiface.ISingleton
Types ¶
type GoexcelFrame ¶
type GoexcelFrame struct {
basedto.BaseEntity
IfCamelCase bool
Headers []*goexcel2.ExcelHeader
*goexcel2.GoexecelFile
// contains filtered or unexported fields
}
func NewGoexcelFrame ¶
func NewGoexcelFrame() *GoexcelFrame
func (*GoexcelFrame) DefaultHeaders ¶
func (self *GoexcelFrame) DefaultHeaders(table schema.Tabler)
func (*GoexcelFrame) DownloadFile ¶
func (self *GoexcelFrame) DownloadFile(ctx *gin.Context)
func (*GoexcelFrame) ExportFile ¶
func (self *GoexcelFrame) ExportFile(c *gin.Context) error
func (*GoexcelFrame) ExportFile2Ret ¶
func (self *GoexcelFrame) ExportFile2Ret(c *gin.Context, models []*map[string]any, tableface gotag2.IreportTable) *basedto.IchubResult
}
func (*GoexcelFrame) ExportFileCtx ¶
func (self *GoexcelFrame) ExportFileCtx(ctx *gin.Context, table schema.Tabler, list []*map[string]any) *basedto.IchubResult
func (*GoexcelFrame) ExportFileDefault ¶
func (self *GoexcelFrame) ExportFileDefault(table schema.Tabler, list []*map[string]any) *basedto.IchubResult
func (*GoexcelFrame) ExportFileTabler ¶
func (self *GoexcelFrame) ExportFileTabler(list []any) *basedto.IchubResult
func (*GoexcelFrame) ExportHttpExcel ¶
func (self *GoexcelFrame) ExportHttpExcel(f excelize.File, w http.ResponseWriter, r *http.Request)
func (*GoexcelFrame) FilterHeaders ¶
func (self *GoexcelFrame) FilterHeaders() []*goexcel2.ExcelHeader
func (*GoexcelFrame) GetRowField ¶
func (self *GoexcelFrame) GetRowField(row map[string]any, key string) any
func (*GoexcelFrame) KeyNames ¶
func (self *GoexcelFrame) KeyNames() []string
func (*GoexcelFrame) MakeStyle ¶
func (self *GoexcelFrame) MakeStyle(file *excelize.File) (int, error)
func (*GoexcelFrame) MakeStyleBody ¶
func (self *GoexcelFrame) MakeStyleBody(file *excelize.File) (int, error)
func (*GoexcelFrame) MakeStyleBodyNumeric ¶
func (self *GoexcelFrame) MakeStyleBodyNumeric(file *excelize.File) (int, error)
func (*GoexcelFrame) NewFile ¶
func (self *GoexcelFrame) NewFile() *excelize.File
func (*GoexcelFrame) PrepareTabler ¶
func (self *GoexcelFrame) PrepareTabler(table schema.Tabler, list []any) error
func (*GoexcelFrame) PutBoolOnly ¶
func (self *GoexcelFrame) PutBoolOnly(key, name string) *goexcel2.ExcelHeader
func (*GoexcelFrame) PutDate ¶
func (self *GoexcelFrame) PutDate(key, name string) *goexcel2.ExcelHeader
func (*GoexcelFrame) PutDateOnly ¶
func (self *GoexcelFrame) PutDateOnly(key, name string) *goexcel2.ExcelHeader
func (*GoexcelFrame) PutDatetime ¶
func (self *GoexcelFrame) PutDatetime(key, name string) *goexcel2.ExcelHeader
func (*GoexcelFrame) PutDatetimeOnly ¶
func (self *GoexcelFrame) PutDatetimeOnly(key, name string) *goexcel2.ExcelHeader
func (*GoexcelFrame) PutDecimal ¶
func (self *GoexcelFrame) PutDecimal(key, name string) *goexcel2.ExcelHeader
func (*GoexcelFrame) PutDecimalOnly ¶
func (self *GoexcelFrame) PutDecimalOnly(key, name string) *goexcel2.ExcelHeader
func (*GoexcelFrame) PutInt ¶
func (self *GoexcelFrame) PutInt(key, name string) *goexcel2.ExcelHeader
func (*GoexcelFrame) PutIntOnly ¶
func (self *GoexcelFrame) PutIntOnly(key, name string) *goexcel2.ExcelHeader
func (*GoexcelFrame) PutKey ¶
func (self *GoexcelFrame) PutKey(key string, nameany any, dataType ...string) *goexcel2.ExcelHeader
func (*GoexcelFrame) PutKeyExportColumn ¶
func (self *GoexcelFrame) PutKeyExportColumn(column *gotag2.ExportColumn) *goexcel2.ExcelHeader
func (*GoexcelFrame) PutKeyExportColumns ¶
func (self *GoexcelFrame) PutKeyExportColumns(columns []*gotag2.ExportColumn)
func (*GoexcelFrame) PutKeyOnly ¶
func (self *GoexcelFrame) PutKeyOnly(propKeyName string, propTitle any, dataType ...string) *goexcel2.ExcelHeader
https://view.officeapps.live.com/op/embed.aspx?src=https://leijmdas.oss-cn-shenzhen.aliyuncs.com/erp/product/product_%E4%BA%A7%E5%93%81_725.xlsx?x-oss-credential=LTAI5tJSGz JZaqHG4T9kmi6G%2F20251004%2Fcn-shenzhen%2Foss%2Faliyun_v4_request\u0026x-oss-date=20251004T090146Z\u0026x-oss-expires=4800\u0026x-oss-signature=7975f4d96b97fe3de7c16e434d9da0adaeca16639f1768d4dff0146567ef3ece\u0026x-oss-signature-version=OSS4-HMAC-SHA256
func (*GoexcelFrame) PutString ¶
func (self *GoexcelFrame) PutString(key string, nameany any, dataType ...string) *goexcel2.ExcelHeader
func (*GoexcelFrame) PutStringOnly ¶
func (self *GoexcelFrame) PutStringOnly(key string, nameany any, dataType ...string) *goexcel2.ExcelHeader
func (*GoexcelFrame) Rows ¶
func (self *GoexcelFrame) Rows() []map[string]any
func (*GoexcelFrame) SaveBefore ¶
func (self *GoexcelFrame) SaveBefore(list []*map[string]any) error
func (*GoexcelFrame) SaveExport2Db ¶
func (self *GoexcelFrame) SaveExport2Db() *basedto.IchubResult
func (*GoexcelFrame) SaveExportFile2Db ¶
func (self *GoexcelFrame) SaveExportFile2Db(objectType string, filepath string) *basedto.IchubResult
func (*GoexcelFrame) SaveFileAs ¶
c.Header("Content-Type", "application/octet-stream") c.Header("Content-Disposition", "attachment; filename=export.xlsx") c.Header("Content-Transfer-Encoding", "binary")
func (*GoexcelFrame) SetKeyNames ¶
func (self *GoexcelFrame) SetKeyNames(keyNames []string)
func (*GoexcelFrame) SetRows ¶
func (self *GoexcelFrame) SetRows(rows []map[string]any)
func (*GoexcelFrame) SetTitles ¶
func (self *GoexcelFrame) SetTitles(titles []string)
func (*GoexcelFrame) Titles ¶
func (self *GoexcelFrame) Titles() []string
func (*GoexcelFrame) TransBody ¶
func (self *GoexcelFrame) TransBody() error
func (*GoexcelFrame) UploadExport2Db ¶
func (self *GoexcelFrame) UploadExport2Db() *basedto.IchubResult
func (self *GoexcelFrame) UploadAli() (string, error) {
//var objectType = self.tabler.TableName()
//var localFile = self.GetFullPath()
//var fileKey = dbdongxw.NewReportFile().AliOssKey(objectType, localFile)
//return fileKey, alioss.FindBeanAliOssLoad().Upload(fileKey, localFile)
}
func (*GoexcelFrame) WriteBody ¶
func (self *GoexcelFrame) WriteBody(file *excelize.File)
func (*GoexcelFrame) WriteHead ¶
func (self *GoexcelFrame) WriteHead(file *excelize.File)
type GoexcelImport ¶
type GoexcelImport struct {
basedto.BaseEntity
*basedata.DataPath
TitleRow int
DataRow int
SheetName string
FileName string
}
func (*GoexcelImport) CheckRowPrice ¶
func (self *GoexcelImport) CheckRowPrice(col []string) (bool, error)
func (*GoexcelImport) FullFilePth ¶
func (self *GoexcelImport) FullFilePth() string
func (*GoexcelImport) GetSheetName ¶
func (self *GoexcelImport) GetSheetName() ([]string, error)
func (*GoexcelImport) ImportExcel ¶
func (self *GoexcelImport) ImportExcel(file string, userId int64) ([][]string, error)
type GoexcelStyle ¶
type GoexcelStyle struct {
basedto.BaseEntitySingle
IntStyle int
DecimalStyle int
StrStyle int
}
func NewGoexcelStyle ¶
func NewGoexcelStyle() *GoexcelStyle
func (*GoexcelStyle) MakeStyle ¶
func (self *GoexcelStyle) MakeStyle(header *goexcel2.ExcelHeader, file *excelize.File) (int, error)
func (*GoexcelStyle) MakeStyleAll ¶
func (self *GoexcelStyle) MakeStyleAll(file *excelize.File) (int, error)
type GoexcelTemplate ¶
type GoexcelTemplate struct {
basedto.BaseEntity
SheetName string
FileName string
*basedata.DataPath
// contains filtered or unexported fields
}
func FindBeanGoexcelTemplate ¶
func FindBeanGoexcelTemplate() *GoexcelTemplate
FindBeanGoexcelTemplate
func NewGoexcelTemplate ¶
func NewGoexcelTemplate() *GoexcelTemplate
func (*GoexcelTemplate) FullFilePth ¶
func (self *GoexcelTemplate) FullFilePth() string
func (*GoexcelTemplate) ParseTemplate ¶
func (self *GoexcelTemplate) ParseTemplate(file string) error
func (*GoexcelTemplate) SetTemplate ¶
func (self *GoexcelTemplate) SetTemplate(template *goexcel2.ExcelTemplate)
func (*GoexcelTemplate) Template ¶
func (self *GoexcelTemplate) Template() *goexcel2.ExcelTemplate
Click to show internal directories.
Click to hide internal directories.