function isDatagridEmpty_duty(total){
var interval;
var time=1000;
var x=3;
if(total==0){
$.messager.alert(' ','<font size=\"2\" color=\"#666666\"><strong>数据库暂无记录!</strong></font>','infoSunnyIcon',function(){
//alert('点击确定按钮才关闭');//
});
$(".messager-window .window-header .panel-title").append("系统提示("+x+"秒后自动关闭)");
interval=setInterval(fun,time);
function fun(){
--x;
if(x==0){
clearInterval(interval);
$(".messager-body").window('close');
}
$(".messager-window .window-header .panel-title").text("");
$(".messager-window .window-header .panel-title").append("系统提示("+x+"秒后自动关闭)");
}
}
}
[b]优化后:[/b]
function alert_totalQuery(msg,icon,tm){
var interval;
var time=1000;
var x;
if(null==tm||''==tm){
x=Number(3);
}else{
x=Number(tm);
}
//
if(null==icon||''==icon){
icon="infoSunnyIcon";
}
$.messager.alert(' ','<font size=\"2\" color=\"#666666\"><strong>'+msg+'</strong></font>',icon,function(){});
$(".messager-window .window-header .panel-title").append("系统提示("+x+"秒后自动关闭)");
interval=setInterval(fun,time);
function fun(){
--x;
if(x==0){
clearInterval(interval);
$(".messager-body").window('close');
}
$(".messager-window .window-header .panel-title").text("");
$(".messager-window .window-header .panel-title").append("系统提示("+x+"秒后自动关闭)");
}
}