Skip to content
This repository has been archived by the owner on Jul 12, 2019. It is now read-only.

Commit

Permalink
[FIX]修复创建问题后,无法再次创建的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sj279811799 committed Apr 10, 2019
1 parent 00b8318 commit e532ef6
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions agile/src/app/agile/components/CreateIssueNew/CreateIssue.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class CreateIssue extends Component {

handleSave = (data) => {
const { fileList } = this.state;
const { onOk } = this.props;
const { onOk, form } = this.props;
const callback = (newFileList) => {
this.setState({ fileList: newFileList });
};
Expand All @@ -159,9 +159,17 @@ class CreateIssue extends Component {
handleFileUpload(fileList, callback, config);
}
}
form.resetFields();
this.setState({
createLoading: false,
});
onOk(res);
})
.catch(() => {
form.resetFields();
this.setState({
createLoading: false,
});
onOk();
});
};
Expand Down Expand Up @@ -373,13 +381,23 @@ class CreateIssue extends Component {
});
};

handleCancel = () => {
const { onCancel, form } = this.props;
form.resetFields();
this.setState({
createLoading: false,
});
if (onCancel) {
onCancel();
}
};

render() {
const {
visible,
onCancel,
form,
} = this.props;
const { getFieldDecorator, setFieldsValue } = form;
const { getFieldDecorator } = form;
const {
originPriorities, defaultPriority, createLoading, storyPoints, estimatedTime,
edit, delta, originUsers, selectLoading,
Expand All @@ -398,7 +416,7 @@ class CreateIssue extends Component {
title="创建问题"
visible={visible || false}
onOk={this.handleCreateIssue}
onCancel={onCancel}
onCancel={this.handleCancel}
okText="创建"
cancelText="取消"
confirmLoading={createLoading}
Expand Down

0 comments on commit e532ef6

Please sign in to comment.