1 changed files with 99 additions and 0 deletions
@ -0,0 +1,99 @@ |
|||||
|
package customerform |
||||
|
|
||||
|
import ( |
||||
|
"appPlatform/overall/publicmethod" |
||||
|
"sync" |
||||
|
|
||||
|
"github.com/gin-gonic/gin" |
||||
|
) |
||||
|
|
||||
|
// 协程设置
|
||||
|
var syncSeting = sync.WaitGroup{} |
||||
|
|
||||
|
type ApiMethod struct{} |
||||
|
|
||||
|
/* |
||||
|
* |
||||
|
@ 作者: 秦东 |
||||
|
@ 时间: 2023-05-25 10:20:11 |
||||
|
@ 功能:自定义表单入口 |
||||
|
@ 参数 |
||||
|
|
||||
|
# |
||||
|
|
||||
|
@ 返回值 |
||||
|
|
||||
|
# |
||||
|
|
||||
|
@ 方法原型 |
||||
|
|
||||
|
# |
||||
|
*/ |
||||
|
func (a *ApiMethod) Index(c *gin.Context) { |
||||
|
outputCont := publicmethod.MapOut[string]() |
||||
|
outputCont["index"] = "自定义表单入口" |
||||
|
publicmethod.Result(0, outputCont, c) |
||||
|
} |
||||
|
|
||||
|
// 自定义表单主框架
|
||||
|
type CustomerFormMaster struct { |
||||
|
List []MasterStruct `json:"list"` //组件列表
|
||||
|
Form FormStruct `json:"form"` //表单配置
|
||||
|
Config ConfigStruct `json:"config"` |
||||
|
} |
||||
|
|
||||
|
// 组件主体
|
||||
|
type MasterStruct struct { |
||||
|
Type string `json:"type"` //组件类型
|
||||
|
Control ControlStruct `json:"control"` |
||||
|
Config UnitConfigStruct `json:"config"` |
||||
|
Options []OptionsStruct `json:"options"` |
||||
|
Name string `json:"name"` |
||||
|
Item ItemStruct `json:"item"` |
||||
|
} |
||||
|
|
||||
|
// 选择内容
|
||||
|
type OptionsStruct struct { |
||||
|
Label string `json:"label"` |
||||
|
Value string `json:"value"` |
||||
|
} |
||||
|
|
||||
|
type ItemStruct struct { |
||||
|
Label string `json:"label"` |
||||
|
} |
||||
|
|
||||
|
// 组件控制器
|
||||
|
type ControlStruct struct { |
||||
|
Label string `json:"label"` |
||||
|
Type string `json:"type"` |
||||
|
Key string `json:"key"` |
||||
|
ModelValue []interface{} `json:"model"` |
||||
|
} |
||||
|
|
||||
|
// 组件配置
|
||||
|
type UnitConfigStruct struct { |
||||
|
ClassName string `json:"className"` //自定义样式
|
||||
|
Span int `json:"span"` //占行范围
|
||||
|
TextAlign string `json:"textAlign"` //对齐方式
|
||||
|
DisabledAdd bool `json:"disabledAdd"` //添加页隐藏
|
||||
|
DisabledDetail bool `json:"disabledDetail"` //编辑页隐藏
|
||||
|
LinkKey bool `json:"linkKey"` //开启联动条件
|
||||
|
LinkValue string `json:"linkValue"` //联动条件内容
|
||||
|
OptionsType int `json:"optionsType"` //选择数据源 0:固定选项;1:数据源;3:1接口字典
|
||||
|
OptionsFun string `json:"optionsFun"` |
||||
|
Help string `json:"help"` //帮助信息
|
||||
|
} |
||||
|
|
||||
|
// 表单信息
|
||||
|
type FormStruct struct { |
||||
|
Size string `json:"size"` |
||||
|
Name string `json:"name"` |
||||
|
LabelWidth string `json:"labelWidth"` |
||||
|
Class string `json:"class"` |
||||
|
ShowColon bool `json:"showColon"` |
||||
|
} |
||||
|
|
||||
|
// 属性配置
|
||||
|
type ConfigStruct struct { |
||||
|
AddLoad bool `json:"addLoad"` |
||||
|
} |
||||
Loading…
Reference in new issue