58 lines
1.2 KiB
TypeScript
58 lines
1.2 KiB
TypeScript
import { FormInstance } from "antd"
|
|
import React from "react"
|
|
export enum FormType {
|
|
input = "input",
|
|
inputNumber = "inputNumber",
|
|
select = "select",
|
|
editor = "editor",
|
|
date = "date",
|
|
map = "map",
|
|
textarea = "textarea",
|
|
radio = "radio",
|
|
upload = "upload",
|
|
cehckbox = "checkbox",
|
|
cehckboxGroup = "checkboxGroup",
|
|
password = "password",
|
|
treeVideo = "treeVideo",
|
|
fetchList = "fetchList",
|
|
}
|
|
|
|
export interface FormDatas {
|
|
type: string,
|
|
label: string,
|
|
name: string,
|
|
value: any,
|
|
selectUrl?: string,
|
|
key?: string,
|
|
selectList?: Array<selectItem>
|
|
checkboxData?: Array<any>,
|
|
radioData?: Array<any>,
|
|
rules: Array<rules>
|
|
}
|
|
|
|
export interface SimpleFormData {
|
|
subBtnName?: string,
|
|
formName: string,
|
|
colProps: number,
|
|
span?: number,
|
|
initialValues?: Object | null | undefined,
|
|
onFinish: Function,
|
|
formRef?: React.RefObject<FormInstance<any>>,
|
|
onFinishFailed?: Function,
|
|
formDatas: Array<FormDatas>,
|
|
createCallback?: Function
|
|
children?: React.ReactElement
|
|
childrenPosi?: boolean
|
|
}
|
|
|
|
|
|
export interface rules {
|
|
required: boolean,
|
|
message: string,
|
|
}
|
|
|
|
|
|
export interface selectItem {
|
|
name: string,
|
|
id: number,
|
|
} |