Documentation ¶
Index ¶
- func FormDecode(data []byte, form *Form) error
- type CheckBox
- type CodeEditor
- type Element
- type ElementInterface
- type EnvBox
- type Form
- func (this *Form) ApplyRequest(req *http.Request) (values map[string]interface{}, errField string, err error)
- func (this *Form) Compose()
- func (this *Form) Encode() ([]byte, error)
- func (this *Form) EncodePretty() ([]byte, error)
- func (this *Form) Init(values map[string]interface{})
- func (this *Form) NewGroup() *Group
- type Group
- type HTTPBox
- type Option
- type Options
- type Presentation
- type ScriptBox
- type SingleValueList
- type TextBox
- type TextField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormDecode ¶
Types ¶
type CheckBox ¶
type CheckBox struct { Element IsChecked bool `yaml:"isChecked" json:"isChecked"` Label string `yaml:"label" json:"label"` }
func NewCheckBox ¶
func (*CheckBox) ApplyRequest ¶
type CodeEditor ¶
func NewCodeEditor ¶
func NewCodeEditor(title string, subTitle string) *CodeEditor
func (*CodeEditor) ApplyRequest ¶
func (this *CodeEditor) ApplyRequest(req *http.Request) (value interface{}, skip bool, err error)
func (*CodeEditor) Compose ¶
func (this *CodeEditor) Compose() string
func (*CodeEditor) Super ¶
func (this *CodeEditor) Super() *Element
type Element ¶
type Element struct { ClassType string `yaml:"classType" json:"classType"` // 字段类型 Attrs map[string]string `yaml:"attrs" json:"attrs"` // 附加属性 Namespace string `yaml:"namespace" json:"namespace"` // 命名空间 Code string `yaml:"code" json:"code"` // 字段值代号 Title string `yaml:"title" json:"title"` // 标题 Subtitle string `yaml:"subtitle" json:"subtitle"` // 副标题 IsRequired bool `yaml:"isRequired" json:"isRequired"` // 是否为必填,并没有实际的约束作用,只是用来在字段左边标记星号 IsComposed bool `yaml:"isComposed" json:"isComposed"` // 是否已经组合,组合后的不需要再次组合 Comment string `yaml:"comment" json:"comment"` // 注释 ValidateCode string `yaml:"validateCode" json:"validateCode"` // 值校验代码 InitCode string `yaml:"initCode" json:"initCode"` // 值初始化代码 Value interface{} `yaml:"value" json:"value"` // 字段值 Javascript string `yaml:"javascript" json:"javascript"` // 附加的Javascript代码 CSS string `yaml:"css" json:"css"` // 附加的CSS代码 }
元素公共定义
type ElementInterface ¶
type ElementInterface interface { Compose() string Super() *Element ApplyRequest(req *http.Request) (value interface{}, skip bool, err error) }
元素接口
type Form ¶
type Form struct { Namespace string `yaml:"namespace" json:"namespace"` Groups []*Group `yaml:"groups" json:"groups"` Javascript string `yaml:"javascript" json:"javascript"` CSS string `yaml:"css" json:"css"` ValidateCode string `yaml:"validateCode" json:"validateCode"` ComposedAttrs map[string]string `yaml:"composedAttrs" json:"composedAttrs"` // contains filtered or unexported fields }
func (*Form) ApplyRequest ¶
func (*Form) EncodePretty ¶
type Group ¶
type Group struct { Namespace string `yaml:"namespace" json:"namespace"` Elements []ElementInterface `yaml:"elements" json:"elements"` HTML string `yaml:"html" json:"html"` IsComposed bool `yaml:"isComposed" json:"isComposed"` ComposedAttrs map[string]string `yaml:"composedAttrs" json:"composedAttrs"` }
func (*Group) Add ¶
func (this *Group) Add(element ElementInterface)
type HTTPBox ¶ added in v0.1.8
type HTTPBox struct {
Element `yaml:",inline"`
}
HTTP参数组件
func (*HTTPBox) ApplyRequest ¶ added in v0.1.8
type Presentation ¶
type Presentation struct { HTML string `yaml:"html" json:"html"` CSS string `yaml:"css" json:"css"` Javascript string `yaml:"javascript" json:"javascript"` }
界面显示信息
func NewPresentation ¶
func NewPresentation() *Presentation
type ScriptBox ¶
type ScriptBox struct {
Element
}
func NewScriptBox ¶
func NewScriptBox(title string, subTitle string) *ScriptBox
func (*ScriptBox) ApplyRequest ¶
type SingleValueList ¶ added in v0.1.8
type SingleValueList struct { Element `yaml:",inline"` ValueName string `yaml:"valueName" json:"valueName"` }
单值列表
func NewSingleValueList ¶ added in v0.1.8
func NewSingleValueList(title string, subtitle string) *SingleValueList
获取新对象
func (*SingleValueList) ApplyRequest ¶ added in v0.1.8
func (this *SingleValueList) ApplyRequest(req *http.Request) (value interface{}, skip bool, err error)
获取值
func (*SingleValueList) Super ¶ added in v0.1.8
func (this *SingleValueList) Super() *Element
获取父级类型
type TextField ¶
type TextField struct { Element `yaml:",inline"` MaxLength int `yaml:"maxLength" json:"maxLength"` Placeholder string `yaml:"placeholder" json:"placeholder"` Size int `yaml:"size" json:"size"` RightLabel string `yaml:"rightLabel" json:"rightLabel"` }
func NewTextField ¶
func (*TextField) ApplyRequest ¶
Click to show internal directories.
Click to hide internal directories.