37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
(function(){
|
|
X.pageLogic['sqlquery'] = {
|
|
init : function(){
|
|
$(document).off('click','.sqlquery-but').on('click','.sqlquery-but',function(){
|
|
var txt = $('.sql-textarea').val();
|
|
|
|
// console.log(EncodeURIFilter(txt));
|
|
|
|
X.api("ck/sql","post",{"sql": txt},function(d){
|
|
console.log(JSON.stringify(d));
|
|
$('.table-sql-box-con').html(JSON.stringify(d));
|
|
})
|
|
|
|
|
|
});
|
|
|
|
$(document).off('click','.sqlquery-daochu').on('click','.sqlquery-daochu',function(){
|
|
var txt = $('.sql-textarea').val();
|
|
|
|
X.download('ck/sql_export',{"sql": txt},'sql');
|
|
|
|
|
|
});
|
|
|
|
// function EncodeURIFilter(str) {
|
|
// if(str != null && str != "") {
|
|
// str = str.replace(/\+/g, "%2B");
|
|
// str = str.replace(/\&/g, "%26");
|
|
// }
|
|
// return str;
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
};
|
|
})(); |