Documentation
¶
Index ¶
- Variables
- func Export() error
- func Guard(c *gin.Context)
- func Load(cfg config.Config) error
- func LoadAndExport(cfg config.Config) error
- func LoadFile(root string, file string) error
- func LoadFileSync(root string, file string) error
- func LoadID(id string, root string) error
- type ActionDSL
- type BatchPresetDSL
- type BindActionDSL
- type DSL
- func (dsl *DSL) Actions() []component.ActionsExport
- func (dsl *DSL) Bind() error
- func (dsl *DSL) Export(filename string, data interface{}, page int, chunkSize int) error
- func (dsl *DSL) Validate() error
- func (dsl *DSL) Xgen(data map[string]interface{}, excludes map[string]bool) (map[string]interface{}, error)
- type FieldsDSL
- type FilterLayoutDSL
- type HeaderLayoutDSL
- type ImportPresetDSL
- type LayoutDSL
- func (layout *LayoutDSL) BindModel(m *model.Model, fields *FieldsDSL, option map[string]interface{}) error
- func (layout *LayoutDSL) BindTable(tab *DSL, fields *FieldsDSL) error
- func (layout *LayoutDSL) Clone() (*LayoutDSL, error)
- func (layout *LayoutDSL) Xgen(data map[string]interface{}, excludes map[string]bool, ...) (*LayoutDSL, error)
- type OperationTableDSL
- type PresetHeaderDSL
- type ViewLayoutDSL
Constants ¶
This section is empty.
Variables ¶
View Source
var Tables map[string]*DSL = map[string]*DSL{}
Tables the loaded table widgets
Functions ¶
func LoadFileSync ¶ added in v0.10.3
LoadFileSync load table dsl by file
Types ¶
type ActionDSL ¶
type ActionDSL struct {
Guard string `json:"guard,omitempty"` // the default guard
Bind *BindActionDSL `json:"bind,omitempty"`
Setting *action.Process `json:"setting,omitempty"`
Component *action.Process `json:"component,omitempty"`
Upload *action.Process `json:"upload,omitempty"`
Download *action.Process `json:"download,omitempty"`
Search *action.Process `json:"search,omitempty"`
Get *action.Process `json:"get,omitempty"`
Find *action.Process `json:"find,omitempty"`
Save *action.Process `json:"save,omitempty"`
Create *action.Process `json:"create,omitempty"`
Insert *action.Process `json:"insert,omitempty"`
Delete *action.Process `json:"delete,omitempty"`
DeleteIn *action.Process `json:"delete-in,omitempty"`
DeleteWhere *action.Process `json:"delete-where,omitempty"`
Update *action.Process `json:"update,omitempty"`
UpdateIn *action.Process `json:"update-in,omitempty"`
UpdateWhere *action.Process `json:"update-where,omitempty"`
BeforeFind *hook.Before `json:"before:find,omitempty"`
AfterFind *hook.After `json:"after:find,omitempty"`
BeforeSearch *hook.Before `json:"before:search,omitempty"`
AfterSearch *hook.After `json:"after:search,omitempty"`
BeforeGet *hook.Before `json:"before:get,omitempty"`
AfterGet *hook.After `json:"after:get,omitempty"`
BeforeSave *hook.Before `json:"before:save,omitempty"`
AfterSave *hook.After `json:"after:save,omitempty"`
BeforeCreate *hook.Before `json:"before:create,omitempty"`
AfterCreate *hook.After `json:"after:create,omitempty"`
BeforeInsert *hook.Before `json:"before:insert,omitempty"`
AfterInsert *hook.After `json:"after:insert,omitempty"`
BeforeDelete *hook.Before `json:"before:delete,omitempty"`
AfterDelete *hook.After `json:"after:delete,omitempty"`
BeforeDeleteIn *hook.Before `json:"before:delete-in,omitempty"`
AfterDeleteIn *hook.After `json:"after:delete-in,omitempty"`
BeforeDeleteWhere *hook.Before `json:"before:delete-where,omitempty"`
AfterDeleteWhere *hook.After `json:"after:delete-where,omitempty"`
BeforeUpdate *hook.Before `json:"before:update,omitempty"`
AfterUpdate *hook.After `json:"after:update,omitempty"`
BeforeUpdateIn *hook.Before `json:"before:update-in,omitempty"`
AfterUpdateIn *hook.After `json:"after:update-in,omitempty"`
BeforeUpdateWhere *hook.Before `json:"before:update-where,omitempty"`
AfterUpdateWhere *hook.After `json:"after:update-where,omitempty"`
}
ActionDSL the table action DSL
func (*ActionDSL) SetDefaultProcess ¶
func (act *ActionDSL) SetDefaultProcess()
SetDefaultProcess set the default value of action
type BatchPresetDSL ¶
type BatchPresetDSL struct {
Columns []component.InstanceDSL `json:"columns,omitempty"`
Deletable bool `json:"deletable,omitempty"`
}
BatchPresetDSL layout.header.preset.batch
type BindActionDSL ¶
type BindActionDSL struct {
Model string `json:"model,omitempty"` // bind model
Store string `json:"store,omitempty"` // bind store
Table string `json:"table,omitempty"` // bind table
Form string `json:"form,omitempty"` // bind form
Option map[string]interface{} `json:"option,omitempty"` // bind option
}
BindActionDSL action.bind
type DSL ¶
type DSL struct {
Root string `json:"-"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Action *ActionDSL `json:"action"`
Layout *LayoutDSL `json:"layout"`
Fields *FieldsDSL `json:"fields"`
Config map[string]interface{} `json:"config,omitempty"`
CProps field.CloudProps `json:"-"`
compute.Computable
*mapping.Mapping
}
DSL the table DSL
func (*DSL) Actions ¶ added in v0.10.3
func (dsl *DSL) Actions() []component.ActionsExport
Actions get the table actions
type FieldsDSL ¶
type FieldsDSL struct {
Filter field.Filters `json:"filter,omitempty"`
Table field.Columns `json:"table,omitempty"`
// contains filtered or unexported fields
}
FieldsDSL the table fields DSL
type FilterLayoutDSL ¶
type FilterLayoutDSL struct {
Actions component.Actions `json:"actions,omitempty"`
Columns component.Instances `json:"columns,omitempty"`
}
FilterLayoutDSL layout.filter
type HeaderLayoutDSL ¶
type HeaderLayoutDSL struct {
Preset *PresetHeaderDSL `json:"preset,omitempty"`
Actions []component.ActionDSL `json:"actions"`
}
HeaderLayoutDSL layout.header
type ImportPresetDSL ¶
type ImportPresetDSL struct {
Name string `json:"name,omitempty"`
Actions component.Actions `json:"actions,omitempty"`
}
ImportPresetDSL layout.header.preset.import
type LayoutDSL ¶
type LayoutDSL struct {
Primary string `json:"primary,omitempty"`
Header *HeaderLayoutDSL `json:"header,omitempty"`
Filter *FilterLayoutDSL `json:"filter,omitempty"`
Table *ViewLayoutDSL `json:"table,omitempty"`
}
LayoutDSL the table layout
func (*LayoutDSL) BindModel ¶
func (layout *LayoutDSL) BindModel(m *model.Model, fields *FieldsDSL, option map[string]interface{}) error
BindModel bind model
type OperationTableDSL ¶
type OperationTableDSL struct {
Width int `json:"width,omitempty"`
Fold bool `json:"fold,omitempty"`
Hide bool `json:"hide,omitempty"`
Actions component.Actions `json:"actions"`
}
OperationTableDSL layout.table.operation
type PresetHeaderDSL ¶
type PresetHeaderDSL struct {
Batch *BatchPresetDSL `json:"batch,omitempty"`
Import *ImportPresetDSL `json:"import,omitempty"`
}
PresetHeaderDSL layout.header.preset
type ViewLayoutDSL ¶
type ViewLayoutDSL struct {
Props component.PropsDSL `json:"props,omitempty"`
Columns component.Instances `json:"columns,omitempty"`
Operation OperationTableDSL `json:"operation,omitempty"`
}
ViewLayoutDSL layout.table
Click to show internal directories.
Click to hide internal directories.