106 lines
2.5 KiB
Smarty
106 lines
2.5 KiB
Smarty
<!--{include file='top.tpl'}-->
|
|
<style>
|
|
.nr_nr {line-height:18px;}
|
|
.ban {float: left;width:50%}
|
|
.title li {list-style: none;}
|
|
</style>
|
|
<div id=in style="padding-left:10px;">
|
|
<div class="ban">
|
|
<div id="zxsj"></div>
|
|
<div id="zxnr"></div>
|
|
<div id="def_hit"></div>
|
|
</div>
|
|
<div class="ban">
|
|
<div class="title" id="title"></div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
//处理名称 连续处理次数
|
|
var conf = [['处理会员日月报表','a',6],
|
|
['处理公会数据','b',1],
|
|
['处理公会欢乐分','c',1]];
|
|
var miao = 100;//间隔每秒执行
|
|
var gg = 30;//显示多少个日志
|
|
var def = 0;
|
|
var load_def = 0;
|
|
var shuaxin = wsx = 300;//反刷新执行秒 重新执行
|
|
var wh;
|
|
|
|
function getNowFormatDate() {
|
|
var date = new Date();
|
|
var seperator1 = "-";
|
|
var seperator2 = ":";
|
|
var month = date.getMonth() + 1;
|
|
var strDate = date.getDate();
|
|
if (month >= 1 && month <= 9) {
|
|
month = "0" + month;
|
|
}
|
|
if (strDate >= 0 && strDate <= 9) {
|
|
strDate = "0" + strDate;
|
|
}
|
|
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
|
|
+ " " + date.getHours() + seperator2 + date.getMinutes()
|
|
+ seperator2 + date.getSeconds();
|
|
return currentdate;
|
|
}
|
|
|
|
function tit_plus(nr){
|
|
$("#title").append("<li>"+nr+"</li>");
|
|
var hit = $("#title li").length;
|
|
if(hit > gg){
|
|
$("#title li:first").remove();
|
|
}
|
|
}
|
|
function load(){
|
|
if(load_def >= conf[def][2]){
|
|
load_def = 0;
|
|
if(def >= parseInt(conf.length-1)){
|
|
def = 0;
|
|
}else{
|
|
def++;
|
|
}
|
|
}
|
|
time_sx(def);//反刷新
|
|
//$("#zxsj").html("<font color=red>"+conf[def][0]+"<br>执行中,请稍后...</font>");
|
|
$.get("weihu-"+conf[def][1]+".php",{js:'js'}, function(result){
|
|
$("#zxnr").html(result);
|
|
var zxm = shuaxin-wsx;
|
|
tit_plus(getNowFormatDate()+" "+conf[def][0]+"(执行"+zxm+"秒)");
|
|
load_def++;
|
|
times();
|
|
wsx = shuaxin;
|
|
clearTimeout(wh);
|
|
});
|
|
}
|
|
var wait = miao;
|
|
function times(){
|
|
if (wait == 0) {
|
|
load();
|
|
wait = miao;
|
|
} else {
|
|
wait--;
|
|
$("#zxsj").html(" (" + wait + ") 后秒执行");
|
|
setTimeout(function(){
|
|
times();
|
|
},1000);
|
|
}
|
|
}
|
|
times();
|
|
//反刷新
|
|
function time_sx(def){
|
|
wsx--;
|
|
if (wsx == 0) {
|
|
load();
|
|
wsx = shuaxin;
|
|
} else {
|
|
$("#zxsj").html("<font color=red>"+conf[def][0]+"<br>执行中,请稍后...<br>(" + wsx + ") 后刷新</font>");
|
|
wh = setTimeout(function(){
|
|
time_sx(def);
|
|
},1000);
|
|
}
|
|
}
|
|
|
|
</script>
|
|
<!--{include file='bottom.tpl'}-->
|
|
</body>
|
|
</html> |