| | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | formlist: PropTypes.any, |
| | | standardform: PropTypes.any, |
| | | fields: PropTypes.array, |
| | | card: PropTypes.object, |
| | | inputSubmit: PropTypes.any |
| | | } |
| | |
| | | changeVal = (val, type) => { |
| | | if (type !== 'span' || ![24, 12, 8, 6].includes(val)) return |
| | | |
| | | const { standardform } = this.props |
| | | const { card, fields } = this.props |
| | | |
| | | if (!standardform || ![24, 12, 8, 6].includes(standardform.span) || !standardform.labelwidth) return |
| | | let index = fields.findIndex(item => card.uuid === item.uuid) |
| | | let stform = fields[index - 1] |
| | | |
| | | if (!stform || ![24, 12, 8, 6].includes(stform.span) || !stform.labelwidth) return |
| | | |
| | | let labelwidth = null |
| | | |
| | | if (standardform.span === val) { |
| | | labelwidth = standardform.labelwidth |
| | | } else if (standardform.span > val) { |
| | | if (stform.span === val) { |
| | | labelwidth = stform.labelwidth |
| | | } else if (stform.span > val) { |
| | | labelwidth = 33.3 |
| | | } else { |
| | | switch(standardform.span) { |
| | | switch(stform.span) { |
| | | case 12: |
| | | labelwidth = 16.2 |
| | | break; |
| | |
| | | } |
| | | } |
| | | |
| | | handleConfirm = (fields) => { |
| | | const { card } = this.props |
| | | handleConfirm = () => { |
| | | const { card, fields } = this.props |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |