| | |
| | | |
| | | state = { |
| | | formlist: [], // 表单项 |
| | | formId: '' |
| | | } |
| | | |
| | | record = {} |
| | |
| | | let record = {} |
| | | let controlFields = {} |
| | | let fieldMap = new Map() |
| | | let formId = (() => { |
| | | let uuid = [] |
| | | let _options = '0123456789abcdefghigklmnopqrstuv' |
| | | for (let i = 0; i < 19; i++) { |
| | | uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1)) |
| | | } |
| | | uuid = uuid.join('') |
| | | return uuid |
| | | })() |
| | | |
| | | let formlist = this.props.formlist.filter(item => { |
| | | if (item.controlFields) { // 多层表单控制 |
| | |
| | | if (item.options) { |
| | | item.oriOptions = fromJS(item.options).toJS() |
| | | } |
| | | item.$formId = formId |
| | | |
| | | if (item.type === 'text') { |
| | | let _rules = [{ |
| | |
| | | |
| | | this.record = record |
| | | |
| | | this.setState({ formlist }) |
| | | this.setState({ formlist, formId }) |
| | | } |
| | | |
| | | checkNumber = (rule, value, callback, item) => { |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="normal-form-field" id="normal-form-field"> |
| | | <Form {...formItemLayout} className="normal-form-field" id={this.state.formId}> |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | </Form> |
| | | ) |