diff --git a/AccountCenter/.umirc.js b/AccountCenter/.umirc.js deleted file mode 100644 index 6f5bf0564d9bd0bd2952b8c733821edae8d6c4f8..0000000000000000000000000000000000000000 --- a/AccountCenter/.umirc.js +++ /dev/null @@ -1,13 +0,0 @@ -export default { - plugins: [ - ['umi-plugin-block-dev', { layout: 'ant-design-pro' }], - [ - 'umi-plugin-react', - { - dva: true, - locale: true, - antd: true, - }, - ], - ], -}; diff --git a/AccountCenter/src/model.ts b/AccountCenter/src/model.ts index 2cbf4a3fc33c3cd87ee144cd5893d3d54a45880a..37454d35fb3be454934ae1a3626ccbb141abe474 100644 --- a/AccountCenter/src/model.ts +++ b/AccountCenter/src/model.ts @@ -22,7 +22,7 @@ export default { call, put, }: { - call: callType>; + call: callType>; put: Dispatch; } ) { diff --git a/AccountSettings/.umirc.js b/AccountSettings/.umirc.js deleted file mode 100644 index 70ab1e9b79813e2a091d036d763edc262cdf23bf..0000000000000000000000000000000000000000 --- a/AccountSettings/.umirc.js +++ /dev/null @@ -1,18 +0,0 @@ -export default { - plugins: [ - [ - 'umi-plugin-block-dev', - { - layout: 'ant-design-pro', - }, - ], - [ - 'umi-plugin-react', - { - dva: true, - locale: true, - antd: true, - }, - ], - ], -}; diff --git a/AccountSettings/jsconfig.json b/AccountSettings/jsconfig.json deleted file mode 100644 index f87334d482029d82509ddb6c0dab5ab62236cd15..0000000000000000000000000000000000000000 --- a/AccountSettings/jsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "baseUrl": ".", - "paths": { - "@/*": ["./src/*"] - } - } -} diff --git a/AccountSettings/src/_mock.js b/AccountSettings/src/_mock.ts similarity index 87% rename from AccountSettings/src/_mock.js rename to AccountSettings/src/_mock.ts index 6533a3386ea3930d739fe63e381562ef4397ae4c..6612cabf13402d1003961ab5a26b0d65709d9a64 100644 --- a/AccountSettings/src/_mock.js +++ b/AccountSettings/src/_mock.ts @@ -1,11 +1,14 @@ import city from './geographic/city.json'; import province from './geographic/province.json'; -function getProvince(req, res) { +function getProvince(req: any, res: { json: (arg0: { name: string; id: string }[]) => void }) { return res.json(province); } -function getCity(req, res) { +function getCity( + req: { params: { province: string | number } }, + res: { json: (arg: any) => void } +) { return res.json(city[req.params.province]); } // 代码中会兼容本地 service mock 以及部署站点的静态数据 diff --git a/AccountSettings/src/components/GeographicView.js b/AccountSettings/src/components/GeographicView.tsx similarity index 51% rename from AccountSettings/src/components/GeographicView.js rename to AccountSettings/src/components/GeographicView.tsx index c5274b7c894d9edb52298219c35126a26357561c..a5a5e4a378c0cf6799f0dc75f2635350352c93b9 100644 --- a/AccountSettings/src/components/GeographicView.js +++ b/AccountSettings/src/components/GeographicView.tsx @@ -1,53 +1,89 @@ -import React, { PureComponent } from 'react'; +import React, { Component } from 'react'; import { Select, Spin } from 'antd'; import { connect } from 'dva'; import styles from './GeographicView.less'; - +import { Dispatch } from 'redux'; +import { ProvinceData, CityData } from '../data'; const { Option } = Select; -const nullSlectItem = { +interface SelectItem { + label: string; + key: string; +} +const nullSlectItem: SelectItem = { label: '', key: '', }; -@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => { - const { province, city } = BLOCK_NAME_CAMEL_CASE; - return { - province, - city, - loading: loading.models.BLOCK_NAME_CAMEL_CASE, +interface GeographicViewProps { + dispatch?: Dispatch; + province?: ProvinceData[]; + city?: CityData[]; + value?: { + province: SelectItem; + city: SelectItem; }; -}) -class GeographicView extends PureComponent { + loading?: boolean; + onChange?: (value: { province: SelectItem; city: SelectItem }) => void; +} + +@connect( + ({ + BLOCK_NAME_CAMEL_CASE, + loading, + }: { + BLOCK_NAME_CAMEL_CASE: { + province: ProvinceData[]; + city: CityData[]; + }; + loading: any; + }) => { + const { province, city } = BLOCK_NAME_CAMEL_CASE; + return { + province, + city, + loading: loading.models.BLOCK_NAME_CAMEL_CASE, + }; + } +) +class GeographicView extends Component { componentDidMount = () => { const { dispatch } = this.props; - dispatch({ - type: 'BLOCK_NAME_CAMEL_CASE/fetchProvince', - }); + dispatch && + dispatch({ + type: 'BLOCK_NAME_CAMEL_CASE/fetchProvince', + }); }; - componentDidUpdate(props) { + componentDidUpdate(props: GeographicViewProps) { const { dispatch, value } = this.props; if (!props.value && !!value && !!value.province) { - dispatch({ - type: 'BLOCK_NAME_CAMEL_CASE/fetchCity', - payload: value.province.key, - }); + dispatch && + dispatch({ + type: 'BLOCK_NAME_CAMEL_CASE/fetchCity', + payload: value.province.key, + }); } } getProvinceOption() { const { province } = this.props; - return this.getOption(province); + if (province) { + return this.getOption(province); + } + return []; } getCityOption = () => { const { city } = this.props; - return this.getOption(city); + if (city) { + return this.getOption(city); + } + return []; }; - getOption = list => { + getOption = (list: CityData[] | ProvinceData[]) => { if (!list || list.length < 1) { return ( ); } - return list.map(item => ( + return (list as CityData[]).map(item => ( )); }; - selectProvinceItem = item => { + selectProvinceItem = (item: SelectItem) => { const { dispatch, onChange } = this.props; - dispatch({ - type: 'BLOCK_NAME_CAMEL_CASE/fetchCity', - payload: item.key, - }); - onChange({ - province: item, - city: nullSlectItem, - }); + + dispatch && + dispatch({ + type: 'BLOCK_NAME_CAMEL_CASE/fetchCity', + payload: item.key, + }); + + onChange && + onChange({ + province: item, + city: nullSlectItem, + }); }; - selectCityItem = item => { + selectCityItem = (item: SelectItem) => { const { value, onChange } = this.props; - onChange({ - province: value.province, - city: item, - }); + if (value && onChange) { + onChange({ + province: value.province, + city: item, + }); + } }; conversionObject() { diff --git a/AccountSettings/src/components/PhoneView.js b/AccountSettings/src/components/PhoneView.tsx similarity index 69% rename from AccountSettings/src/components/PhoneView.js rename to AccountSettings/src/components/PhoneView.tsx index 2665527642409007a28ea61ab2db0dc46938f629..c48358c2d87bcd8cc5bf13278ff32ec048c295af 100644 --- a/AccountSettings/src/components/PhoneView.js +++ b/AccountSettings/src/components/PhoneView.tsx @@ -2,7 +2,12 @@ import React, { Fragment, PureComponent } from 'react'; import { Input } from 'antd'; import styles from './PhoneView.less'; -class PhoneView extends PureComponent { +interface PhoneViewProps { + value?: string; + onChange?: (value: string) => void; +} + +class PhoneView extends PureComponent { render() { const { value, onChange } = this.props; let values = ['', '']; @@ -15,13 +20,13 @@ class PhoneView extends PureComponent { className={styles.area_code} value={values[0]} onChange={e => { - onChange(`${e.target.value}-${values[1]}`); + onChange && onChange(`${e.target.value}-${values[1]}`); }} /> { - onChange(`${values[0]}-${e.target.value}`); + onChange && onChange(`${values[0]}-${e.target.value}`); }} value={values[1]} /> diff --git a/AccountSettings/src/components/base.js b/AccountSettings/src/components/base.tsx similarity index 85% rename from AccountSettings/src/components/base.js rename to AccountSettings/src/components/base.tsx index 8576451595e904601f3af586137da2908018e078..f9e663b8b06a49cc0f3c87e62515db51c34bcd49 100644 --- a/AccountSettings/src/components/base.js +++ b/AccountSettings/src/components/base.tsx @@ -1,16 +1,17 @@ import React, { Component, Fragment } from 'react'; -import { formatMessage, FormattedMessage } from 'umi/locale'; +import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import { Form, Input, Upload, Select, Button } from 'antd'; +import { FormComponentProps } from 'antd/lib/form'; import { connect } from 'dva'; import styles from './BaseView.less'; import GeographicView from './GeographicView'; import PhoneView from './PhoneView'; - +import { CurrentUser } from '../data'; const FormItem = Form.Item; const { Option } = Select; // 头像组件 方便以后独立,增加裁剪之类的功能 -const AvatarView = ({ avatar }) => ( +const AvatarView = ({ avatar }: { avatar: string }) => (
@@ -27,8 +28,19 @@ const AvatarView = ({ avatar }) => ( ); +interface SelectItem { + label: string; + key: string; +} -const validatorGeographic = (rule, value, callback) => { +const validatorGeographic = ( + _: any, + value: { + province: SelectItem; + city: SelectItem; + }, + callback: (message?: string) => void +) => { const { province, city } = value; if (!province.key) { callback('Please input your province!'); @@ -39,7 +51,7 @@ const validatorGeographic = (rule, value, callback) => { callback(); }; -const validatorPhone = (rule, value, callback) => { +const validatorPhone = (rule: any, value: string, callback: (message?: string) => void) => { const values = value.split('-'); if (!values[0]) { callback('Please input your area code!'); @@ -50,11 +62,14 @@ const validatorPhone = (rule, value, callback) => { callback(); }; -@connect(({ BLOCK_NAME_CAMEL_CASE }) => ({ +interface BaseViewProps extends FormComponentProps { + currentUser: CurrentUser; +} + +@connect(({ BLOCK_NAME_CAMEL_CASE }: { BLOCK_NAME_CAMEL_CASE: { currentUser: CurrentUser } }) => ({ currentUser: BLOCK_NAME_CAMEL_CASE.currentUser, })) -@Form.create() -class BaseView extends Component { +class BaseView extends Component { componentDidMount() { this.setBaseInfo(); } @@ -76,8 +91,9 @@ class BaseView extends Component { const url = 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png'; return url; } + view: HTMLDivElement | undefined; - getViewDom = ref => { + getViewDom = (ref: HTMLDivElement) => { this.view = ref; }; @@ -88,7 +104,7 @@ class BaseView extends Component { return (
-
+ {getFieldDecorator('email', { rules: [ @@ -185,4 +201,4 @@ class BaseView extends Component { } } -export default BaseView; +export default Form.create()(BaseView); diff --git a/AccountSettings/src/components/binding.js b/AccountSettings/src/components/binding.tsx similarity index 95% rename from AccountSettings/src/components/binding.js rename to AccountSettings/src/components/binding.tsx index c95eca62ab0a200b78bcf0cb3a043dfc808ebde5..d78a765cbfa3cb1ab2ffdc85ef2752d1a4d64d7e 100644 --- a/AccountSettings/src/components/binding.js +++ b/AccountSettings/src/components/binding.tsx @@ -1,5 +1,5 @@ import React, { Component, Fragment } from 'react'; -import { formatMessage, FormattedMessage } from 'umi/locale'; +import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import { Icon, List } from 'antd'; class BindingView extends Component { diff --git a/AccountSettings/src/components/notification.js b/AccountSettings/src/components/notification.tsx similarity index 87% rename from AccountSettings/src/components/notification.js rename to AccountSettings/src/components/notification.tsx index b61eac3e68bd65000fe3043c8c2c70bb79da2227..e06f54d66e06a6faa8f3f547eb7a92b66f8a3b96 100644 --- a/AccountSettings/src/components/notification.js +++ b/AccountSettings/src/components/notification.tsx @@ -1,7 +1,9 @@ import React, { Component, Fragment } from 'react'; -import { formatMessage } from 'umi/locale'; +import { formatMessage } from 'umi-plugin-react/locale'; import { Switch, List } from 'antd'; +type Unpacked = T extends (infer U)[] ? U : T; + class NotificationView extends Component { getData = () => { const Action = ( @@ -31,11 +33,12 @@ class NotificationView extends Component { }; render() { + const data = this.getData(); return ( - > itemLayout="horizontal" - dataSource={this.getData()} + dataSource={data} renderItem={item => ( diff --git a/AccountSettings/src/components/security.js b/AccountSettings/src/components/security.tsx similarity index 88% rename from AccountSettings/src/components/security.js rename to AccountSettings/src/components/security.tsx index 96685c0fb911c20d2e73a644fd7aa3f82d1ebe3d..6a15f41233e1bc18af2768221f0024c09904f977 100644 --- a/AccountSettings/src/components/security.js +++ b/AccountSettings/src/components/security.tsx @@ -1,24 +1,25 @@ import React, { Component, Fragment } from 'react'; -import { formatMessage, FormattedMessage } from 'umi/locale'; +import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import { List } from 'antd'; -// import { getTimeDistance } from '@/utils/utils'; + +type Unpacked = T extends (infer U)[] ? U : T; const passwordStrength = { strong: ( - + - + ), medium: ( - + - + ), weak: ( - + Weak - + ), }; @@ -83,11 +84,12 @@ class SecurityView extends Component { ]; render() { + const data = this.getData(); return ( - > itemLayout="horizontal" - dataSource={this.getData()} + dataSource={data} renderItem={item => ( diff --git a/AccountSettings/src/data.d.ts b/AccountSettings/src/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..afc53e51ebfbd1b421729d5cc9a0e384c3377fe0 --- /dev/null +++ b/AccountSettings/src/data.d.ts @@ -0,0 +1,56 @@ +export interface ITag { + key: string; + label: string; +} + +export interface Province { + label: string; + key: string; +} + +export interface City { + label: string; + key: string; +} + +export interface Geographic { + province: Province; + city: City; +} +export interface ProvinceData { + name: string; + id: string; +} +export interface CityData { + province: string; + name: string; + id: string; +} +export interface Notice { + id: string; + title: string; + logo: string; + description: string; + updatedAt: string; + member: string; + href: string; + memberLink: string; +} + +export interface CurrentUser { + name: string; + avatar: string; + userid: string; + notice: Notice[]; + email: string; + signature: string; + title: string; + group: string; + tags: ITag[]; + notifyCount: number; + unreadCount: number; + country: string; + geographic: Geographic; + address: string; + phone: string; +} diff --git a/AccountSettings/src/index.js b/AccountSettings/src/index.tsx similarity index 98% rename from AccountSettings/src/index.js rename to AccountSettings/src/index.tsx index 32985cfec461b82e1e85c134a9a03ece7d4e75b3..52e91652b8903a5e3ef0ca667aeb014091600ac7 100644 --- a/AccountSettings/src/index.js +++ b/AccountSettings/src/index.tsx @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { connect } from 'dva'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import { Menu } from 'antd'; import styles from './style.less'; import BaseView from './components/base'; diff --git a/AccountSettings/src/locales/en-US.js b/AccountSettings/src/locales/en-US.ts similarity index 100% rename from AccountSettings/src/locales/en-US.js rename to AccountSettings/src/locales/en-US.ts diff --git a/AccountSettings/src/locales/zh-CN.js b/AccountSettings/src/locales/zh-CN.ts similarity index 100% rename from AccountSettings/src/locales/zh-CN.js rename to AccountSettings/src/locales/zh-CN.ts diff --git a/AccountSettings/src/locales/zh-TW.js b/AccountSettings/src/locales/zh-TW.ts similarity index 100% rename from AccountSettings/src/locales/zh-TW.js rename to AccountSettings/src/locales/zh-TW.ts diff --git a/AccountSettings/src/model.js b/AccountSettings/src/model.ts similarity index 100% rename from AccountSettings/src/model.js rename to AccountSettings/src/model.ts diff --git a/AccountSettings/src/service.js b/AccountSettings/src/service.ts similarity index 87% rename from AccountSettings/src/service.js rename to AccountSettings/src/service.ts index 104bb1e95faf1c80935bdcf42af0807c2e3304e0..309f0665c75510e0032da3da193f262544da7c9f 100644 --- a/AccountSettings/src/service.js +++ b/AccountSettings/src/service.ts @@ -8,7 +8,7 @@ export async function queryProvince() { return request('/api/BLOCK_NAME/province'); } -export async function queryCity(province) { +export async function queryCity(province: string) { return request(`/api/BLOCK_NAME/city/${province}`); } diff --git a/AdvancedForm/src/components/PageHeaderWrapper/index.js b/AdvancedForm/src/components/PageHeaderWrapper/index.js index c11873f2c8c24d44391261910d5adb52ab916d1a..1a40e25dfdc97a4e69407cbf1516e15ad65bd00b 100644 --- a/AdvancedForm/src/components/PageHeaderWrapper/index.js +++ b/AdvancedForm/src/components/PageHeaderWrapper/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; import { PageHeader } from 'ant-design-pro'; import styles from './index.less'; diff --git a/AdvancedProfile/src/components/PageHeaderWrapper/index.js b/AdvancedProfile/src/components/PageHeaderWrapper/index.js index 165ae2524640af9bfb6a72e918852e8e60480fc7..9e839c45ffc1a3f170a4034441324e69d7cf717b 100644 --- a/AdvancedProfile/src/components/PageHeaderWrapper/index.js +++ b/AdvancedProfile/src/components/PageHeaderWrapper/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; import { PageHeader } from 'ant-design-pro'; import styles from './index.less'; diff --git a/Analysis/src/components/IntroduceRow.js b/Analysis/src/components/IntroduceRow.js index 1485c41727642172b7897039bd5f120f4f8f1de3..720c40f89c48326ac96e06c7be4ac8398db6de10 100755 --- a/Analysis/src/components/IntroduceRow.js +++ b/Analysis/src/components/IntroduceRow.js @@ -1,6 +1,6 @@ import React, { memo } from 'react'; import { Row, Col, Icon, Tooltip } from 'antd'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import { Charts, Trend } from 'ant-design-pro'; import numeral from 'numeral'; import styles from '../style.less'; diff --git a/Analysis/src/components/OfflineData.js b/Analysis/src/components/OfflineData.js index 44a75d3c52776b172c160dc13d5a2db0eb041a7c..bac3d62d050aea7d3ea9f985ac079d8b2947ac19 100755 --- a/Analysis/src/components/OfflineData.js +++ b/Analysis/src/components/OfflineData.js @@ -1,6 +1,6 @@ import React, { memo } from 'react'; import { Card, Tabs, Row, Col } from 'antd'; -import { formatMessage, FormattedMessage } from 'umi/locale'; +import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import { Charts, NumberInfo } from 'ant-design-pro'; import styles from '../style.less'; diff --git a/Analysis/src/components/ProportionSales.js b/Analysis/src/components/ProportionSales.js index 51d44be2070a1fa9c332dd90fd12766b5df15747..6c5a89f69afd3d5e79d3526024b1c9a10acc4170 100755 --- a/Analysis/src/components/ProportionSales.js +++ b/Analysis/src/components/ProportionSales.js @@ -1,7 +1,7 @@ import React, { memo } from 'react'; import { Card, Radio } from 'antd'; import { Charts } from 'ant-design-pro'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import styles from '../style.less'; import Yuan from '../utils/Yuan'; diff --git a/Analysis/src/components/SalesCard.js b/Analysis/src/components/SalesCard.js index 893314eb075fb6511ad8233e366d94054bbaa592..0121e794b3a3aff855fec5dcc5a98dd04587302f 100755 --- a/Analysis/src/components/SalesCard.js +++ b/Analysis/src/components/SalesCard.js @@ -1,6 +1,6 @@ import React, { memo } from 'react'; import { Row, Col, Card, Tabs, DatePicker } from 'antd'; -import { FormattedMessage, formatMessage } from 'umi/locale'; +import { FormattedMessage, formatMessage } from 'umi-plugin-react/locale'; import numeral from 'numeral'; import { Charts } from 'ant-design-pro'; import styles from '../style.less'; diff --git a/Analysis/src/components/TopSearch.js b/Analysis/src/components/TopSearch.js index faf7f5572fdf5dfd55cfd6a1d1cc459975ccee44..4e19176cb9103b6e19271952ed37efe7bf08bf8f 100755 --- a/Analysis/src/components/TopSearch.js +++ b/Analysis/src/components/TopSearch.js @@ -1,6 +1,6 @@ import React, { memo } from 'react'; import { Row, Col, Table, Tooltip, Card, Icon } from 'antd'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import { Trend, NumberInfo, Charts } from 'ant-design-pro'; import numeral from 'numeral'; import styles from '../style.less'; diff --git a/BasicForm/src/components/PageHeaderWrapper/index.js b/BasicForm/src/components/PageHeaderWrapper/index.js index c11873f2c8c24d44391261910d5adb52ab916d1a..1a40e25dfdc97a4e69407cbf1516e15ad65bd00b 100644 --- a/BasicForm/src/components/PageHeaderWrapper/index.js +++ b/BasicForm/src/components/PageHeaderWrapper/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; import { PageHeader } from 'ant-design-pro'; import styles from './index.less'; diff --git a/BasicForm/src/index.js b/BasicForm/src/index.js index 69235e575cf50740a27d16fa54563e65921d4a05..a140e9bea61384cfedf9209ba72205f4d0883179 100644 --- a/BasicForm/src/index.js +++ b/BasicForm/src/index.js @@ -1,6 +1,6 @@ import React, { PureComponent } from 'react'; import { connect } from 'dva'; -import { formatMessage, FormattedMessage } from 'umi/locale'; +import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import { Form, Input, diff --git a/BasicList/src/index.js b/BasicList/src/index.js index d75d6e4d27e02e722eca53815772f6708a5bc2ed..054d96361422fb21cb505f0179045ad673d4efcc 100644 --- a/BasicList/src/index.js +++ b/BasicList/src/index.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import { findDOMNode } from 'react-dom'; import moment from 'moment'; import { connect } from 'dva'; diff --git a/BasicProfile/src/components/PageHeaderWrapper/index.js b/BasicProfile/src/components/PageHeaderWrapper/index.js index 165ae2524640af9bfb6a72e918852e8e60480fc7..9e839c45ffc1a3f170a4034441324e69d7cf717b 100644 --- a/BasicProfile/src/components/PageHeaderWrapper/index.js +++ b/BasicProfile/src/components/PageHeaderWrapper/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; import { PageHeader } from 'ant-design-pro'; import styles from './index.less'; diff --git a/CardList/src/components/PageHeaderWrapper/index.js b/CardList/src/components/PageHeaderWrapper/index.js index c11873f2c8c24d44391261910d5adb52ab916d1a..1a40e25dfdc97a4e69407cbf1516e15ad65bd00b 100644 --- a/CardList/src/components/PageHeaderWrapper/index.js +++ b/CardList/src/components/PageHeaderWrapper/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; import { PageHeader } from 'ant-design-pro'; import styles from './index.less'; diff --git a/Monitor/src/index.js b/Monitor/src/index.js index cd48ebb72c862a6646386739b302d5916762e37d..35b18fb4a9f875bc022e8c997dcb0c08c5061c17 100644 --- a/Monitor/src/index.js +++ b/Monitor/src/index.js @@ -1,6 +1,6 @@ import React, { PureComponent } from 'react'; import { connect } from 'dva'; -import { formatMessage, FormattedMessage } from 'umi/locale'; +import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import { Row, Col, Card, Tooltip } from 'antd'; import { NumberInfo, Charts } from 'ant-design-pro'; import CountDown from 'ant-design-pro/lib/CountDown'; diff --git a/ResultFail/src/index.js b/ResultFail/src/index.js index 6077ce97a313ef40cdddd83647010a52e4a9669a..e5b77eb282ad6f6d46bdad2ccfe6e05b696e05d1 100644 --- a/ResultFail/src/index.js +++ b/ResultFail/src/index.js @@ -1,5 +1,5 @@ import React, { Fragment } from 'react'; -import { formatMessage, FormattedMessage } from 'umi/locale'; +import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import { Button, Icon, Card } from 'antd'; import { Result } from 'ant-design-pro'; diff --git a/ResultSuccess/src/index.js b/ResultSuccess/src/index.js index 615be18115f8fcb978c9a47989e98c069984e729..a15594e2fb761f7e59cd8f3db6194bebc8d93680 100644 --- a/ResultSuccess/src/index.js +++ b/ResultSuccess/src/index.js @@ -1,5 +1,5 @@ import React, { Fragment } from 'react'; -import { formatMessage, FormattedMessage } from 'umi/locale'; +import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import { Button, Row, Col, Icon, Steps, Card } from 'antd'; import { Result } from 'ant-design-pro'; diff --git a/SearchListApplications/src/components/PageHeaderWrapper/index.js b/SearchListApplications/src/components/PageHeaderWrapper/index.js index c11873f2c8c24d44391261910d5adb52ab916d1a..1a40e25dfdc97a4e69407cbf1516e15ad65bd00b 100644 --- a/SearchListApplications/src/components/PageHeaderWrapper/index.js +++ b/SearchListApplications/src/components/PageHeaderWrapper/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; import { PageHeader } from 'ant-design-pro'; import styles from './index.less'; diff --git a/SearchListArticles/src/components/PageHeaderWrapper/index.js b/SearchListArticles/src/components/PageHeaderWrapper/index.js index c11873f2c8c24d44391261910d5adb52ab916d1a..1a40e25dfdc97a4e69407cbf1516e15ad65bd00b 100644 --- a/SearchListArticles/src/components/PageHeaderWrapper/index.js +++ b/SearchListArticles/src/components/PageHeaderWrapper/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; import { PageHeader } from 'ant-design-pro'; import styles from './index.less'; diff --git a/SearchListProjects/src/components/PageHeaderWrapper/index.js b/SearchListProjects/src/components/PageHeaderWrapper/index.js index c11873f2c8c24d44391261910d5adb52ab916d1a..1a40e25dfdc97a4e69407cbf1516e15ad65bd00b 100644 --- a/SearchListProjects/src/components/PageHeaderWrapper/index.js +++ b/SearchListProjects/src/components/PageHeaderWrapper/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; import { PageHeader } from 'ant-design-pro'; import styles from './index.less'; diff --git a/StepForm/src/components/PageHeaderWrapper/index.js b/StepForm/src/components/PageHeaderWrapper/index.js index c11873f2c8c24d44391261910d5adb52ab916d1a..1a40e25dfdc97a4e69407cbf1516e15ad65bd00b 100644 --- a/StepForm/src/components/PageHeaderWrapper/index.js +++ b/StepForm/src/components/PageHeaderWrapper/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; import { PageHeader } from 'ant-design-pro'; import styles from './index.less'; diff --git a/UserLogin/src/index.js b/UserLogin/src/index.js index 0c4480bbb8199e0ab2b70b475084995da27ff600..b255a8bac104fa697b280e1720738fc06ee5a1d2 100644 --- a/UserLogin/src/index.js +++ b/UserLogin/src/index.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { connect } from 'dva'; -import { formatMessage, FormattedMessage } from 'umi/locale'; +import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; import { Checkbox, Alert, Icon } from 'antd'; import { Login } from 'ant-design-pro'; diff --git a/UserRegister/src/index.js b/UserRegister/src/index.js index b5bcd4137550c6ec2ed2b35fb8d4a0a0ac244621..eb49b4573e58695d1a903a27bc16df959e96591b 100644 --- a/UserRegister/src/index.js +++ b/UserRegister/src/index.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { connect } from 'dva'; -import { formatMessage, FormattedMessage } from 'umi/locale'; +import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; import router from 'umi/router'; import { Form, Input, Button, Select, Row, Col, Popover, Progress } from 'antd'; diff --git a/UserRegisterResult/src/index.js b/UserRegisterResult/src/index.js index 3a3425323619a8e717b44138446b50bf26326103..9bd6306009f53711a85d54d002b0a279b28ef8f6 100644 --- a/UserRegisterResult/src/index.js +++ b/UserRegisterResult/src/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import { formatMessage, FormattedMessage } from 'umi/locale'; +import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import { Button } from 'antd'; import Link from 'umi/link'; import { Result } from 'ant-design-pro'; diff --git a/Workplace/src/components/PageHeaderWrapper/index.js b/Workplace/src/components/PageHeaderWrapper/index.js index db0daf4548eba34c349391fb3f099aea3646e841..d121b2c4994d8c5110f9ff69fd9079dddcd183dc 100644 --- a/Workplace/src/components/PageHeaderWrapper/index.js +++ b/Workplace/src/components/PageHeaderWrapper/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import { FormattedMessage } from 'umi/locale'; +import { FormattedMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; import { PageHeader } from 'ant-design-pro'; import styles from './index.less'; diff --git a/tsconfig.json b/tsconfig.json index b753726ea8aae883d8855c32f4162a9dca14308f..c9377ebce581fde074c1a4619c24e5673f6523a6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,7 @@ "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, "allowJs": true, + "resolveJsonModule": true, "experimentalDecorators": true, "strict": true, "paths": {