[fix] table & form layout.confg
This commit is contained in:
parent
5517b4ac60
commit
e9844819e2
3 changed files with 19 additions and 8 deletions
|
|
@ -218,10 +218,6 @@ func MustGet(form interface{}) *DSL {
|
|||
// Xgen trans to xgen setting
|
||||
func (dsl *DSL) Xgen(data map[string]interface{}, excludes map[string]bool) (map[string]interface{}, error) {
|
||||
|
||||
if dsl.Config == nil {
|
||||
dsl.Config = map[string]interface{}{}
|
||||
}
|
||||
|
||||
if dsl.Layout == nil {
|
||||
dsl.Layout = &LayoutDSL{Form: &ViewLayoutDSL{}}
|
||||
}
|
||||
|
|
@ -245,6 +241,13 @@ func (dsl *DSL) Xgen(data map[string]interface{}, excludes map[string]bool) (map
|
|||
dsl.Config["full"] = true
|
||||
}
|
||||
|
||||
// Merge the layout config
|
||||
if layout.Config != nil {
|
||||
for key, value := range layout.Config {
|
||||
dsl.Config[key] = value
|
||||
}
|
||||
}
|
||||
|
||||
setting := map[string]interface{}{}
|
||||
bytes, err := jsoniter.Marshal(layout)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -277,6 +277,13 @@ func (dsl *DSL) Xgen(data map[string]interface{}, excludes map[string]bool) (map
|
|||
dsl.Config["full"] = true
|
||||
}
|
||||
|
||||
// Merge the layout config
|
||||
if layout.Config != nil {
|
||||
for key, value := range layout.Config {
|
||||
dsl.Config[key] = value
|
||||
}
|
||||
}
|
||||
|
||||
setting := map[string]interface{}{}
|
||||
bytes, err := jsoniter.Marshal(layout)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -80,10 +80,11 @@ type BindActionDSL struct {
|
|||
|
||||
// LayoutDSL the table layout
|
||||
type LayoutDSL struct {
|
||||
Primary string `json:"primary,omitempty"`
|
||||
Header *HeaderLayoutDSL `json:"header,omitempty"`
|
||||
Filter *FilterLayoutDSL `json:"filter,omitempty"`
|
||||
Table *ViewLayoutDSL `json:"table,omitempty"`
|
||||
Primary string `json:"primary,omitempty"`
|
||||
Header *HeaderLayoutDSL `json:"header,omitempty"`
|
||||
Filter *FilterLayoutDSL `json:"filter,omitempty"`
|
||||
Table *ViewLayoutDSL `json:"table,omitempty"`
|
||||
Config map[string]interface{} `json:"config,omitempty"`
|
||||
}
|
||||
|
||||
// HeaderLayoutDSL layout.header
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue