Skip to content

属性

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}, {})