Documentation ¶
Index ¶
- type ExcelQuick
- type ExcelTemplate
- func (t *ExcelTemplate) BeforeLoadParamsFile(c any, logErr string) (result bool)
- func (t *ExcelTemplate) GetExcelTemplate(c any, logErr string, filename string) (excelData *excelize.File, err error)
- func (t *ExcelTemplate) GetFileHash() string
- func (t *ExcelTemplate) GetFileName() string
- func (t *ExcelTemplate) SaveExcelAndCreateTempFile(c any, logErr string) (fileSrc string, newID int64, hash string, err error)
- func (t *ExcelTemplate) SaveExcelFile(src string) (err error)
- func (t *ExcelTemplate) SaveExcelTemplate(c any, logErr string) error
- func (t *ExcelTemplate) SetFileHash(fileHash string)
- func (t *ExcelTemplate) SetFileName(fileName string)
- func (t *ExcelTemplate) SetImgByFileSysClaimID(fileClaimID int64, sheet string, cell string) (err error)
- func (t *ExcelTemplate) SetImgSuffix(suffix string)
- func (t *ExcelTemplate) SetRootDir(dir string)
- func (t *ExcelTemplate) SetSubDir(dir string)
- func (t *ExcelTemplate) SetTempFileExpire(tempFileExpire int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExcelQuick ¶
type ExcelQuick struct { //路由头部 C any //前置错误日志 LogErr string //缓冲名称组 // eg: fmt.Sprint("erp_permanent_assets_", orgID, "_end_", endAtCarbon.Time.Format("2006-01-02")) FileParams string //文件名称 // eg: fmt.Sprint("固定资产", endAtCarbon.Time.Format("2006"), "年度变动情况.xlsx") FileName string //模板路径 // 该路径位于builds的excel目录下 // eg: fmt.Sprint("erp", CoreFile.Sep, "permanent_assets", CoreFile.Sep, "sort_change_analysis.xlsx") TemplatePath string //是否覆盖样式 // 仅可用于单个表,如果是多个表,请手动调用QuickSetStyle方法 NeedReplaceStyle bool //覆盖样式参考表名称 // eg: "",给空则采用默认表名称Sheet1 ReplaceStyleSheet string //覆盖样式参考位置 // eg: "A1" ReplaceStyleRef string //覆盖样式起点位置 // eg: fmt.Sprint("A", 1) ReplaceStyleStart string //覆盖样式结束位置 // eg: fmt.Sprint("O", rowStep) ReplaceStyleEnd string //Excel数据对象 ExcelObj *excelize.File //缓冲数据保留秒 CacheSaveTime int }
func (*ExcelQuick) QuickInsertCol ¶
func (t *ExcelQuick) QuickInsertCol(sheetName string, data map[string]string)
QuickInsertCol 快入给单元格写入数据
func (*ExcelQuick) QuickSetStyle ¶
func (t *ExcelQuick) QuickSetStyle(sheetName string, defaultStyle string, areaStart string, areaEnd string)
QuickSetStyle 快速设置样式
type ExcelTemplate ¶ added in v5.1.37
type ExcelTemplate struct { //Excel句柄 ExcelData *excelize.File // contains filtered or unexported fields }
ExcelTemplate 快速模板工具模块
func (*ExcelTemplate) BeforeLoadParamsFile ¶ added in v5.1.37
func (t *ExcelTemplate) BeforeLoadParamsFile(c any, logErr string) (result bool)
BeforeLoadParamsFile 预先下载文件处理
func (*ExcelTemplate) GetExcelTemplate ¶ added in v5.1.37
func (t *ExcelTemplate) GetExcelTemplate(c any, logErr string, filename string) (excelData *excelize.File, err error)
GetExcelTemplate 获取模版文件
func (*ExcelTemplate) GetFileHash ¶ added in v5.2.14
func (t *ExcelTemplate) GetFileHash() string
func (*ExcelTemplate) GetFileName ¶ added in v5.2.14
func (t *ExcelTemplate) GetFileName() string
func (*ExcelTemplate) SaveExcelAndCreateTempFile ¶ added in v5.2.14
func (t *ExcelTemplate) SaveExcelAndCreateTempFile(c any, logErr string) (fileSrc string, newID int64, hash string, err error)
SaveExcelAndCreateTempFile 保存excel文件到指定新的路径
func (*ExcelTemplate) SaveExcelFile ¶ added in v5.1.37
func (t *ExcelTemplate) SaveExcelFile(src string) (err error)
SaveExcelFile 保存修改结果
func (*ExcelTemplate) SaveExcelTemplate ¶ added in v5.1.37
func (t *ExcelTemplate) SaveExcelTemplate(c any, logErr string) error
SaveExcelTemplate 第二代保存excel文件
func (*ExcelTemplate) SetFileHash ¶ added in v5.1.37
func (t *ExcelTemplate) SetFileHash(fileHash string)
func (*ExcelTemplate) SetFileName ¶ added in v5.1.37
func (t *ExcelTemplate) SetFileName(fileName string)
func (*ExcelTemplate) SetImgByFileSysClaimID ¶ added in v5.1.37
func (t *ExcelTemplate) SetImgByFileSysClaimID(fileClaimID int64, sheet string, cell string) (err error)
SetImgByFileSysClaimID 将图片ID写入对应位置
func (*ExcelTemplate) SetImgSuffix ¶ added in v5.1.37
func (t *ExcelTemplate) SetImgSuffix(suffix string)
func (*ExcelTemplate) SetRootDir ¶ added in v5.1.37
func (t *ExcelTemplate) SetRootDir(dir string)
func (*ExcelTemplate) SetSubDir ¶ added in v5.1.37
func (t *ExcelTemplate) SetSubDir(dir string)
func (*ExcelTemplate) SetTempFileExpire ¶ added in v5.1.37
func (t *ExcelTemplate) SetTempFileExpire(tempFileExpire int)
Click to show internal directories.
Click to hide internal directories.