function load_overview() {
var timecount = 0;
if (orHavaAuthorityStatus == "have") {
if (needUpdateStr.indexOf('ck_overview') != -1) {
sessionStorage.setItem("authrorityStatus", "have")
} else {
sessionStorage.setItem("authrorityStatus", "nohave")
}
} else {
sessionStorage.setItem("authrorityStatus", "nohave")
}
var lastclickTime = sessionStorage.getItem("load_overview_time");
var newclickTime = getClickTime(clicktime);
sessionStorage.setItem("load_overview_time", newclickTime); //每次点击的时候把当前时间存一下
if (lastclickTime != null) {
var d1 = new Date(lastclickTime); //上次
var d2 = new Date(newclickTime); //这次
if (parseInt(d2 - d1) < 2000) { //单位是毫秒
var last_timecount = sessionStorage.getItem("load_overview_timecount");
var code = "操作太快,请稍后...x" + last_timecount;
if (last_timecount == null) {
last_timecount = 0;
}
PNotify.removeAll();
new PNotify({
text: code,
styling: 'bootstrap3',
hide: true,
delay: 1000,
});
timecount = parseInt(last_timecount) + 1;
sessionStorage.setItem("load_overview_timecount", timecount);
} else {
sessionStorage.setItem("load_overview_timecount", 1);
clearTimeoutAll("load_overview");
$('#kanbanID').empty();
$('#kanbanID').load('productStatus/workShopOverview.jsp');
}
} else {
sessionStorage.setItem("load_overview_timecount", 1);
clearTimeoutAll("load_overview");
$('#kanbanID').empty();
$('#kanbanID').load('productStatus/workShopOverview.jsp');
}
}
Pnotify 不停点击只出现一个提示框(不停点击,防止接口不停调用)
最新推荐文章于 2024-03-22 09:31:57 发布