diff --git a/src/routes/Profile/AdvancedProfile.js b/src/routes/Profile/AdvancedProfile.js index 66d3bd37abc0f8622dba3456c07f302b83006507..9cb95f84ced4a9ae0e07e3a97edbc7a6ac652aeb 100644 --- a/src/routes/Profile/AdvancedProfile.js +++ b/src/routes/Profile/AdvancedProfile.js @@ -1,6 +1,5 @@ import React, { Component } from 'react'; -import addEventListener from 'rc-util/lib/Dom/addEventListener'; -import debounce from 'lodash.debounce'; +import Debounce from 'lodash-decorators/debounce'; import { connect } from 'dva'; import { Button, Menu, Dropdown, Icon, Row, Col, Steps, Card, Popover, Badge, Table, Tooltip, Divider } from 'antd'; import classNames from 'classnames'; @@ -93,7 +92,7 @@ const popoverContent = ( 未响应} /> -

耗时:2小时25分钟

+

耗时:2小时25分钟

); @@ -156,21 +155,18 @@ export default class AdvancedProfile extends Component { }); this.setStepDirection(); - this.resizeEvent = addEventListener(window, 'resize', debounce(this.setStepDirection, 100, { - leading: false, - })); + window.addEventListener('resize', this.setStepDirection); } componentWillUnmount() { - if (this.resizeEvent) { - this.resizeEvent.remove(); - } + window.removeEventListener('resize', this.setStepDirection); } onOperationTabChange = (key) => { this.setState({ operationkey: key }); } + @Debounce(200) setStepDirection = () => { const { stepDirection } = this.state; const w = getWindowWidth(); @@ -233,7 +229,7 @@ export default class AdvancedProfile extends Component { 32943898021309809423 3321944288191034921 18112345678 - 曲丽丽 18100000000 浙江省杭州市西湖区黄姑山路工专路交叉路口 + 曲丽丽 18100000000 浙江省杭州市西湖区黄姑山路工专路交叉路口 725