diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js index 60cb2d50..b520db28 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js @@ -29,10 +29,16 @@ class Index extends Component { componentDidMount() { window.addEventListener("message", this.handleReceive, false); + window.addEventListener("resize", this.handleResize, false); } + handleResize = () => { + this.forceUpdate(); + }; + componentWillUnmount() { window.removeEventListener("message", this.handleReceive, false); + window.removeEventListener("resize", this.handleResize, false); } componentWillReceiveProps(nextProps, nextContext) { @@ -107,8 +113,13 @@ class Index extends Component { render() { const { loading, dataSource } = this.state; + const dom = document.querySelector(".wea-new-top-req-content"); + let height = 280; + if (dom && dataSource.length > 0) { + height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 39 + 113 : parseFloat(dom.style.height) - 170; + } return ( -