From c8d324193cb85fc576c7ed1f6ce62a8eda91657c Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Thu, 24 Aug 2023 16:51:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/version1/customerform/type.go | 99 +++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 api/version1/customerform/type.go diff --git a/api/version1/customerform/type.go b/api/version1/customerform/type.go new file mode 100644 index 0000000..794d874 --- /dev/null +++ b/api/version1/customerform/type.go @@ -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"` +}