1.2.2 • Published 4 years ago

extends-antd-design v1.2.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

基于 Ant Design 的 组件封装

RenderFrom 组件

API

参数说明类型默认值
titleForm 表单的标题string
searchColumsForm 表单控件的配置描述,具体项见下表array
handleSearch表单的查询数据的方法function
view查看模式booleanfalse
selectOptions选择的参数arrayfalse

searchColums

参数说明类型默认值
label表单的控件的labelstring
name控件对应后端的字段string
searchType控件的类型,具体项见下表string
hidden是否隐藏控件booleanfalse
initialValue初始值string
rules校验规则array
props控件的时间以及默认的属性object

searchType

参数说明类型默认值
input输入框string
inputEnterSearch弹层选择,具体项见下表string
textArea富文本string
inputNumber数字输入框number
checkbox多选array
radio单选array
datePicker日期moment
rangePicker区间日期array(object)
cascader级联选择array
select下拉选择string

inputEnterSearch

参数说明类型默认值
titleForm 表单的标题string
searchColumsForm 表单控件的配置描述,具体项见表searchColumsarray
handleSearch表单的查询数据的方法function
view查看模式booleanfalse
selectOptions选择的参数arrayfalse
modalProps弹层的Props,具体项见下表object
enterButtonSearch点击控件的button事件,参数说明function

modalProps

参数说明类型默认值
tableRowKey表格单行的keystring
tableColums表格的表头array
searchColumsForm 表单控件的配置描述,具体项见表searchColumsarray
fetchData调用接口查询数据的方法,参数说明function
onModalOk弹层的确认事件,参数说明function

fetchData

fetchData: () => {
    return (params, callback) => {
        // 1) 直接调用接口返回数据
        axios({ url: `${baseUrl}/getFormData`, method: 'get', params }).then((res) => {
            const { list, total } = res
            callback({ data: { data: list, total } })
        })
        // 2) 结合redux返回数据
        dispatch({
            type: 'getFormData',
            payload: {
                ...params,
            },
            callback,
        })
    }
}             

onModalOk

onModalOk: (callback, oldSelectItem, newSelectItem) => {
    // 弹层关闭的事件,必须执行的参数
    callback()
    // 之前选中的数据的值
    oldSelectItem
    // 新选中的数据的值
    newSelectItem
}

enterButtonSearch

enterButtonSearch: (callback, childInputs) => {
    // 显示弹层的事件,必须执行的参数
    callback()
    // 包含所有弹层显示的 objects,以当前控件的 dataIndex 为 key
    childInputs
}
1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.0.19

4 years ago

1.1.0

4 years ago

1.0.20

4 years ago

1.0.18

4 years ago

1.0.16

4 years ago

1.0.14

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago