opti: 路由

This commit is contained in:
zwjamnsss 2017-08-11 15:02:07 +08:00
parent b637fc6412
commit d4fc53614c
5 changed files with 56 additions and 12 deletions

27
.tags Normal file
View File

@ -0,0 +1,27 @@
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ constructor(props) {$/;" function line:26
state.login /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ this.state = {$/;" property line:28
static.checkLoginState /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ static propTypes = {$/;" property line:33
componentDidMount /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ componentDidMount() {$/;" function line:45
render /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ render() {$/;" function line:78
from.groupList /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ static propTypes = {$/;" property line:35
state.addGroupModalVisible /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ state = {$/;" property line:46
state.editGroupModalVisible /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ addGroupModalVisible: false,$/;" property line:47
state.newGroupName /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ editGroupModalVisible: false,$/;" property line:48
state.newGroupDesc /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ newGroupName: '',$/;" property line:49
state.currGroupName /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ newGroupDesc: '',$/;" property line:50
state.currGroupDesc /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ currGroupName: '',$/;" property line:51
state.groupList /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ currGroupDesc: '',$/;" property line:52
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ constructor(props) {$/;" function line:56
showModal /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ showModal(type) {$/;" function line:80
hideModal /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ hideModal(type) {$/;" function line:95
inputNewGroupName /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ inputNewGroupName(e, type) {$/;" function line:134
inputNewGroupDesc /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ inputNewGroupDesc(e, type) {$/;" function line:142
selectGroup /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ selectGroup(e) {$/;" function line:151
searchGroup /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ searchGroup(e, value) {$/;" function line:175
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ render () {$/;" function line:185
from.match /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ static propTypes = {$/;" property line:9
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ constructor(props) {$/;" function line:16
componentWillMount /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ componentWillMount() {$/;" function line:20
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ render () {$/;" function line:23
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/Group.js /^ constructor(props) {$/;" function line:11
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/Group.js /^ render () {$/;" function line:15

8
.tags1 Normal file
View File

@ -0,0 +1,8 @@
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 0 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/Group.js /^ constructor(props) {$/;" function line:11
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/Group.js /^ render () {$/;" function line:15

View File

@ -56,9 +56,9 @@ export default class App extends Component {
<div className="router-main">
<Header />
<div className="router-container">
<Route path="/" component={Home} exact />
<Route exact path="/" component={Home} />
<Route path="/group" component={requireAuthentication(Group)} />
<Route path="/project/:id" component={requireAuthentication(Project)} />
<Route path="/project" component={requireAuthentication(Project)} />
<Route path="/user" component={requireAuthentication(User)} />
<Route path="/follow" component={requireAuthentication(Follows)} />
<Route path="/add-project" component={requireAuthentication(AddProject)} />

View File

@ -2,6 +2,7 @@ import React, { Component } from 'react';
import GroupList from './GroupList/GroupList.js';
import ProjectList from './ProjectList/ProjectList.js';
import Subnav from '../../components/Subnav/Subnav.js';
import { Route, Switch, Redirect } from 'react-router-dom';
import { Row, Col } from 'antd';
import './Group.scss'
@ -12,6 +13,19 @@ export default class Group extends Component {
}
render () {
const GroupContent = (
<div className="g-row">
<Row gutter={16}>
<Col span={6}>
<GroupList></GroupList>
</Col>
<Col span={18}>
<ProjectList/>
</Col>
</Row>
</div>
)
return (
<div>
<Subnav
@ -23,16 +37,10 @@ export default class Group extends Component {
name: '我的关注',
path: '/follow'
}]}/>
<div className="g-row">
<Row gutter={16}>
<Col span={6}>
<GroupList></GroupList>
</Col>
<Col span={18}>
<ProjectList/>
</Col>
</Row>
</div>
<Switch>
<Redirect exact from='/group' to='/group/0' />
<Route path="/group/:groupId" render={() => GroupContent} />
</Switch>
</div>
)
}

View File

@ -37,6 +37,7 @@ export default class GroupList extends Component {
path: `/project/${match.params.id}/activity`
}]}/>
<Switch>
<Redirect exact from='/project' to='/project/0' />
<Redirect exact from='/project/:id' to={`/project/${match.params.id}/interface`} />
<Route path="/project/:id/activity" component={null} />
<Route path="/project/:id/interface" component={Interface} />