From d6b2123b19dfc2aa50774df2159e22d7e66239a5 Mon Sep 17 00:00:00 2001 From: sorrycc Date: Tue, 14 Aug 2018 14:18:18 +0800 Subject: [PATCH] move src/pages/layouts to src/layouts --- config/router.config.js | 6 +++--- src/{pages => }/layouts/BasicLayout.js | 8 ++++---- src/{pages => }/layouts/Footer.js | 2 +- src/{pages => }/layouts/GridContent.js | 0 src/{pages => }/layouts/GridContent.less | 0 src/{pages => }/layouts/Header.js | 6 +++--- src/{pages => }/layouts/Header.less | 0 src/{pages => }/layouts/LoadingPage.js | 2 +- src/{pages => }/layouts/MenuContext.js | 0 src/{pages => }/layouts/PageHeaderLayout.js | 0 src/{pages => }/layouts/PageHeaderLayout.less | 0 src/{pages => }/layouts/UserLayout.js | 4 ++-- src/{pages => }/layouts/UserLayout.less | 0 src/pages/Account/Center/Center.js | 2 +- src/pages/Account/Settings/Info.js | 2 +- src/pages/Dashboard/Analysis.js | 2 +- src/pages/Dashboard/Monitor.js | 2 +- src/pages/Dashboard/Workplace.js | 2 +- src/pages/Forms/AdvancedForm.js | 2 +- src/pages/Forms/BasicForm.js | 2 +- src/pages/Forms/StepForm/index.js | 2 +- src/pages/List/BasicList.js | 2 +- src/pages/List/CardList.js | 2 +- src/pages/List/List.js | 2 +- src/pages/List/TableList.js | 2 +- src/pages/Profile/AdvancedProfile.js | 2 +- src/pages/Profile/BasicProfile.js | 2 +- src/pages/Result/Error.js | 2 +- src/pages/Result/Success.js | 2 +- 29 files changed, 30 insertions(+), 30 deletions(-) rename src/{pages => }/layouts/BasicLayout.js (96%) rename src/{pages => }/layouts/Footer.js (93%) rename src/{pages => }/layouts/GridContent.js (100%) rename src/{pages => }/layouts/GridContent.less (100%) rename src/{pages => }/layouts/Header.js (95%) rename src/{pages => }/layouts/Header.less (100%) rename src/{pages => }/layouts/LoadingPage.js (97%) rename src/{pages => }/layouts/MenuContext.js (100%) rename src/{pages => }/layouts/PageHeaderLayout.js (100%) rename src/{pages => }/layouts/PageHeaderLayout.less (100%) rename src/{pages => }/layouts/UserLayout.js (94%) rename src/{pages => }/layouts/UserLayout.less (100%) diff --git a/config/router.config.js b/config/router.config.js index e67feded..763ae131 100644 --- a/config/router.config.js +++ b/config/router.config.js @@ -2,10 +2,10 @@ module.exports = [ // user { path: '/user', - component: './layouts/UserLayout', + component: '../layouts/UserLayout', routes: [ { path: '/user', redirect: '/user/login' }, - { path: '/user/login', component: '/User/Login' }, + { path: '/user/login', component: './User/Login' }, { path: '/user/register', component: './User/Register' }, { path: '/user/register-result', component: './User/RegisterResult' }, ], @@ -13,7 +13,7 @@ module.exports = [ // app { path: '/', - component: './layouts/LoadingPage', + component: '../layouts/LoadingPage', routes: [ // dashboard { path: '/', redirect: '/dashboard/analysis' }, diff --git a/src/pages/layouts/BasicLayout.js b/src/layouts/BasicLayout.js similarity index 96% rename from src/pages/layouts/BasicLayout.js rename to src/layouts/BasicLayout.js index cb2f941b..4c1596a9 100644 --- a/src/pages/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -7,10 +7,10 @@ import { ContainerQuery } from 'react-container-query'; import classNames from 'classnames'; import pathToRegexp from 'path-to-regexp'; import { formatMessage } from 'umi/locale'; -import SiderMenu from '../../components/SiderMenu'; -import Authorized from '../../utils/Authorized'; -import SettingDarwer from '../../components/SettingDarwer'; -import logo from '../../assets/logo.svg'; +import SiderMenu from '../components/SiderMenu/index'; +import Authorized from '../utils/Authorized'; +import SettingDarwer from '../components/SettingDarwer/index'; +import logo from '../assets/logo.svg'; import Footer from './Footer'; import Header from './Header'; import Context from './MenuContext'; diff --git a/src/pages/layouts/Footer.js b/src/layouts/Footer.js similarity index 93% rename from src/pages/layouts/Footer.js rename to src/layouts/Footer.js index dbb06200..e1c6e816 100644 --- a/src/pages/layouts/Footer.js +++ b/src/layouts/Footer.js @@ -1,6 +1,6 @@ import React, { Fragment } from 'react'; import { Layout, Icon } from 'antd'; -import GlobalFooter from '../../components/GlobalFooter'; +import GlobalFooter from '../components/GlobalFooter/index'; const { Footer } = Layout; const FooterView = () => ( diff --git a/src/pages/layouts/GridContent.js b/src/layouts/GridContent.js similarity index 100% rename from src/pages/layouts/GridContent.js rename to src/layouts/GridContent.js diff --git a/src/pages/layouts/GridContent.less b/src/layouts/GridContent.less similarity index 100% rename from src/pages/layouts/GridContent.less rename to src/layouts/GridContent.less diff --git a/src/pages/layouts/Header.js b/src/layouts/Header.js similarity index 95% rename from src/pages/layouts/Header.js rename to src/layouts/Header.js index f529be91..c1d0c524 100644 --- a/src/pages/layouts/Header.js +++ b/src/layouts/Header.js @@ -3,10 +3,10 @@ import { Layout, message } from 'antd'; import Animate from 'rc-animate'; import { connect } from 'dva'; import { routerRedux } from 'dva/router'; -import GlobalHeader from '../../components/GlobalHeader'; -import TopNavHeader from '../../components/TopNavHeader'; +import GlobalHeader from '../components/GlobalHeader/index'; +import TopNavHeader from '../components/TopNavHeader/index'; import styles from './Header.less'; -import Authorized from '../../utils/Authorized'; +import Authorized from '../utils/Authorized'; const { Header } = Layout; diff --git a/src/pages/layouts/Header.less b/src/layouts/Header.less similarity index 100% rename from src/pages/layouts/Header.less rename to src/layouts/Header.less diff --git a/src/pages/layouts/LoadingPage.js b/src/layouts/LoadingPage.js similarity index 97% rename from src/pages/layouts/LoadingPage.js rename to src/layouts/LoadingPage.js index 4a96dfc1..85139723 100644 --- a/src/pages/layouts/LoadingPage.js +++ b/src/layouts/LoadingPage.js @@ -4,7 +4,7 @@ import { connect } from 'dva'; import { enquireScreen, unenquireScreen } from 'enquire-js'; import BasicLayout from './BasicLayout'; // TODO: should use this.props.routes -import routerConfig from '../../../config/router.config'; +import routerConfig from '../../config/router.config'; // Conversion router to menu. function formatter(data, parentPath = '', parentAuthority, parentName) { diff --git a/src/pages/layouts/MenuContext.js b/src/layouts/MenuContext.js similarity index 100% rename from src/pages/layouts/MenuContext.js rename to src/layouts/MenuContext.js diff --git a/src/pages/layouts/PageHeaderLayout.js b/src/layouts/PageHeaderLayout.js similarity index 100% rename from src/pages/layouts/PageHeaderLayout.js rename to src/layouts/PageHeaderLayout.js diff --git a/src/pages/layouts/PageHeaderLayout.less b/src/layouts/PageHeaderLayout.less similarity index 100% rename from src/pages/layouts/PageHeaderLayout.less rename to src/layouts/PageHeaderLayout.less diff --git a/src/pages/layouts/UserLayout.js b/src/layouts/UserLayout.js similarity index 94% rename from src/pages/layouts/UserLayout.js rename to src/layouts/UserLayout.js index f281d11d..3eb766c9 100644 --- a/src/pages/layouts/UserLayout.js +++ b/src/layouts/UserLayout.js @@ -1,9 +1,9 @@ import React, { Fragment } from 'react'; import { Link } from 'dva/router'; import { Icon } from 'antd'; -import GlobalFooter from '../../components/GlobalFooter'; +import GlobalFooter from '../components/GlobalFooter/index'; import styles from './UserLayout.less'; -import logo from '../../assets/logo.svg'; +import logo from '../assets/logo.svg'; const links = [ { diff --git a/src/pages/layouts/UserLayout.less b/src/layouts/UserLayout.less similarity index 100% rename from src/pages/layouts/UserLayout.less rename to src/layouts/UserLayout.less diff --git a/src/pages/Account/Center/Center.js b/src/pages/Account/Center/Center.js index f61aff9b..9609ca3a 100644 --- a/src/pages/Account/Center/Center.js +++ b/src/pages/Account/Center/Center.js @@ -2,7 +2,7 @@ import React, { PureComponent } from 'react'; import { connect } from 'dva'; import { Link, routerRedux } from 'dva/router'; import { Card, Row, Col, Icon, Avatar, Tag, Divider, Spin, Input } from 'antd'; -import GridContent from '../../layouts/GridContent'; +import GridContent from '../../../layouts/GridContent'; import styles from './Center.less'; @connect(({ loading, user, project }) => ({ diff --git a/src/pages/Account/Settings/Info.js b/src/pages/Account/Settings/Info.js index 5c20298f..bf52a482 100644 --- a/src/pages/Account/Settings/Info.js +++ b/src/pages/Account/Settings/Info.js @@ -4,7 +4,7 @@ import { routerRedux } from 'dva/router'; import { FormattedMessage } from 'umi/locale'; import { Menu } from 'antd'; import styles from './Info.less'; -import GridContent from '../../layouts/GridContent'; +import GridContent from '../../../layouts/GridContent'; const { Item } = Menu; diff --git a/src/pages/Dashboard/Analysis.js b/src/pages/Dashboard/Analysis.js index 3f293396..33034b6d 100644 --- a/src/pages/Dashboard/Analysis.js +++ b/src/pages/Dashboard/Analysis.js @@ -27,7 +27,7 @@ import { import Trend from 'components/Trend'; import NumberInfo from 'components/NumberInfo'; import numeral from 'numeral'; -import GridContent from '../layouts/GridContent'; +import GridContent from '../../layouts/GridContent'; import Yuan from '../../utils/Yuan'; import { getTimeDistance } from '../../utils/utils'; diff --git a/src/pages/Dashboard/Monitor.js b/src/pages/Dashboard/Monitor.js index cbc29daf..d8f1aa0c 100644 --- a/src/pages/Dashboard/Monitor.js +++ b/src/pages/Dashboard/Monitor.js @@ -6,7 +6,7 @@ import NumberInfo from 'components/NumberInfo'; import CountDown from 'components/CountDown'; import ActiveChart from 'components/ActiveChart'; import numeral from 'numeral'; -import GridContent from '../layouts/GridContent'; +import GridContent from '../../layouts/GridContent'; import Authorized from '../../utils/Authorized'; import styles from './Monitor.less'; diff --git a/src/pages/Dashboard/Workplace.js b/src/pages/Dashboard/Workplace.js index 40851e38..91e5dd28 100644 --- a/src/pages/Dashboard/Workplace.js +++ b/src/pages/Dashboard/Workplace.js @@ -6,7 +6,7 @@ import { Row, Col, Card, List, Avatar } from 'antd'; import { Radar } from 'components/Charts'; import EditableLinkGroup from 'components/EditableLinkGroup'; -import PageHeaderLayout from '../layouts/PageHeaderLayout'; +import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import styles from './Workplace.less'; diff --git a/src/pages/Forms/AdvancedForm.js b/src/pages/Forms/AdvancedForm.js index 126d0e91..fdaa61ba 100644 --- a/src/pages/Forms/AdvancedForm.js +++ b/src/pages/Forms/AdvancedForm.js @@ -14,7 +14,7 @@ import { } from 'antd'; import { connect } from 'dva'; import FooterToolbar from 'components/FooterToolbar'; -import PageHeaderLayout from '../layouts/PageHeaderLayout'; +import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import TableForm from './TableForm'; import styles from './style.less'; diff --git a/src/pages/Forms/BasicForm.js b/src/pages/Forms/BasicForm.js index 073c7f7a..a971a33e 100644 --- a/src/pages/Forms/BasicForm.js +++ b/src/pages/Forms/BasicForm.js @@ -12,7 +12,7 @@ import { Icon, Tooltip, } from 'antd'; -import PageHeaderLayout from '../layouts/PageHeaderLayout'; +import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import styles from './style.less'; const FormItem = Form.Item; diff --git a/src/pages/Forms/StepForm/index.js b/src/pages/Forms/StepForm/index.js index 536171e7..685f3ed7 100644 --- a/src/pages/Forms/StepForm/index.js +++ b/src/pages/Forms/StepForm/index.js @@ -1,6 +1,6 @@ import React, { PureComponent, Fragment } from 'react'; import { Card, Steps } from 'antd'; -import PageHeaderLayout from '../../layouts/PageHeaderLayout'; +import PageHeaderLayout from '../../../layouts/PageHeaderLayout'; import styles from '../style.less'; // import { Route, Redirect, Switch } from 'dva/router'; diff --git a/src/pages/List/BasicList.js b/src/pages/List/BasicList.js index c0821fbb..97b8e31a 100644 --- a/src/pages/List/BasicList.js +++ b/src/pages/List/BasicList.js @@ -21,7 +21,7 @@ import { Select, } from 'antd'; -import PageHeaderLayout from '../layouts/PageHeaderLayout'; +import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import Result from '../../components/Result'; import styles from './BasicList.less'; diff --git a/src/pages/List/CardList.js b/src/pages/List/CardList.js index a35417d2..6ad863e5 100644 --- a/src/pages/List/CardList.js +++ b/src/pages/List/CardList.js @@ -3,7 +3,7 @@ import { connect } from 'dva'; import { Card, Button, Icon, List } from 'antd'; import Ellipsis from 'components/Ellipsis'; -import PageHeaderLayout from '../layouts/PageHeaderLayout'; +import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import styles from './CardList.less'; diff --git a/src/pages/List/List.js b/src/pages/List/List.js index a9f96d93..5443f5f6 100644 --- a/src/pages/List/List.js +++ b/src/pages/List/List.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { routerRedux } from 'dva/router'; import { connect } from 'dva'; import { Input } from 'antd'; -import PageHeaderLayout from '../layouts/PageHeaderLayout'; +import PageHeaderLayout from '../../layouts/PageHeaderLayout'; @connect() export default class SearchList extends Component { diff --git a/src/pages/List/TableList.js b/src/pages/List/TableList.js index f764834c..938853ac 100644 --- a/src/pages/List/TableList.js +++ b/src/pages/List/TableList.js @@ -22,7 +22,7 @@ import { Radio, } from 'antd'; import StandardTable from 'components/StandardTable'; -import PageHeaderLayout from '../layouts/PageHeaderLayout'; +import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import styles from './TableList.less'; diff --git a/src/pages/Profile/AdvancedProfile.js b/src/pages/Profile/AdvancedProfile.js index 9039609e..93d407f2 100644 --- a/src/pages/Profile/AdvancedProfile.js +++ b/src/pages/Profile/AdvancedProfile.js @@ -19,7 +19,7 @@ import { } from 'antd'; import classNames from 'classnames'; import DescriptionList from 'components/DescriptionList'; -import PageHeaderLayout from '../layouts/PageHeaderLayout'; +import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import styles from './AdvancedProfile.less'; const { Step } = Steps; diff --git a/src/pages/Profile/BasicProfile.js b/src/pages/Profile/BasicProfile.js index 10c9e14f..b226de39 100644 --- a/src/pages/Profile/BasicProfile.js +++ b/src/pages/Profile/BasicProfile.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { connect } from 'dva'; import { Card, Badge, Table, Divider } from 'antd'; import DescriptionList from 'components/DescriptionList'; -import PageHeaderLayout from '../layouts/PageHeaderLayout'; +import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import styles from './BasicProfile.less'; const { Description } = DescriptionList; diff --git a/src/pages/Result/Error.js b/src/pages/Result/Error.js index dcb37066..4ef70c6d 100644 --- a/src/pages/Result/Error.js +++ b/src/pages/Result/Error.js @@ -2,7 +2,7 @@ import React, { Fragment } from 'react'; import { formatMessage, FormattedMessage } from 'umi/locale'; import { Button, Icon, Card } from 'antd'; import Result from 'components/Result'; -import PageHeaderLayout from '../layouts/PageHeaderLayout'; +import PageHeaderLayout from '../../layouts/PageHeaderLayout'; const extra = ( diff --git a/src/pages/Result/Success.js b/src/pages/Result/Success.js index 173e01cb..7ce0c68f 100644 --- a/src/pages/Result/Success.js +++ b/src/pages/Result/Success.js @@ -2,7 +2,7 @@ import React, { Fragment } from 'react'; import { formatMessage, FormattedMessage } from 'umi/locale'; import { Button, Row, Col, Icon, Steps, Card } from 'antd'; import Result from 'components/Result'; -import PageHeaderLayout from '../layouts/PageHeaderLayout'; +import PageHeaderLayout from '../../layouts/PageHeaderLayout'; const { Step } = Steps; -- GitLab