diff --git a/src/components/ActiveChart/index.js b/src/components/ActiveChart/index.js index 8d653694d27ab860d260f9bbfd72f4d1d9a4a528..4976be31f225751f6d8cfb77b861f24dbe120761 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 b1a3b1604e52fa79c6a419fe1516fe263a80d51d..8463ec13c16766be8b4586f2955d474181fa9fa4 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 09d2d01917c3fc8d135eaf4ade70c609f881e71c..b081ba03d735ebe15120e9fa5a78248f0d2da608 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 102ad38451c11ab72b36768be60d1e2ec06b36c9..62f8ccebefe899371f39e0419cc3f82d514fafc9 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 fcf42ce70454be04c4dbcc9bbaa0e622483babc7..c948895380774780d74c57af37e227215e2d4320 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 79235f948be94dd19c92af9f95be7059ec1726ef..433313f59c511acfb8d198e796b3978c9f6ab520 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 4758edaaa0a1611beb9ab8adf225202445f41468..0000000000000000000000000000000000000000 --- 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 25948912b62f33f71f2ccbec1cea3668cefe827f..4143571a83d00cd0b6a1497e46692cf90c0bbe62 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 415e95574b059a85ba89116446f6f72620e34bdd..26e5e90ef09c4d15ad1682f023c0984c630f9bf5 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 */