diff --git a/base/grid_layout.go b/base/grid_layout.go new file mode 100644 index 0000000..b1922b4 --- /dev/null +++ b/base/grid_layout.go @@ -0,0 +1,24 @@ +package base + +import ( + "git.fsdpf.net/go/contracts/res_type" +) + +type GridLayout struct { + Uuid string `db:"uuid"` + ResourceUuid string `db:"resource_uuid"` // 所属资源UUID + Code string `db:"code"` // 布局标识 + Name string `db:"name"` // 布局名称 + PrimaryKey string `db:"primaryKey"` // 主键 + MarginX int `db:"marginX"` // 栅格 x 间距 + MarginY int `db:"marginY"` // 栅格 y 间距 + Cols int `db:"cols"` // 网格列基数 + RowHeight int `db:"rowHeight"` // 栅格行高 + Css res_type.ResFieldByMap `db:"css"` // 布局CSS + Props res_type.ResFieldByAnys `db:"props"` // 布局PROPS + Roles res_type.ResFieldByAnys `db:"roles"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` +} + +type GetGridLayout func(code string) (GridLayout, bool) diff --git a/base/grid_layout_field.go b/base/grid_layout_field.go new file mode 100644 index 0000000..68b1a89 --- /dev/null +++ b/base/grid_layout_field.go @@ -0,0 +1,32 @@ +package base + +import "git.fsdpf.net/go/contracts/res_type" + +type GridLayoutField struct { + Uuid string `db:"uuid"` + GridLayoutUuid string `db:"grid_layout_uuid"` // 所属布局 UUID + Type string `db:"type"` + X int `db:"x"` + Y int `db:"y"` + W int `db:"w"` + H int `db:"h"` + MinH int `db:"minH"` + MinW int `db:"minW"` + MaxH int `db:"maxH"` + MaxW int `db:"maxW"` + Code string `db:"code"` + Label string `db:"label"` + Widget string `db:"widget"` + WidgetPerfix string `db:"widgetPerfix"` + WidgetDecorator res_type.ResFieldByString `db:"widgetDecorator"` + SubWidgets res_type.ResFieldByAnys `db:"subWidgets"` + InitialValue string `db:"initialValue"` + Css res_type.ResFieldByMap `db:"css"` + Extras res_type.ResFieldByMap `db:"extras"` + Hidden bool `db:"hidden"` + IsVirtual bool `db:"isVirtual"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` +} + +type GetGridLayoutField func(code string) (GridLayoutField, bool) diff --git a/base/grid_layout_form.go b/base/grid_layout_form.go new file mode 100644 index 0000000..4325f7e --- /dev/null +++ b/base/grid_layout_form.go @@ -0,0 +1,25 @@ +package base + +import "git.fsdpf.net/go/contracts/res_type" + +type GridLayoutForm struct { + Uuid string `db:"uuid"` + ResourceUuid string `db:"resource_uuid"` // 所属资源UUID + Code string `db:"code"` // 布局标识 + Name string `db:"name"` // 布局名称 + Type int `db:"type"` // 布局类型 + Align string `db:"align"` // 方向 + PrimaryKey string `db:"primaryKey"` // 主键 + AutoComplete string `db:"autoComplete"` // 自动填充表单, off | on + RowHeight int `db:"rowHeight"` // 栅格行高 + MarginX int `db:"marginX"` // 栅格 x 间距 + MarginY int `db:"marginY"` // 栅格 y 间距 + FormProps res_type.ResFieldByAnys `db:"formProps"` // 表单PROPS + ListenChangeFields res_type.ResFieldByAnys `db:"listenChangeFields"` // 监听字段 + ListenChangeFieldsFunc res_type.ResFieldByString `db:"listenChangeFieldsFunc"` // 监听字段回调方法 + Roles res_type.ResFieldByAnys `db:"roles"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` +} + +type GetGridLayoutForm func(code string) (GridLayoutForm, bool) diff --git a/base/grid_layout_form_field.go b/base/grid_layout_form_field.go new file mode 100644 index 0000000..c464779 --- /dev/null +++ b/base/grid_layout_form_field.go @@ -0,0 +1,37 @@ +package base + +import ( + "git.fsdpf.net/go/contracts/res_type" +) + +type GridLayoutFormField struct { + Uuid string `db:"uuid"` + GridLayoutFormUuid string `db:"grid_layout_form_uuid"` // 所属布局 UUID + Type string `db:"type"` + X int `db:"x"` + Y int `db:"y"` + W int `db:"w"` + H int `db:"h"` + MinH int `db:"minH"` + MinW int `db:"minW"` + MaxH int `db:"maxH"` + MaxW int `db:"maxW"` + Code string `db:"code"` + Label string `db:"label"` + Widget string `db:"widget"` + WidgetPerfix string `db:"widgetPerfix"` + WidgetDecorator res_type.ResFieldByString `db:"widgetDecorator"` + SubWidgets res_type.ResFieldByAnys `db:"subWidgets"` + Placeholder string `db:"placeholder"` + Help string `db:"help"` + Disabled int `db:"disabled"` + InitialValue string `db:"initialValue"` + Extras res_type.ResFieldByMap `db:"extras"` + Validators res_type.ResFieldByMap `db:"validators"` + Hidden bool `db:"hidden"` + IsVirtual bool `db:"isVirtual"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` +} + +type GetGridLayoutFormFields func(uuid string) []GridLayoutFormField