From 7ea2f24a33f49bfe0edfaf21c7384aadf9efcd4d Mon Sep 17 00:00:00 2001 From: zwjamnsss Date: Fri, 8 Sep 2017 11:36:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=9D=E5=A7=8B=E5=8A=A0=E8=BD=BDcase?= =?UTF-8?q?List?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Interface/InterfaceCol/InterfaceColContent.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/client/containers/Project/Interface/InterfaceCol/InterfaceColContent.js b/client/containers/Project/Interface/InterfaceCol/InterfaceColContent.js index 6f37c705..9564a9cc 100644 --- a/client/containers/Project/Interface/InterfaceCol/InterfaceColContent.js +++ b/client/containers/Project/Interface/InterfaceCol/InterfaceColContent.js @@ -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}) } }