From 1716c0b78bd903b62427a1f696cef196b9ddf1fc Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Thu, 23 May 2024 16:09:45 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Home.js | 109 +++++++++++++++++++++++++++------------------ 1 file changed, 65 insertions(+), 44 deletions(-) diff --git a/src/routes/Home.js b/src/routes/Home.js index b36f6f9..f643e92 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -249,16 +249,7 @@ class Home extends React.Component { lmdisplay: 24, }, () => { - this.getBaseData(1, "1", 5); - this.getBaseData(1, "1"); - this.timeJudg(); - this.riskLevel(); - // this.homeRound(); - this.completeRate(); - this.timelyRate(); - this.safeCheck(); - this.dangerChange(); - this.getUser(); + this.willDo() } ); } else { @@ -268,20 +259,50 @@ class Home extends React.Component { lmdisplay: 17, }, () => { - this.getBaseData(1, "1", 5); - this.getBaseData(1, "1"); - this.timeJudg(); - this.riskLevel(); - // this.homeRound(); - this.completeRate(); - this.timelyRate(); - this.safeCheck(); - this.dangerChange(); - this.getUser(); + this.willDo() } ); } } + willDo = ()=>{ + this.getBaseData(1, "1", 5); + this.getBaseData(1, "1"); + this.timeJudg(); + this.riskLevel(); + // this.homeRound(); + this.completeRate(); + this.timelyRate(); + this.safeCheck(); + this.dangerChange(); + this.getUser(); + //定时器功能,暂时不开启 + this.timerID = setInterval( + () =>{this.getBaseData(1, this.state.tableKey, 5),this.getBaseData(1, this.state.overDataKey)} , + 120000 + ); + this.showModalSign(); + } + componentWillUnmount() { + this.timerID && clearTimeout(this.timerID); + } + showModalSign = () => { + var userId = storage("lacal").getItem("userid")?.val; //登录后有存储登录信息 + var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息 + + let json = initFilter(orgId); + this.props.dispatch({ + type: "app/getDataByPost", + payload: json, + url: "FM/User/UserSign", //验证是否有签名照 + onComplete: (ret) => { + //返回查询结果ret + if (ret) { + //判断是否有记录 + openNotification("topRight"); + } + }, + }); + }; showTodayModal = ( dataId, formCode, @@ -524,18 +545,18 @@ class Home extends React.Component { } } showTableEditModal = (dataId, formCode, TaskID, title, taskCode) => { - // this.props.dispatch({ - // type: "app/getDataByPost", - // url: "BI/BIController/getVersion", - // onComplete: (ret) => { - // if (ret > config.version) { - // window.localStorage.clear(); - // message.success("清除成功,即将重新加载页面", 2, () => { - // setTimeout(() => window.location.reload(true), 500); - // }); - // } - // }, - // }); + this.props.dispatch({ + type: "app/getDataByPost", + url: "BI/BIController/getVersion", + onComplete: (ret) => { + if (ret > config.version) { + window.localStorage.clear(); + message.success("清除成功,即将重新加载页面", 2, () => { + setTimeout(() => window.location.reload(true), 500); + }); + } + }, + }); const newtmpData = { data: { id: dataId, @@ -562,18 +583,18 @@ class Home extends React.Component { ); }; showEditModal = (dataId, formCode, TaskID, title, taskCode) => { - // this.props.dispatch({ - // type: "app/getDataByPost", - // url: "BI/BIController/getVersion", - // onComplete: (ret) => { - // if (ret > config.version) { - // window.localStorage.clear(); - // message.success("清除成功,即将重新加载页面", 2, () => { - // setTimeout(() => window.location.reload(true), 500); - // }); - // } - // }, - // }); + this.props.dispatch({ + type: "app/getDataByPost", + url: "BI/BIController/getVersion", + onComplete: (ret) => { + if (ret > config.version) { + window.localStorage.clear(); + message.success("清除成功,即将重新加载页面", 2, () => { + setTimeout(() => window.location.reload(true), 500); + }); + } + }, + }); const newtmpData = { data: { id: dataId, From a281990f61e4893e3346b0915620e5a734f48862 Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Thu, 23 May 2024 16:16:16 +0800 Subject: [PATCH 2/6] =?UTF-8?q?modal=E5=8A=A0=E8=BE=B9=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Home.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/Home.js b/src/routes/Home.js index f643e92..5726e21 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -1540,7 +1540,7 @@ class Home extends React.Component { >