|
|
|
@ -66,6 +66,12 @@ const CreateForm = Form.create()(props => { |
|
|
|
|
|
|
|
@Form.create() |
|
|
|
class UpdateForm extends PureComponent { |
|
|
|
static defaultProps = { |
|
|
|
handleUpdate: () => {}, |
|
|
|
handleUpdateModalVisible: () => {}, |
|
|
|
values: {}, |
|
|
|
}; |
|
|
|
|
|
|
|
constructor(props) { |
|
|
|
super(props); |
|
|
|
|
|
|
|
@ -203,13 +209,13 @@ class UpdateForm extends PureComponent { |
|
|
|
}; |
|
|
|
|
|
|
|
renderFooter = currentStep => { |
|
|
|
const { handleUpdateModalVisible } = this.props; |
|
|
|
const { handleUpdateModalVisible, values } = this.props; |
|
|
|
if (currentStep === 1) { |
|
|
|
return [ |
|
|
|
<Button key="back" style={{ float: 'left' }} onClick={this.backward}> |
|
|
|
上一步 |
|
|
|
</Button>, |
|
|
|
<Button key="cancel" onClick={() => handleUpdateModalVisible()}> |
|
|
|
<Button key="cancel" onClick={() => handleUpdateModalVisible(false, values)}> |
|
|
|
取消 |
|
|
|
</Button>, |
|
|
|
<Button key="forward" type="primary" onClick={() => this.handleNext(currentStep)}> |
|
|
|
@ -222,7 +228,7 @@ class UpdateForm extends PureComponent { |
|
|
|
<Button key="back" style={{ float: 'left' }} onClick={this.backward}> |
|
|
|
上一步 |
|
|
|
</Button>, |
|
|
|
<Button key="cancel" onClick={() => handleUpdateModalVisible()}> |
|
|
|
<Button key="cancel" onClick={() => handleUpdateModalVisible(false, values)}> |
|
|
|
取消 |
|
|
|
</Button>, |
|
|
|
<Button key="submit" type="primary" onClick={() => this.handleNext(currentStep)}> |
|
|
|
@ -231,7 +237,7 @@ class UpdateForm extends PureComponent { |
|
|
|
]; |
|
|
|
} |
|
|
|
return [ |
|
|
|
<Button key="cancel" onClick={() => handleUpdateModalVisible()}> |
|
|
|
<Button key="cancel" onClick={() => handleUpdateModalVisible(false, values)}> |
|
|
|
取消 |
|
|
|
</Button>, |
|
|
|
<Button key="forward" type="primary" onClick={() => this.handleNext(currentStep)}> |
|
|
|
@ -241,7 +247,7 @@ class UpdateForm extends PureComponent { |
|
|
|
}; |
|
|
|
|
|
|
|
render() { |
|
|
|
const { updateModalVisible, handleUpdateModalVisible } = this.props; |
|
|
|
const { updateModalVisible, handleUpdateModalVisible, values } = this.props; |
|
|
|
const { currentStep, formVals } = this.state; |
|
|
|
|
|
|
|
return ( |
|
|
|
@ -252,7 +258,8 @@ class UpdateForm extends PureComponent { |
|
|
|
title="规则配置" |
|
|
|
visible={updateModalVisible} |
|
|
|
footer={this.renderFooter(currentStep)} |
|
|
|
onCancel={() => handleUpdateModalVisible()} |
|
|
|
onCancel={() => handleUpdateModalVisible(false, values)} |
|
|
|
afterClose={() => handleUpdateModalVisible()} |
|
|
|
> |
|
|
|
<Steps style={{ marginBottom: 28 }} size="small" current={currentStep}> |
|
|
|
<Step title="基本信息" /> |
|
|
|
|