diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js index 9b827c7d..576155c5 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js @@ -48,7 +48,9 @@ class List extends Component { } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.isQuery !== this.props.isQuery) this.getLYList(); + if (nextProps.isQuery !== this.props.isQuery) this.setState({ + pageInfo: { ...this.state.pageInfo, current: 1 } + }, () => this.getLYList()); } handleReceive = ({ data }) => { @@ -96,9 +98,9 @@ class List extends Component { }, () => { onInit(); this.postMessageToChild({ - scrollHeight: 195, dataSource, pageInfo: this.state.pageInfo, selectedRowKeys, + dataSource, pageInfo: this.state.pageInfo, selectedRowKeys, unitTableType: "custom_lingyue", columns: traverseCols(columns), showTotalCell: true, - sumDataSource: this.state.sumDataSource + sumDataSource: this.state.sumDataSource, scrollHeight: !_.isEmpty(dataSource) ? 195 : 0 }); }); } @@ -140,16 +142,15 @@ class List extends Component { }; render() { - const { loading, visible } = this.state; + const { loading, dataSource, visible } = this.state; const { type } = this.props; const dom = document.querySelector(".wea-new-top-content"); + let height = 307.53; + if (dom && dataSource.length > 0) { + height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 47 + 204.53 : dataSource.length < 10 ? dataSource.length * 47 + 204.53 : parseFloat(dom.style.height) - 32; + } return ( -