| | |
| | | hint: ['label', 'type', 'blacklist', 'message', 'span', 'labelwidth'], |
| | | split: ['label', 'type'], |
| | | brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'span', 'labelwidth', 'tooltip', 'extra', 'encryption'], |
| | | funcvar: [], |
| | | funcvar: ['span', 'labelwidth'], |
| | | linkMain: ['readonly', 'required', 'hidden', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra'] |
| | | } |
| | | |
| | |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | formlist: PropTypes.any, |
| | | standardform: PropTypes.any, |
| | | card: PropTypes.object, |
| | | inputSubmit: PropTypes.any |
| | | } |
| | |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let formlist = fromJS(this.props.formlist).toJS() |
| | | |
| | | let type = '' |
| | | let resourceType = '' |
| | | let supField = '' |
| | |
| | | }) |
| | | } |
| | | |
| | | changeVal = (val, type) => { |
| | | if (type !== 'span' || ![24, 12, 8, 6].includes(val)) return |
| | | |
| | | const { standardform } = this.props |
| | | |
| | | if (!standardform || ![24, 12, 8, 6].includes(standardform.span) || !standardform.labelwidth) return |
| | | |
| | | let labelwidth = null |
| | | |
| | | if (standardform.span === val) { |
| | | labelwidth = standardform.labelwidth |
| | | } else if (standardform.span > val) { |
| | | labelwidth = 33.3 |
| | | } else { |
| | | switch(standardform.span) { |
| | | case 12: |
| | | labelwidth = 16.2 |
| | | break; |
| | | case 8: |
| | | if (val === 12) { |
| | | labelwidth = 21.6 |
| | | } else { |
| | | labelwidth = 10.5 |
| | | } |
| | | break; |
| | | case 6: |
| | | if (val === 8) { |
| | | labelwidth = 24.3 |
| | | } else if (val === 12) { |
| | | labelwidth = 15.8 |
| | | } else { |
| | | labelwidth = 7.7 |
| | | } |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | | |
| | | |
| | | if (labelwidth) { |
| | | this.props.form.setFieldsValue({labelwidth}) |
| | | } |
| | | } |
| | | |
| | | handleSubmit = (e) => { |
| | | e.preventDefault() |
| | | |
| | |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={item.min} max={item.max} precision={item.precision} onPressEnter={this.handleSubmit}/>)} |
| | | })(<InputNumber onChange={(value) => this.changeVal(value, item.key)} min={item.min} max={item.max} precision={item.precision} onPressEnter={this.handleSubmit}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |