| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { type } = this.props |
| | | const { editItem } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (type === 'fullscreen' && err) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请输入sql!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | if (!err) { |
| | | values.uuid = editItem ? editItem.uuid : '' |
| | | values.position = values.position || (editItem ? editItem.position : 'front') |
| | |
| | | render() { |
| | | const { usefulfields, systemScripts, btn, type } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { editItem } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | </Col> : null} |
| | | <Col span={6} className="add"> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}> |
| | | 保存 |
| | | {_type === 'fullscreen' && !editItem ? '添加' : '保存'} |
| | | </Button> |
| | | <Button onClick={this.handleCancel} style={{marginBottom: 15, marginLeft: 10}}> |
| | | 取消 |