source

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Click

type Click struct {
	UUKey  string `json:"uukey"`  // 数据类型
	Label  string `json:"label"`  // 显示文本
	Action string `json:"action"` // 按钮动作

	SeqNo uint64   `json:"seqno,omitempty"` // 排序序号
	Group string   `json:"group,omitempty"` // 按钮分组
	Scene []string `json:"scene,omitempty"` // 应用场景

	Helps string `json:"helps,omitempty"` // 提示信息
	Click string `json:"click,omitempty"` // 字段名称
	CType string `json:"ctype,omitempty"` // 事件类型
	Props object `json:"props,omitempty"` // 按钮属性
	Extra object `json:"extra,omitempty"` // 补充信息
}

type CountFn

type CountFn struct {
	Label string `json:"label"` // 取值名称
	Index string `json:"index"` // 字段名称
	Func  string `json:"func"`  // 取值方式

	Option object `json:"option"` // 聚合选项

	Items []CountFn `json:"items,omitempty"` // 子查询
}

type FExtra

type FExtra struct {
	// internal & embedded & necessary
	Embedded bool `json:"embedded,omitempty" bson:"embedded,omitempty"`
	// edit props
	Required bool `json:"required,omitempty" bson:"required,omitempty"`
	Multiple bool `json:"multiple,omitempty" bson:"multiple,omitempty"`
	Implicit bool `json:"implicit,omitempty" bson:"implicit,omitempty"`
	// edit mode
	Editable string `json:"editable,omitempty" bson:"editable,omitempty"`
	Disabled string `json:"disabled,omitempty" bson:"disabled,omitempty"`
	// serialno
	DateTime string `json:"datetime,omitempty" bson:"datetime,omitempty"`
	Constant string `json:"constant,omitempty" bson:"constant,omitempty"`
	Counting int64  `json:"counting,omitempty" bson:"counting,omitempty"`
	// Formula
	Formula string `json:"formula,omitempty" bson:"formula,omitempty"`
	Display string `json:"display,omitempty" bson:"display,omitempty"`
	Depends []any  `json:"depends,omitempty" bson:"depends,omitempty"`
	// numberic
	MinValue  int64  `json:"minValue,omitempty" bson:"minValue,omitempty"`
	MaxValue  int64  `json:"maxValue,omitempty" bson:"maxValue,omitempty"`
	Precision int64  `json:"precision,omitempty" bson:"precision,omitempty"`
	RoundMode string `json:"roundMode,omitempty" bson:"roundMode,omitempty"`
	// ValueFmt 数字展示格式
	ValueFmt string `json:"valueFmt,omitempty" bson:"valueFmt,omitempty"`
	// AggrType 汇总行聚合方式
	AggrType string `json:"aggrType,omitempty" bson:"aggrType,omitempty"`
	// expense
	Expense string `json:"expense,omitempty" bson:"expense,omitempty"`
	// relation
	Relation string `json:"relation,omitempty" bson:"relation,omitempty"`
	// options
	Options []Option `json:"options,omitempty" bson:"options,omitempty"`
	DictKey string   `json:"dictKey,omitempty" bson:"dictKey,omitempty"`
	DataKey string   `json:"dataKey,omitempty" bson:"dataKey,omitempty"`
	TextKey string   `json:"textKey,omitempty" bson:"textKey,omitempty"`
	// Display string `json:"display,omitempty" bson:"display,omitempty"`
	// datetime|strings|uploads|numeric
	DataType string `json:"dataType,omitempty" bson:"dataType,omitempty"`
	// time term, NONE|26|27|28|29, 财务周期范围
	TimeTerm string `json:"timeTerm,omitempty" bson:"timeTerm,omitempty"`
	// upload
	AcceptType string `json:"acceptType,omitempty" bson:"acceptType,omitempty"`
}

type Field

type Field struct {
	UUKey string `json:"uukey" gorm:"column:uukey"`   // 数据类型
	GType string `json:"gtype" bson:"-" gorm:"-:all"` // group type
	GName string `json:"gname" bson:"-" gorm:"-:all"` // group name

	FType string `json:"ftype" bson:"ftype" gorm:"column:ftype"` // field type
	Group string `json:"group,omitempty" bson:"group,omitempty"` // 逻辑类型
	Field string `json:"field,omitempty" bson:"field,omitempty"` // 字段key
	Label string `json:"label,omitempty" bson:"label,omitempty"` // 字段名称
	Index string `json:"index,omitempty" bson:"index,omitempty"` // 搜索字段
	Shown bool   `json:"shown,omitempty" bson:"shown,omitempty"` // 是否显示
	Width uint16 `json:"width,omitempty" bson:"width,omitempty"` // 是否显示

	Refer  *Refer `json:"refer,omitempty" bson:"refer,omitempty"`   // 引用数据
	SeqNo  uint16 `json:"seqno,omitempty" bson:"seqno,omitempty"`   // 展示顺序
	Remark string `json:"remark,omitempty" bson:"remark,omitempty"` // 字段备注

	Extra FExtra `json:"extra,omitempty" bson:"extra,omitempty" gorm:"serializer:json"` // 关联属性
}

func (Field) Equal

func (s Field) Equal(old, get any) bool

func (Field) GetDataType

func (s Field) GetDataType() string

func (Field) GetFieldType

func (s Field) GetFieldType() string

func (Field) GetKey

func (s Field) GetKey() string

func (Field) GetRefer

func (s Field) GetRefer() *Refer

func (Field) GetTermWeek

func (s Field) GetTermWeek(date *time.Time) (int, int)

func (Field) GetTimeTerm

func (s Field) GetTimeTerm() int

func (Field) HasTimeTerm

func (s Field) HasTimeTerm() bool

func (Field) Parse

func (s Field) Parse(get any) any

func (Field) ParseTime

func (s Field) ParseTime(get string) *time.Time

func (Field) ToMap

func (s Field) ToMap() object

type GExtra

type GExtra struct {
	Nested bool     `json:"nested,omitempty" bson:"nested,omitempty"`
	Remark string   `json:"remark,omitempty" bson:"remark,omitempty"`
	Fields []string `json:"fields,omitempty" bson:"fields,omitempty"`

	Multiple bool   `json:"multiple,omitempty" bson:"multiple,omitempty"`
	Relation string `json:"relation,omitempty" bson:"relation,omitempty"`
}

type Group

type Group struct {
	UUKey string `json:"uukey" bson:"uukey" gorm:"column:uukey"` // 数据类型
	Title string `json:"title" bson:"title" gorm:"column:title"` // 字段名称
	GType string `json:"gtype" bson:"gtype" gorm:"column:gtype"` // 查询条件
	// 补充信息
	Model string `json:"model,omitempty" bson:"model,omitempty" gorm:"column:model"`    // 数据类型
	SeqNo uint16 `json:"seqno,omitempty" bson:"seqno,omitempty" gorm:"column:seqno"`    // 显示顺序
	Extra GExtra `json:"extra,omitempty" bson:"extra,omitempty" gorm:"serializer:json"` // 关联属性
}

type GroupBy

type GroupBy struct {
	Index  string `json:"index"`  // 字段名称
	SortBy string `json:"sortby"` // 排序方式
	Format string `json:"format"` // 格式化方式
}

type Input

type Input struct {
	UUKey  string `json:"uukey"`  // 数据类型
	Title  string `json:"title"`  // 字段名称
	Extra  object `json:"extra"`  // 扩展信息
	Layout string `json:"layout"` // 字段名称
	Preset object `json:"preset"` // 新建默认值

	Groups  []string `json:"groups"`  // 字段名称
	Fields  []string `json:"fields"`  // 可用字段
	Hidden  []string `json:"hidden"`  // 隐藏字段
	Rename  object   `json:"rename"`  // uukey -> label
	Replace object   `json:"replace"` // uukey -> FExtra 属性
	XRules  []string `json:"xrules"`  // 字段名称
	Clicks  []string `json:"clicks"`  // 按钮名称
}

type Model

type Model struct {
	UUKey  string `json:"uukey" gorm:"column:uukey"`   // 页面标识
	Title  string `json:"title" gorm:"column:title"`   // 页面标题
	Brief  string `json:"brief" gorm:"column:brief"`   // 页面描述
	Driver string `json:"driver" gorm:"column:driver"` // 驱动类型
	Source string `json:"source" gorm:"column:source"` // 存储数据源
	Search string `json:"search" gorm:"column:search"` // 索引数据源

	Groups []Group `json:"-" gorm:"serializer:json"` // 分组
	Fields []Field `json:"-" gorm:"serializer:json"` // 字段
	Clicks []Click `json:"-" gorm:"serializer:json"` // 按钮

	Extra object `json:"-" gorm:"serializer:json"` // 关联属性
}

type Option

type Option struct {
	UUKey string `json:"uukey" bson:"uukey"`
	Label string `json:"label" bson:"label"`
	Color string `json:"color" bson:"color"`
}

type Order

type Order struct {
	Field string `json:"field"` // 字段名称
	Order string `json:"order"` // 排序方式
}

type PivotBy

type PivotBy struct {
	Pivot string `json:"pivot"` // 透视字段
	Value string `json:"value"` // 值字段
	State string `json:"state"` // 状态: active, none
}

type Refer

type Refer struct {
	UUKey string `json:"uukey"`
	KeyBy string `json:"keyby"`
	TxtBy string `json:"txtby"`
	Image string `json:"image"`
	Using string `json:"using"`
}

func (*Refer) Load

func (self *Refer) Load(object map[string]string) *Refer

func (*Refer) Parse

func (self *Refer) Parse(using string) *Refer

type Table

type Table struct {
	UUKey   string   `json:"uukey" bson:"uukey"`     // 数据类型
	Title   string   `json:"title" bson:"title"`     // 字段名称
	Query   object   `json:"query" bson:"query"`     // 默认筛选
	Extra   object   `json:"extra" bson:"extra"`     // 透视/合并等默认配置
	Fields  []string `json:"fields" bson:"fields"`   // 可用字段
	Hidden  []string `json:"hidden" bson:"hidden"`   // 隐藏字段
	Rename  object   `json:"rename" bson:"rename"`   // uukey -> label
	Replace object   `json:"replace" bson:"replace"` // uukey -> FExtra 属性
	Clicks  []string `json:"clicks" bson:"clicks"`   // 表格动作

	Order []Order   `json:"-" bson:"-" gorm:"-"` // 默认排序
	Pivot []GroupBy `json:"-" bson:"-" gorm:"-"` // 聚合字段
	Aggrs []CountFn `json:"-" bson:"-" gorm:"-"` // 聚合配置
}

type Value

type Value struct {
	Model Model  `json:"model"` // model name
	Scene string `json:"scene"` // source scene

	Fields map[string]Field `json:"fields"` // 逻辑类型
	Groups map[string]Group `json:"groups"` // 逻辑类型
	Tables map[string]Table `json:"tables"` // 表格配置
	Inputs map[string]Input `json:"inputs"` // 表单配置
	Clicks map[string]Click `json:"clicks"` // 表格事件
	XRules map[string]XRule `json:"xrules"` // 规则配置
}

type XRule

type XRule struct {
	Title string `json:"title"`
	Model string `json:"model"`
	UUKey string `json:"uukey"`

	SeqNo int16    `json:"seqno"`
	Scope []string `json:"scope"`

	XWhen []XRuleWhen `json:"xwhen"`
	XThen []XRuleThen `json:"xthen"`
	XElse []XRuleThen `json:"xelse"`
}

type XRuleThen

type XRuleThen struct {
	Action string `json:"action"`
	Target string `json:"target"`
	TgType string `json:"tgtype"`
	Values any    `json:"values"`
}

type XRuleWhen

type XRuleWhen struct {
	Logic  string `json:"logic"`
	Value  string `json:"value"`
	Target string `json:"target"`
}

Jump to

Keyboard shortcuts

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