diff --git a/config/router.config.js b/config/router.config.js index e67feded581d91b6c97d6919ee1f8300ad34817d..763ae1315e4cc6fca943291ef6bb00e6a2f8a606 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 cb2f941b74f6900624d531ca5b7145e7e5281d35..4c1596a98f45d37895436f65a6ab4e3d638d50a7 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 dbb06200a47b5192b7bf125a218a7630dc32e41b..e1c6e8169893d07d96076cf0f346c244dfd4dd27 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 f529be91b407676145deb68cf10b97830b76218e..c1d0c52408e1ca72012eaef3dc0034fdab2d249f 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 4a96dfc1aeec4905abe5480927f7e345e4c30acc..85139723d4c7caaef596ad58185665183c5db602 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 f281d11db45a0e5dd45365d461614233641f0e35..3eb766c9903b2ca12d7627e241b5157085886c66 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 f61aff9bde2089d6477f251f70edc5e4a4a64ec6..9609ca3a9a82b3a6a9894137ae91c61a5682b142 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 5c20298f0715b140a3aefffd3e86699073fa0e5a..bf52a48261cbc13189c48be2b2ba511aaf548e89 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 3f29339690c9f2abdbbb7e073cc1e915ff2bb3b8..33034b6d921af11449246a1471a814eaa779a841 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 cbc29dafbf59ae15455dfb87405e4feb4789d90b..d8f1aa0c6b4c44ed52188f986881920731bec95a 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 40851e38347c39da4e2a4ced3019923c8be04b26..91e5dd28119465dd0261e5486faedb4c5bcf0d77 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 126d0e912cbbd20b21b04f650359167c85765383..fdaa61bace91afa13919efb6fcf63abd54e7821d 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 073c7f7a3c3269f2fc18f78742207ad0f91dd72a..a971a33ee01c3fe5d4c04df702a1d78998952f69 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 536171e791c73cb57f04ed136a182f890c431dea..685f3ed71ab05c35d5c13b6aac0cae62a71e501a 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 c0821fbb920d283e113d8de1f8d0e6cfb29995ec..97b8e31a0511a7afc459f22eda313feb0ad75d77 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 a35417d2f7fd1200bdfd5d35ada867eb19a54e32..6ad863e551bee2581ca581d37efe095d14164d7c 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 a9f96d93e2e63430f8393dc29e9672d38c7f4c65..5443f5f6b29ceafe3310e4cff500298ae38a6bb0 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 f764834ca9f3c9d9e3b770283b78fbf851cf3e51..938853ac663ee861092dc90a7d359fd5d3ba0da1 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 9039609e66d8d2bd7ada75be434bd2f6a61e1161..93d407f27a3732f87d238f506c78c39137ad81a2 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 10c9e14f76a14222af7228ea036f3a1760e6c9e9..b226de39becb331e3fb769618d5e7f184368a687 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 dcb37066ef0e0728f2d10c728679e99fb4668506..4ef70c6db46c5b9c72ec74108a5933a897b2bb7a 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 173e01cbc7c9bbe02a77278fb90230af6546b65f..7ce0c68f1e1007a8459e615e71b85673e4c2fecc 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;