Documentation
¶
Overview ¶
用于 vue.ant 前台表格生成 excel 文件的 支持定制表头表尾 即将成为共用模块
excel @since 0.0.11 模板生成
Index ¶
- Constants
- func APIPostExportExcel(c *gin.Context)
- func CenterStyle(f *excelize.File) int
- func ColDataToInterface(c interface{}) interface{}
- func FormColumnsToInterface(formColumns []table.Column) []interface{}
- func FormDataWriteExcel(file *excelize.File, columns []table.Column, nowRow int, data interface{}) (error, int)
- func GetValueFromMapStringInterface(i interface{}, key string) (interface{}, error)
- func GetValueFromMapStringInterfaceToString(i interface{}, key string) (string, error)
- func MakeTitle(file *excelize.File, title string, columns []interface{}) error
- func MergeCell(f *excelize.File, sheet string, begin Axis, end Axis) error
- func NewFile(orientation bool) (*excelize.File, error)
- func Register()
- func RowsDataToInterface(d interface{}) []interface{}
- func Save(f *excelize.File, name string) error
- func SetColWidth(f *excelize.File, sheet string, axis Axis, width float64) error
- func SetColsWidth(f *excelize.File, sheet string, begin Axis, end Axis, width float64) error
- func SetExcelHeader(file *excelize.File, sheet string, data []Cell, nowRow int) (error, int)
- func SetFreeCell(file *excelize.File, sheet string, header []Cell, nowRow int) (int, error)
- func SetRowCallsValue(f *excelize.File, sheet string, begin Axis, values []interface{}) error
- func SetTitle(f *excelize.File, sheet string, begin Axis, end Axis, value string) error
- type APIPostExportForm
- type Axis
- type Cell
Constants ¶
View Source
const ( A = iota + 65 B C D E F G H I J K L M N O P Q R S T U V W X Y Z )
Variables ¶
This section is empty.
Functions ¶
func CenterStyle ¶
CenterStyle 居中的样式 TODO 改成文件级别的全局 @since 0.0.11
func ColDataToInterface ¶
func ColDataToInterface(c interface{}) interface{}
func FormColumnsToInterface ¶
将表单中的列字段转换成 excel 可以写入的格式
func FormDataWriteExcel ¶
func FormDataWriteExcel(file *excelize.File, columns []table.Column, nowRow int, data interface{}) (error, int)
从form 表单中的data字段读取数据 并写入 excel
func GetValueFromMapStringInterface ¶
GetValueFromMapStringInterface
func GetValueFromMapStringInterfaceToString ¶ added in v0.0.25
func MakeTitle ¶
MakeTitle 设置标题相关
func MergeCell ¶
MergeCell 合并单元格 @since 0.0.11
func Register ¶
func Register()
func RowsDataToInterface ¶
func RowsDataToInterface(d interface{}) []interface{}
把各种奇怪的类型如 sql.NullString int64 float64等 转换为 interface{]
func SetColWidth ¶
SetColsWidth 设置字段的宽度 单个单元格 @since 0.0.11
func SetColsWidth ¶
SetColsWidth 设置字段的宽度 连读单元格首尾设置 @since 0.0.11 @since 0.0.23 不传宽度默认是15.5
func SetExcelHeader ¶
func SetFreeCell ¶
任意写值 在一定区段内
func SetRowCallsValue ¶
SetRowCallsValue 横向依次写值 @since 0.0.11
Types ¶
type APIPostExportForm ¶ added in v0.0.25
type APIPostExportForm struct { Title string `json:"title" binding:"required"` Header []Cell `json:"header"` Columns []table.Column `json:"columns" binding:"required"` Data interface{} `json:"data"` Orientation bool `json:"orientation"` // @since 0.0.23 false 为纵向 true 为横向 Width float64 `json:"width"` // 0 为 15.5 }
APIPostExportForm 提取成通用表单
Click to show internal directories.
Click to hide internal directories.