diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js index f1ad9a67..fce37671 100644 --- a/pc4mobx/hrmSalary/layout.js +++ b/pc4mobx/hrmSalary/layout.js @@ -30,6 +30,7 @@ class Layout extends Component { } componentDidMount() { + this.checkData(); if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) { const src = "/spa/hrmSalary/hrmSalaryCalculateDetail/css/iconfont/iconfont.css"; const link = document.createElement("link"); @@ -41,8 +42,26 @@ class Layout extends Component { top.$(".ant-message").remove(); window.location.hash.indexOf("mobilepayroll") === -1 && stores.taxAgentStore.getPermission(); } + window.addEventListener("storage", this.checkData); } + componentWillUnmount() { + window.removeEventListener("storage", this.checkData); + } + + checkData = () => { + const { themeFontSize } = JSON.parse(localStorage.getItem("theme-themeInfo")) || { themeFontSize: "12" }; + if (window.location.href.indexOf("/spa/hrmSalary/") !== -1) { + const src = `/cloudstore/resource/pc/com/font-size/${themeFontSize}px.css`; + const link = document.createElement("link"); + link.setAttribute("rel", "stylesheet"); + link.setAttribute("type", "text/css"); + link.setAttribute("href", src); + let header = document.getElementById("container"); + header.appendChild(link); + } + }; + render() { return ( {this.props.children}