This commit is contained in:
喻希里 2017-09-08 11:43:25 +08:00
commit 9d2f4f96a6

View File

@ -52,18 +52,19 @@ export default class InterfaceColContent extends Component {
result.payload.data.data.find(item => +item._id === +currColId) && +currColId ||
result.payload.data.data[0]._id;
this.props.history.push('/project/' + params.id + '/interface/col/' + currColId)
this.props.fetchCaseList(currColId);
this.props.setColData({currColId: +currColId, isShowCol: true})
}
componentWillReceiveProps(nextProps) {
const { interfaceColList } = nextProps;
const { actionId: oldCaseId, id } = this.props.match.params
let newCaseId = nextProps.match.params.actionId
if (!interfaceColList.find(item => +item._id === +newCaseId)) {
const { actionId: oldColId, id } = this.props.match.params
let newColId = nextProps.match.params.actionId
if (!interfaceColList.find(item => +item._id === +newColId)) {
this.props.history.push('/project/' + id + '/interface/col/' + interfaceColList[0]._id)
} else if (oldCaseId !== newCaseId) {
this.props.fetchCaseList(newCaseId);
this.props.setColData({currColId: +newCaseId, isShowCol: true})
} else if (oldColId !== newColId) {
this.props.fetchCaseList(newColId);
this.props.setColData({currColId: +newColId, isShowCol: true})
}
}