Unverified Commit 0d6fba34 authored by 陈小聪's avatar 陈小聪 Committed by GitHub

Merge pull request #11 from ant-design/Exception500

Exception (First Commit)
parents fe37e833 4e733b7b
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-block-dev": "^1.0.0", "umi-plugin-block-dev": "^1.0.0",
"umi-plugin-react": "^1.3.0-beta.1" "umi-plugin-react": "^1.3.0-beta.1"
}, },
......
...@@ -173,10 +173,7 @@ class BaseView extends Component { ...@@ -173,10 +173,7 @@ class BaseView extends Component {
})(<PhoneView />)} })(<PhoneView />)}
</FormItem> </FormItem>
<Button type="primary"> <Button type="primary">
<FormattedMessage <FormattedMessage id="BLOCK_NAME.basic.update" defaultMessage="Update Information" />
id="BLOCK_NAME.basic.update"
defaultMessage="Update Information"
/>
</Button> </Button>
</Form> </Form>
</div> </div>
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
...@@ -46,7 +46,8 @@ export default { ...@@ -46,7 +46,8 @@ export default {
'BLOCK_NAME.client.placeholder': 'BLOCK_NAME.client.placeholder':
'Please describe your customer service, internal customers directly @ Name / job number', 'Please describe your customer service, internal customers directly @ Name / job number',
'BLOCK_NAME.invites.label': 'Inviting critics', '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.label': 'Weight',
'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight',
'BLOCK_NAME.public.label': 'Target disclosure', 'BLOCK_NAME.public.label': 'Target disclosure',
......
...@@ -42,7 +42,8 @@ export default { ...@@ -42,7 +42,8 @@ export default {
'BLOCK_NAME.client.placeholder': 'BLOCK_NAME.client.placeholder':
'Please describe your customer service, internal customers directly @ Name / job number', 'Please describe your customer service, internal customers directly @ Name / job number',
'BLOCK_NAME.invites.label': 'Inviting critics', '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.label': 'Weight',
'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight',
'BLOCK_NAME.public.label': 'Target disclosure', 'BLOCK_NAME.public.label': 'Target disclosure',
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
"numeral": "^2.0.6" "numeral": "^2.0.6"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.1.0" "umi-plugin-block-dev": "^1.1.0"
}, },
"license": "ISC" "license": "ISC"
......
...@@ -22,10 +22,14 @@ const IntroduceRow = memo(({ loading, visitData }) => ( ...@@ -22,10 +22,14 @@ const IntroduceRow = memo(({ loading, visitData }) => (
<Col {...topColResponsiveProps}> <Col {...topColResponsiveProps}>
<ChartCard <ChartCard
bordered={false} bordered={false}
title={<FormattedMessage id="BLOCK_NAME.analysis.total-sales" defaultMessage="Total Sales" />} title={
<FormattedMessage id="BLOCK_NAME.analysis.total-sales" defaultMessage="Total Sales" />
}
action={ action={
<Tooltip <Tooltip
title={<FormattedMessage id="BLOCK_NAME.analysis.introduce" defaultMessage="Introduce" />} title={
<FormattedMessage id="BLOCK_NAME.analysis.introduce" defaultMessage="Introduce" />
}
> >
<Icon type="info-circle-o" /> <Icon type="info-circle-o" />
</Tooltip> </Tooltip>
...@@ -34,7 +38,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( ...@@ -34,7 +38,9 @@ const IntroduceRow = memo(({ loading, visitData }) => (
total={() => <Yuan>126560</Yuan>} total={() => <Yuan>126560</Yuan>}
footer={ footer={
<Field <Field
label={<FormattedMessage id="BLOCK_NAME.analysis.day-sales" defaultMessage="Daily Sales" />} label={
<FormattedMessage id="BLOCK_NAME.analysis.day-sales" defaultMessage="Daily Sales" />
}
value={`¥${numeral(12423).format('0,0')}`} value={`¥${numeral(12423).format('0,0')}`}
/> />
} }
...@@ -58,7 +64,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( ...@@ -58,7 +64,9 @@ const IntroduceRow = memo(({ loading, visitData }) => (
title={<FormattedMessage id="BLOCK_NAME.analysis.visits" defaultMessage="Visits" />} title={<FormattedMessage id="BLOCK_NAME.analysis.visits" defaultMessage="Visits" />}
action={ action={
<Tooltip <Tooltip
title={<FormattedMessage id="BLOCK_NAME.analysis.introduce" defaultMessage="Introduce" />} title={
<FormattedMessage id="BLOCK_NAME.analysis.introduce" defaultMessage="Introduce" />
}
> >
<Icon type="info-circle-o" /> <Icon type="info-circle-o" />
</Tooltip> </Tooltip>
...@@ -66,7 +74,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( ...@@ -66,7 +74,9 @@ const IntroduceRow = memo(({ loading, visitData }) => (
total={numeral(8846).format('0,0')} total={numeral(8846).format('0,0')}
footer={ footer={
<Field <Field
label={<FormattedMessage id="BLOCK_NAME.analysis.day-visits" defaultMessage="Daily Visits" />} label={
<FormattedMessage id="BLOCK_NAME.analysis.day-visits" defaultMessage="Daily Visits" />
}
value={numeral(1234).format('0,0')} value={numeral(1234).format('0,0')}
/> />
} }
...@@ -82,7 +92,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( ...@@ -82,7 +92,9 @@ const IntroduceRow = memo(({ loading, visitData }) => (
title={<FormattedMessage id="BLOCK_NAME.analysis.payments" defaultMessage="Payments" />} title={<FormattedMessage id="BLOCK_NAME.analysis.payments" defaultMessage="Payments" />}
action={ action={
<Tooltip <Tooltip
title={<FormattedMessage id="BLOCK_NAME.analysis.introduce" defaultMessage="Introduce" />} title={
<FormattedMessage id="BLOCK_NAME.analysis.introduce" defaultMessage="Introduce" />
}
> >
<Icon type="info-circle-o" /> <Icon type="info-circle-o" />
</Tooltip> </Tooltip>
...@@ -116,7 +128,9 @@ const IntroduceRow = memo(({ loading, visitData }) => ( ...@@ -116,7 +128,9 @@ const IntroduceRow = memo(({ loading, visitData }) => (
} }
action={ action={
<Tooltip <Tooltip
title={<FormattedMessage id="BLOCK_NAME.analysis.introduce" defaultMessage="Introduce" />} title={
<FormattedMessage id="BLOCK_NAME.analysis.introduce" defaultMessage="Introduce" />
}
> >
<Icon type="info-circle-o" /> <Icon type="info-circle-o" />
</Tooltip> </Tooltip>
......
...@@ -12,7 +12,10 @@ const CustomTab = ({ data, currentTabKey: currentKey }) => ( ...@@ -12,7 +12,10 @@ const CustomTab = ({ data, currentTabKey: currentKey }) => (
<NumberInfo <NumberInfo
title={data.name} title={data.name}
subTitle={ subTitle={
<FormattedMessage id="BLOCK_NAME.analysis.conversion-rate" defaultMessage="Conversion Rate" /> <FormattedMessage
id="BLOCK_NAME.analysis.conversion-rate"
defaultMessage="Conversion Rate"
/>
} }
gap={2} gap={2}
total={`${data.cvr * 100}%`} total={`${data.cvr * 100}%`}
......
...@@ -47,7 +47,10 @@ const TopSearch = memo(({ loading, visitData2, searchData, dropdownGroup }) => ( ...@@ -47,7 +47,10 @@ const TopSearch = memo(({ loading, visitData2, searchData, dropdownGroup }) => (
loading={loading} loading={loading}
bordered={false} bordered={false}
title={ title={
<FormattedMessage id="BLOCK_NAME.analysis.online-top-search" defaultMessage="Online Top Search" /> <FormattedMessage
id="BLOCK_NAME.analysis.online-top-search"
defaultMessage="Online Top Search"
/>
} }
extra={dropdownGroup} extra={dropdownGroup}
style={{ marginTop: 24 }} style={{ marginTop: 24 }}
...@@ -57,9 +60,14 @@ const TopSearch = memo(({ loading, visitData2, searchData, dropdownGroup }) => ( ...@@ -57,9 +60,14 @@ const TopSearch = memo(({ loading, visitData2, searchData, dropdownGroup }) => (
<NumberInfo <NumberInfo
subTitle={ subTitle={
<span> <span>
<FormattedMessage id="BLOCK_NAME.analysis.search-users" defaultMessage="search users" /> <FormattedMessage
id="BLOCK_NAME.analysis.search-users"
defaultMessage="search users"
/>
<Tooltip <Tooltip
title={<FormattedMessage id="BLOCK_NAME.analysis.introduce" defaultMessage="introduce" />} title={
<FormattedMessage id="BLOCK_NAME.analysis.introduce" defaultMessage="introduce" />
}
> >
<Icon style={{ marginLeft: 8 }} type="info-circle-o" /> <Icon style={{ marginLeft: 8 }} type="info-circle-o" />
</Tooltip> </Tooltip>
...@@ -81,7 +89,9 @@ const TopSearch = memo(({ loading, visitData2, searchData, dropdownGroup }) => ( ...@@ -81,7 +89,9 @@ const TopSearch = memo(({ loading, visitData2, searchData, dropdownGroup }) => (
defaultMessage="Per Capita Search" defaultMessage="Per Capita Search"
/> />
<Tooltip <Tooltip
title={<FormattedMessage id="BLOCK_NAME.analysis.introduce" defaultMessage="introduce" />} title={
<FormattedMessage id="BLOCK_NAME.analysis.introduce" defaultMessage="introduce" />
}
> >
<Icon style={{ marginLeft: 8 }} type="info-circle-o" /> <Icon style={{ marginLeft: 8 }} type="info-circle-o" />
</Tooltip> </Tooltip>
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
...@@ -115,7 +115,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { ...@@ -115,7 +115,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
/> />
)} )}
</FormItem> </FormItem>
<FormItem {...formItemLayout} label={<FormattedMessage id="BLOCK_NAME.standard.label" />}> <FormItem
{...formItemLayout}
label={<FormattedMessage id="BLOCK_NAME.standard.label" />}
>
{getFieldDecorator('standard', { {getFieldDecorator('standard', {
rules: [ rules: [
{ {
......
...@@ -46,7 +46,8 @@ export default { ...@@ -46,7 +46,8 @@ export default {
'BLOCK_NAME.client.placeholder': 'BLOCK_NAME.client.placeholder':
'Please describe your customer service, internal customers directly @ Name / job number', 'Please describe your customer service, internal customers directly @ Name / job number',
'BLOCK_NAME.invites.label': 'Inviting critics', '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.label': 'Weight',
'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight',
'BLOCK_NAME.public.label': 'Target disclosure', 'BLOCK_NAME.public.label': 'Target disclosure',
......
...@@ -42,7 +42,8 @@ export default { ...@@ -42,7 +42,8 @@ export default {
'BLOCK_NAME.client.placeholder': 'BLOCK_NAME.client.placeholder':
'Please describe your customer service, internal customers directly @ Name / job number', 'Please describe your customer service, internal customers directly @ Name / job number',
'BLOCK_NAME.invites.label': 'Inviting critics', '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.label': 'Weight',
'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight',
'BLOCK_NAME.public.label': 'Target disclosure', 'BLOCK_NAME.public.label': 'Target disclosure',
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
{ {
"name": "@umi-block/exception-403", "name": "@pro-blocks/exception-403",
"version": "0.0.1", "version": "0.0.1",
"description": "Exception403", "description": "Exception403",
"main": "src/index.js", "main": "src/index.js",
...@@ -8,18 +8,18 @@ ...@@ -8,18 +8,18 @@
}, },
"repository": { "repository": {
"type": "git", "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": { "dependencies": {
"react": "^16.6.3", "classnames": "^2.2.6",
"ant-design-pro": "^2.1.1",
"dva": "^2.4.0", "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": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi-plugin-block-dev": "^1.3.0"
"umi-plugin-react": "^1.3.0-beta.1",
"umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "MIT"
} }
---
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 = (
<div>
<Button type="primary">Home</Button>
<Button>Detail</Button>
</div>
);
ReactDOM.render(
<Exception type="403" actions={actions} />
, mountNode);
````
---
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(
<Exception type="404" />
, mountNode);
````
---
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(
<Exception type="500" />
, mountNode);
````
---
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
@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;
}
}
}
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<L> | typeof Link;
style?: React.CSSProperties;
className?: string;
backText?: React.ReactNode;
redirect?: string;
}
class Exception extends React.Component<ExceptionProps, any> {
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 (
<div className={clsString} {...rest}>
<div className={styles.imgBlock}>
<div
className={styles.imgEle}
style={{ backgroundImage: `url(${img || config[pageType].img})` }}
/>
</div>
<div className={styles.content}>
<h1>{title || config[pageType].title}</h1>
<div className={styles.desc}>{desc || config[pageType].desc}</div>
<div className={styles.actions}>
{actions ||
createElement(
linkElement as any,
{
to: redirect,
href: redirect,
},
<Button type="primary">{backText}</Button>
)}
</div>
</div>
</div>
);
}
}
export default Exception;
---
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 | '/'
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;
import React from 'react'; import React from 'react';
import { formatMessage } from 'umi/locale'; import { formatMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; 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 = () => (
<Exception <Exception
type="403" type="403"
desc={formatMessage({ id: 'BLOCK_NAME.description.403' })} desc={formatMessage({ id: 'BLOCK_NAME.description.403' })}
......
{ {
"name": "@umi-block/exception-404", "name": "@pro-blocks/exception-404",
"version": "0.0.1", "version": "0.0.1",
"description": "Exception404", "description": "Exception404",
"main": "src/index.js", "main": "src/index.js",
...@@ -8,18 +8,17 @@ ...@@ -8,18 +8,17 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/umijs/umi-blocks/ant-design-pro/exception404" "url": "https://github.com/ant-design/pro-blocks/tree/master/Exception404"
}, },
"dependencies": { "dependencies": {
"react": "^16.6.3", "react": "^16.6.3",
"ant-design-pro": "^2.1.1",
"dva": "^2.4.0", "dva": "^2.4.0",
"umi-request": "^1.0.0-beta.1" "umi-request": "^1.0.0-beta.1"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "MIT"
} }
---
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 = (
<div>
<Button type="primary">Home</Button>
<Button>Detail</Button>
</div>
);
ReactDOM.render(
<Exception type="403" actions={actions} />
, mountNode);
````
---
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(
<Exception type="404" />
, mountNode);
````
---
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(
<Exception type="500" />
, mountNode);
````
---
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
@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;
}
}
}
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<L> | typeof Link;
style?: React.CSSProperties;
className?: string;
backText?: React.ReactNode;
redirect?: string;
}
class Exception extends React.Component<ExceptionProps, any> {
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 (
<div className={clsString} {...rest}>
<div className={styles.imgBlock}>
<div
className={styles.imgEle}
style={{ backgroundImage: `url(${img || config[pageType].img})` }}
/>
</div>
<div className={styles.content}>
<h1>{title || config[pageType].title}</h1>
<div className={styles.desc}>{desc || config[pageType].desc}</div>
<div className={styles.actions}>
{actions ||
createElement(
linkElement as any,
{
to: redirect,
href: redirect,
},
<Button type="primary">{backText}</Button>
)}
</div>
</div>
</div>
);
}
}
export default Exception;
---
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 | '/'
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;
import React from 'react'; import React from 'react';
import { formatMessage } from 'umi/locale'; import { formatMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; 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 = () => (
<Exception <Exception
type="404" type="404"
desc={formatMessage({ id: 'BLOCK_NAME.description.404' })}
linkElement={Link} linkElement={Link}
desc={formatMessage({ id: 'BLOCK_NAME.description.404' })}
backText={formatMessage({ id: 'BLOCK_NAME.exception.back' })} backText={formatMessage({ id: 'BLOCK_NAME.exception.back' })}
/> />
); );
......
{ {
"name": "@umi-block/exception-500", "name": "@pro-blocks/exception-500",
"version": "0.0.1", "version": "0.0.1",
"description": "Exception500", "description": "Exception500",
"main": "src/index.js", "main": "src/index.js",
...@@ -8,18 +8,17 @@ ...@@ -8,18 +8,17 @@
}, },
"repository": { "repository": {
"type": "git", "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": { "dependencies": {
"react": "^16.6.3", "react": "^16.6.3",
"ant-design-pro": "^2.1.1",
"dva": "^2.4.0", "dva": "^2.4.0",
"umi-request": "^1.0.0-beta.1" "umi-request": "^1.0.0-beta.1"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "MIT"
} }
---
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 = (
<div>
<Button type="primary">Home</Button>
<Button>Detail</Button>
</div>
);
ReactDOM.render(
<Exception type="403" actions={actions} />
, mountNode);
````
---
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(
<Exception type="404" />
, mountNode);
````
---
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(
<Exception type="500" />
, mountNode);
````
---
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
@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;
}
}
}
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<L> | typeof Link;
style?: React.CSSProperties;
className?: string;
backText?: React.ReactNode;
redirect?: string;
}
class Exception extends React.Component<ExceptionProps, any> {
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 (
<div className={clsString} {...rest}>
<div className={styles.imgBlock}>
<div
className={styles.imgEle}
style={{ backgroundImage: `url(${img || config[pageType].img})` }}
/>
</div>
<div className={styles.content}>
<h1>{title || config[pageType].title}</h1>
<div className={styles.desc}>{desc || config[pageType].desc}</div>
<div className={styles.actions}>
{actions ||
createElement(
linkElement as any,
{
to: redirect,
href: redirect,
},
<Button type="primary">{backText}</Button>
)}
</div>
</div>
</div>
);
}
}
export default Exception;
---
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 | '/'
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;
import React from 'react'; import React from 'react';
import { formatMessage } from 'umi/locale'; import { formatMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; 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 = () => (
<Exception <Exception
type="500" type="500"
desc={formatMessage({ id: 'BLOCK_NAME.description.500' })} desc={formatMessage({ id: 'BLOCK_NAME.description.500' })}
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
}, },
"devDependencies": { "devDependencies": {
"mockjs": "^1.0.1-beta3", "mockjs": "^1.0.1-beta3",
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
...@@ -121,7 +121,9 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { ...@@ -121,7 +121,9 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
<ActiveChart /> <ActiveChart />
</Card> </Card>
<Card <Card
title={<FormattedMessage id="BLOCK_NAME.monitor.efficiency" defaultMessage="Efficiency" />} title={
<FormattedMessage id="BLOCK_NAME.monitor.efficiency" defaultMessage="Efficiency" />
}
style={{ marginBottom: 24 }} style={{ marginBottom: 24 }}
bodyStyle={{ textAlign: 'center' }} bodyStyle={{ textAlign: 'center' }}
bordered={false} bordered={false}
...@@ -152,7 +154,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { ...@@ -152,7 +154,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
animate={false} animate={false}
percent={28} percent={28}
subTitle={ subTitle={
<FormattedMessage id="BLOCK_NAME.monitor.fast-food" defaultMessage="Fast food" /> <FormattedMessage
id="BLOCK_NAME.monitor.fast-food"
defaultMessage="Fast food"
/>
} }
total="28%" total="28%"
height={128} height={128}
...@@ -220,7 +225,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { ...@@ -220,7 +225,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
<WaterWave <WaterWave
height={161} height={161}
title={ title={
<FormattedMessage id="BLOCK_NAME.monitor.fund-surplus" defaultMessage="Fund Surplus" /> <FormattedMessage
id="BLOCK_NAME.monitor.fund-surplus"
defaultMessage="Fund Surplus"
/>
} }
percent={34} percent={34}
/> />
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
"ant-design-pro": "^2.1.1" "ant-design-pro": "^2.1.1"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
"ant-design-pro": "^2.1.1" "ant-design-pro": "^2.1.1"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import numeral from 'numeral'; import numeral from 'numeral';
import { connect } from 'dva'; 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 { TagSelect } from 'ant-design-pro';
import StandardFormRow from './components/StandardFormRow'; import StandardFormRow from './components/StandardFormRow';
...@@ -102,11 +115,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { ...@@ -102,11 +115,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
); );
return ( return (
<PageHeaderWrapper <PageHeaderWrapper title="搜索列表" content={mainSearch} onTabChange={this.handleTabChange}>
title="搜索列表"
content={mainSearch}
onTabChange={this.handleTabChange}
>
<div className={styles.filterCardList}> <div className={styles.filterCardList}>
<Card bordered={false}> <Card bordered={false}>
<Form layout="inline"> <Form layout="inline">
...@@ -181,7 +190,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { ...@@ -181,7 +190,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
</Dropdown>, </Dropdown>,
]} ]}
> >
<Card.Meta avatar={<Avatar size="small" src={item.avatar} />} title={item.title} /> <Card.Meta
avatar={<Avatar size="small" src={item.avatar} />}
title={item.title}
/>
<div className={styles.cardItemContent}> <div className={styles.cardItemContent}>
<CardInfo <CardInfo
activeUser={formatWan(item.activeUser)} activeUser={formatWan(item.activeUser)}
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
...@@ -133,11 +133,7 @@ class SearchList extends Component { ...@@ -133,11 +133,7 @@ class SearchList extends Component {
); );
return ( return (
<PageHeaderWrapper <PageHeaderWrapper title="搜索列表" content={mainSearch} onTabChange={this.handleTabChange}>
title="搜索列表"
content={mainSearch}
onTabChange={this.handleTabChange}
>
<Card bordered={false}> <Card bordered={false}>
<Form layout="inline"> <Form layout="inline">
<StandardFormRow title="所属类目" block style={{ paddingBottom: 11 }}> <StandardFormRow title="所属类目" block style={{ paddingBottom: 11 }}>
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
...@@ -107,11 +107,7 @@ class CoverCardList extends PureComponent { ...@@ -107,11 +107,7 @@ class CoverCardList extends PureComponent {
); );
return ( return (
<PageHeaderWrapper <PageHeaderWrapper title="搜索列表" content={mainSearch} onTabChange={this.handleTabChange}>
title="搜索列表"
content={mainSearch}
onTabChange={this.handleTabChange}
>
<div className={styles.coverCardList}> <div className={styles.coverCardList}>
<Card bordered={false}> <Card bordered={false}>
<Form layout="inline"> <Form layout="inline">
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
"nzh": "^1.0.3" "nzh": "^1.0.3"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
...@@ -46,7 +46,8 @@ export default { ...@@ -46,7 +46,8 @@ export default {
'BLOCK_NAME.client.placeholder': 'BLOCK_NAME.client.placeholder':
'Please describe your customer service, internal customers directly @ Name / job number', 'Please describe your customer service, internal customers directly @ Name / job number',
'BLOCK_NAME.invites.label': 'Inviting critics', '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.label': 'Weight',
'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight',
'BLOCK_NAME.public.label': 'Target disclosure', 'BLOCK_NAME.public.label': 'Target disclosure',
......
...@@ -42,7 +42,8 @@ export default { ...@@ -42,7 +42,8 @@ export default {
'BLOCK_NAME.client.placeholder': 'BLOCK_NAME.client.placeholder':
'Please describe your customer service, internal customers directly @ Name / job number', 'Please describe your customer service, internal customers directly @ Name / job number',
'BLOCK_NAME.invites.label': 'Inviting critics', '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.label': 'Weight',
'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight',
'BLOCK_NAME.public.label': 'Target disclosure', 'BLOCK_NAME.public.label': 'Target disclosure',
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "ISC" "license": "ISC"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-block-dev": "^1.0.0", "umi-plugin-block-dev": "^1.0.0",
"umi-plugin-react": "^1.3.0-beta.1" "umi-plugin-react": "^1.3.0-beta.1"
}, },
......
...@@ -81,7 +81,9 @@ class LoginPage extends Component { ...@@ -81,7 +81,9 @@ class LoginPage extends Component {
{status === 'error' && {status === 'error' &&
loginType === 'account' && loginType === 'account' &&
!submitting && !submitting &&
this.renderMessage(formatMessage({ id: 'BLOCK_NAME.login.message-invalid-credentials' }))} this.renderMessage(
formatMessage({ id: 'BLOCK_NAME.login.message-invalid-credentials' })
)}
<UserName <UserName
name="userName" name="userName"
placeholder={`${formatMessage({ id: 'BLOCK_NAME.login.userName' })}: admin or user`} placeholder={`${formatMessage({ id: 'BLOCK_NAME.login.userName' })}: admin or user`}
......
export default { export default {
'BLOCK_NAME.login.userName': 'userName', 'BLOCK_NAME.login.userName': 'userName',
'BLOCK_NAME.login.password': 'password', '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.message-invalid-verification-code': 'Invalid verification code',
'BLOCK_NAME.login.tab-login-credentials': 'Credentials', 'BLOCK_NAME.login.tab-login-credentials': 'Credentials',
'BLOCK_NAME.login.tab-login-mobile': 'Mobile number', 'BLOCK_NAME.login.tab-login-mobile': 'Mobile number',
...@@ -60,7 +61,8 @@ export default { ...@@ -60,7 +61,8 @@ export default {
'BLOCK_NAME.client.placeholder': 'BLOCK_NAME.client.placeholder':
'Please describe your customer service, internal customers directly @ Name / job number', 'Please describe your customer service, internal customers directly @ Name / job number',
'BLOCK_NAME.invites.label': 'Inviting critics', '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.label': 'Weight',
'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight',
'BLOCK_NAME.public.label': 'Target disclosure', 'BLOCK_NAME.public.label': 'Target disclosure',
......
import { parse } from 'query-string' import { parse } from 'query-string';
export function getPageQuery() { export function getPageQuery() {
return parse(window.location.href.split('?')[1]); return parse(window.location.href.split('?')[1]);
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "MIT" "license": "MIT"
......
...@@ -196,7 +196,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component { ...@@ -196,7 +196,10 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
}, },
], ],
})( })(
<Input size="large" placeholder={formatMessage({ id: 'BLOCK_NAME.email.placeholder' })} /> <Input
size="large"
placeholder={formatMessage({ id: 'BLOCK_NAME.email.placeholder' })}
/>
)} )}
</FormItem> </FormItem>
<FormItem help={help}> <FormItem help={help}>
......
export default { export default {
'BLOCK_NAME.login.userName': 'userName', 'BLOCK_NAME.login.userName': 'userName',
'BLOCK_NAME.login.password': 'password', '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.message-invalid-verification-code': 'Invalid verification code',
'BLOCK_NAME.login.tab-login-credentials': 'Credentials', 'BLOCK_NAME.login.tab-login-credentials': 'Credentials',
'BLOCK_NAME.login.tab-login-mobile': 'Mobile number', 'BLOCK_NAME.login.tab-login-mobile': 'Mobile number',
...@@ -60,7 +61,8 @@ export default { ...@@ -60,7 +61,8 @@ export default {
'BLOCK_NAME.client.placeholder': 'BLOCK_NAME.client.placeholder':
'Please describe your customer service, internal customers directly @ Name / job number', 'Please describe your customer service, internal customers directly @ Name / job number',
'BLOCK_NAME.invites.label': 'Inviting critics', '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.label': 'Weight',
'BLOCK_NAME.weight.placeholder': 'Please enter weight', 'BLOCK_NAME.weight.placeholder': 'Please enter weight',
'BLOCK_NAME.public.label': 'Target disclosure', 'BLOCK_NAME.public.label': 'Target disclosure',
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
"ant-design-pro": "^2.1.1" "ant-design-pro": "^2.1.1"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-react": "^1.3.0-beta.1", "umi-plugin-react": "^1.7.2",
"umi-plugin-block-dev": "^1.0.0" "umi-plugin-block-dev": "^1.0.0"
}, },
"license": "MIT" "license": "MIT"
......
export default { export default {
'BLOCK_NAME.login.userName': 'userName', 'BLOCK_NAME.login.userName': 'userName',
'BLOCK_NAME.login.password': 'password', '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.message-invalid-verification-code': 'Invalid verification code',
'BLOCK_NAME.login.tab-login-credentials': 'Credentials', 'BLOCK_NAME.login.tab-login-credentials': 'Credentials',
'BLOCK_NAME.login.tab-login-mobile': 'Mobile number', 'BLOCK_NAME.login.tab-login-mobile': 'Mobile number',
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"umi-request": "^1.0.0" "umi-request": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"umi": "^2.3.0-beta.1", "umi": "^2.6.9",
"umi-plugin-block-dev": "^1.0.0", "umi-plugin-block-dev": "^1.0.0",
"umi-plugin-react": "^1.3.0-beta.1" "umi-plugin-react": "^1.3.0-beta.1"
}, },
......
...@@ -15,14 +15,15 @@ const prettierConfigPath = require.resolve('../.prettierrc'); ...@@ -15,14 +15,15 @@ const prettierConfigPath = require.resolve('../.prettierrc');
let didError = false; let didError = false;
let files = []; let files = [];
const jsFiles = glob.sync('ant-design-pro/**/*.js*', { const jsFiles = glob.sync('**/src/*.js*', {
ignore: ['**/node_modules/**', 'build/**'], ignore: ['**/node_modules/**', 'build/**', '**/.umi/**'],
}); });
const tsFiles = glob.sync('ant-design-pro/**/*.ts*', { const tsFiles = glob.sync('**/src/*.ts*', {
ignore: ['**/node_modules/**', 'build/**'], ignore: ['**/node_modules/**', 'build/**', '**/.umi/**'],
}); });
files = files.concat(jsFiles); files = files.concat(jsFiles);
files = files.concat(tsFiles); files = files.concat(tsFiles);
if (!files.length) { if (!files.length) {
return; return;
} }
......
{ {
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "umi dev", "dev": "PAGES_PATH='Exception500/src' umi dev",
"lint:style": "stylelint \"src/**/*.less\" --syntax less", "lint:style": "stylelint \"src/**/*.less\" --syntax less",
"lint": "eslint --ext .js src mock tests && npm run lint:style", "lint": "eslint --ext .js src mock tests && npm run lint:style",
"lint:fix": "eslint --fix --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 @@ ...@@ -10,6 +10,7 @@
"prettier": "node ./_scripts/prettier.js" "prettier": "node ./_scripts/prettier.js"
}, },
"devDependencies": { "devDependencies": {
"@types/classnames": "^2.2.7",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"eslint": "^5.4.0", "eslint": "^5.4.0",
"eslint-config-airbnb": "^17.0.0", "eslint-config-airbnb": "^17.0.0",
...@@ -28,7 +29,7 @@ ...@@ -28,7 +29,7 @@
"stylelint-config-prettier": "^4.0.0", "stylelint-config-prettier": "^4.0.0",
"stylelint-config-standard": "^18.0.0", "stylelint-config-standard": "^18.0.0",
"umi": "^2.3.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" "umi-plugin-react": "^1.3.0-0"
}, },
"lint-staged": { "lint-staged": {
......
...@@ -22,11 +22,5 @@ ...@@ -22,11 +22,5 @@
} }
}, },
"include": ["."], "include": ["."],
"exclude": [ "exclude": ["node_modules", "_scripts", "jest", "tslint:latest", "tslint-config-prettier"]
"node_modules",
"_scripts",
"jest",
"tslint:latest",
"tslint-config-prettier"
]
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment