excel

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExcelTagKey = "excel"
	Pattern     = "name:(.*?);|index:(.*?);|width:(.*?);|needMerge:(.*?);|replace:(.*?);"
)

定义正则表达式模式

Variables

This section is empty.

Functions

This section is empty.

Types

type Excel

type Excel struct {
	F             *excelize.File // excel 对象
	TitleStyle    int            // 表头样式
	HeadStyle     int            // 表头样式
	ContentStyle1 int            // 主体样式1,无背景色
	ContentStyle2 int            // 主体样式2,有背景色
}

func ExcelInit

func ExcelInit() (e *Excel)

初始化

func (*Excel) ExportExcel

func (e *Excel) ExportExcel(sheet, title string, resMap map[string]interface{}, changeHead map[string]string) (err error)

ExportExcel excel导出

type ExcelTag

type ExcelTag struct {
	Value     interface{}
	Name      string // 表头标题
	Index     int    // 列下标(从0开始)
	Width     int    // 列宽
	NeedMerge bool   // 是否需要合并
	Replace   string // 替换(需要替换的内容_替换后的内容。比如:1_未开始 ==> 表示1替换为未开始)
}

func NewExcelTag

func NewExcelTag() ExcelTag

构造函数,返回一个带有默认值的 ExcelTag 实例

func (*ExcelTag) GetTag

func (e *ExcelTag) GetTag(tag string) (err error)

读取字段tag值

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL