datalist

package
v0.0.0-...-b9c356b Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func YesNoValue

func YesNoValue(value int, yesNoLabel ...string) string

YesNoValue 是或否的中文值

Types

type ColumnItem

type ColumnItem struct {
	Field             string                                `json:"field"`
	FieldName         string                                `json:"field_name"`
	FieldAttr         *FieldAttr                            `json:"field_attr"`
	Hidden            bool                                  `json:"-"`
	ValueCallBack     func(rowData interface{}) string      `json:"-"`
	OriValueCallBack  func(rowData interface{}) interface{} `json:"-"`
	ValueAttrCallBack func(rowData interface{}) string      `json:"-"`
	CanFilter         bool                                  `json:"-"`
	FilterType        *FilterType                           `json:"-"`
	FilterField       string                                `json:"-"`
}

ColumnItem 列

type ColumnList

type ColumnList []*ColumnItem

ColumnList 列的表

type Columns

type Columns struct {
	ListName       string `json:"list_name"`
	ListID         string `json:"list_id"`
	RelevantListID string `json:"relevant_list_id"` // 此字段主要用于一个列表方法用在多处路由上,防止没有权限的情况出现,具体用法可以参照奖金流水列表
	ColumnList     ColumnList
}

Columns 列表信息

type ExportFile

type ExportFile struct {
	Path     string `json:"path"`
	FileSize string `json:"file_size"`
}

ExportFile 导出文件

type FieldAttr

type FieldAttr struct {
	Width int `json:"width"`
}

FieldAttr 字段的属性

type FilterType

type FilterType struct {
	Attr       string  `json:"attr"`
	SelectData g.Slice `json:"attr_data"`
}

func YesNoFilterType

func YesNoFilterType(yesNoLabel ...string) (re *FilterType)

YesNoFilterType 是或否的筛选条件

type FilterWhereParam

type FilterWhereParam struct {
	Where  string
	Params g.Slice
}

FilterWhereParam 筛选参数

func FilterWhereAndParams

func FilterWhereAndParams(r *ghttp.Request, columns *Columns) (re *FilterWhereParam, err error)

FilterWhereAndParams 筛选用到的where 和 params

type Result

type Result struct {
	Columns     ColumnList               `json:"columns"`
	List        ResultList               `json:"list"`
	ListID      string                   `json:"list_id"`
	TotalCount  int                      `json:"total_count"`
	Page        int                      `json:"page"`
	PageSize    int                      `json:"page_size"`
	TotalPage   int                      `json:"total_page"`
	PageCount   int                      `json:"page_count"`
	FilterTypes []*ResultFilterTypesItem `json:"filter_types"`
}

Result 返回的结果

func List

func List(r *ghttp.Request, pageData *page.Response, columns *Columns) (re *Result, err error)

List 列表返回结果(主要是为了兼容之前的前端)

type ResultFilterTypesItem

type ResultFilterTypesItem struct {
	Field     string  `json:"field"`
	FieldName string  `json:"field_name"`
	Attr      string  `json:"attr"`
	AttrData  g.Slice `json:"attr_data"`
}

type ResultList

type ResultList []map[string]*ResultListValue

ResultList 结果列表

type ResultListValue

type ResultListValue struct {
	Value     string      `json:"value"`
	OriValue  interface{} `json:"ori_value"`
	ValueAttr interface{} `json:"value_attr"`
}

ResultListValue 结果列表集

Jump to

Keyboard shortcuts

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