Commit d1d6ec05 authored by 陈帅's avatar 陈帅

Merge branch 'master' into v4

parents 4ad0e5a1 a375bddc
version: "3.5" version: '3.5'
services: services:
ant-design-pro_build: ant-design-pro_build:
build: ../ build: ../
container_name: "ant-design-pro_build" container_name: 'ant-design-pro_build'
volumes: volumes:
- dist:/usr/src/app/dist - dist:/usr/src/app/dist
...@@ -11,7 +11,7 @@ services: ...@@ -11,7 +11,7 @@ services:
image: nginx image: nginx
ports: ports:
- 80:80 - 80:80
container_name: "ant-design-pro_web" container_name: 'ant-design-pro_web'
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- dist:/usr/share/nginx/html:ro - dist:/usr/share/nginx/html:ro
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
"@antv/data-set": "^0.10.1", "@antv/data-set": "^0.10.1",
"ant-design-pro": "^2.1.1", "ant-design-pro": "^2.1.1",
"antd": "^3.16.1", "antd": "^3.16.1",
"bizcharts": "^3.4.3", "bizcharts": "3.5.2-beta",
"bizcharts-plugin-slider": "^2.1.1-beta.1", "bizcharts-plugin-slider": "^2.1.1-beta.1",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"dva": "^2.4.0", "dva": "^2.4.0",
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
"react-fittext": "^1.0.0", "react-fittext": "^1.0.0",
"react-media": "^1.9.2", "react-media": "^1.9.2",
"react-media-hook2": "^1.0.2", "react-media-hook2": "^1.0.2",
"umi": "^2.6.10", "umi": "^2.6.17",
"umi-plugin-pro-block": "^1.3.0", "umi-plugin-pro-block": "^1.3.0",
"umi-plugin-react": "^1.7.2", "umi-plugin-react": "^1.7.2",
"umi-request": "^1.0.5" "umi-request": "^1.0.5"
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
"eslint-plugin-markdown": "^1.0.0", "eslint-plugin-markdown": "^1.0.0",
"eslint-plugin-react": "^7.12.4", "eslint-plugin-react": "^7.12.4",
"gh-pages": "^2.0.1", "gh-pages": "^2.0.1",
"husky": "^1.3.1", "husky": "^2.2.0",
"jest-puppeteer": "^4.1.0", "jest-puppeteer": "^4.1.0",
"jsdom-global": "^3.0.2", "jsdom-global": "^3.0.2",
"less": "^3.9.0", "less": "^3.9.0",
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
"puppeteer": "^1.12.1" "puppeteer": "^1.12.1"
}, },
"engines": { "engines": {
"node": ">=8.0.0" "node": ">=10.0.0"
}, },
"checkFiles": [ "checkFiles": [
"src/**/*.js*", "src/**/*.js*",
......
import { checkPermissions } from './CheckPermissions';
const target = 'ok';
const error = 'error';
describe('test CheckPermissions', () => {
it('Correct string permission authentication', () => {
expect(checkPermissions('user', 'user', target, error)).toEqual('ok');
});
it('Correct string permission authentication', () => {
expect(checkPermissions('user', 'NULL', target, error)).toEqual('error');
});
it('authority is undefined , return ok', () => {
expect(checkPermissions(null, 'NULL', target, error)).toEqual('ok');
});
it('currentAuthority is undefined , return error', () => {
expect(checkPermissions('admin', null, target, error)).toEqual('error');
});
it('Wrong string permission authentication', () => {
expect(checkPermissions('admin', 'user', target, error)).toEqual('error');
});
it('Correct Array permission authentication', () => {
expect(checkPermissions(['user', 'admin'], 'user', target, error)).toEqual('ok');
});
it('Wrong Array permission authentication,currentAuthority error', () => {
expect(checkPermissions(['user', 'admin'], 'user,admin', target, error)).toEqual('error');
});
it('Wrong Array permission authentication', () => {
expect(checkPermissions(['user', 'admin'], 'guest', target, error)).toEqual('error');
});
it('Wrong Function permission authentication', () => {
expect(checkPermissions(() => false, 'guest', target, error)).toEqual('error');
});
it('Correct Function permission authentication', () => {
expect(checkPermissions(() => true, 'guest', target, error)).toEqual('ok');
});
it('authority is string, currentAuthority is array, return ok', () => {
expect(checkPermissions('user', ['user'], target, error)).toEqual('ok');
});
it('authority is string, currentAuthority is array, return ok', () => {
expect(checkPermissions('user', ['user', 'admin'], target, error)).toEqual('ok');
});
it('authority is array, currentAuthority is array, return ok', () => {
expect(checkPermissions(['user', 'admin'], ['user', 'admin'], target, error)).toEqual('ok');
});
it('Wrong Function permission authentication', () => {
expect(checkPermissions(() => false, ['user'], target, error)).toEqual('error');
});
it('Correct Function permission authentication', () => {
expect(checkPermissions(() => true, ['user'], target, error)).toEqual('ok');
});
it('authority is undefined , return ok', () => {
expect(checkPermissions(null, ['user'], target, error)).toEqual('ok');
});
});
export default {
'app.login.userName': 'userName',
'app.login.password': 'password',
'app.login.message-invalid-credentials': 'Invalid username or password(admin/ant.design)',
'app.login.message-invalid-verification-code': 'Invalid verification code',
'app.login.tab-login-credentials': 'Credentials',
'app.login.tab-login-mobile': 'Mobile number',
'app.login.remember-me': 'Remember me',
'app.login.forgot-password': 'Forgot your password?',
'app.login.sign-in-with': 'Sign in with',
'app.login.signup': 'Sign up',
'app.login.login': 'Login',
'app.register.register': 'Register',
'app.register.get-verification-code': 'Get code',
'app.login.verification-code-warning':
'This project is a demo project and will not actually send you a verification code. Please switch to the account password login interface and log in as prompted.',
'app.register.sign-in': 'Already have an account?',
'app.register-result.msg': 'Account:registered at {email}',
'app.register-result.activation-email':
'The activation email has been sent to your email address and is valid for 24 hours. Please log in to the email in time and click on the link in the email to activate the account.',
'app.register-result.back-home': 'Back to home',
'app.register-result.view-mailbox': 'View mailbox',
'validation.email.required': 'Please enter your email!',
'validation.email.wrong-format': 'The email address is in the wrong format!',
'validation.userName.required': 'Please enter your userName!',
'validation.password.required': 'Please enter your password!',
'validation.password.twice': 'The passwords entered twice do not match!',
'validation.password.strength.msg':
"Please enter at least 6 characters and don't use passwords that are easy to guess.",
'validation.password.strength.strong': 'Strength: strong',
'validation.password.strength.medium': 'Strength: medium',
'validation.password.strength.short': 'Strength: too short',
'validation.confirm-password.required': 'Please confirm your password!',
'validation.phone-number.required': 'Please enter your phone number!',
'validation.phone-number.wrong-format': 'Malformed phone number!',
'validation.verification-code.required': 'Please enter the verification code!',
'validation.title.required': 'Please enter a title',
'validation.date.required': 'Please select the start and end date',
'validation.goal.required': 'Please enter a description of the goal',
'validation.standard.required': 'Please enter a metric',
};
export default {
'app.login.userName': 'Nome de usuário',
'app.login.password': 'Sua senha',
'app.login.message-invalid-credentials':
'Nome de usuário ou senha inválidosd(admin/ant.design)',
'app.login.message-invalid-verification-code': 'Código de verificação inválido',
'app.login.tab-login-credentials': 'Credenciais',
'app.login.tab-login-mobile': 'Telefone',
'app.login.remember-me': 'Lembre-me',
'app.login.forgot-password': 'Esqueceu sua senha?',
'app.login.sign-in-with': 'Login com',
'app.login.signup': 'Cadastre-se',
'app.login.login': 'Login',
'app.register.register': 'Cadastro',
'app.register.get-verification-code': 'Recuperar código',
'app.login.verification-code-warning':
'This project is a demo project and will not actually send you a verification code. Please switch to the account password login interface and log in as prompted.',
'app.register.sign-in': 'Já tem uma conta?',
'app.register-result.msg': 'Conta:registrada em {email}',
'app.register-result.activation-email':
'Um email de ativação foi enviado para o seu email e é válido por 24 horas. Por favor entre no seu email e clique no link de ativação da conta.',
'app.register-result.back-home': 'Voltar ao Início',
'app.register-result.view-mailbox': 'Visualizar a caixa de email',
'validation.email.required': 'Por favor insira seu email!',
'validation.email.wrong-format': 'O email está errado!',
'validation.userName.required': 'Por favor insira nome de usuário!',
'validation.password.required': 'Por favor insira sua senha!',
'validation.password.twice': 'As senhas não estão iguais!',
'validation.password.strength.msg':
'Por favor insira pelo menos 6 caracteres e não use senhas fáceis de adivinhar.',
'validation.password.strength.strong': 'Força: forte',
'validation.password.strength.medium': 'Força: média',
'validation.password.strength.short': 'Força: curta',
'validation.confirm-password.required': 'Por favor confirme sua senha!',
'validation.phone-number.required': 'Por favor insira seu telefone!',
'validation.phone-number.wrong-format': 'Formato de telefone errado!',
'validation.verification-code.required': 'Por favor insira seu código de verificação!',
};
export default {
'app.login.userName': '用户名',
'app.login.password': '密码',
'app.login.message-invalid-credentials': '账户或密码错误(admin/ant.design)',
'app.login.message-invalid-verification-code': '验证码错误',
'app.login.tab-login-credentials': '账户密码登录',
'app.login.tab-login-mobile': '手机号登录',
'app.login.remember-me': '自动登录',
'app.login.forgot-password': '忘记密码',
'app.login.sign-in-with': '其他登录方式',
'app.login.signup': '注册账户',
'app.login.login': '登录',
'app.register.register': '注册',
'app.register.get-verification-code': '获取验证码',
'app.login.verification-code-warning':
'此项目为演示项目,并不会真的给您发送验证码。请切换到账户密码登录界面按提示登录。',
'app.register.sign-in': '使用已有账户登录',
'app.register-result.msg': '你的账户:{email} 注册成功',
'app.register-result.activation-email':
'激活邮件已发送到你的邮箱中,邮件有效期为24小时。请及时登录邮箱,点击邮件中的链接激活帐户。',
'app.register-result.back-home': '返回首页',
'app.register-result.view-mailbox': '查看邮箱',
'validation.email.required': '请输入邮箱地址!',
'validation.email.wrong-format': '邮箱地址格式错误!',
'validation.userName.required': '请输入用户名!',
'validation.password.required': '请输入密码!',
'validation.password.twice': '两次输入的密码不匹配!',
'validation.password.strength.msg': '请至少输入 6 个字符。请不要使用容易被猜到的密码。',
'validation.password.strength.strong': '强度:强',
'validation.password.strength.medium': '强度:中',
'validation.password.strength.short': '强度:太短',
'validation.confirm-password.required': '请确认密码!',
'validation.phone-number.required': '请输入手机号!',
'validation.phone-number.wrong-format': '手机号格式错误!',
'validation.verification-code.required': '请输入验证码!',
'validation.title.required': '请输入标题',
'validation.date.required': '请选择起止日期',
'validation.goal.required': '请输入目标描述',
'validation.standard.required': '请输入衡量标准',
};
export default { export default {
'menu.welcome': '欢迎', 'menu.welcome': '欢迎',
'menu.more-blocks': '更多区块', 'menu.more-blocks': '更多区块',
'menu.account.center': '个人中心', 'menu.account.center': '个人中心',
'menu.account.settings': '个人设置', 'menu.account.settings': '个人设置',
'menu.account.trigger': '触发报错', 'menu.account.trigger': '触发报错',
......
export default {
'app.login.userName': '賬戶',
'app.login.password': '密碼',
'app.login.message-invalid-credentials': '賬戶或密碼錯誤(admin/ant.design)',
'app.login.message-invalid-verification-code': '驗證碼錯誤',
'app.login.tab-login-credentials': '賬戶密碼登錄',
'app.login.tab-login-mobile': '手機號登錄',
'app.login.remember-me': '自動登錄',
'app.login.forgot-password': '忘記密碼',
'app.login.sign-in-with': '其他登錄方式',
'app.login.signup': '註冊賬戶',
'app.login.login': '登錄',
'app.register.register': '註冊',
'app.register.get-verification-code': '獲取驗證碼',
'app.login.verification-code-warning':
'此項目為演示項目,並不會真的給您發送驗證碼。請切換到賬戶密碼登錄界面按提示登錄。',
'app.register.sign-in': '使用已有賬戶登錄',
'app.register-result.msg': '妳的賬戶:{email} 註冊成功',
'app.register-result.activation-email':
'激活郵件已發送到妳的郵箱中,郵件有效期為24小時。請及時登錄郵箱,點擊郵件中的鏈接激活帳戶。',
'app.register-result.back-home': '返回首頁',
'app.register-result.view-mailbox': '查看郵箱',
'validation.email.required': '請輸入郵箱地址!',
'validation.email.wrong-format': '郵箱地址格式錯誤!',
'validation.userName.required': '請輸入賬戶!',
'validation.password.required': '請輸入密碼!',
'validation.password.twice': '兩次輸入的密碼不匹配!',
'validation.password.strength.msg': '請至少輸入 6 個字符。請不要使用容易被猜到的密碼。',
'validation.password.strength.strong': '強度:強',
'validation.password.strength.medium': '強度:中',
'validation.password.strength.short': '強度:太短',
'validation.confirm-password.required': '請確認密碼!',
'validation.phone-number.required': '請輸入手機號!',
'validation.phone-number.wrong-format': '手機號格式錯誤!',
'validation.verification-code.required': '請輸入驗證碼!',
'validation.title.required': '請輸入標題',
'validation.date.required': '請選擇起止日期',
'validation.goal.required': '請輸入目標描述',
'validation.standard.required': '請輸入衡量標淮',
};
import Authorized from '@/utils/Authorized'; import Authorized from '@/utils/Authorized';
import { Route } from '@/components/SiderMenu'; import { Route } from '@/models/connect';
import { ConnectProps, ConnectState, UserModelState } from '@/models/connect'; import { ConnectProps, ConnectState, UserModelState } from '@/models/connect';
import { connect } from 'dva'; import { connect } from 'dva';
import pathToRegexp from 'path-to-regexp'; import pathToRegexp from 'path-to-regexp';
......
...@@ -2,8 +2,8 @@ import React, { Component } from 'react'; ...@@ -2,8 +2,8 @@ import React, { Component } from 'react';
import { Chart, Axis, Tooltip, Geom } from 'bizcharts'; import { Chart, Axis, Tooltip, Geom } from 'bizcharts';
import Debounce from 'lodash-decorators/debounce'; import Debounce from 'lodash-decorators/debounce';
import Bind from 'lodash-decorators/bind'; import Bind from 'lodash-decorators/bind';
import autoHeight from '../autoHeight';
import styles from '../index.less'; import styles from '../index.less';
import autoHeight from '../autoHeight';
export interface IBarProps { export interface IBarProps {
title: React.ReactNode; title: React.ReactNode;
...@@ -29,6 +29,7 @@ class Bar extends Component< ...@@ -29,6 +29,7 @@ class Bar extends Component<
node: HTMLDivElement | undefined; node: HTMLDivElement | undefined;
state = { state = {
height: 0,
autoHideXLabels: false, autoHideXLabels: false,
}; };
...@@ -76,7 +77,7 @@ class Bar extends Component< ...@@ -76,7 +77,7 @@ class Bar extends Component<
render() { render() {
const { const {
height = 1, height: propsHeight = 1,
title, title,
forceFit = true, forceFit = true,
data, data,
...@@ -102,7 +103,8 @@ class Bar extends Component< ...@@ -102,7 +103,8 @@ class Bar extends Component<
value: y, value: y,
}), }),
]; ];
const { height: stateHeight } = this.state;
const height = propsHeight || stateHeight;
return ( return (
<div className={styles.chart} style={{ height }} ref={this.handleRoot}> <div className={styles.chart} style={{ height }} ref={this.handleRoot}>
<div ref={this.handleRef}> <div ref={this.handleRef}>
......
...@@ -6,9 +6,8 @@ import classNames from 'classnames'; ...@@ -6,9 +6,8 @@ import classNames from 'classnames';
import ReactFitText from 'react-fittext'; import ReactFitText from 'react-fittext';
import Debounce from 'lodash-decorators/debounce'; import Debounce from 'lodash-decorators/debounce';
import Bind from 'lodash-decorators/bind'; import Bind from 'lodash-decorators/bind';
import autoHeight from '../autoHeight';
import styles from './index.less'; import styles from './index.less';
import autoHeight from '../autoHeight';
export interface IPieProps { export interface IPieProps {
animate?: boolean; animate?: boolean;
color?: string; color?: string;
...@@ -279,7 +278,6 @@ class Pie extends Component<IPieProps, IPieState> { ...@@ -279,7 +278,6 @@ class Pie extends Component<IPieProps, IPieState> {
)} )}
</div> </div>
</ReactFitText> </ReactFitText>
{hasLegend && ( {hasLegend && (
<ul className={styles.legend}> <ul className={styles.legend}>
{legendData.map((item, i) => ( {legendData.map((item, i) => (
......
...@@ -57,6 +57,11 @@ class Analysis extends Component<AnalysisProps, AnalysisState> { ...@@ -57,6 +57,11 @@ class Analysis extends Component<AnalysisProps, AnalysisState> {
type: 'analysis/fetch', type: 'analysis/fetch',
}); });
}); });
setTimeout(() => {
this.setState({
loading: false,
});
}, 2000);
} }
componentWillUnmount() { componentWillUnmount() {
......
...@@ -135,6 +135,12 @@ ...@@ -135,6 +135,12 @@
} }
} }
.twoColLayout {
.salesCard {
height: calc(100% - 24px);
}
}
.trendText { .trendText {
margin-left: 8px; margin-left: 8px;
color: @heading-color; color: @heading-color;
......
...@@ -12,6 +12,159 @@ ...@@ -12,6 +12,159 @@
</head> </head>
<body> <body>
<noscript>Sorry, we need js to run correctly!</noscript> <noscript>Sorry, we need js to run correctly!</noscript>
<div id="root"></div> <div id="root">
<style>
.page-loading-warp {
padding: 120px;
display: flex;
justify-content: center;
align-items: center;
}
.ant-spin {
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
color: rgba(0, 0, 0, 0.65);
font-size: 14px;
font-variant: tabular-nums;
line-height: 1.5;
list-style: none;
-webkit-font-feature-settings: "tnum";
font-feature-settings: "tnum";
position: absolute;
display: none;
color: #1890ff;
text-align: center;
vertical-align: middle;
opacity: 0;
-webkit-transition: -webkit-transform 0.3s
cubic-bezier(0.78, 0.14, 0.15, 0.86);
transition: -webkit-transform 0.3s
cubic-bezier(0.78, 0.14, 0.15, 0.86);
transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86),
-webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
}
.ant-spin-spinning {
position: static;
display: inline-block;
opacity: 1;
}
.ant-spin-dot {
position: relative;
display: inline-block;
font-size: 20px;
width: 20px;
height: 20px;
}
.ant-spin-dot-item {
position: absolute;
display: block;
width: 9px;
height: 9px;
background-color: #1890ff;
border-radius: 100%;
-webkit-transform: scale(0.75);
-ms-transform: scale(0.75);
transform: scale(0.75);
-webkit-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
opacity: 0.3;
-webkit-animation: antSpinMove 1s infinite linear alternate;
animation: antSpinMove 1s infinite linear alternate;
}
.ant-spin-dot-item:nth-child(1) {
top: 0;
left: 0;
}
.ant-spin-dot-item:nth-child(2) {
top: 0;
right: 0;
-webkit-animation-delay: 0.4s;
animation-delay: 0.4s;
}
.ant-spin-dot-item:nth-child(3) {
right: 0;
bottom: 0;
-webkit-animation-delay: 0.8s;
animation-delay: 0.8s;
}
.ant-spin-dot-item:nth-child(4) {
bottom: 0;
left: 0;
-webkit-animation-delay: 1.2s;
animation-delay: 1.2s;
}
.ant-spin-dot-spin {
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-animation: antRotate 1.2s infinite linear;
animation: antRotate 1.2s infinite linear;
}
.ant-spin-lg .ant-spin-dot {
font-size: 32px;
width: 32px;
height: 32px;
}
.ant-spin-lg .ant-spin-dot i {
width: 14px;
height: 14px;
}
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
.ant-spin-blur {
background: #fff;
opacity: 0.5;
}
}
@-webkit-keyframes antSpinMove {
to {
opacity: 1;
}
}
@keyframes antSpinMove {
to {
opacity: 1;
}
}
@-webkit-keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}
@keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}
</style>
<div class="page-loading-warp">
<div class="ant-spin ant-spin-lg ant-spin-spinning">
<span class="ant-spin-dot ant-spin-dot-spin"
><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i
><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i
></span>
</div>
</div>
</div>
</body> </body>
</html> </html>
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