Commit 82fd0b8b authored by zhang0ZGC's avatar zhang0ZGC Committed by 陈帅

fix #2965 查询表格关闭配置Modal时没有渐隐效果 (#2980)

parent b8d146ae
...@@ -66,6 +66,12 @@ const CreateForm = Form.create()(props => { ...@@ -66,6 +66,12 @@ const CreateForm = Form.create()(props => {
@Form.create() @Form.create()
class UpdateForm extends PureComponent { class UpdateForm extends PureComponent {
static defaultProps = {
handleUpdate: () => {},
handleUpdateModalVisible: () => {},
values: {},
};
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -203,13 +209,13 @@ class UpdateForm extends PureComponent { ...@@ -203,13 +209,13 @@ class UpdateForm extends PureComponent {
}; };
renderFooter = currentStep => { renderFooter = currentStep => {
const { handleUpdateModalVisible } = this.props; const { handleUpdateModalVisible, values } = this.props;
if (currentStep === 1) { if (currentStep === 1) {
return [ return [
<Button key="back" style={{ float: 'left' }} onClick={this.backward}> <Button key="back" style={{ float: 'left' }} onClick={this.backward}>
上一步 上一步
</Button>, </Button>,
<Button key="cancel" onClick={() => handleUpdateModalVisible()}> <Button key="cancel" onClick={() => handleUpdateModalVisible(false, values)}>
取消 取消
</Button>, </Button>,
<Button key="forward" type="primary" onClick={() => this.handleNext(currentStep)}> <Button key="forward" type="primary" onClick={() => this.handleNext(currentStep)}>
...@@ -222,7 +228,7 @@ class UpdateForm extends PureComponent { ...@@ -222,7 +228,7 @@ class UpdateForm extends PureComponent {
<Button key="back" style={{ float: 'left' }} onClick={this.backward}> <Button key="back" style={{ float: 'left' }} onClick={this.backward}>
上一步 上一步
</Button>, </Button>,
<Button key="cancel" onClick={() => handleUpdateModalVisible()}> <Button key="cancel" onClick={() => handleUpdateModalVisible(false, values)}>
取消 取消
</Button>, </Button>,
<Button key="submit" type="primary" onClick={() => this.handleNext(currentStep)}> <Button key="submit" type="primary" onClick={() => this.handleNext(currentStep)}>
...@@ -231,7 +237,7 @@ class UpdateForm extends PureComponent { ...@@ -231,7 +237,7 @@ class UpdateForm extends PureComponent {
]; ];
} }
return [ return [
<Button key="cancel" onClick={() => handleUpdateModalVisible()}> <Button key="cancel" onClick={() => handleUpdateModalVisible(false, values)}>
取消 取消
</Button>, </Button>,
<Button key="forward" type="primary" onClick={() => this.handleNext(currentStep)}> <Button key="forward" type="primary" onClick={() => this.handleNext(currentStep)}>
...@@ -241,7 +247,7 @@ class UpdateForm extends PureComponent { ...@@ -241,7 +247,7 @@ class UpdateForm extends PureComponent {
}; };
render() { render() {
const { updateModalVisible, handleUpdateModalVisible } = this.props; const { updateModalVisible, handleUpdateModalVisible, values } = this.props;
const { currentStep, formVals } = this.state; const { currentStep, formVals } = this.state;
return ( return (
...@@ -252,7 +258,8 @@ class UpdateForm extends PureComponent { ...@@ -252,7 +258,8 @@ class UpdateForm extends PureComponent {
title="规则配置" title="规则配置"
visible={updateModalVisible} visible={updateModalVisible}
footer={this.renderFooter(currentStep)} footer={this.renderFooter(currentStep)}
onCancel={() => handleUpdateModalVisible()} onCancel={() => handleUpdateModalVisible(false, values)}
afterClose={() => handleUpdateModalVisible()}
> >
<Steps style={{ marginBottom: 28 }} size="small" current={currentStep}> <Steps style={{ marginBottom: 28 }} size="small" current={currentStep}>
<Step title="基本信息" /> <Step title="基本信息" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment