| | |
| | | actions: PropTypes.array |
| | | } |
| | | |
| | | state = {} |
| | | state = { |
| | | enable: this.props.autoMatic.enable |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | // 表单提交时检查输入值是否正确 |
| | |
| | | render() { |
| | | const { actions, autoMatic } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { enable } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | {getFieldDecorator('enable', { |
| | | initialValue: autoMatic.enable, |
| | | })( |
| | | <Radio.Group> |
| | | <Radio.Group onChange={(e) => this.setState({enable: e.target.value})}> |
| | | <Radio value="true">是</Radio> |
| | | <Radio value="false">否</Radio> |
| | | </Radio.Group> |
| | |
| | | {getFieldDecorator('action', { |
| | | initialValue: autoMatic.action || '', |
| | | rules: [{ |
| | | required: true, |
| | | required: enable === 'true', |
| | | message: '请选择执行按钮!' |
| | | }] |
| | | })( |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={20}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="按钮执行失败时,后续的处理方式。"> |
| | | <Icon type="question-circle" style={{color: '#c49f47', marginRight: '3px'}} /> |
| | | 报错时 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('onFail', { |
| | | initialValue: autoMatic.onFail, |
| | | })( |
| | | <Radio.Group onChange={(e) => this.setState({enable: e.target.value})}> |
| | | <Radio value="stop">停止</Radio> |
| | | <Radio value="skip">跳过</Radio> |
| | | <Radio value="again">重新执行</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |