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 => {
@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="基本信息" />
......
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