From ca3c9079a100fa78d0596c6fe68d36da8338bd97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 10 Oct 2024 13:57:09 +0800 Subject: [PATCH] release/2.15.2.2409.01 --- pc4mobx/hrmSalary/layout.js | 24 ++++++++++++------- .../components/payrollTempBaseSet/index.js | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js index fce37671..df3d02d3 100644 --- a/pc4mobx/hrmSalary/layout.js +++ b/pc4mobx/hrmSalary/layout.js @@ -30,7 +30,6 @@ 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"); @@ -42,23 +41,32 @@ class Layout extends Component { top.$(".ant-message").remove(); window.location.hash.indexOf("mobilepayroll") === -1 && stores.taxAgentStore.getPermission(); } - window.addEventListener("storage", this.checkData); + window.addEventListener("storage", this.setFontSize); } componentWillUnmount() { - window.removeEventListener("storage", this.checkData); + window.removeEventListener("storage", this.setFontSize); } - checkData = () => { + componentDidUpdate(prevProps, prevState, snapshot) { + this.setFontSize(); + } + + setFontSize = (init = false) => { 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 href = `/cloudstore/resource/pc/com/font-size/${themeFontSize}px.css`; + jQuery("#theme-font").remove(); + window.parent.jQuery("#theme-font1").remove(); + jQuery(jQuery("head")[0]).append(``); 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); + link.setAttribute("href", href); + link.setAttribute("id", "theme-font1"); + setTimeout(() => { + window.parent.document.head.appendChild(link); + }, 500); } }; diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js index 904d9ca4..fbb75a46 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js @@ -174,7 +174,7 @@ class Index extends Component { if (it === "ackFeedbackStatus" || it === "feedbackStatus") { payrollTempFeedbackForm.updateFields({ [it]: fieldsEchoData[it] ? "1" : "0" }); } else { - payrollTempFeedbackForm.updateFields({ [it]: !_.isNil(fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "/" }); + payrollTempFeedbackForm.updateFields({ [it]: (!_.isNil(fieldsEchoData[it]) && fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "/" }); } }); this.setState({