feature/2.9.42310.02-社保福利档案页面重构

This commit is contained in:
黎永顺 2023-11-02 09:18:16 +08:00
parent 121d82d379
commit 8a3a1dcf76
2 changed files with 12 additions and 3 deletions

View File

@ -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 (
<div className="table-layout" style={{ height: dataSource.length * 38 + "px" }}>
<div className="table-layout" style={{ height: height + "px" }}>
<Spin spinning={loading}>
<iframe
style={{ border: 0, width: "100%", height: "100%" }}

View File

@ -19,8 +19,6 @@
flex-direction: column;
.table-layout {
min-height: 220px;
.ant-spin-nested-loading, .ant-spin-container {
height: 100%;
}