| | |
| | | number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'editable', 'initval', 'sum', 'blacklist'], |
| | | textarea: ['label', 'field', 'type', 'Align', 'Hide', 'Width', 'prefix', 'initval', 'postfix', 'blacklist'], |
| | | custom: ['label', 'type', 'Align', 'Hide', 'Width', 'blacklist'], |
| | | colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'], |
| | | action: ['label', 'type', 'Align', 'Width'], |
| | | formula: ['label', 'type', 'Align', 'Hide', 'Width', 'prefix', 'postfix', 'eval', 'formula', 'blacklist'], |
| | | index: ['label', 'type', 'Align', 'Width'] |
| | |
| | | return item |
| | | }) |
| | | }, () => { |
| | | if (value === 'action') { |
| | | if (value === 'action' || value === 'colspan') { |
| | | this.props.form.setFieldsValue({Align: 'center'}) |
| | | } |
| | | }) |
| | |
| | | } |
| | | |
| | | handleSubmit = () => { |
| | | const { columns, column } = this.props |
| | | // const { columns } = this.props |
| | | // 表单提交时检查输入值是否正确 |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | values.uuid = column.uuid |
| | | values.marks = column.marks || [] |
| | | |
| | | if (values.field && columns.filter(col => col.field && col.uuid !== values.uuid && col.field === values.field).length > 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段已添加!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | // if (values.field && columns.filter(col => col.field && col.uuid !== values.uuid && col.field === values.field).length > 0) { |
| | | // notification.warning({ |
| | | // top: 92, |
| | | // message: '字段已添加!', |
| | | // duration: 5 |
| | | // }) |
| | | // return |
| | | // } |
| | | this.setState({visible: false, formlist: null}) |
| | | this.props.submitCol(values) |
| | | |