Documentation
¶
Index ¶
- Variables
- func BuildPreset(requst map[string]any, skma *Table) map[string]any
- func IsDateRange(data any) bool
- func PivotByActive(p *PivotBy) bool
- func SetCache(cache ICache)
- type CacheConfig
- type Click
- type CountFN
- type Digest
- type FExtra
- type Field
- type GExtra
- type Group
- type GroupBy
- type ICache
- type ISchema
- type Input
- func (self *Input) GetField(uukey string) *source.Field
- func (self *Input) GetFields() []Field
- func (self *Input) GetGroup(uukey string) *source.Group
- func (self *Input) GetGroups() []Group
- func (self *Input) GetRefers() []Refer
- func (self *Input) GetRelation(uukey string, value any) object
- func (self *Input) GetRequest() *request.Record
- func (self *Input) GetSearch() *request.Search
- func (self *Input) NeedRefers() bool
- type Model
- type Option
- type PivotBy
- type Query
- type Refer
- type SInput
- type STable
- type SortBy
- type Source
- type Table
- func (self *Table) BuildCountFn() []CountFN
- func (self *Table) BuildDigest() *Digest
- func (self *Table) BuildGroupBy() []GroupBy
- func (self *Table) BuildPivotBy() *PivotBy
- func (self *Table) BuildQuery() []Query
- func (self *Table) GetField(uukey string) *source.Field
- func (self *Table) GetFields() []source.Field
- func (self *Table) GetGroups() []source.Group
- func (self *Table) GetPlain(uukey string, value any) string
- func (self *Table) GetRefer(uukey string) *source.Refer
- func (self *Table) GetRefers() []source.Refer
- func (self *Table) GetRequest() *request.Search
- func (self *Table) GetSearch() *request.Search
- func (self *Table) GetSubject() *source.Field
- func (self *Table) SetDisplay(refer *source.Refer, display string)
- type XRule
Constants ¶
This section is empty.
Variables ¶
View Source
var BucketValues = []string{ consts.VALUE_TERMS, consts.VALUE_RANGE, consts.VALUE_HIST1, consts.VALUE_HIST2, }
View Source
var NULL_LOGIC = []string{ consts.LOGIC_VAL_NULL, consts.LOGIC_NOT_NULL, }
View Source
var SubQuery = []string{ consts.LOGIC_SUBOR, consts.LOGIC_SUBAND, consts.LOGIC_SUBNOT, consts.LOGIC_SUBRAW, consts.LOGIC_NESTED, }
Functions ¶
func IsDateRange ¶
func PivotByActive ¶
PivotByActive 透视是否开启。前端保存 on/off,关闭后 Pivot/Value 可能仍有值,必须以 State 为准。
Types ¶
type Digest ¶
type Input ¶
type Input struct {
Model *Model `json:"-"` // 模型信息
Input *SInput `json:"-"` // 模型信息
Source *Source `json:"-"` // 登陆用户
Scope object `json:"-"` // 查询限制
// this fields make record unique
Unique []string `json:"-"` // 唯一字段
Title string `json:"title,omitempty"` // 模型信息
Groups []Group `json:"groups,omitempty"` // 分组信息
Fields []Field `json:"fields,omitempty"` // 字段类型
XRules []XRule `json:"xrules,omitempty"` // 表单事件
Clicks []Click `json:"clicks,omitempty"` // 表单按钮
Values object `json:"values,omitempty"` // 分组信息
Refers object `json:"refers,omitempty"` // 字典信息
Others object `json:"-"` // 视图扩展配置
// 传入信息
Account *request.Account `json:"-"` // 登陆用户
Request *request.Record `json:"request"` // 请求信息
}
func (*Input) GetRelation ¶
GetRelation 按 relation 字段在 Refers 中查找与 value 匹配的一条关联对象(扁平 map),与 Table.GetPlain 同源逻辑。 uukey 为字段 key(如 basic.team_id);value 为 Combine 里该字段存的外键值(与 refer.KeyBy 对应)。 未找到时返回 nil。
func (*Input) GetRequest ¶
func (*Input) NeedRefers ¶
NeedRefers 与 EngineService.AttachRefers 中实际会发起关联查询的条件一致: 存在已展示、已配置 relation、且 Values 里该字段 UUKey 对应有效外键的 RELATION 字段。
type Query ¶
type Table ¶
type Table struct {
Scene string `json:"-"` // 构建来源(场景)
Model *source.Model `json:"-"` // 模型信息
Table *source.Table `json:"-"` // 表格信息
// query scope
Scope map[string]any `json:"-"` // 查询限制
Query map[string]any `json:"-"` // 查询信息
Sticky []string `json:"sticky"` // 固定字段
Groups []source.Group `json:"groups"` // 分组信息
Fields []source.Field `json:"fields"` // 字段类型
Clicks []source.Click `json:"clicks"` // 表格事件
Refers map[string]any `json:"refers"` // 字典信息
Others map[string]any `json:"others"` // 其他信息
Source *source.Value `json:"-"` // 源数据
// 传入信息
Account *request.Account `json:"-"` // 登陆用户
Request *request.Search `json:"request"` // 请求信息
}
func (*Table) BuildCountFn ¶
others.count=[]string{index|func|label} 金额求和:["basic.amount|SUM|合计金额"]
func (*Table) BuildDigest ¶
func (*Table) BuildGroupBy ¶
others.group=[]string{index|sort|format} 按车型分组:["basic.vehicle|ASC|车型"]
func (*Table) BuildPivotBy ¶
others.pivot=index|value|state
func (*Table) BuildQuery ¶
func (*Table) GetRequest ¶
func (*Table) GetSubject ¶
Get Subject Field for Schema
Click to show internal directories.
Click to hide internal directories.