Appearance
属性
javascript
// 表单配置对象
form: {
// 标识是否为容器类型
isContainer: true,
// 表单的显示名称
displayName: "表单",
// 标识是否为表单类型
isForm: false,
// 是否可以添加数据表查询
canAddDataTableQuery: false,
// 是否可以添加数据表列表
canAddDataTableList: false,
// 表单完成状态
complete: true,
// 表单组件列表
widgetList: [],
// 表单属性配置
props: {
// 是否显示标签
hasLabel: false,
// 标签内容
label: "",
// 表单项宽度
width: 24,
// 表单项备注
remark: "",
// 是否显示底部区域
hasFooter: true,
// 是否显示提交按钮
hasSubmitButton: true,
// 是否显示重置按钮
hasResetButton: false,
// 按钮对齐方式
buttonAlign: 'right',
// 提交按钮文本
submitButtonText: '提交',
// 是否显示底部背景
hasFooterBg: true,
// 是否显示边框
hasBorder: true,
// 表单列表数据
list: [],
// 是否隐藏表单
hide: false,
// 表单样式配置
style: {},
// 表单类型:创建、更新、详情
formType: "Create",
// 创建操作的API配置
apiSetCreate: {
// 请求方法
method: "post",
// API地址
apiurl: "",
// 请求参数
params: [],
// 请求头
headers: [],
// 内容类型
contentType: "JSON",
// 参数格式化
paramsFormat: "",
// 请求头格式化
headersFormat: "",
// 成功响应格式化
successFormat: "",
// 错误响应格式化
errorFormat: "",
},
// 更新操作的API配置
apiSetUpdate: {
// 请求方法
method: "post",
// API地址
apiurl: "",
// 请求参数
params: [],
// 请求头
headers: [],
// 内容类型
contentType: "JSON",
// 参数格式化
paramsFormat: "",
// 请求头格式化
headersFormat: "",
// 成功响应格式化
successFormat: "",
// 错误响应格式化
errorFormat: "",
},
// 详情操作的API配置
apiSetDetail: {
// 请求方法
method: "post",
// API地址
apiurl: "",
// 请求参数
params: [],
// 请求头
headers: [],
// 内容类型
contentType: "JSON",
// 参数格式化
paramsFormat: "",
// 请求头格式化
headersFormat: "",
// 成功响应格式化
successFormat: "",
// 错误响应格式化
errorFormat: "",
},
// 表单创建时的回调函数
onCreated: null,
// 表单挂载时的回调函数
onMounted: null,
// 按钮点击时的回调函数
onButtonClick: null,
}
},
方法
名称 | 描述 | 示例 |
---|---|---|
app.getPropsById | 获取当前组件参数值 | app.getPropsById({id}) |
app.setVisible | 设置可见 | app.setVisible({id}, false) |
app.setFormType | 设置表单类型 | app.setFormType({id}, "Create") |
app.getFormType | 获取表单类型 | app.getFormType({id}) |
app.getResult | 获取表单结果 | app.getWidgetListResultById({id}) |
app.reset | 重置表单 | app.resetWidgetListById({id}) |
app.submit | 提交表单数据 | app.getMethodById({id}).submit() |
app.inputData | 赋值表单数据 | app.inputWidgetListValueById({id}, {}) |