Commit 47bae748 authored by 陈帅's avatar 陈帅

merge master

parents 98dbe499 c10d7009
...@@ -4,7 +4,7 @@ server { ...@@ -4,7 +4,7 @@ server {
gzip on; gzip on;
gzip_min_length 1k; gzip_min_length 1k;
gzip_comp_level 9; gzip_comp_level 9;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png; gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml;
gzip_vary on; gzip_vary on;
gzip_disable "MSIE [1-6]\."; gzip_disable "MSIE [1-6]\.";
......
{ {
"name": "ant-design-pro", "name": "ant-design-pro",
"version": "2.1.0", "version": "2.1.1",
"description": "An out-of-box UI solution for enterprise applications", "description": "An out-of-box UI solution for enterprise applications",
"private": true, "private": true,
"scripts": { "scripts": {
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
"docker-prod:build": "docker-compose -f ./docker/docker-compose.yml build" "docker-prod:build": "docker-compose -f ./docker/docker-compose.yml build"
}, },
"dependencies": { "dependencies": {
"@antv/data-set": "^0.9.6", "@antv/data-set": "^0.10.0",
"@babel/runtime": "^7.1.2", "@babel/runtime": "^7.1.5",
"antd": "^3.10.0", "antd": "^3.10.7",
"bizcharts": "^3.2.2", "bizcharts": "^3.2.5-beta.4",
"bizcharts-plugin-slider": "^2.0.3", "bizcharts-plugin-slider": "^2.0.3",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"dva": "^2.4.0", "dva": "^2.4.0",
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
"devDependencies": { "devDependencies": {
"@types/react": "^16.4.16", "@types/react": "^16.4.16",
"@types/react-dom": "^16.0.9", "@types/react-dom": "^16.0.9",
"antd-pro-merge-less": "^0.0.9", "antd-pro-merge-less": "^0.2.0",
"antd-theme-webpack-plugin": "^1.1.8", "antd-theme-webpack-plugin": "^1.1.8",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"cross-env": "^5.1.1", "cross-env": "^5.1.1",
...@@ -73,25 +73,25 @@ ...@@ -73,25 +73,25 @@
"eslint-plugin-jsx-a11y": "^6.1.2", "eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-markdown": "^1.0.0-beta.6", "eslint-plugin-markdown": "^1.0.0-beta.6",
"eslint-plugin-react": "^7.11.1", "eslint-plugin-react": "^7.11.1",
"tslint": "^5.10.0",
"tslint-config-prettier": "^1.10.0",
"tslint-react": "^3.6.0",
"gh-pages": "^2.0.1", "gh-pages": "^2.0.1",
"husky": "^1.1.2", "husky": "^1.1.2",
"lint-staged": "^7.2.0", "lint-staged": "^8.0.4",
"merge-umi-mock-data": "^0.0.3", "merge-umi-mock-data": "^0.0.3",
"mockjs": "^1.0.1-beta3", "mockjs": "^1.0.1-beta3",
"prettier": "1.14.3", "prettier": "1.15.2",
"pro-download": "^1.0.1", "pro-download": "^1.0.1",
"stylelint": "^9.4.0", "stylelint": "^9.4.0",
"stylelint-config-prettier": "^4.0.0", "stylelint-config-prettier": "^4.0.0",
"stylelint-config-standard": "^18.0.0", "stylelint-config-standard": "^18.0.0",
"tslint": "^5.10.0",
"tslint-config-prettier": "^1.10.0",
"tslint-react": "^3.6.0",
"umi": "^2.2.1", "umi": "^2.2.1",
"umi-plugin-ga": "^1.1.3", "umi-plugin-ga": "^1.1.3",
"umi-plugin-react": "^1.2.0" "umi-plugin-react": "^1.2.0"
}, },
"optionalDependencies": { "optionalDependencies": {
"puppeteer": "^1.9.0" "puppeteer": "^1.10.0"
}, },
"lint-staged": { "lint-staged": {
"**/*.{js,jsx,less}": [ "**/*.{js,jsx,less}": [
......
public/favicon.png

6.56 KB | W: | H:

public/favicon.png

2.78 KB | W: | H:

public/favicon.png
public/favicon.png
public/favicon.png
public/favicon.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -4,8 +4,8 @@ import styles from './index.less'; ...@@ -4,8 +4,8 @@ import styles from './index.less';
const Field = ({ label, value, ...rest }) => ( const Field = ({ label, value, ...rest }) => (
<div className={styles.field} {...rest}> <div className={styles.field} {...rest}>
<span>{label}</span> <span className={styles.label}>{label}</span>
<span>{value}</span> <span className={styles.number}>{value}</span>
</div> </div>
); );
......
...@@ -5,12 +5,13 @@ ...@@ -5,12 +5,13 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
margin: 0; margin: 0;
span { .label,
.number {
font-size: @font-size-base; font-size: @font-size-base;
line-height: 22px; line-height: 22px;
} }
span:last-child { .number {
margin-left: 8px;
color: @heading-color; color: @heading-color;
margin-left: 8px;
} }
} }
...@@ -72,7 +72,7 @@ class Gauge extends React.Component { ...@@ -72,7 +72,7 @@ class Gauge extends React.Component {
nice: true, nice: true,
}, },
}; };
const data = [{ value: percent }]; const data = [{ value: percent / 10 }];
return ( return (
<Chart height={height} data={data} scale={cols} padding={[-16, 0, 16, 0]} forceFit={forceFit}> <Chart height={height} data={data} scale={cols} padding={[-16, 0, 16, 0]} forceFit={forceFit}>
<Coord type="polar" startAngle={-1.25 * Math.PI} endAngle={0.25 * Math.PI} radius={0.8} /> <Coord type="polar" startAngle={-1.25 * Math.PI} endAngle={0.25 * Math.PI} radius={0.8} />
...@@ -134,7 +134,7 @@ class Gauge extends React.Component { ...@@ -134,7 +134,7 @@ class Gauge extends React.Component {
<Arc <Arc
zIndex={1} zIndex={1}
start={[0, 0.965]} start={[0, 0.965]}
end={[data[0].value / 10, 0.965]} end={[data[0].value, 0.965]}
style={{ style={{
stroke: color, stroke: color,
lineWidth: 10, lineWidth: 10,
...@@ -146,7 +146,7 @@ class Gauge extends React.Component { ...@@ -146,7 +146,7 @@ class Gauge extends React.Component {
<div style="width: 300px;text-align: center;font-size: 12px!important;"> <div style="width: 300px;text-align: center;font-size: 12px!important;">
<p style="font-size: 14px; color: rgba(0,0,0,0.43);margin: 0;">${title}</p> <p style="font-size: 14px; color: rgba(0,0,0,0.43);margin: 0;">${title}</p>
<p style="font-size: 24px;color: rgba(0,0,0,0.85);margin: 0;"> <p style="font-size: 24px;color: rgba(0,0,0,0.85);margin: 0;">
${data[0].value}% ${data[0].value * 10}%
</p> </p>
</div>`} </div>`}
/> />
......
import * as React from 'react'; import * as React from 'react';
import { TooltipProps } from 'antd/lib/tooltip';
export interface IEllipsisTooltipProps extends TooltipProps {
title?: undefined;
overlayStyle?: undefined;
}
export interface IEllipsisProps { export interface IEllipsisProps {
tooltip?: boolean; tooltip?: boolean | IEllipsisTooltipProps;
length?: number; length?: number;
lines?: number; lines?: number;
style?: React.CSSProperties; style?: React.CSSProperties;
......
...@@ -38,6 +38,14 @@ export const cutStrByFullLength = (str = '', maxLength) => { ...@@ -38,6 +38,14 @@ export const cutStrByFullLength = (str = '', maxLength) => {
}, ''); }, '');
}; };
const getTooltip = ({ tooltip, overlayStyle, title, children }) => {
if (tooltip) {
const props = tooltip === true ? { overlayStyle, title } : { ...tooltip, overlayStyle, title };
return <Tooltip {...props}>{children}</Tooltip>;
}
return children;
};
const EllipsisText = ({ text, length, tooltip, fullWidthRecognition, ...other }) => { const EllipsisText = ({ text, length, tooltip, fullWidthRecognition, ...other }) => {
if (typeof text !== 'string') { if (typeof text !== 'string') {
throw new Error('Ellipsis children must be string.'); throw new Error('Ellipsis children must be string.');
...@@ -54,23 +62,18 @@ const EllipsisText = ({ text, length, tooltip, fullWidthRecognition, ...other }) ...@@ -54,23 +62,18 @@ const EllipsisText = ({ text, length, tooltip, fullWidthRecognition, ...other })
displayText = fullWidthRecognition ? cutStrByFullLength(text, length) : text.slice(0, length); displayText = fullWidthRecognition ? cutStrByFullLength(text, length) : text.slice(0, length);
} }
if (tooltip) { const spanAttrs = tooltip ? {} : { ...other };
return ( return getTooltip({
<Tooltip overlayStyle={TooltipOverlayStyle} title={text}> tooltip,
<span> overlayStyle: TooltipOverlayStyle,
{displayText} title: text,
{tail} children: (
</span> <span {...spanAttrs}>
</Tooltip> {displayText}
); {tail}
} </span>
),
return ( });
<span {...other}>
{displayText}
{tail}
</span>
);
}; };
export default class Ellipsis extends Component { export default class Ellipsis extends Component {
...@@ -230,13 +233,12 @@ export default class Ellipsis extends Component { ...@@ -230,13 +233,12 @@ export default class Ellipsis extends Component {
</div> </div>
); );
return tooltip ? ( return getTooltip({
<Tooltip overlayStyle={TooltipOverlayStyle} title={children}> tooltip,
{node} overlayStyle: TooltipOverlayStyle,
</Tooltip> title: children,
) : ( children: node,
node });
);
} }
const childNode = ( const childNode = (
...@@ -249,13 +251,12 @@ export default class Ellipsis extends Component { ...@@ -249,13 +251,12 @@ export default class Ellipsis extends Component {
return ( return (
<div {...restProps} ref={this.handleRoot} className={cls}> <div {...restProps} ref={this.handleRoot} className={cls}>
<div ref={this.handleContent}> <div ref={this.handleContent}>
{tooltip ? ( {getTooltip({
<Tooltip overlayStyle={TooltipOverlayStyle} title={text}> tooltip,
{childNode} overlayStyle: TooltipOverlayStyle,
</Tooltip> title: text,
) : ( children: childNode,
childNode })}
)}
<div className={styles.shadow} ref={this.handleShadowChildren}> <div className={styles.shadow} ref={this.handleShadowChildren}>
{children} {children}
</div> </div>
......
...@@ -5,7 +5,7 @@ export interface IExceptionProps { ...@@ -5,7 +5,7 @@ export interface IExceptionProps {
desc?: React.ReactNode; desc?: React.ReactNode;
img?: string; img?: string;
actions?: React.ReactNode; actions?: React.ReactNode;
linkElement?: React.ReactNode; linkElement?: string | React.ComponentType;
style?: React.CSSProperties; style?: React.CSSProperties;
className?: string; className?: string;
backText?: React.ReactNode; backText?: React.ReactNode;
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Form, Input, Button, Row, Col } from 'antd'; import { Form, Input, Button, Row, Col } from 'antd';
import { formatMessage } from 'umi/locale';
import omit from 'omit.js'; import omit from 'omit.js';
import styles from './index.less'; import styles from './index.less';
import ItemMap from './map'; import ItemMap from './map';
...@@ -9,7 +10,8 @@ const FormItem = Form.Item; ...@@ -9,7 +10,8 @@ const FormItem = Form.Item;
class WrapFormItem extends Component { class WrapFormItem extends Component {
static defaultProps = { static defaultProps = {
buttonText: '获取验证码', getCaptchaButtonText: formatMessage({ id: 'form.captcha' }),
getCaptchaSecondText: formatMessage({ id: 'form.captcha.second' }),
}; };
constructor(props) { constructor(props) {
...@@ -83,7 +85,8 @@ class WrapFormItem extends Component { ...@@ -83,7 +85,8 @@ class WrapFormItem extends Component {
defaultValue, defaultValue,
rules, rules,
name, name,
buttonText, getCaptchaButtonText,
getCaptchaSecondText,
updateActive, updateActive,
type, type,
...restProps ...restProps
...@@ -108,7 +111,7 @@ class WrapFormItem extends Component { ...@@ -108,7 +111,7 @@ class WrapFormItem extends Component {
size="large" size="large"
onClick={this.onGetCaptcha} onClick={this.onGetCaptcha}
> >
{count ? `${count} s` : buttonText} {count ? `${count} ${getCaptchaSecondText}` : getCaptchaButtonText}
</Button> </Button>
</Col> </Col>
</Row> </Row>
......
...@@ -13,6 +13,11 @@ ...@@ -13,6 +13,11 @@
} }
} }
.getCaptcha {
display: block;
width: 100%;
}
.icon { .icon {
font-size: 24px; font-size: 24px;
color: rgba(0, 0, 0, 0.2); color: rgba(0, 0, 0, 0.2);
......
...@@ -21,6 +21,7 @@ popupAlign | 弹出卡片的位置配置 | Object [alignConfig](https://github.c ...@@ -21,6 +21,7 @@ popupAlign | 弹出卡片的位置配置 | Object [alignConfig](https://github.c
onPopupVisibleChange | 弹出卡片显隐的回调 | function(visible) | - onPopupVisibleChange | 弹出卡片显隐的回调 | function(visible) | -
popupVisible | 控制弹层显隐 | boolean | - popupVisible | 控制弹层显隐 | boolean | -
locale | 默认文案 | Object | `{ emptyText: '暂无数据', clear: '清空' }` locale | 默认文案 | Object | `{ emptyText: '暂无数据', clear: '清空' }`
clearClose | 点击清空按钮后关闭通知菜单 | boolean | false
### NoticeIcon.Tab ### NoticeIcon.Tab
...@@ -43,3 +44,4 @@ title | 标题 | ReactNode | - ...@@ -43,3 +44,4 @@ title | 标题 | ReactNode | -
description | 描述信息 | ReactNode | - description | 描述信息 | ReactNode | -
datetime | 时间戳 | ReactNode | - datetime | 时间戳 | ReactNode | -
extra | 额外信息,在列表项右上角 | ReactNode | - extra | 额外信息,在列表项右上角 | ReactNode | -
clickClose | 点击列表项关闭通知菜单 | boolean | false
...@@ -118,7 +118,7 @@ export default class SiderMenu extends PureComponent { ...@@ -118,7 +118,7 @@ export default class SiderMenu extends PureComponent {
mode="inline" mode="inline"
handleOpenChange={this.handleOpenChange} handleOpenChange={this.handleOpenChange}
onOpenChange={this.handleOpenChange} onOpenChange={this.handleOpenChange}
style={{ padding: '16px 0', width: '100%', overflowX: 'hidden' }} style={{ padding: '16px 0', width: '100%' }}
{...defaultProps} {...defaultProps}
/> />
</Sider> </Sider>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
vertical-align: middle; vertical-align: middle;
font-size: 20px; font-size: 20px;
margin: 0 0 0 12px; margin: 0 0 0 12px;
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif; font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: 600; font-weight: 600;
} }
} }
......
...@@ -14,7 +14,7 @@ const Trend = ({ colorful = true, reverseColor = false, flag, children, classNam ...@@ -14,7 +14,7 @@ const Trend = ({ colorful = true, reverseColor = false, flag, children, classNam
); );
return ( return (
<div {...rest} className={classString} title={typeof children === 'string' ? children : ''}> <div {...rest} className={classString} title={typeof children === 'string' ? children : ''}>
<span className={styles.value}>{children}</span> <span>{children}</span>
{flag && ( {flag && (
<span className={styles[flag]}> <span className={styles[flag]}>
<Icon type={`caret-${flag}`} /> <Icon type={`caret-${flag}`} />
......
...@@ -3,13 +3,16 @@ import puppeteer from 'puppeteer'; ...@@ -3,13 +3,16 @@ import puppeteer from 'puppeteer';
const BASE_URL = `http://localhost:${process.env.PORT || 8000}`; const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
describe('Homepage', () => { describe('Homepage', () => {
beforeAll(async () => {
jest.setTimeout(1000000);
});
it('it should have logo text', async () => { it('it should have logo text', async () => {
const browser = await puppeteer.launch({ args: ['--no-sandbox'] }); const browser = await puppeteer.launch({ args: ['--no-sandbox'] });
const page = await browser.newPage(); const page = await browser.newPage();
await page.goto(BASE_URL, { waitUntil: 'networkidle2' }); await page.goto(BASE_URL, { waitUntil: 'networkidle2' });
await page.waitForSelector('#logo h1'); const text = await page.evaluate(() => document.getElementsByTagName('h1')[0].innerText);
const text = await page.evaluate(() => document.body.innerHTML); expect(text).toContain('Ant Design Pro');
expect(text).toContain('<h1>Ant Design Pro</h1>');
await page.close(); await page.close();
browser.close(); browser.close();
}); });
......
...@@ -28,6 +28,7 @@ describe('Homepage', () => { ...@@ -28,6 +28,7 @@ describe('Homepage', () => {
}; };
beforeAll(async () => { beforeAll(async () => {
jest.setTimeout(1000000);
browser = await puppeteer.launch({ args: ['--no-sandbox'] }); browser = await puppeteer.launch({ args: ['--no-sandbox'] });
page = await browser.newPage(); page = await browser.newPage();
}); });
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
} }
.content { .content {
padding: 72px 0 24px 0; padding: 32px 0 24px 0;
} }
} }
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
.title { .title {
font-size: 33px; font-size: 33px;
color: @heading-color; color: @heading-color;
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif; font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: 600; font-weight: 600;
position: relative; position: relative;
top: 2px; top: 2px;
......
...@@ -20,6 +20,8 @@ export default { ...@@ -20,6 +20,8 @@ export default {
'validation.date.required': 'Please select the start and end date', 'validation.date.required': 'Please select the start and end date',
'validation.goal.required': 'Please enter a description of the goal', 'validation.goal.required': 'Please enter a description of the goal',
'validation.standard.required': 'Please enter a metric', 'validation.standard.required': 'Please enter a metric',
'form.captcha': 'Get Captcha',
'form.captcha.second': 'sec',
'form.optional': ' (optional) ', 'form.optional': ' (optional) ',
'form.submit': 'Submit', 'form.submit': 'Submit',
'form.save': 'Save', 'form.save': 'Save',
......
...@@ -16,6 +16,8 @@ export default { ...@@ -16,6 +16,8 @@ export default {
'validation.phone-number.required': 'Por favor insira seu telefone!', 'validation.phone-number.required': 'Por favor insira seu telefone!',
'validation.phone-number.wrong-format': 'Formato de telefone errado!', 'validation.phone-number.wrong-format': 'Formato de telefone errado!',
'validation.verification-code.required': 'Por favor insira seu código de verificação!', 'validation.verification-code.required': 'Por favor insira seu código de verificação!',
'form.captcha': 'Get Captcha',
'form.captcha.second': 'sec',
'form.email.placeholder': 'Email', 'form.email.placeholder': 'Email',
'form.password.placeholder': 'Senha', 'form.password.placeholder': 'Senha',
'form.confirm-password.placeholder': 'Confirme a senha', 'form.confirm-password.placeholder': 'Confirme a senha',
......
...@@ -19,6 +19,8 @@ export default { ...@@ -19,6 +19,8 @@ export default {
'validation.date.required': '请选择起止日期', 'validation.date.required': '请选择起止日期',
'validation.goal.required': '请输入目标描述', 'validation.goal.required': '请输入目标描述',
'validation.standard.required': '请输入衡量标准', 'validation.standard.required': '请输入衡量标准',
'form.captcha': '获取验证码',
'form.captcha.second': '',
'form.optional': '(选填)', 'form.optional': '(选填)',
'form.submit': '提交', 'form.submit': '提交',
'form.save': '保存', 'form.save': '保存',
......
...@@ -19,6 +19,8 @@ export default { ...@@ -19,6 +19,8 @@ export default {
'validation.date.required': '請選擇起止日期', 'validation.date.required': '請選擇起止日期',
'validation.goal.required': '請輸入目標描述', 'validation.goal.required': '請輸入目標描述',
'validation.standard.required': '請輸入衡量標淮', 'validation.standard.required': '請輸入衡量標淮',
'form.captcha': '獲取驗證碼',
'form.captcha.second': '',
'form.optional': '(選填)', 'form.optional': '(選填)',
'form.submit': '提交', 'form.submit': '提交',
'form.save': '保存', 'form.save': '保存',
......
...@@ -145,7 +145,7 @@ class Monitor extends PureComponent { ...@@ -145,7 +145,7 @@ class Monitor extends PureComponent {
</Col> </Col>
</Row> </Row>
<Row gutter={24}> <Row gutter={24}>
<Col xl={12} lg={24} sm={24} xs={24}> <Col xl={12} lg={24} sm={24} xs={24} style={{ marginBottom: 24 }}>
<Card <Card
title={ title={
<FormattedMessage <FormattedMessage
...@@ -201,7 +201,7 @@ class Monitor extends PureComponent { ...@@ -201,7 +201,7 @@ class Monitor extends PureComponent {
</Row> </Row>
</Card> </Card>
</Col> </Col>
<Col xl={6} lg={12} sm={24} xs={24}> <Col xl={6} lg={12} sm={24} xs={24} style={{ marginBottom: 24 }}>
<Card <Card
title={ title={
<FormattedMessage <FormattedMessage
...@@ -216,7 +216,7 @@ class Monitor extends PureComponent { ...@@ -216,7 +216,7 @@ class Monitor extends PureComponent {
<TagCloud data={tags} height={161} /> <TagCloud data={tags} height={161} />
</Card> </Card>
</Col> </Col>
<Col xl={6} lg={12} sm={24} xs={24}> <Col xl={6} lg={12} sm={24} xs={24} style={{ marginBottom: 24 }}>
<Card <Card
title={ title={
<FormattedMessage <FormattedMessage
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
.mapChart { .mapChart {
padding-top: 24px; padding-top: 24px;
height: 457px; height: 452px;
text-align: center; text-align: center;
img { img {
display: inline-block; display: inline-block;
......
...@@ -114,7 +114,7 @@ class LoginPage extends Component { ...@@ -114,7 +114,7 @@ class LoginPage extends Component {
<Icon type="alipay-circle" className={styles.icon} theme="outlined" /> <Icon type="alipay-circle" className={styles.icon} theme="outlined" />
<Icon type="taobao-circle" className={styles.icon} theme="outlined" /> <Icon type="taobao-circle" className={styles.icon} theme="outlined" />
<Icon type="weibo-circle" className={styles.icon} theme="outlined" /> <Icon type="weibo-circle" className={styles.icon} theme="outlined" />
<Link className={styles.register} to="/User/Register"> <Link className={styles.register} to="/user/register">
<FormattedMessage id="app.login.signup" /> <FormattedMessage id="app.login.signup" />
</Link> </Link>
</div> </div>
......
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