Commit e4652952 authored by nikogu's avatar nikogu
parent b0cfa106
import React, { Component } from 'react'; import React, { Component } from 'react';
import addEventListener from 'rc-util/lib/Dom/addEventListener'; import Debounce from 'lodash-decorators/debounce';
import debounce from 'lodash.debounce';
import { connect } from 'dva'; import { connect } from 'dva';
import { Button, Menu, Dropdown, Icon, Row, Col, Steps, Card, Popover, Badge, Table, Tooltip, Divider } from 'antd'; import { Button, Menu, Dropdown, Icon, Row, Col, Steps, Card, Popover, Badge, Table, Tooltip, Divider } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
...@@ -93,7 +92,7 @@ const popoverContent = ( ...@@ -93,7 +92,7 @@ const popoverContent = (
<span className={styles.textSecondary} style={{ float: 'right' }}> <span className={styles.textSecondary} style={{ float: 'right' }}>
<Badge status="default" text={<span style={{ color: 'rgba(0, 0, 0, 0.45)' }}>未响应</span>} /> <Badge status="default" text={<span style={{ color: 'rgba(0, 0, 0, 0.45)' }}>未响应</span>} />
</span> </span>
<p className={styles.textSecondary} style={{ marginTop: 4 }} >耗时2小时25分钟</p> <p className={styles.textSecondary} style={{ marginTop: 4 }}>耗时2小时25分钟</p>
</div> </div>
); );
...@@ -156,21 +155,18 @@ export default class AdvancedProfile extends Component { ...@@ -156,21 +155,18 @@ export default class AdvancedProfile extends Component {
}); });
this.setStepDirection(); this.setStepDirection();
this.resizeEvent = addEventListener(window, 'resize', debounce(this.setStepDirection, 100, { window.addEventListener('resize', this.setStepDirection);
leading: false,
}));
} }
componentWillUnmount() { componentWillUnmount() {
if (this.resizeEvent) { window.removeEventListener('resize', this.setStepDirection);
this.resizeEvent.remove();
}
} }
onOperationTabChange = (key) => { onOperationTabChange = (key) => {
this.setState({ operationkey: key }); this.setState({ operationkey: key });
} }
@Debounce(200)
setStepDirection = () => { setStepDirection = () => {
const { stepDirection } = this.state; const { stepDirection } = this.state;
const w = getWindowWidth(); const w = getWindowWidth();
......
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