Commit 193aa9f8 authored by jim's avatar jim

Merge branch 'master' into v2

parents 2c3214f1 2fbc37b0
...@@ -6,18 +6,17 @@ import styles from './index.less'; ...@@ -6,18 +6,17 @@ import styles from './index.less';
// TODO: 添加逻辑 // TODO: 添加逻辑
class EditableLinkGroup extends PureComponent { class EditableLinkGroup extends PureComponent {
static defaultProps = {
links: [],
onAdd: () => {},
linkElement: 'a',
};
static propTypes = { static propTypes = {
links: PropTypes.array, links: PropTypes.array,
onAdd: PropTypes.func, onAdd: PropTypes.func,
linkElement: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), linkElement: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
}; };
static defaultProps = {
links: [],
onAdd: () => {},
linkElement: 'a',
};
render() { render() {
const { links, linkElement, onAdd } = this.props; const { links, linkElement, onAdd } = this.props;
return ( return (
......
...@@ -20,7 +20,7 @@ const EllipsisText = ({ text, length, tooltip, ...other }) => { ...@@ -20,7 +20,7 @@ const EllipsisText = ({ text, length, tooltip, ...other }) => {
if (length - tail.length <= 0) { if (length - tail.length <= 0) {
displayText = ''; displayText = '';
} else { } else {
displayText = text.slice(0, length - tail.length); displayText = text.slice(0, length);
} }
if (tooltip) { if (tooltip) {
......
...@@ -5,15 +5,6 @@ import classNames from 'classnames'; ...@@ -5,15 +5,6 @@ import classNames from 'classnames';
import styles from './index.less'; import styles from './index.less';
export default class HeaderSearch extends PureComponent { export default class HeaderSearch extends PureComponent {
static defaultProps = {
defaultActiveFirstOption: false,
onPressEnter: () => {},
onSearch: () => {},
className: '',
placeholder: '',
dataSource: [],
defaultOpen: false,
};
static propTypes = { static propTypes = {
className: PropTypes.string, className: PropTypes.string,
placeholder: PropTypes.string, placeholder: PropTypes.string,
...@@ -23,6 +14,17 @@ export default class HeaderSearch extends PureComponent { ...@@ -23,6 +14,17 @@ export default class HeaderSearch extends PureComponent {
dataSource: PropTypes.array, dataSource: PropTypes.array,
defaultOpen: PropTypes.bool, defaultOpen: PropTypes.bool,
}; };
static defaultProps = {
defaultActiveFirstOption: false,
onPressEnter: () => {},
onSearch: () => {},
className: '',
placeholder: '',
dataSource: [],
defaultOpen: false,
};
state = { state = {
searchMode: this.props.defaultOpen, searchMode: this.props.defaultOpen,
value: '', value: '',
......
...@@ -9,18 +9,20 @@ import styles from './index.less'; ...@@ -9,18 +9,20 @@ import styles from './index.less';
import LoginContext from './loginContext'; import LoginContext from './loginContext';
class Login extends Component { class Login extends Component {
static defaultProps = {
className: '',
defaultActiveKey: '',
onTabChange: () => {},
onSubmit: () => {},
};
static propTypes = { static propTypes = {
className: PropTypes.string, className: PropTypes.string,
defaultActiveKey: PropTypes.string, defaultActiveKey: PropTypes.string,
onTabChange: PropTypes.func, onTabChange: PropTypes.func,
onSubmit: PropTypes.func, onSubmit: PropTypes.func,
}; };
static defaultProps = {
className: '',
defaultActiveKey: '',
onTabChange: () => {},
onSubmit: () => {},
};
state = { state = {
type: this.props.defaultActiveKey, type: this.props.defaultActiveKey,
tabs: [], tabs: [],
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
.getCaptcha { .getCaptcha {
display: block; display: block;
width: 100%; width: 100%;
height: 42px;
} }
.submit { .submit {
......
...@@ -7,6 +7,8 @@ import styles from './index.less'; ...@@ -7,6 +7,8 @@ import styles from './index.less';
const { TabPane } = Tabs; const { TabPane } = Tabs;
export default class NoticeIcon extends PureComponent { export default class NoticeIcon extends PureComponent {
static Tab = TabPane;
static defaultProps = { static defaultProps = {
onItemClick: () => {}, onItemClick: () => {},
onPopupVisibleChange: () => {}, onPopupVisibleChange: () => {},
...@@ -19,7 +21,6 @@ export default class NoticeIcon extends PureComponent { ...@@ -19,7 +21,6 @@ export default class NoticeIcon extends PureComponent {
}, },
emptyImage: 'https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg', emptyImage: 'https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg',
}; };
static Tab = TabPane;
constructor(props) { constructor(props) {
super(props); super(props);
this.state = {}; this.state = {};
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
.row { .row {
display: flex; display: flex;
width: 100%;
} }
.breadcrumb { .breadcrumb {
...@@ -66,10 +67,11 @@ ...@@ -66,10 +67,11 @@
.content, .content,
.extraContent, .extraContent,
.main { .main {
// IE auto is no have height flex: 0 1 auto;
flex: 1; }
.main {
width: 100%;
} }
.title, .title,
.action { .action {
margin-bottom: 16px; margin-bottom: 16px;
......
...@@ -78,7 +78,7 @@ export default class LoginPage extends Component { ...@@ -78,7 +78,7 @@ export default class LoginPage extends Component {
<Tab key="account" tab="账户密码登录"> <Tab key="account" tab="账户密码登录">
{login.status === 'error' && {login.status === 'error' &&
login.type === 'account' && login.type === 'account' &&
!login.submitting && !submitting &&
this.renderMessage('账户或密码错误(admin/888888)')} this.renderMessage('账户或密码错误(admin/888888)')}
<UserName name="userName" placeholder="admin/user" /> <UserName name="userName" placeholder="admin/user" />
<Password name="password" placeholder="888888/123456" /> <Password name="password" placeholder="888888/123456" />
...@@ -86,7 +86,7 @@ export default class LoginPage extends Component { ...@@ -86,7 +86,7 @@ export default class LoginPage extends Component {
<Tab key="mobile" tab="手机号登录"> <Tab key="mobile" tab="手机号登录">
{login.status === 'error' && {login.status === 'error' &&
login.type === 'mobile' && login.type === 'mobile' &&
!login.submitting && !submitting &&
this.renderMessage('验证码错误')} this.renderMessage('验证码错误')}
<Mobile name="mobile" /> <Mobile name="mobile" />
<Captcha name="captcha" countDown={120} onGetCaptcha={this.onGetCaptcha} /> <Captcha name="captcha" countDown={120} onGetCaptcha={this.onGetCaptcha} />
......
...@@ -71,14 +71,23 @@ export function getPlainNode(nodeList, parentPath = '') { ...@@ -71,14 +71,23 @@ export function getPlainNode(nodeList, parentPath = '') {
return arr; return arr;
} }
function accMul(arg1, arg2) {
let m = 0;
const s1 = arg1.toString();
const s2 = arg2.toString();
m += s1.split('.').length > 1 ? s1.split('.')[1].length : 0;
m += s2.split('.').length > 1 ? s2.split('.')[1].length : 0;
return (Number(s1.replace('.', '')) * Number(s2.replace('.', ''))) / 10 ** m;
}
export function digitUppercase(n) { export function digitUppercase(n) {
const fraction = ['', '']; const fraction = ['', ''];
const digit = ['', '', '', '', '', '', '', '', '', '']; const digit = ['', '', '', '', '', '', '', '', '', ''];
const unit = [['', '', '亿'], ['', '', '', '']]; const unit = [['', '', '亿'], ['', '', '', '', '']];
let num = Math.abs(n); let num = Math.abs(n);
let s = ''; let s = '';
fraction.forEach((item, index) => { fraction.forEach((item, index) => {
s += (digit[Math.floor(num * 10 * 10 ** index) % 10] + item).replace(/零./, ''); s += (digit[Math.floor(accMul(num, 10 * 10 ** index)) % 10] + item).replace(/零./, '');
}); });
s = s || ''; s = s || '';
num = Math.floor(num); num = Math.floor(num);
......
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