diff --git a/Exception500/.umirc.js b/.umirc.js similarity index 100% rename from Exception500/.umirc.js rename to .umirc.js diff --git a/AccountCenter/package.json b/AccountCenter/package.json index d8cd626ee453fa1ec271aeea23ef596930a38e20..6058ebff7305e1efaf8e3590e7f3a1bdd64e346f 100644 --- a/AccountCenter/package.json +++ b/AccountCenter/package.json @@ -17,8 +17,8 @@ "umi-request": "^1.0.0" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" diff --git a/AccountSettings/package.json b/AccountSettings/package.json index 8901d45c231094e654de3bd20d13725f03a245ea..54e3b9a11230ef50628d1dfb36f5a70090ef9993 100644 --- a/AccountSettings/package.json +++ b/AccountSettings/package.json @@ -17,7 +17,7 @@ "umi-request": "^1.0.0" }, "devDependencies": { - "umi": "^2.3.0-beta.1", + "umi": "^2.6.9", "umi-plugin-block-dev": "^1.0.0", "umi-plugin-react": "^1.3.0-beta.1" }, diff --git a/AccountSettings/src/components/base.js b/AccountSettings/src/components/base.js index d9a4bfd896e2617354aef3fc8acccb2c259e627c..8576451595e904601f3af586137da2908018e078 100644 --- a/AccountSettings/src/components/base.js +++ b/AccountSettings/src/components/base.js @@ -173,10 +173,7 @@ class BaseView extends Component { })()} diff --git a/AdvancedForm/package.json b/AdvancedForm/package.json index a26dc013f98971eeab36d1c4ac42957c4385ea0b..7d684e4bc9e9dc73cd799a33cc0ee5eae5d775a8 100644 --- a/AdvancedForm/package.json +++ b/AdvancedForm/package.json @@ -19,8 +19,8 @@ "umi-request": "^1.0.0" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" diff --git a/AdvancedForm/src/locales/en-US.js b/AdvancedForm/src/locales/en-US.js index 3356dda0f90eaa80e52b8bc4bd9002f62d9d4bc8..06f130b319a848ef019572468746972dbee9a7ac 100644 --- a/AdvancedForm/src/locales/en-US.js +++ b/AdvancedForm/src/locales/en-US.js @@ -46,7 +46,8 @@ export default { 'BLOCK_NAME.client.placeholder': 'Please describe your customer service, internal customers directly @ Name / job number', 'BLOCK_NAME.invites.label': 'Inviting critics', - 'BLOCK_NAME.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'BLOCK_NAME.invites.placeholder': + 'Please direct @ Name / job number, you can invite up to 5 people', 'BLOCK_NAME.weight.label': 'Weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.public.label': 'Target disclosure', diff --git a/AdvancedForm/src/locales/pt-BR.js b/AdvancedForm/src/locales/pt-BR.js index 1cc9013111adbea37ac80892f11b28d487566f72..c88bccb366065a849c6ea0a30c57f64a4a19cf85 100644 --- a/AdvancedForm/src/locales/pt-BR.js +++ b/AdvancedForm/src/locales/pt-BR.js @@ -42,7 +42,8 @@ export default { 'BLOCK_NAME.client.placeholder': 'Please describe your customer service, internal customers directly @ Name / job number', 'BLOCK_NAME.invites.label': 'Inviting critics', - 'BLOCK_NAME.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'BLOCK_NAME.invites.placeholder': + 'Please direct @ Name / job number, you can invite up to 5 people', 'BLOCK_NAME.weight.label': 'Weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.public.label': 'Target disclosure', diff --git a/AdvancedProfile/package.json b/AdvancedProfile/package.json index 65437eb63f4ea64badf6ee14032824c4ab7bc3b6..9aeeaea2596c7e71fff128e477615b03f1a8956c 100644 --- a/AdvancedProfile/package.json +++ b/AdvancedProfile/package.json @@ -20,8 +20,8 @@ "umi-request": "^1.0.0" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" diff --git a/Analysis/package.json b/Analysis/package.json index 47c8d091b5b7ced0496f773204531f4641e77f05..83afadcccb7ea8f558f95f41da48fcf1d5ebeb1a 100644 --- a/Analysis/package.json +++ b/Analysis/package.json @@ -20,8 +20,8 @@ "numeral": "^2.0.6" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.1.0" }, "license": "ISC" diff --git a/Analysis/src/components/IntroduceRow.js b/Analysis/src/components/IntroduceRow.js index bf7b2f595c879a6236e4ea1c91818aca97605e40..1485c41727642172b7897039bd5f120f4f8f1de3 100755 --- a/Analysis/src/components/IntroduceRow.js +++ b/Analysis/src/components/IntroduceRow.js @@ -22,10 +22,14 @@ const IntroduceRow = memo(({ loading, visitData }) => ( } + title={ + + } action={ } + title={ + + } > @@ -34,7 +38,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( total={() => 126560} footer={ } + label={ + + } value={`¥${numeral(12423).format('0,0')}`} /> } @@ -58,7 +64,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( title={} action={ } + title={ + + } > @@ -66,7 +74,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( total={numeral(8846).format('0,0')} footer={ } + label={ + + } value={numeral(1234).format('0,0')} /> } @@ -82,7 +92,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( title={} action={ } + title={ + + } > @@ -116,7 +128,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( } action={ } + title={ + + } > diff --git a/Analysis/src/components/OfflineData.js b/Analysis/src/components/OfflineData.js index 274c1e0d4157c373ee8e0e01f32078e1c6dc720d..44a75d3c52776b172c160dc13d5a2db0eb041a7c 100755 --- a/Analysis/src/components/OfflineData.js +++ b/Analysis/src/components/OfflineData.js @@ -12,7 +12,10 @@ const CustomTab = ({ data, currentTabKey: currentKey }) => ( + } gap={2} total={`${data.cvr * 100}%`} diff --git a/Analysis/src/components/TopSearch.js b/Analysis/src/components/TopSearch.js index 9946b2ad5763b7bcde5ddda74fa202e467660f20..faf7f5572fdf5dfd55cfd6a1d1cc459975ccee44 100755 --- a/Analysis/src/components/TopSearch.js +++ b/Analysis/src/components/TopSearch.js @@ -47,7 +47,10 @@ const TopSearch = memo(({ loading, visitData2, searchData, dropdownGroup }) => ( loading={loading} bordered={false} title={ - + } extra={dropdownGroup} style={{ marginTop: 24 }} @@ -57,9 +60,14 @@ const TopSearch = memo(({ loading, visitData2, searchData, dropdownGroup }) => ( - + } + title={ + + } > @@ -81,7 +89,9 @@ const TopSearch = memo(({ loading, visitData2, searchData, dropdownGroup }) => ( defaultMessage="Per Capita Search" /> } + title={ + + } > diff --git a/BasicForm/package.json b/BasicForm/package.json index 1f96d53fc5d3818656c3de984a31757e0a34dc2c..59a87d80581a8772e5d9afc073c9bf4db2c2f134 100644 --- a/BasicForm/package.json +++ b/BasicForm/package.json @@ -18,8 +18,8 @@ "umi-request": "^1.0.0" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" diff --git a/BasicForm/src/index.js b/BasicForm/src/index.js index bdef2fee1739adaf2cc34e920a96293d805dffd9..69235e575cf50740a27d16fa54563e65921d4a05 100644 --- a/BasicForm/src/index.js +++ b/BasicForm/src/index.js @@ -115,7 +115,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { /> )} - }> + } + > {getFieldDecorator('standard', { rules: [ { diff --git a/BasicForm/src/locales/en-US.js b/BasicForm/src/locales/en-US.js index 3356dda0f90eaa80e52b8bc4bd9002f62d9d4bc8..06f130b319a848ef019572468746972dbee9a7ac 100644 --- a/BasicForm/src/locales/en-US.js +++ b/BasicForm/src/locales/en-US.js @@ -46,7 +46,8 @@ export default { 'BLOCK_NAME.client.placeholder': 'Please describe your customer service, internal customers directly @ Name / job number', 'BLOCK_NAME.invites.label': 'Inviting critics', - 'BLOCK_NAME.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'BLOCK_NAME.invites.placeholder': + 'Please direct @ Name / job number, you can invite up to 5 people', 'BLOCK_NAME.weight.label': 'Weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.public.label': 'Target disclosure', diff --git a/BasicForm/src/locales/pt-BR.js b/BasicForm/src/locales/pt-BR.js index 1cc9013111adbea37ac80892f11b28d487566f72..c88bccb366065a849c6ea0a30c57f64a4a19cf85 100644 --- a/BasicForm/src/locales/pt-BR.js +++ b/BasicForm/src/locales/pt-BR.js @@ -42,7 +42,8 @@ export default { 'BLOCK_NAME.client.placeholder': 'Please describe your customer service, internal customers directly @ Name / job number', 'BLOCK_NAME.invites.label': 'Inviting critics', - 'BLOCK_NAME.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'BLOCK_NAME.invites.placeholder': + 'Please direct @ Name / job number, you can invite up to 5 people', 'BLOCK_NAME.weight.label': 'Weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.public.label': 'Target disclosure', diff --git a/BasicList/package.json b/BasicList/package.json index ad52c543869302affd3827224af1e1c6aba1b0a1..e236692c5b787ec4a91cc0e86240b14bfcfb3be0 100644 --- a/BasicList/package.json +++ b/BasicList/package.json @@ -21,8 +21,8 @@ "umi-request": "^1.0.0" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" diff --git a/BasicProfile/package.json b/BasicProfile/package.json index 36c6d2201de8ec6fc63f558420537fbd1d84bb40..ed1a15ed684e7e437628381337c970bc0780eb4a 100644 --- a/BasicProfile/package.json +++ b/BasicProfile/package.json @@ -18,8 +18,8 @@ "umi-request": "^1.0.0" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" diff --git a/CardList/package.json b/CardList/package.json index c3b42f501d56ead598331bf8659f8e9f5e304acd..9f43492dd0595fbace32772a2cbad792e7b33311 100644 --- a/CardList/package.json +++ b/CardList/package.json @@ -18,8 +18,8 @@ "umi-request": "^1.0.0" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" diff --git a/Exception403/package.json b/Exception403/package.json index 21ead27ca8db51828d1786863d3a76ce28c75662..1c2a3a3550e2abf402d6c2a9532e9deb7d287479 100644 --- a/Exception403/package.json +++ b/Exception403/package.json @@ -1,5 +1,5 @@ { - "name": "@umi-block/exception-403", + "name": "@pro-blocks/exception-403", "version": "0.0.1", "description": "Exception403", "main": "src/index.js", @@ -8,18 +8,18 @@ }, "repository": { "type": "git", - "url": "https://github.com/umijs/umi-blocks/ant-design-pro/exception403" + "url": "https://github.com/ant-design/pro-blocks/tree/master/Exception403" }, "dependencies": { - "react": "^16.6.3", - "ant-design-pro": "^2.1.1", + "classnames": "^2.2.6", "dva": "^2.4.0", - "umi-request": "^1.0.0-beta.1" + "react": "^16.6.3", + "umi-request": "^1.0.4", + "umi": "^2.6.8", + "umi-plugin-react": "^1.7.2" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", - "umi-plugin-block-dev": "^1.0.0" + "umi-plugin-block-dev": "^1.3.0" }, - "license": "ISC" + "license": "MIT" } diff --git a/Exception403/src/components/Exception/demo/403.md b/Exception403/src/components/Exception/demo/403.md new file mode 100644 index 0000000000000000000000000000000000000000..c0244ab12046ac98706b893e73ea74748798d4dc --- /dev/null +++ b/Exception403/src/components/Exception/demo/403.md @@ -0,0 +1,29 @@ +--- +order: 2 +title: + zh-CN: 403 页面 + en-US: 403 Page +--- + +## zh-CN + +403 页面,配合自定义操作。 + +## en-US + +403 page with custom operations. + +````jsx +import Exception from 'ant-design-pro/lib/Exception'; +import { Button } from 'antd'; + +const actions = ( +
+ + +
+); +ReactDOM.render( + +, mountNode); +```` diff --git a/Exception403/src/components/Exception/demo/404.md b/Exception403/src/components/Exception/demo/404.md new file mode 100644 index 0000000000000000000000000000000000000000..c54e99d47cc695f456daaa99c652a4f9f8b4ca7c --- /dev/null +++ b/Exception403/src/components/Exception/demo/404.md @@ -0,0 +1,22 @@ +--- +order: 0 +title: + zh-CN: 404 页面 + en-US: 404 Page +--- + +## zh-CN + +404 页面。 + +## en-US + +404 page. + +````jsx +import Exception from 'ant-design-pro/lib/Exception'; + +ReactDOM.render( + +, mountNode); +```` diff --git a/Exception403/src/components/Exception/demo/500.md b/Exception403/src/components/Exception/demo/500.md new file mode 100644 index 0000000000000000000000000000000000000000..2336e41edab14bd86728df8d2f4ad20e2787594b --- /dev/null +++ b/Exception403/src/components/Exception/demo/500.md @@ -0,0 +1,22 @@ +--- +order: 1 +title: + zh-CN: 500 页面 + en-US: 500 Page +--- + +## zh-CN + +500 页面。 + +## en-US + +500 page. + +````jsx +import Exception from 'ant-design-pro/lib/Exception'; + +ReactDOM.render( + +, mountNode); +```` diff --git a/Exception403/src/components/Exception/index.en-US.md b/Exception403/src/components/Exception/index.en-US.md new file mode 100644 index 0000000000000000000000000000000000000000..37e7e80756fb7517239658775e4ce5ef170dcb21 --- /dev/null +++ b/Exception403/src/components/Exception/index.en-US.md @@ -0,0 +1,20 @@ +--- +title: Exception +cols: 1 +order: 5 +--- + +Exceptions page is used to provide feedback on specific abnormal state. Usually, it contains an explanation of the error status, and provides users with suggestions or operations, to prevent users from feeling lost and confused. + +## API + +Property | Description | Type | Default +---------|-------------|------|-------- +| backText | default return button text | ReactNode | back to home | +type | type of exception, the corresponding default `title`, `desc`, `img` will be given if set, which can be overridden by explicit setting of `title`, `desc`, `img` | Enum {'403', '404', '500'} | - +title | title | ReactNode | - +desc | supplementary description | ReactNode | - +img | the url of background image | string | - +actions | suggested operations, a default 'Home' link will show if not set | ReactNode | - +linkElement | to specify the element of link | string\|ReactElement | 'a' +redirect | redirect path | string | '/' \ No newline at end of file diff --git a/Exception403/src/components/Exception/index.less b/Exception403/src/components/Exception/index.less new file mode 100644 index 0000000000000000000000000000000000000000..45a2844b86f369c0df693fbfddea32134d1012c1 --- /dev/null +++ b/Exception403/src/components/Exception/index.less @@ -0,0 +1,89 @@ +@import '~antd/lib/style/themes/default.less'; + +.exception { + display: flex; + align-items: center; + height: 80%; + min-height: 500px; + + .imgBlock { + flex: 0 0 62.5%; + width: 62.5%; + padding-right: 152px; + zoom: 1; + &::before, + &::after { + content: ' '; + display: table; + } + &::after { + clear: both; + height: 0; + font-size: 0; + visibility: hidden; + } + } + + .imgEle { + float: right; + width: 100%; + max-width: 430px; + height: 360px; + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + } + + .content { + flex: auto; + + h1 { + margin-bottom: 24px; + color: #434e59; + font-weight: 600; + font-size: 72px; + line-height: 72px; + } + + .desc { + margin-bottom: 16px; + color: @text-color-secondary; + font-size: 20px; + line-height: 28px; + } + + .actions { + button:not(:last-child) { + margin-right: 8px; + } + } + } +} + +@media screen and (max-width: @screen-xl) { + .exception { + .imgBlock { + padding-right: 88px; + } + } +} + +@media screen and (max-width: @screen-sm) { + .exception { + display: block; + text-align: center; + .imgBlock { + margin: 0 auto 24px; + padding-right: 0; + } + } +} + +@media screen and (max-width: @screen-xs) { + .exception { + .imgBlock { + margin-bottom: -24px; + overflow: hidden; + } + } +} diff --git a/Exception403/src/components/Exception/index.tsx b/Exception403/src/components/Exception/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..7a25ebfa1f6d2856390c13d81aad31279857cfe3 --- /dev/null +++ b/Exception403/src/components/Exception/index.tsx @@ -0,0 +1,83 @@ +import { Button } from 'antd'; +import classNames from 'classnames'; +import * as H from 'history'; +import React, { createElement } from 'react'; +import styles from './index.less'; +import config from './typeConfig'; +import Link from 'umi/link'; + +export interface ExceptionProps< + L = { + to: H.LocationDescriptor; + href?: H.LocationDescriptor; + replace?: boolean; + innerRef?: (node: HTMLAnchorElement | null) => void; + } +> { + type?: '403' | '404' | '500'; + title?: React.ReactNode; + desc?: React.ReactNode; + img?: string; + actions?: React.ReactNode; + linkElement?: string | React.ComponentType | typeof Link; + style?: React.CSSProperties; + className?: string; + backText?: React.ReactNode; + redirect?: string; +} + +class Exception extends React.Component { + static defaultProps = { + backText: 'back to home', + redirect: '/', + }; + + constructor(props: ExceptionProps) { + super(props); + this.state = {}; + } + + render() { + const { + className, + backText, + linkElement = 'a', + type = '404', + title, + desc, + img, + actions, + redirect, + ...rest + } = this.props; + const pageType = type in config ? type : '404'; + const clsString = classNames(styles.exception, className); + return ( +
+
+
+
+
+

{title || config[pageType].title}

+
{desc || config[pageType].desc}
+
+ {actions || + createElement( + linkElement as any, + { + to: redirect, + href: redirect, + }, + + )} +
+
+
+ ); + } +} + +export default Exception; diff --git a/Exception403/src/components/Exception/index.zh-CN.md b/Exception403/src/components/Exception/index.zh-CN.md new file mode 100644 index 0000000000000000000000000000000000000000..2e64399fcbe4fe2c0eca7b9c4cb7742ccef3ed9a --- /dev/null +++ b/Exception403/src/components/Exception/index.zh-CN.md @@ -0,0 +1,21 @@ +--- +title: Exception +subtitle: 异常 +cols: 1 +order: 5 +--- + +异常页用于对页面特定的异常状态进行反馈。通常,它包含对错误状态的阐述,并向用户提供建议或操作,避免用户感到迷失和困惑。 + +## API + +| 参数 | 说明| 类型 | 默认值 | +|-------------|------------------------------------------|-------------|-------| +| backText| 默认的返回按钮文本 | ReactNode| back to home | +| type| 页面类型,若配置,则自带对应类型默认的 `title`,`desc`,`img`,此默认设置可以被 `title`,`desc`,`img` 覆盖 | Enum {'403', '404', '500'} | - | +| title | 标题 | ReactNode| -| +| desc| 补充描述| ReactNode| -| +| img | 背景图片地址 | string| -| +| actions | 建议操作,配置此属性时默认的『返回首页』按钮不生效| ReactNode| -| +| linkElement | 定义链接的元素 | string\|ReactElement | 'a' | +| redirect | 返回按钮的跳转地址 | string | '/' diff --git a/Exception403/src/components/Exception/typeConfig.ts b/Exception403/src/components/Exception/typeConfig.ts new file mode 100644 index 0000000000000000000000000000000000000000..453a5edcecb0b01f7f2cb720be3b0dfcc2302da4 --- /dev/null +++ b/Exception403/src/components/Exception/typeConfig.ts @@ -0,0 +1,36 @@ +interface Config { + 403: { + img: string; + title: string; + desc: string; + }; + 404: { + img: string; + title: string; + desc: string; + }; + 500: { + img: string; + title: string; + desc: string; + }; +} +const config: Config = { + 403: { + img: 'https://gw.alipayobjects.com/zos/rmsportal/wZcnGqRDyhPOEYFcZDnb.svg', + title: '403', + desc: '抱歉,你无权访问该页面', + }, + 404: { + img: 'https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg', + title: '404', + desc: '抱歉,你访问的页面不存在', + }, + 500: { + img: 'https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg', + title: '500', + desc: '抱歉,服务器出错了', + }, +}; + +export default config; diff --git a/Exception403/src/index.js b/Exception403/src/index.tsx similarity index 64% rename from Exception403/src/index.js rename to Exception403/src/index.tsx index f375a1006aa9d8fd71637b6be8e98101ab134357..e632f2a8dd672b858b5ba6212fc1533c6580d779 100644 --- a/Exception403/src/index.js +++ b/Exception403/src/index.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { formatMessage } from 'umi/locale'; +import { formatMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; -import { Exception } from 'ant-design-pro'; +import Exception from './components/Exception'; -const PAGE_NAME_UPPER_CAMEL_CASE = () => ( +const PAGE_NAME_UPPER_CAMEL_CASE: React.FC = () => ( + + +
+); +ReactDOM.render( + +, mountNode); +```` diff --git a/Exception404/src/components/Exception/demo/404.md b/Exception404/src/components/Exception/demo/404.md new file mode 100644 index 0000000000000000000000000000000000000000..c54e99d47cc695f456daaa99c652a4f9f8b4ca7c --- /dev/null +++ b/Exception404/src/components/Exception/demo/404.md @@ -0,0 +1,22 @@ +--- +order: 0 +title: + zh-CN: 404 页面 + en-US: 404 Page +--- + +## zh-CN + +404 页面。 + +## en-US + +404 page. + +````jsx +import Exception from 'ant-design-pro/lib/Exception'; + +ReactDOM.render( + +, mountNode); +```` diff --git a/Exception404/src/components/Exception/demo/500.md b/Exception404/src/components/Exception/demo/500.md new file mode 100644 index 0000000000000000000000000000000000000000..2336e41edab14bd86728df8d2f4ad20e2787594b --- /dev/null +++ b/Exception404/src/components/Exception/demo/500.md @@ -0,0 +1,22 @@ +--- +order: 1 +title: + zh-CN: 500 页面 + en-US: 500 Page +--- + +## zh-CN + +500 页面。 + +## en-US + +500 page. + +````jsx +import Exception from 'ant-design-pro/lib/Exception'; + +ReactDOM.render( + +, mountNode); +```` diff --git a/Exception404/src/components/Exception/index.en-US.md b/Exception404/src/components/Exception/index.en-US.md new file mode 100644 index 0000000000000000000000000000000000000000..37e7e80756fb7517239658775e4ce5ef170dcb21 --- /dev/null +++ b/Exception404/src/components/Exception/index.en-US.md @@ -0,0 +1,20 @@ +--- +title: Exception +cols: 1 +order: 5 +--- + +Exceptions page is used to provide feedback on specific abnormal state. Usually, it contains an explanation of the error status, and provides users with suggestions or operations, to prevent users from feeling lost and confused. + +## API + +Property | Description | Type | Default +---------|-------------|------|-------- +| backText | default return button text | ReactNode | back to home | +type | type of exception, the corresponding default `title`, `desc`, `img` will be given if set, which can be overridden by explicit setting of `title`, `desc`, `img` | Enum {'403', '404', '500'} | - +title | title | ReactNode | - +desc | supplementary description | ReactNode | - +img | the url of background image | string | - +actions | suggested operations, a default 'Home' link will show if not set | ReactNode | - +linkElement | to specify the element of link | string\|ReactElement | 'a' +redirect | redirect path | string | '/' \ No newline at end of file diff --git a/Exception404/src/components/Exception/index.less b/Exception404/src/components/Exception/index.less new file mode 100644 index 0000000000000000000000000000000000000000..45a2844b86f369c0df693fbfddea32134d1012c1 --- /dev/null +++ b/Exception404/src/components/Exception/index.less @@ -0,0 +1,89 @@ +@import '~antd/lib/style/themes/default.less'; + +.exception { + display: flex; + align-items: center; + height: 80%; + min-height: 500px; + + .imgBlock { + flex: 0 0 62.5%; + width: 62.5%; + padding-right: 152px; + zoom: 1; + &::before, + &::after { + content: ' '; + display: table; + } + &::after { + clear: both; + height: 0; + font-size: 0; + visibility: hidden; + } + } + + .imgEle { + float: right; + width: 100%; + max-width: 430px; + height: 360px; + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + } + + .content { + flex: auto; + + h1 { + margin-bottom: 24px; + color: #434e59; + font-weight: 600; + font-size: 72px; + line-height: 72px; + } + + .desc { + margin-bottom: 16px; + color: @text-color-secondary; + font-size: 20px; + line-height: 28px; + } + + .actions { + button:not(:last-child) { + margin-right: 8px; + } + } + } +} + +@media screen and (max-width: @screen-xl) { + .exception { + .imgBlock { + padding-right: 88px; + } + } +} + +@media screen and (max-width: @screen-sm) { + .exception { + display: block; + text-align: center; + .imgBlock { + margin: 0 auto 24px; + padding-right: 0; + } + } +} + +@media screen and (max-width: @screen-xs) { + .exception { + .imgBlock { + margin-bottom: -24px; + overflow: hidden; + } + } +} diff --git a/Exception404/src/components/Exception/index.tsx b/Exception404/src/components/Exception/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..7a25ebfa1f6d2856390c13d81aad31279857cfe3 --- /dev/null +++ b/Exception404/src/components/Exception/index.tsx @@ -0,0 +1,83 @@ +import { Button } from 'antd'; +import classNames from 'classnames'; +import * as H from 'history'; +import React, { createElement } from 'react'; +import styles from './index.less'; +import config from './typeConfig'; +import Link from 'umi/link'; + +export interface ExceptionProps< + L = { + to: H.LocationDescriptor; + href?: H.LocationDescriptor; + replace?: boolean; + innerRef?: (node: HTMLAnchorElement | null) => void; + } +> { + type?: '403' | '404' | '500'; + title?: React.ReactNode; + desc?: React.ReactNode; + img?: string; + actions?: React.ReactNode; + linkElement?: string | React.ComponentType | typeof Link; + style?: React.CSSProperties; + className?: string; + backText?: React.ReactNode; + redirect?: string; +} + +class Exception extends React.Component { + static defaultProps = { + backText: 'back to home', + redirect: '/', + }; + + constructor(props: ExceptionProps) { + super(props); + this.state = {}; + } + + render() { + const { + className, + backText, + linkElement = 'a', + type = '404', + title, + desc, + img, + actions, + redirect, + ...rest + } = this.props; + const pageType = type in config ? type : '404'; + const clsString = classNames(styles.exception, className); + return ( +
+
+
+
+
+

{title || config[pageType].title}

+
{desc || config[pageType].desc}
+
+ {actions || + createElement( + linkElement as any, + { + to: redirect, + href: redirect, + }, + + )} +
+
+
+ ); + } +} + +export default Exception; diff --git a/Exception404/src/components/Exception/index.zh-CN.md b/Exception404/src/components/Exception/index.zh-CN.md new file mode 100644 index 0000000000000000000000000000000000000000..2e64399fcbe4fe2c0eca7b9c4cb7742ccef3ed9a --- /dev/null +++ b/Exception404/src/components/Exception/index.zh-CN.md @@ -0,0 +1,21 @@ +--- +title: Exception +subtitle: 异常 +cols: 1 +order: 5 +--- + +异常页用于对页面特定的异常状态进行反馈。通常,它包含对错误状态的阐述,并向用户提供建议或操作,避免用户感到迷失和困惑。 + +## API + +| 参数 | 说明| 类型 | 默认值 | +|-------------|------------------------------------------|-------------|-------| +| backText| 默认的返回按钮文本 | ReactNode| back to home | +| type| 页面类型,若配置,则自带对应类型默认的 `title`,`desc`,`img`,此默认设置可以被 `title`,`desc`,`img` 覆盖 | Enum {'403', '404', '500'} | - | +| title | 标题 | ReactNode| -| +| desc| 补充描述| ReactNode| -| +| img | 背景图片地址 | string| -| +| actions | 建议操作,配置此属性时默认的『返回首页』按钮不生效| ReactNode| -| +| linkElement | 定义链接的元素 | string\|ReactElement | 'a' | +| redirect | 返回按钮的跳转地址 | string | '/' diff --git a/Exception404/src/components/Exception/typeConfig.ts b/Exception404/src/components/Exception/typeConfig.ts new file mode 100644 index 0000000000000000000000000000000000000000..453a5edcecb0b01f7f2cb720be3b0dfcc2302da4 --- /dev/null +++ b/Exception404/src/components/Exception/typeConfig.ts @@ -0,0 +1,36 @@ +interface Config { + 403: { + img: string; + title: string; + desc: string; + }; + 404: { + img: string; + title: string; + desc: string; + }; + 500: { + img: string; + title: string; + desc: string; + }; +} +const config: Config = { + 403: { + img: 'https://gw.alipayobjects.com/zos/rmsportal/wZcnGqRDyhPOEYFcZDnb.svg', + title: '403', + desc: '抱歉,你无权访问该页面', + }, + 404: { + img: 'https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg', + title: '404', + desc: '抱歉,你访问的页面不存在', + }, + 500: { + img: 'https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg', + title: '500', + desc: '抱歉,服务器出错了', + }, +}; + +export default config; diff --git a/Exception404/src/index.js b/Exception404/src/index.tsx similarity index 64% rename from Exception404/src/index.js rename to Exception404/src/index.tsx index d5b93d4367454c6428b4a444d7a672372857f381..1239c2c1ff7afff5fdc10619c5c9543759b8e989 100644 --- a/Exception404/src/index.js +++ b/Exception404/src/index.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import { formatMessage } from 'umi/locale'; +import { formatMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; -import { Exception } from 'ant-design-pro'; +import Exception from './components/Exception'; -const PAGE_NAME_UPPER_CAMEL_CASE = () => ( +const PAGE_NAME_UPPER_CAMEL_CASE: React.FC = () => ( ); diff --git a/Exception404/src/locales/en-US.js b/Exception404/src/locales/en-US.ts similarity index 100% rename from Exception404/src/locales/en-US.js rename to Exception404/src/locales/en-US.ts diff --git a/Exception404/src/locales/pt-BR.js b/Exception404/src/locales/pt-BR.ts similarity index 100% rename from Exception404/src/locales/pt-BR.js rename to Exception404/src/locales/pt-BR.ts diff --git a/Exception404/src/locales/zh-CN.js b/Exception404/src/locales/zh-CN.ts similarity index 100% rename from Exception404/src/locales/zh-CN.js rename to Exception404/src/locales/zh-CN.ts diff --git a/Exception404/src/locales/zh-TW.js b/Exception404/src/locales/zh-TW.ts similarity index 100% rename from Exception404/src/locales/zh-TW.js rename to Exception404/src/locales/zh-TW.ts diff --git a/Exception500/package.json b/Exception500/package.json index 8b4f47fb8223287bb989b6aee605164531220d1f..81cae72ed6e920ecec3c866ff0400f4b5b64ad49 100644 --- a/Exception500/package.json +++ b/Exception500/package.json @@ -1,5 +1,5 @@ { - "name": "@umi-block/exception-500", + "name": "@pro-blocks/exception-500", "version": "0.0.1", "description": "Exception500", "main": "src/index.js", @@ -8,18 +8,17 @@ }, "repository": { "type": "git", - "url": "https://github.com/umijs/umi-blocks/ant-design-pro/exception500" + "url": "https://github.com/ant-design/pro-blocks/tree/master/Exception500" }, "dependencies": { "react": "^16.6.3", - "ant-design-pro": "^2.1.1", "dva": "^2.4.0", "umi-request": "^1.0.0-beta.1" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, - "license": "ISC" + "license": "MIT" } diff --git a/Exception500/src/components/Exception/demo/403.md b/Exception500/src/components/Exception/demo/403.md new file mode 100644 index 0000000000000000000000000000000000000000..c0244ab12046ac98706b893e73ea74748798d4dc --- /dev/null +++ b/Exception500/src/components/Exception/demo/403.md @@ -0,0 +1,29 @@ +--- +order: 2 +title: + zh-CN: 403 页面 + en-US: 403 Page +--- + +## zh-CN + +403 页面,配合自定义操作。 + +## en-US + +403 page with custom operations. + +````jsx +import Exception from 'ant-design-pro/lib/Exception'; +import { Button } from 'antd'; + +const actions = ( +
+ + +
+); +ReactDOM.render( + +, mountNode); +```` diff --git a/Exception500/src/components/Exception/demo/404.md b/Exception500/src/components/Exception/demo/404.md new file mode 100644 index 0000000000000000000000000000000000000000..c54e99d47cc695f456daaa99c652a4f9f8b4ca7c --- /dev/null +++ b/Exception500/src/components/Exception/demo/404.md @@ -0,0 +1,22 @@ +--- +order: 0 +title: + zh-CN: 404 页面 + en-US: 404 Page +--- + +## zh-CN + +404 页面。 + +## en-US + +404 page. + +````jsx +import Exception from 'ant-design-pro/lib/Exception'; + +ReactDOM.render( + +, mountNode); +```` diff --git a/Exception500/src/components/Exception/demo/500.md b/Exception500/src/components/Exception/demo/500.md new file mode 100644 index 0000000000000000000000000000000000000000..2336e41edab14bd86728df8d2f4ad20e2787594b --- /dev/null +++ b/Exception500/src/components/Exception/demo/500.md @@ -0,0 +1,22 @@ +--- +order: 1 +title: + zh-CN: 500 页面 + en-US: 500 Page +--- + +## zh-CN + +500 页面。 + +## en-US + +500 page. + +````jsx +import Exception from 'ant-design-pro/lib/Exception'; + +ReactDOM.render( + +, mountNode); +```` diff --git a/Exception500/src/components/Exception/index.en-US.md b/Exception500/src/components/Exception/index.en-US.md new file mode 100644 index 0000000000000000000000000000000000000000..37e7e80756fb7517239658775e4ce5ef170dcb21 --- /dev/null +++ b/Exception500/src/components/Exception/index.en-US.md @@ -0,0 +1,20 @@ +--- +title: Exception +cols: 1 +order: 5 +--- + +Exceptions page is used to provide feedback on specific abnormal state. Usually, it contains an explanation of the error status, and provides users with suggestions or operations, to prevent users from feeling lost and confused. + +## API + +Property | Description | Type | Default +---------|-------------|------|-------- +| backText | default return button text | ReactNode | back to home | +type | type of exception, the corresponding default `title`, `desc`, `img` will be given if set, which can be overridden by explicit setting of `title`, `desc`, `img` | Enum {'403', '404', '500'} | - +title | title | ReactNode | - +desc | supplementary description | ReactNode | - +img | the url of background image | string | - +actions | suggested operations, a default 'Home' link will show if not set | ReactNode | - +linkElement | to specify the element of link | string\|ReactElement | 'a' +redirect | redirect path | string | '/' \ No newline at end of file diff --git a/Exception500/src/components/Exception/index.less b/Exception500/src/components/Exception/index.less new file mode 100644 index 0000000000000000000000000000000000000000..45a2844b86f369c0df693fbfddea32134d1012c1 --- /dev/null +++ b/Exception500/src/components/Exception/index.less @@ -0,0 +1,89 @@ +@import '~antd/lib/style/themes/default.less'; + +.exception { + display: flex; + align-items: center; + height: 80%; + min-height: 500px; + + .imgBlock { + flex: 0 0 62.5%; + width: 62.5%; + padding-right: 152px; + zoom: 1; + &::before, + &::after { + content: ' '; + display: table; + } + &::after { + clear: both; + height: 0; + font-size: 0; + visibility: hidden; + } + } + + .imgEle { + float: right; + width: 100%; + max-width: 430px; + height: 360px; + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + } + + .content { + flex: auto; + + h1 { + margin-bottom: 24px; + color: #434e59; + font-weight: 600; + font-size: 72px; + line-height: 72px; + } + + .desc { + margin-bottom: 16px; + color: @text-color-secondary; + font-size: 20px; + line-height: 28px; + } + + .actions { + button:not(:last-child) { + margin-right: 8px; + } + } + } +} + +@media screen and (max-width: @screen-xl) { + .exception { + .imgBlock { + padding-right: 88px; + } + } +} + +@media screen and (max-width: @screen-sm) { + .exception { + display: block; + text-align: center; + .imgBlock { + margin: 0 auto 24px; + padding-right: 0; + } + } +} + +@media screen and (max-width: @screen-xs) { + .exception { + .imgBlock { + margin-bottom: -24px; + overflow: hidden; + } + } +} diff --git a/Exception500/src/components/Exception/index.tsx b/Exception500/src/components/Exception/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..7a25ebfa1f6d2856390c13d81aad31279857cfe3 --- /dev/null +++ b/Exception500/src/components/Exception/index.tsx @@ -0,0 +1,83 @@ +import { Button } from 'antd'; +import classNames from 'classnames'; +import * as H from 'history'; +import React, { createElement } from 'react'; +import styles from './index.less'; +import config from './typeConfig'; +import Link from 'umi/link'; + +export interface ExceptionProps< + L = { + to: H.LocationDescriptor; + href?: H.LocationDescriptor; + replace?: boolean; + innerRef?: (node: HTMLAnchorElement | null) => void; + } +> { + type?: '403' | '404' | '500'; + title?: React.ReactNode; + desc?: React.ReactNode; + img?: string; + actions?: React.ReactNode; + linkElement?: string | React.ComponentType | typeof Link; + style?: React.CSSProperties; + className?: string; + backText?: React.ReactNode; + redirect?: string; +} + +class Exception extends React.Component { + static defaultProps = { + backText: 'back to home', + redirect: '/', + }; + + constructor(props: ExceptionProps) { + super(props); + this.state = {}; + } + + render() { + const { + className, + backText, + linkElement = 'a', + type = '404', + title, + desc, + img, + actions, + redirect, + ...rest + } = this.props; + const pageType = type in config ? type : '404'; + const clsString = classNames(styles.exception, className); + return ( +
+
+
+
+
+

