$(function(){
var _dbservice= $("input[name='dbservice']");
var _dbip= $("input[name='dbip']");
var _dbuser= $("input[name='dbuser']");
var _dbpass= $("input[name='dbpass']");
var _customsql= $("#customsql");
var _exportname= $("input[name='exportname']");
var _ip_bt = $(".content .con #condition .es_1");
console.log(_customsql);
_ip_bt.on('click',function(){
_ip_bt.attr('disabled','disabled');
var data={};
data.dbservice=_dbservice.val();
data.dbip=_dbip.val();
data.dbuser=_dbuser.val();
data.dbpass=_dbpass.val();
data.customsql=_customsql.val();
data.exportname=_exportname.val();
var successfn = function(jdata){
_ip_bt.removeAttr('disabled');
$(".gridtable").empty();
var _HTML="<tr><th>DownLoad Url </th></tr>";
_HTML=_HTML+"<tr><td>"+jdata+"</td></tr>";
$(".gridtable").html(_HTML);
};
var errorfn = function(){
_ip_bt.removeAttr('disabled');
alert("数据获取出错");
};
$.ajax({
type: "get",
data: data,
url: "/api/exportcustomdata",
dataType: "text",
success: function(d){
successfn(d);
},
error: function(e){
errorfn(e);
}
});
});
}
)