Commit 931e27fb authored by ζ„šι“'s avatar ζ„šι“

add acount center

parent dc5b0f67
......@@ -76,6 +76,32 @@ export default {
{ path: '/exception/403', component: './Exception/403' },
{ path: '/exception/404', component: './Exception/404' },
{ path: '/exception/500', component: './Exception/500' },
// acount
{
path: '/acount/center',
component: './Account/Center/Center',
routes: [
{ path: '/acount/center', redirect: '/acount/center/articles' },
{ path: '/acount/center/articles', component: './Account/Center/Articles' },
{ path: '/acount/center/applications', component: './Account/Center/Applications' },
{ path: '/acount/center/projects', component: './Account/Center/Projects' },
],
},
{
path: '/acount/settings',
component: './Account/Settings/Info',
routes: [
{ path: '/acount/settings', redirect: '/acount/settings/base' },
{ path: '/acount/center/base', component: './Account/Settings/BaseView' },
{ path: '/acount/center/security', component: './Account/Settings/SecurityView' },
{ path: '/acount/center/binding', component: './Account/Settings/BindingView' },
{
path: '/acount/center/notification',
component: './Account/Settings/NotificationView',
},
],
},
],
},
],
......@@ -135,46 +161,3 @@ export default {
},
},
};
// [
// {
// "path": "/Dashboard",
// "exact": true,
// "redirect": "/Dashboard/Analysis"
// },
// {
// "path": "/Forms",
// "exact": true,
// "redirect": "/Forms/BasicForm"
// },
// {
// "path": "/Forms/StepForm",
// "exact": true,
// "redirect": "/Forms/StepForm/Step1"
// },
// {
// "path": "/List",
// "exact": true,
// "redirect": "/List/TableList"
// },
// {
// "path": "/List/Search",
// "exact": true,
// "redirect": "/List/Search/Articles"
// },
// {
// "path": "/Profile",
// "exact": true,
// "redirect": "/Profile/BasicProfile"
// },
// {
// "path": "/Result",
// "exact": true,
// "redirect": "/Result/Success"
// },
// {
// "path": "/Exception",
// "exact": true,
// "redirect": "/Exception/403"
// }
// ]
import React from 'react';
import React, { PureComponent } from 'react';
import { List, Card, Icon, Dropdown, Menu, Avatar, Tooltip } from 'antd';
import numeral from 'numeral';
import { connect } from 'dva';
import { formatWan } from '../../../utils/utils';
import stylesApplications from '../../List/Search/Applications.less';
import stylesApplications from '../../List/Applications.less';
export default props => {
const { list } = props;
@connect(({ list }) => ({
list,
}))
export default class Center extends PureComponent {
render() {
const {
list: { list },
} = this.props;
const itemMenu = (
<Menu>
<Menu.Item>
......@@ -75,4 +82,5 @@ export default props => {
)}
/>
);
};
}
}
import React from 'react';
import React, { PureComponent } from 'react';
import { List, Icon, Avatar, Tag } from 'antd';
import moment from 'moment';
import stylesArticles from '../../List/Search/Articles.less';
import { connect } from 'dva';
import stylesArticles from '../../List/Articles.less';
import styles from './Articles.less';
export default props => {
const { list } = props;
@connect(({ list }) => ({
list,
}))
export default class Center extends PureComponent {
render() {
const {
list: { list },
} = this.props;
const IconText = ({ type, text }) => (
<span>
<Icon type={type} style={{ marginRight: 8 }} />
......@@ -57,4 +64,5 @@ export default props => {
)}
/>
);
};
}
}
import React, { PureComponent } from 'react';
import { connect } from 'dva';
import { Link, routerRedux, Route, Switch, Redirect } from 'dva/router';
import { Link, routerRedux } from 'dva/router';
import { Card, Row, Col, Icon, Avatar, Tag, Divider, Spin, Input } from 'antd';
import { getRoutes } from '../../../utils/utils';
import GridContent from '../../layouts/GridContent';
import styles from './Center.less';
@connect(({ list, loading, user, project }) => ({
list,
@connect(({ loading, user, project }) => ({
listLoading: loading.effects['list/fetch'],
currentUser: user.currentUser,
currentUserLoading: loading.effects['user/fetchCurrent'],
......@@ -83,17 +81,15 @@ export default class Center extends PureComponent {
render() {
const { newTags, inputVisible, inputValue } = this.state;
const {
list: { list },
listLoading,
currentUser,
currentUserLoading,
project: { notice },
projectLoading,
match,
routerData,
location,
children,
} = this.props;
const routes = getRoutes(match.path, routerData);
const operationTabList = [
{
......@@ -207,18 +203,7 @@ export default class Center extends PureComponent {
onTabChange={this.onTabChange}
loading={listLoading}
>
<Switch>
{routes.map(item => (
<Route
key={item.key}
path={item.path}
render={props => <item.component {...props} list={list} />}
exact={item.exact}
/>
))}
<Redirect exact from="/account/center" to="/account/center/articles" />
<Redirect to="/exception/404" />
</Switch>
{children}
</Card>
</Col>
</Row>
......
import React from 'react';
import React, { PureComponent } from 'react';
import { List, Card } from 'antd';
import moment from 'moment';
import { connect } from 'dva';
import AvatarList from '../../../components/AvatarList';
import stylesProjects from '../../List/Search/Projects.less';
import stylesProjects from '../../List/Projects.less';
export default props => {
const { list } = props;
@connect(({ list }) => ({
list,
}))
export default class Center extends PureComponent {
render() {
const {
list: { list },
} = this.props;
return (
<List
className={stylesProjects.coverCardList}
......@@ -39,4 +46,5 @@ export default props => {
)}
/>
);
};
}
}
import React, { Component } from 'react';
import { connect } from 'dva';
import { Route, routerRedux, Switch, Redirect } from 'dva/router';
import { routerRedux } from 'dva/router';
import { Menu } from 'antd';
import styles from './Info.less';
import { getRoutes } from '../../../utils/utils';
import GridContent from '../../layouts/GridContent';
const { Item } = Menu;
......@@ -86,7 +85,7 @@ export default class Info extends Component {
};
render() {
const { match, routerData, currentUser } = this.props;
const { children, currentUser } = this.props;
if (!currentUser.userid) {
return '';
}
......@@ -106,18 +105,7 @@ export default class Info extends Component {
</div>
<div className={styles.right}>
<div className={styles.title}>{this.getRightTitle()}</div>
<Switch>
{getRoutes(match.path, routerData).map(item => (
<Route
key={item.key}
path={item.path}
render={props => <item.component {...props} currentUser={currentUser} />}
exact={item.exact}
/>
))}
<Redirect exact from="/account/settings" to="/account/settings/base" />
<Redirect to="/exception/404" />
</Switch>
{children}
</div>
</div>
</GridContent>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment