| | |
| | | state = { |
| | | openType: null, |
| | | resourceType: null, |
| | | supField: '', |
| | | formlist: null, |
| | | linkSubFields: null |
| | | } |
| | |
| | | |
| | | let type = '' |
| | | let resourceType = '' |
| | | let supField = '' |
| | | let linkSubFields = [] |
| | | |
| | | formlist.forEach(cell => { |
| | |
| | | return false |
| | | } |
| | | }) |
| | | } else if (cell.key === 'supField') { |
| | | supField = cell.initVal |
| | | } |
| | | }) |
| | | |
| | |
| | | _options = ['label', 'field', 'type', 'readonly', 'required', 'hidden', 'fieldlength'] |
| | | } |
| | | |
| | | if (type !== 'funcvar' && type !== 'linkMain') { |
| | | if (supField) { |
| | | _options.push('supField', 'supvalue') |
| | | } else { |
| | | _options.push('supField') |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | openType: type, |
| | | supField: supField, |
| | | resourceType: resourceType, |
| | | linkSubFields: linkSubFields, |
| | | formlist: formlist.map(form => { |
| | |
| | | } else if (value === 'linkMain') { |
| | | _options = ['label', 'field', 'type', 'readonly', 'required', 'hidden', 'fieldlength'] |
| | | } |
| | | |
| | | if (value !== 'funcvar' && value !== 'linkMain') { |
| | | if (this.state.supField) { |
| | | _options.push('supField', 'supvalue') |
| | | } else { |
| | | _options.push('supField') |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | openType: value, |
| | |
| | | formlist: this.state.formlist.map(form => { |
| | | if (form.key === 'options') { |
| | | form.initVal = option.options |
| | | } |
| | | |
| | | return form |
| | | }) |
| | | }) |
| | | } else if (key === 'supField') { |
| | | this.setState({ |
| | | supField: value, |
| | | formlist: this.state.formlist.map(form => { |
| | | if (form.key === 'supvalue' && value) { |
| | | form.show = true |
| | | } else if (form.key === 'supvalue' && !value) { |
| | | form.show = false |
| | | } |
| | | |
| | | return form |
| | |
| | | } else if (item.type === 'select') { // 下拉搜索 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |