chore: 优化excel导入导出

This commit is contained in:
Zero
2024-04-19 08:53:02 +08:00
parent 4e747d9f23
commit 8e193da90c
4 changed files with 24 additions and 27 deletions

15
pkg/utils/excel/excel.go Normal file
View File

@@ -0,0 +1,15 @@
package excel
// 生成 Excel 中的列标签
func GenerateColumnLabel(index int) string {
var columnLabel string
for index > 0 {
mod := (index - 1) % 26
columnLabel = string(rune('A'+mod)) + columnLabel
index = (index - 1) / 26
}
return columnLabel
}