|
@@ -32,13 +32,15 @@ class BasicVersion extends Component {
|
|
|
userID: '',
|
|
userID: '',
|
|
|
avatar: ''
|
|
avatar: ''
|
|
|
};
|
|
};
|
|
|
- console.log(props);
|
|
|
|
|
|
|
+ // console.log('BasicVersion props',props);
|
|
|
if(props.location) {
|
|
if(props.location) {
|
|
|
- switch(props.location.pathname) {
|
|
|
|
|
- case '/common/deploy':
|
|
|
|
|
|
|
+ let tabMenu = props.location.pathname.split('/')[2] || 'example';
|
|
|
|
|
+ // console.log('tabMenu',tabMenu);
|
|
|
|
|
+ switch(tabMenu) {
|
|
|
|
|
+ case 'deploy':
|
|
|
this.state.menuLevel1 = 'my-deploy';
|
|
this.state.menuLevel1 = 'my-deploy';
|
|
|
break;
|
|
break;
|
|
|
- case '/common/communication':
|
|
|
|
|
|
|
+ case 'communication':
|
|
|
this.state.menuLevel1 = 'communication';
|
|
this.state.menuLevel1 = 'communication';
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
@@ -48,6 +50,24 @@ class BasicVersion extends Component {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ componentWillReceiveProps(props){
|
|
|
|
|
+ if(props.location) {
|
|
|
|
|
+ let tabMenu = props.location.pathname.split('/')[2] || 'example';
|
|
|
|
|
+ // console.log('tabMenu1',tabMenu);
|
|
|
|
|
+ switch(tabMenu) {
|
|
|
|
|
+ case 'deploy':
|
|
|
|
|
+ this.setState({menuLevel1: 'my-deploy'});
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'communication':
|
|
|
|
|
+ this.setState({menuLevel1: 'communication'});
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ this.setState({menuLevel1: 'example'});
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
switchMenuLevel = (menuName, value) => {
|
|
switchMenuLevel = (menuName, value) => {
|
|
|
this.setState({
|
|
this.setState({
|
|
|
[menuName]: value,
|
|
[menuName]: value,
|
|
@@ -181,7 +201,7 @@ class BasicVersion extends Component {
|
|
|
<Route path="/common/example" exact component={CaseShow}/>
|
|
<Route path="/common/example" exact component={CaseShow}/>
|
|
|
<Route path="/common/deploy" component={MyDeploy}/>
|
|
<Route path="/common/deploy" component={MyDeploy}/>
|
|
|
<Route path="/common/communication" component={Communication}/>
|
|
<Route path="/common/communication" component={Communication}/>
|
|
|
- <PrivateRoute path="/common/deploy-cloud-choose" component={CaseDetail} ownProps={ownProps}/>
|
|
|
|
|
|
|
+ <PrivateRoute path="/common/example/deploy-cloud-choose" component={CaseDetail} ownProps={ownProps}/>
|
|
|
</Switch>
|
|
</Switch>
|
|
|
</Layout>
|
|
</Layout>
|
|
|
|
|
|