|
|
@ -390,7 +390,28 @@ func FileExist(file string) bool { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 导出excel文件 prefixFilename 文件前缀名称
|
|
|
|
/****************************************************************************** |
|
|
|
* |
|
|
|
* @Function Name : SaveExcelFile |
|
|
|
*----------------------------------------------------------------------------- |
|
|
|
* |
|
|
|
* @Description : 把传入的[]interface 数据保存成excel |
|
|
|
* |
|
|
|
* @Function Parameters : []interface{} 需要保存的数据切片 |
|
|
|
* |
|
|
|
* @Function Parameters : sheetName excel sheet名称 |
|
|
|
* |
|
|
|
* @Function Parameters : prefixFilename 保存文件的前缀名称 后面会有自动添加时间和文件类型后缀 |
|
|
|
* |
|
|
|
* @Return Value : filepath 文件路径 |
|
|
|
* |
|
|
|
* @Return Value : err 执行出现的错误 |
|
|
|
* |
|
|
|
* @Author : zhangxin |
|
|
|
* |
|
|
|
* @Date : 2021-03-19 |
|
|
|
* |
|
|
|
******************************************************************************/ |
|
|
|
func SaveExcelFile(list []interface{}, sheetName string, prefixFilename string) (filepath string, err error) { |
|
|
|
file := excelize.NewFile() |
|
|
|
streamWriter, err := file.NewStreamWriter(sheetName) |
|
|
|