import { IBasicProps } from '@/types' import { FormControl } from '../../form' import { Rule } from 'antd-mobile/es/components/form' class BasicField { uniqueKey: string type: string name: string componentName = 'basic' required = false hidden = false submitDisabled = false readonly = false showTooltip = false tooltip: string rules: Rule[] = [] isComposite = false form: FormControl constructor(props: IBasicProps, form: FormControl) { this.uniqueKey = props.uniqueKey this.type = props.workOrderComponentType this.name = props.name this.required = props.componentConfig.required this.form = form const { readonly = false, submitDisabled = false, hidden = false, showTooltip = false, tooltip = '' } = props.componentConfig this.readonly = readonly this.submitDisabled = submitDisabled this.hidden = hidden this.showTooltip = showTooltip this.tooltip = tooltip } renderLog() { console.log(`[render]: ${this.type} ${this.uniqueKey}`) } render(props: any) { console.log(props) return <>暂未支持的组件类型:{this.type} } } export default BasicField