From 93426715a3430f8caf5f8f2e16b3377ab201f814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=84=9A=E9=81=93?= Date: Thu, 13 Dec 2018 09:55:12 +0800 Subject: [PATCH] fix style import --- src/components/ActiveChart/index.js | 5 +- src/components/GlobalHeader/RightContent.js | 2 +- src/components/PageHeaderWrapper/index.js | 2 +- src/global.js | 1 - src/layouts/Footer.js | 2 +- src/layouts/UserLayout.js | 2 +- src/models/list.js | 54 --------------------- src/utils/Authorized.js | 2 +- src/utils/Yuan.js | 4 +- 9 files changed, 11 insertions(+), 63 deletions(-) delete mode 100644 src/models/list.js diff --git a/src/components/ActiveChart/index.js b/src/components/ActiveChart/index.js index 8d653694..4976be31 100644 --- a/src/components/ActiveChart/index.js +++ b/src/components/ActiveChart/index.js @@ -1,9 +1,10 @@ import React, { Component } from 'react'; -import { MiniArea } from 'ant-design-pro/lib/Charts'; -import NumberInfo from 'ant-design-pro/lib/NumberInfo'; +import { NumberInfo, Charts } from 'ant-design-pro'; import styles from './index.less'; +const { MiniArea } = Charts; + function fixedZero(val) { return val * 1 < 10 ? `0${val}` : val; } diff --git a/src/components/GlobalHeader/RightContent.js b/src/components/GlobalHeader/RightContent.js index b1a3b160..8463ec13 100644 --- a/src/components/GlobalHeader/RightContent.js +++ b/src/components/GlobalHeader/RightContent.js @@ -3,7 +3,7 @@ import { FormattedMessage, formatMessage } from 'umi/locale'; import { Spin, Tag, Menu, Icon, Avatar, Tooltip } from 'antd'; import moment from 'moment'; import groupBy from 'lodash/groupBy'; -import NoticeIcon from 'ant-design-pro/lib/NoticeIcon'; +import { NoticeIcon } from 'ant-design-pro'; import HeaderSearch from '../HeaderSearch'; import HeaderDropdown from '../HeaderDropdown'; import SelectLang from '../SelectLang'; diff --git a/src/components/PageHeaderWrapper/index.js b/src/components/PageHeaderWrapper/index.js index 09d2d019..b081ba03 100644 --- a/src/components/PageHeaderWrapper/index.js +++ b/src/components/PageHeaderWrapper/index.js @@ -1,7 +1,7 @@ import React from 'react'; import { FormattedMessage } from 'umi/locale'; import Link from 'umi/link'; -import PageHeader from 'ant-design-pro/lib/PageHeader'; +import { PageHeader } from 'ant-design-pro'; import { connect } from 'dva'; import GridContent from './GridContent'; import styles from './index.less'; diff --git a/src/global.js b/src/global.js index 102ad384..62f8cceb 100644 --- a/src/global.js +++ b/src/global.js @@ -1,7 +1,6 @@ import React from 'react'; import { notification, Button, message } from 'antd'; import { formatMessage } from 'umi/locale'; -import 'ant-design-pro/dist/ant-design-pro.css'; // Notify user if offline now window.addEventListener('sw.offline', () => { diff --git a/src/layouts/Footer.js b/src/layouts/Footer.js index fcf42ce7..c9488953 100644 --- a/src/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 'ant-design-pro/lib/GlobalFooter'; +import { GlobalFooter } from 'ant-design-pro'; const { Footer } = Layout; const FooterView = () => ( diff --git a/src/layouts/UserLayout.js b/src/layouts/UserLayout.js index 79235f94..433313f5 100644 --- a/src/layouts/UserLayout.js +++ b/src/layouts/UserLayout.js @@ -2,7 +2,7 @@ import React, { Fragment } from 'react'; import { formatMessage } from 'umi/locale'; import Link from 'umi/link'; import { Icon } from 'antd'; -import GlobalFooter from 'ant-design-pro/lib/GlobalFooter'; +import { GlobalFooter } from 'ant-design-pro'; import SelectLang from '@/components/SelectLang'; import styles from './UserLayout.less'; import logo from '../assets/logo.svg'; diff --git a/src/models/list.js b/src/models/list.js deleted file mode 100644 index 4758edaa..00000000 --- a/src/models/list.js +++ /dev/null @@ -1,54 +0,0 @@ -import { queryFakeList, removeFakeList, addFakeList, updateFakeList } from '@/services/api'; - -export default { - namespace: 'list', - - state: { - list: [], - }, - - effects: { - *fetch({ payload }, { call, put }) { - const response = yield call(queryFakeList, payload); - yield put({ - type: 'queryList', - payload: Array.isArray(response) ? response : [], - }); - }, - *appendFetch({ payload }, { call, put }) { - const response = yield call(queryFakeList, payload); - yield put({ - type: 'appendList', - payload: Array.isArray(response) ? response : [], - }); - }, - *submit({ payload }, { call, put }) { - let callback; - if (payload.id) { - callback = Object.keys(payload).length === 1 ? removeFakeList : updateFakeList; - } else { - callback = addFakeList; - } - const response = yield call(callback, payload); // post - yield put({ - type: 'queryList', - payload: response, - }); - }, - }, - - reducers: { - queryList(state, action) { - return { - ...state, - list: action.payload, - }; - }, - appendList(state, action) { - return { - ...state, - list: state.list.concat(action.payload), - }; - }, - }, -}; diff --git a/src/utils/Authorized.js b/src/utils/Authorized.js index 25948912..4143571a 100644 --- a/src/utils/Authorized.js +++ b/src/utils/Authorized.js @@ -1,4 +1,4 @@ -import RenderAuthorized from 'ant-design-pro/lib/Authorized'; +import { Authorized as RenderAuthorized } from 'ant-design-pro'; import { getAuthority } from './authority'; let Authorized = RenderAuthorized(getAuthority()); // eslint-disable-line diff --git a/src/utils/Yuan.js b/src/utils/Yuan.js index 415e9557..26e5e90e 100644 --- a/src/utils/Yuan.js +++ b/src/utils/Yuan.js @@ -1,5 +1,7 @@ import React from 'react'; -import { yuan } from 'ant-design-pro/lib/Charts'; +import { Charts } from 'ant-design-pro'; + +const { yuan } = Charts; /** * 减少使用 dangerouslySetInnerHTML */ -- GitLab