diff --git a/htdocs/js/lib/custom/models/dataservice.js b/htdocs/js/lib/custom/models/dataservice.js index 99441dfc..6e64a602 100644 --- a/htdocs/js/lib/custom/models/dataservice.js +++ b/htdocs/js/lib/custom/models/dataservice.js @@ -1,9 +1,13 @@ var westdc = {}; westdc.dataservice = { //wsn 选择数据 - choiceData : function(uuid) + choiceData : function(uuid,btn) { this.uuid = uuid; + _btn = { + html : $(btn).html(), + onclick : $(btn).attr('onclick') + }; $.ajax({ 'type':"POST", @@ -30,6 +34,16 @@ westdc.dataservice = { }, 'timeout': 30000, + 'beforeSend': function(){ + $(btn).attr('onclick',''); + $(btn).html("加载中..."); + $(btn).addClass('disabled'); + }, + 'complete': function(){ + $(btn).attr('onclick', _btn.onclick); + $(btn).html(_btn.html); + $(btn).removeClass('disabled'); + }, 'error': function(){ alert('出现错误,请刷新后重试'); } @@ -113,6 +127,7 @@ westdc.dataservice.wsn = { this.input = new Array(); for(i in data.data) { + for(i in data.data) this.li = '