定时器

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,
},
() => {
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,