定时器

This commit is contained in:
yunkexin 2024-05-23 16:09:45 +08:00
parent c85051e62a
commit 1716c0b78b

View File

@ -249,16 +249,7 @@ class Home extends React.Component {
lmdisplay: 24, lmdisplay: 24,
}, },
() => { () => {
this.getBaseData(1, "1", 5); this.willDo()
this.getBaseData(1, "1");
this.timeJudg();
this.riskLevel();
// this.homeRound();
this.completeRate();
this.timelyRate();
this.safeCheck();
this.dangerChange();
this.getUser();
} }
); );
} else { } else {
@ -268,20 +259,50 @@ class Home extends React.Component {
lmdisplay: 17, lmdisplay: 17,
}, },
() => { () => {
this.getBaseData(1, "1", 5); this.willDo()
this.getBaseData(1, "1");
this.timeJudg();
this.riskLevel();
// this.homeRound();
this.completeRate();
this.timelyRate();
this.safeCheck();
this.dangerChange();
this.getUser();
} }
); );
} }
} }
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 = ( showTodayModal = (
dataId, dataId,
formCode, formCode,
@ -524,18 +545,18 @@ class Home extends React.Component {
} }
} }
showTableEditModal = (dataId, formCode, TaskID, title, taskCode) => { showTableEditModal = (dataId, formCode, TaskID, title, taskCode) => {
// this.props.dispatch({ this.props.dispatch({
// type: "app/getDataByPost", type: "app/getDataByPost",
// url: "BI/BIController/getVersion", url: "BI/BIController/getVersion",
// onComplete: (ret) => { onComplete: (ret) => {
// if (ret > config.version) { if (ret > config.version) {
// window.localStorage.clear(); window.localStorage.clear();
// message.success("清除成功,即将重新加载页面", 2, () => { message.success("清除成功,即将重新加载页面", 2, () => {
// setTimeout(() => window.location.reload(true), 500); setTimeout(() => window.location.reload(true), 500);
// }); });
// } }
// }, },
// }); });
const newtmpData = { const newtmpData = {
data: { data: {
id: dataId, id: dataId,
@ -562,18 +583,18 @@ class Home extends React.Component {
); );
}; };
showEditModal = (dataId, formCode, TaskID, title, taskCode) => { showEditModal = (dataId, formCode, TaskID, title, taskCode) => {
// this.props.dispatch({ this.props.dispatch({
// type: "app/getDataByPost", type: "app/getDataByPost",
// url: "BI/BIController/getVersion", url: "BI/BIController/getVersion",
// onComplete: (ret) => { onComplete: (ret) => {
// if (ret > config.version) { if (ret > config.version) {
// window.localStorage.clear(); window.localStorage.clear();
// message.success("清除成功,即将重新加载页面", 2, () => { message.success("清除成功,即将重新加载页面", 2, () => {
// setTimeout(() => window.location.reload(true), 500); setTimeout(() => window.location.reload(true), 500);
// }); });
// } }
// }, },
// }); });
const newtmpData = { const newtmpData = {
data: { data: {
id: dataId, id: dataId,