Bläddra i källkod

fix style import

愚道 7 år sedan
förälder
incheckning
93426715a3

+ 3 - 2
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;
 }

+ 1 - 1
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';

+ 1 - 1
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';

+ 0 - 1
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', () => {

+ 1 - 1
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 = () => (

+ 1 - 1
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';

+ 0 - 54
src/models/list.js

@@ -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),
-      };
-    },
-  },
-};

+ 1 - 1
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

+ 3 - 1
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
  */