{title || config[pageType].title}

+
{desc || config[pageType].desc}
+
+ {actions || + createElement( + linkElement as any, + { + to: redirect, + href: redirect, + }, + + )} +
+
+
+ ); + } +} + +export default Exception; diff --git a/Exception500/src/components/Exception/index.zh-CN.md b/Exception500/src/components/Exception/index.zh-CN.md new file mode 100644 index 0000000000000000000000000000000000000000..2e64399fcbe4fe2c0eca7b9c4cb7742ccef3ed9a --- /dev/null +++ b/Exception500/src/components/Exception/index.zh-CN.md @@ -0,0 +1,21 @@ +--- +title: Exception +subtitle: 异常 +cols: 1 +order: 5 +--- + +异常页用于对页面特定的异常状态进行反馈。通常,它包含对错误状态的阐述,并向用户提供建议或操作,避免用户感到迷失和困惑。 + +## API + +| 参数 | 说明| 类型 | 默认值 | +|-------------|------------------------------------------|-------------|-------| +| backText| 默认的返回按钮文本 | ReactNode| back to home | +| type| 页面类型,若配置,则自带对应类型默认的 `title`,`desc`,`img`,此默认设置可以被 `title`,`desc`,`img` 覆盖 | Enum {'403', '404', '500'} | - | +| title | 标题 | ReactNode| -| +| desc| 补充描述| ReactNode| -| +| img | 背景图片地址 | string| -| +| actions | 建议操作,配置此属性时默认的『返回首页』按钮不生效| ReactNode| -| +| linkElement | 定义链接的元素 | string\|ReactElement | 'a' | +| redirect | 返回按钮的跳转地址 | string | '/' diff --git a/Exception500/src/components/Exception/typeConfig.ts b/Exception500/src/components/Exception/typeConfig.ts new file mode 100644 index 0000000000000000000000000000000000000000..453a5edcecb0b01f7f2cb720be3b0dfcc2302da4 --- /dev/null +++ b/Exception500/src/components/Exception/typeConfig.ts @@ -0,0 +1,36 @@ +interface Config { + 403: { + img: string; + title: string; + desc: string; + }; + 404: { + img: string; + title: string; + desc: string; + }; + 500: { + img: string; + title: string; + desc: string; + }; +} +const config: Config = { + 403: { + img: 'https://gw.alipayobjects.com/zos/rmsportal/wZcnGqRDyhPOEYFcZDnb.svg', + title: '403', + desc: '抱歉,你无权访问该页面', + }, + 404: { + img: 'https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg', + title: '404', + desc: '抱歉,你访问的页面不存在', + }, + 500: { + img: 'https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg', + title: '500', + desc: '抱歉,服务器出错了', + }, +}; + +export default config; diff --git a/Exception500/src/index.js b/Exception500/src/index.tsx similarity index 64% rename from Exception500/src/index.js rename to Exception500/src/index.tsx index bef7707fecb97257f396d2b4bc46eeb70fcedd90..edbf668546644e0fdc0c33d35b6104f83f3ea289 100644 --- a/Exception500/src/index.js +++ b/Exception500/src/index.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { formatMessage } from 'umi/locale'; +import { formatMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; -import { Exception } from 'ant-design-pro'; +import Exception from './components/Exception'; -const PAGE_NAME_UPPER_CAMEL_CASE = () => ( +const PAGE_NAME_UPPER_CAMEL_CASE: React.FC = () => ( } + title={ + + } style={{ marginBottom: 24 }} bodyStyle={{ textAlign: 'center' }} bordered={false} @@ -152,7 +154,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { animate={false} percent={28} subTitle={ - + } total="28%" height={128} @@ -220,7 +225,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { + } percent={34} /> diff --git a/ResultFail/package.json b/ResultFail/package.json index dd42ba5179f25f26c8d5cba5b7ef6f9c3739d02f..a6a7b35a09e64b02fcd9c03ef909072caf3a4736 100644 --- a/ResultFail/package.json +++ b/ResultFail/package.json @@ -16,8 +16,8 @@ "ant-design-pro": "^2.1.1" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" diff --git a/ResultSuccess/package.json b/ResultSuccess/package.json index 971e1a739dd29c3f79bde7a755cdf12d757ea18f..86e3a72413aaaccc2c0af08b0984c27941c01f6c 100644 --- a/ResultSuccess/package.json +++ b/ResultSuccess/package.json @@ -16,8 +16,8 @@ "ant-design-pro": "^2.1.1" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" diff --git a/SearchListApplications/package.json b/SearchListApplications/package.json index c909fae2f2ac90b74871d8ad2552681a8fc329f8..b0b7f012a60edb7e659ae2ff34a712a2189eaad0 100644 --- a/SearchListApplications/package.json +++ b/SearchListApplications/package.json @@ -23,8 +23,8 @@ "umi-request": "^1.0.0" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" diff --git a/SearchListApplications/src/index.js b/SearchListApplications/src/index.js index e9e458b2f07f15b03838f76972f1ee981d564084..5de54a0853159cff604673c3fbb37ef986bfefce 100644 --- a/SearchListApplications/src/index.js +++ b/SearchListApplications/src/index.js @@ -1,7 +1,20 @@ import React, { PureComponent } from 'react'; import numeral from 'numeral'; import { connect } from 'dva'; -import { Row, Col, Form, Card, Select, Icon, Avatar, List, Tooltip, Dropdown, Menu, Input } from 'antd'; +import { + Row, + Col, + Form, + Card, + Select, + Icon, + Avatar, + List, + Tooltip, + Dropdown, + Menu, + Input, +} from 'antd'; import { TagSelect } from 'ant-design-pro'; import StandardFormRow from './components/StandardFormRow'; @@ -102,11 +115,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { ); return ( - +
@@ -181,7 +190,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { , ]} > - } title={item.title} /> + } + title={item.title} + />
+ diff --git a/SearchListProjects/package.json b/SearchListProjects/package.json index 81d1f3e24f7937f17f37447844c7f909680a1731..441cc04f698741a06b5c76e271554087fa826bce 100644 --- a/SearchListProjects/package.json +++ b/SearchListProjects/package.json @@ -20,8 +20,8 @@ "umi-request": "^1.0.0" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" diff --git a/SearchListProjects/src/index.js b/SearchListProjects/src/index.js index 89d510bd07b090538d1cbc04f50ac260e5ca0572..4db3ba69960aedb32448a28eedc68bf8c283a499 100644 --- a/SearchListProjects/src/index.js +++ b/SearchListProjects/src/index.js @@ -107,11 +107,7 @@ class CoverCardList extends PureComponent { ); return ( - +
diff --git a/StepForm/package.json b/StepForm/package.json index ad8ce32393ec58ffb1d6269bfcefa226e609e1da..a1b07ec193e42cc0f0671459356546260bb83a33 100644 --- a/StepForm/package.json +++ b/StepForm/package.json @@ -19,8 +19,8 @@ "nzh": "^1.0.3" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" diff --git a/StepForm/src/locales/en-US.js b/StepForm/src/locales/en-US.js index 3356dda0f90eaa80e52b8bc4bd9002f62d9d4bc8..06f130b319a848ef019572468746972dbee9a7ac 100644 --- a/StepForm/src/locales/en-US.js +++ b/StepForm/src/locales/en-US.js @@ -46,7 +46,8 @@ export default { 'BLOCK_NAME.client.placeholder': 'Please describe your customer service, internal customers directly @ Name / job number', 'BLOCK_NAME.invites.label': 'Inviting critics', - 'BLOCK_NAME.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'BLOCK_NAME.invites.placeholder': + 'Please direct @ Name / job number, you can invite up to 5 people', 'BLOCK_NAME.weight.label': 'Weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.public.label': 'Target disclosure', diff --git a/StepForm/src/locales/pt-BR.js b/StepForm/src/locales/pt-BR.js index 1cc9013111adbea37ac80892f11b28d487566f72..c88bccb366065a849c6ea0a30c57f64a4a19cf85 100644 --- a/StepForm/src/locales/pt-BR.js +++ b/StepForm/src/locales/pt-BR.js @@ -42,7 +42,8 @@ export default { 'BLOCK_NAME.client.placeholder': 'Please describe your customer service, internal customers directly @ Name / job number', 'BLOCK_NAME.invites.label': 'Inviting critics', - 'BLOCK_NAME.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'BLOCK_NAME.invites.placeholder': + 'Please direct @ Name / job number, you can invite up to 5 people', 'BLOCK_NAME.weight.label': 'Weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.public.label': 'Target disclosure', diff --git a/TableList/package.json b/TableList/package.json index 67a10fcef41068ccd77a0e984658fec4117f4170..fb526910b6afe19278ffbeb73b38690ad2b4be87 100644 --- a/TableList/package.json +++ b/TableList/package.json @@ -19,8 +19,8 @@ "umi-request": "^1.0.0" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, "license": "ISC" diff --git a/UserLogin/package.json b/UserLogin/package.json index 837153b608abe63aae7d655b46a37be802a9daa0..e41e85c5b07d8e373d8a4a83c708670061260c7a 100644 --- a/UserLogin/package.json +++ b/UserLogin/package.json @@ -20,7 +20,7 @@ "umi-request": "^1.0.0" }, "devDependencies": { - "umi": "^2.3.0-beta.1", + "umi": "^2.6.9", "umi-plugin-block-dev": "^1.0.0", "umi-plugin-react": "^1.3.0-beta.1" }, diff --git a/UserLogin/src/index.js b/UserLogin/src/index.js index 33ba5e1b8d29b6377c910fd5c15d294a28718354..0c4480bbb8199e0ab2b70b475084995da27ff600 100644 --- a/UserLogin/src/index.js +++ b/UserLogin/src/index.js @@ -81,7 +81,9 @@ class LoginPage extends Component { {status === 'error' && loginType === 'account' && !submitting && - this.renderMessage(formatMessage({ id: 'BLOCK_NAME.login.message-invalid-credentials' }))} + this.renderMessage( + formatMessage({ id: 'BLOCK_NAME.login.message-invalid-credentials' }) + )} + )} diff --git a/UserRegister/src/locales/en-US.js b/UserRegister/src/locales/en-US.js index f58ec412c7a23fbc16cbc2ad5ba3c2cb3041dd4c..2ce4a265619cf9cfb8cdb3d8379a65695880af09 100644 --- a/UserRegister/src/locales/en-US.js +++ b/UserRegister/src/locales/en-US.js @@ -1,7 +1,8 @@ export default { 'BLOCK_NAME.login.userName': 'userName', 'BLOCK_NAME.login.password': 'password', - 'BLOCK_NAME.login.message-invalid-credentials': 'Invalid username or password(admin/ant.design)', + 'BLOCK_NAME.login.message-invalid-credentials': + 'Invalid username or password(admin/ant.design)', 'BLOCK_NAME.login.message-invalid-verification-code': 'Invalid verification code', 'BLOCK_NAME.login.tab-login-credentials': 'Credentials', 'BLOCK_NAME.login.tab-login-mobile': 'Mobile number', @@ -60,7 +61,8 @@ export default { 'BLOCK_NAME.client.placeholder': 'Please describe your customer service, internal customers directly @ Name / job number', 'BLOCK_NAME.invites.label': 'Inviting critics', - 'BLOCK_NAME.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'BLOCK_NAME.invites.placeholder': + 'Please direct @ Name / job number, you can invite up to 5 people', 'BLOCK_NAME.weight.label': 'Weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.public.label': 'Target disclosure', diff --git a/UserRegisterResult/package.json b/UserRegisterResult/package.json index afdefc4fae8ad383f272007bbd1f91811bb58f1a..add0eb1a5ddf7564543a0535eae2711de43f090a 100644 --- a/UserRegisterResult/package.json +++ b/UserRegisterResult/package.json @@ -16,8 +16,8 @@ "ant-design-pro": "^2.1.1" }, "devDependencies": { - "umi": "^2.3.0-beta.1", - "umi-plugin-react": "^1.3.0-beta.1", + "umi": "^2.6.9", + "umi-plugin-react": "^1.7.2", "umi-plugin-block-dev": "^1.0.0" }, "license": "MIT" diff --git a/UserRegisterResult/src/locales/en-US.js b/UserRegisterResult/src/locales/en-US.js index 471776cabd4973d06ed5abae3db1de8b8ec0a015..1d04b0a5332602e85709bbf359114339823fc3d7 100644 --- a/UserRegisterResult/src/locales/en-US.js +++ b/UserRegisterResult/src/locales/en-US.js @@ -1,7 +1,8 @@ export default { 'BLOCK_NAME.login.userName': 'userName', 'BLOCK_NAME.login.password': 'password', - 'BLOCK_NAME.login.message-invalid-credentials': 'Invalid username or password(admin/ant.design)', + 'BLOCK_NAME.login.message-invalid-credentials': + 'Invalid username or password(admin/ant.design)', 'BLOCK_NAME.login.message-invalid-verification-code': 'Invalid verification code', 'BLOCK_NAME.login.tab-login-credentials': 'Credentials', 'BLOCK_NAME.login.tab-login-mobile': 'Mobile number', diff --git a/Workplace/package.json b/Workplace/package.json index e44affb11638eb102f6ceca2eed0b27cfb98cde7..f8cb63021524bc8880bb89f5404d29ae5c51fa3b 100644 --- a/Workplace/package.json +++ b/Workplace/package.json @@ -20,7 +20,7 @@ "umi-request": "^1.0.0" }, "devDependencies": { - "umi": "^2.3.0-beta.1", + "umi": "^2.6.9", "umi-plugin-block-dev": "^1.0.0", "umi-plugin-react": "^1.3.0-beta.1" }, diff --git a/_scripts/prettier.js b/_scripts/prettier.js index d42fa0edb4e2cfe522d72fec77d85817065b2ae6..6c7d853940b5578461f59007406cf68d69965278 100644 --- a/_scripts/prettier.js +++ b/_scripts/prettier.js @@ -15,14 +15,15 @@ const prettierConfigPath = require.resolve('../.prettierrc'); let didError = false; let files = []; -const jsFiles = glob.sync('ant-design-pro/**/*.js*', { - ignore: ['**/node_modules/**', 'build/**'], +const jsFiles = glob.sync('**/src/*.js*', { + ignore: ['**/node_modules/**', 'build/**', '**/.umi/**'], }); -const tsFiles = glob.sync('ant-design-pro/**/*.ts*', { - ignore: ['**/node_modules/**', 'build/**'], +const tsFiles = glob.sync('**/src/*.ts*', { + ignore: ['**/node_modules/**', 'build/**', '**/.umi/**'], }); files = files.concat(jsFiles); files = files.concat(tsFiles); + if (!files.length) { return; } diff --git a/package.json b/package.json index c016cb78235794adef68979a77560055e7b5e82e..7ead9b8eabf43e6ea67ea3e425ca9ae210680f9d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "scripts": { - "dev": "umi dev", + "dev": "PAGES_PATH='Exception500/src' umi dev", "lint:style": "stylelint \"src/**/*.less\" --syntax less", "lint": "eslint --ext .js src mock tests && npm run lint:style", "lint:fix": "eslint --fix --ext .js src mock tests && npm run lint:style", @@ -10,6 +10,7 @@ "prettier": "node ./_scripts/prettier.js" }, "devDependencies": { + "@types/classnames": "^2.2.7", "babel-eslint": "^10.0.1", "eslint": "^5.4.0", "eslint-config-airbnb": "^17.0.0", @@ -28,7 +29,7 @@ "stylelint-config-prettier": "^4.0.0", "stylelint-config-standard": "^18.0.0", "umi": "^2.3.0-0", - "umi-plugin-block-dev": "^1.0.0", + "umi-plugin-block-dev": "^1.3.1", "umi-plugin-react": "^1.3.0-0" }, "lint-staged": { diff --git a/tsconfig.json b/tsconfig.json index 48b504b7ee2725acb24e6d96490cea75b1b370a0..b753726ea8aae883d8855c32f4162a9dca14308f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,11 +22,5 @@ } }, "include": ["."], - "exclude": [ - "node_modules", - "_scripts", - "jest", - "tslint:latest", - "tslint-config-prettier" - ] + "exclude": ["node_modules", "_scripts", "jest", "tslint:latest", "tslint-config-prettier"] }