From 20c01e08b277c3988b9389ea21798b6a261e1a9a Mon Sep 17 00:00:00 2001 From: xiaohu <448627663@qq.com> Date: Sat, 7 Jul 2018 15:11:52 +0800 Subject: [PATCH] 1.add list search layout --- src/pages/Account/Center/Applications.js | 2 +- src/pages/Account/Center/Articles.js | 2 +- src/pages/Account/Center/Projects.js | 2 +- src/pages/List/{ => Search}/Applications.js | 2 +- src/pages/List/{ => Search}/Applications.less | 2 +- src/pages/List/{ => Search}/Articles.js | 0 src/pages/List/{ => Search}/Articles.less | 2 +- src/pages/List/{ => Search}/Projects.js | 0 src/pages/List/{ => Search}/Projects.less | 2 +- src/pages/List/{List.js => Search/_layout.js} | 31 +++++++++---------- 10 files changed, 22 insertions(+), 23 deletions(-) rename src/pages/List/{ => Search}/Applications.js (99%) rename src/pages/List/{ => Search}/Applications.less (95%) rename src/pages/List/{ => Search}/Articles.js (100%) rename src/pages/List/{ => Search}/Articles.less (96%) rename src/pages/List/{ => Search}/Projects.js (100%) rename src/pages/List/{ => Search}/Projects.less (96%) rename src/pages/List/{List.js => Search/_layout.js} (65%) diff --git a/src/pages/Account/Center/Applications.js b/src/pages/Account/Center/Applications.js index 3c32f8f3..865c1ef7 100644 --- a/src/pages/Account/Center/Applications.js +++ b/src/pages/Account/Center/Applications.js @@ -2,7 +2,7 @@ import React from 'react'; import { List, Card, Icon, Dropdown, Menu, Avatar, Tooltip } from 'antd'; import numeral from 'numeral'; import { formatWan } from '../../../utils/utils'; -import stylesApplications from '../../List/Applications.less'; +import stylesApplications from '../../List/Search/Applications.less'; export default props => { const { list } = props; diff --git a/src/pages/Account/Center/Articles.js b/src/pages/Account/Center/Articles.js index 67964138..fbea8b7b 100644 --- a/src/pages/Account/Center/Articles.js +++ b/src/pages/Account/Center/Articles.js @@ -1,7 +1,7 @@ import React from 'react'; import { List, Icon, Avatar, Tag } from 'antd'; import moment from 'moment'; -import stylesArticles from '../../List/Articles.less'; +import stylesArticles from '../../List/Search/Articles.less'; import styles from './Articles.less'; export default props => { diff --git a/src/pages/Account/Center/Projects.js b/src/pages/Account/Center/Projects.js index 37c1ae5b..a50ac327 100644 --- a/src/pages/Account/Center/Projects.js +++ b/src/pages/Account/Center/Projects.js @@ -2,7 +2,7 @@ import React from 'react'; import { List, Card } from 'antd'; import moment from 'moment'; import AvatarList from '../../../components/AvatarList'; -import stylesProjects from '../../List/Projects.less'; +import stylesProjects from '../../List/Search/Projects.less'; export default props => { const { list } = props; diff --git a/src/pages/List/Applications.js b/src/pages/List/Search/Applications.js similarity index 99% rename from src/pages/List/Applications.js rename to src/pages/List/Search/Applications.js index 1503c6f4..650f4529 100644 --- a/src/pages/List/Applications.js +++ b/src/pages/List/Search/Applications.js @@ -5,7 +5,7 @@ import { Row, Col, Form, Card, Select, Icon, Avatar, List, Tooltip, Dropdown, Me import TagSelect from 'components/TagSelect'; import StandardFormRow from 'components/StandardFormRow'; -import { formatWan } from '../../utils/utils'; +import { formatWan } from '../../../utils/utils'; import styles from './Applications.less'; diff --git a/src/pages/List/Applications.less b/src/pages/List/Search/Applications.less similarity index 95% rename from src/pages/List/Applications.less rename to src/pages/List/Search/Applications.less index ba6cfa79..c0ca31a4 100644 --- a/src/pages/List/Applications.less +++ b/src/pages/List/Search/Applications.less @@ -1,5 +1,5 @@ @import '~antd/lib/style/themes/default.less'; -@import '../../utils/utils.less'; +@import '../../../utils/utils.less'; .filterCardList { margin-bottom: -24px; diff --git a/src/pages/List/Articles.js b/src/pages/List/Search/Articles.js similarity index 100% rename from src/pages/List/Articles.js rename to src/pages/List/Search/Articles.js diff --git a/src/pages/List/Articles.less b/src/pages/List/Search/Articles.less similarity index 96% rename from src/pages/List/Articles.less rename to src/pages/List/Search/Articles.less index 364063a3..e357f4a6 100644 --- a/src/pages/List/Articles.less +++ b/src/pages/List/Search/Articles.less @@ -1,5 +1,5 @@ @import '~antd/lib/style/themes/default.less'; -@import '../../utils/utils.less'; +@import '../../../utils/utils.less'; .listContent { .description { diff --git a/src/pages/List/Projects.js b/src/pages/List/Search/Projects.js similarity index 100% rename from src/pages/List/Projects.js rename to src/pages/List/Search/Projects.js diff --git a/src/pages/List/Projects.less b/src/pages/List/Search/Projects.less similarity index 96% rename from src/pages/List/Projects.less rename to src/pages/List/Search/Projects.less index aeda83c1..00e50b80 100644 --- a/src/pages/List/Projects.less +++ b/src/pages/List/Search/Projects.less @@ -1,5 +1,5 @@ @import '~antd/lib/style/themes/default.less'; -@import '../../utils/utils.less'; +@import '../../../utils/utils.less'; .coverCardList { margin-bottom: -24px; diff --git a/src/pages/List/List.js b/src/pages/List/Search/_layout.js similarity index 65% rename from src/pages/List/List.js rename to src/pages/List/Search/_layout.js index 6dbf62f8..0290d059 100644 --- a/src/pages/List/List.js +++ b/src/pages/List/Search/_layout.js @@ -1,23 +1,22 @@ import React, { Component } from 'react'; -import { routerRedux, Route, Switch } from 'dva/router'; +import { routerRedux } from 'dva/router'; import { connect } from 'dva'; import { Input } from 'antd'; -import PageHeaderLayout from '../../layouts/PageHeaderLayout'; -import { getRoutes } from '../../utils/utils'; +import PageHeaderLayout from '../../../layouts/PageHeaderLayout'; @connect() export default class SearchList extends Component { handleTabChange = key => { const { dispatch, match } = this.props; switch (key) { - case 'articles': - dispatch(routerRedux.push(`${match.url}/articles`)); + case 'Articles': + dispatch(routerRedux.push(`${match.url}/Articles`)); break; - case 'applications': - dispatch(routerRedux.push(`${match.url}/applications`)); + case 'Applications': + dispatch(routerRedux.push(`${match.url}/Applications`)); break; - case 'projects': - dispatch(routerRedux.push(`${match.url}/projects`)); + case 'Projects': + dispatch(routerRedux.push(`${match.url}/Projects`)); break; default: break; @@ -27,15 +26,15 @@ export default class SearchList extends Component { render() { const tabList = [ { - key: 'articles', + key: 'Articles', tab: '文章', }, { - key: 'applications', + key: 'Applications', tab: '应用', }, { - key: 'projects', + key: 'Projects', tab: '项目', }, ]; @@ -52,8 +51,7 @@ export default class SearchList extends Component { ); - const { match, routerData, location } = this.props; - const routes = getRoutes(match.path, routerData); + const { match, children, location } = this.props; return ( - + {children} + {/* {routes.map(item => ( ))} - + */} ); } -- GitLab