//导出表格加载中的提示
var dian=0;//控制'●'的个数
var t=null;//停止时使用
function id_loadspot(loadspotSpan,loadingDiv,exportLink){
  loadingDiv.css('visibility','visible');//显示
  exportLink.click(function(){//使链接失效
    return false;
  });
  t=setTimeout(function() {
    if (dian >= 3) {
      loadspotSpan.text('');
      dian = 0;
    } else {
      dian++;
      loadspotSpan.text(loadspotSpan.text() + '●');
    }
    id_loadspot(loadspotSpan,loadingDiv,exportLink);//递归调用
  }, 1000);

}
//停止加载中的提示
function stop_id_loadspot(loadingDiv,exportLink){
  clearTimeout(t);//停止定时器
  loadingDiv.css('visibility','hidden');//隐藏
  exportLink.unbind("click");//使链接生效
}

 

//页面

<div  style="width: 10%; height: 30px; float: right; text-align: left;">
<a href="javascript:exportMerchantExcel();"  style="text-align: center;" class="audit" ></span>
  </div>
</div>

 

//使用

seachKey = $("#merchantName").val();
status =$('#upsfyx').combobox('getValue');

//加载中...
id_loadspot($('#id_loadspot'),$("#loadingDiv"),$("#exportLink"));
$.ajax({
  url : '../system/cisweb/exportMerchantExcel',
  dataType : "json",
  type : "post",
  data : {
  seachKey : seachKey,
  status:status,
  },
  success : function(data) {
  if (data.status == "succeed") {
    $("#download").attr("href", data.path);
    $("#subBtn").trigger("click");
  } else {
  $.messager.alert('提示', data.msg, 'error');
}
},
error : function(err) {
  $.messager.alert('提示', err.msg, 'error');
},


}

});

 

相关文章:

  • 2022-12-23
  • 2021-09-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-28
  • 2021-10-25
  • 2022-01-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2022-02-02
  • 2021-11-16
  • 2022-12-23
相关资源
相似解决方案