[add] table widget operation.hide & width
This commit is contained in:
parent
92cc28df20
commit
21dfd114e0
2 changed files with 7 additions and 1 deletions
|
|
@ -53,12 +53,15 @@ func (layout *LayoutDSL) BindModel(m *gou.Model, fields *FieldsDSL, option map[s
|
||||||
Props: component.PropsDSL{},
|
Props: component.PropsDSL{},
|
||||||
Columns: component.Instances{},
|
Columns: component.Instances{},
|
||||||
Operation: OperationTableDSL{
|
Operation: OperationTableDSL{
|
||||||
|
Hide: true,
|
||||||
Fold: false,
|
Fold: false,
|
||||||
Actions: component.Actions{},
|
Actions: component.Actions{},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if hasForm {
|
if hasForm {
|
||||||
|
layout.Table.Operation.Width = 160
|
||||||
|
layout.Table.Operation.Hide = false
|
||||||
layout.Table.Operation.Actions = append(
|
layout.Table.Operation.Actions = append(
|
||||||
layout.Table.Operation.Actions,
|
layout.Table.Operation.Actions,
|
||||||
|
|
||||||
|
|
@ -104,7 +107,8 @@ func (layout *LayoutDSL) BindModel(m *gou.Model, fields *FieldsDSL, option map[s
|
||||||
if ok && name != "deleted_at" {
|
if ok && name != "deleted_at" {
|
||||||
if col, has := fields.tableMap[name]; has {
|
if col, has := fields.tableMap[name]; has {
|
||||||
layout.Table.Columns = append(layout.Table.Columns, component.InstanceDSL{
|
layout.Table.Columns = append(layout.Table.Columns, component.InstanceDSL{
|
||||||
Name: col.Key,
|
Name: col.Key,
|
||||||
|
Width: 160,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,9 @@ type ViewLayoutDSL struct {
|
||||||
|
|
||||||
// OperationTableDSL layout.table.operation
|
// OperationTableDSL layout.table.operation
|
||||||
type OperationTableDSL struct {
|
type OperationTableDSL struct {
|
||||||
|
Width int `json:"width,omitempty"`
|
||||||
Fold bool `json:"fold,omitempty"`
|
Fold bool `json:"fold,omitempty"`
|
||||||
|
Hide bool `json:"hide,omitempty"`
|
||||||
Actions component.Actions `json:"actions"`
|
Actions component.Actions `json:"actions"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue