excel

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Data2Excel

func Data2Excel(ctx context.Context, data []map[string]interface{}) (file string)

func Excel2Slice

func Excel2Slice(filePath string, _sheet ...string) [][]string

Excel2Slice 读取excel文件导入为切片

Types

type Excel

type Excel struct {
	Header int //表头行数
	Key    int //key列
}

func New

func New(header int, key int) *Excel

func (*Excel) ExcelLoad

func (s *Excel) ExcelLoad(ctx context.Context, fileItem *FileItem, mainPath string) (runTime time.Duration)

func (*Excel) Items2Map

func (s *Excel) Items2Map(items [][]int64) (list map[int64]int64)

道具格式转map

func (*Excel) Spilt2Item

func (s *Excel) Spilt2Item(str string) (result [][]int64)

字符串转道具类型

type FileItem

type FileItem struct {
	Name     string            `json:"name" dc:"配置文件名"`
	Filename string            `json:"filename" dc:"文件名"`
	Tabs     []string          `json:"tabs" dc:"页签"`
	Items    []string          `json:"items" dc:"道具字段"`
	ItemsMap []string          `json:"items_map" dc:"道具字段map格式"`
	Slice    map[string]string `json:"slice" dc:"切片"`
}

Jump to

Keyboard shortcuts

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