function loadXMLDoc(rest) { var xmlhttp; if (window.XMLHttpRequest) { // IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码 xmlhttp = new XMLHttpRequest(); } else { // IE6, IE5 浏览器执行代码 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("POST", "", false); xmlhttp.send('/rest/' + rest + '/rest'); return JSON.parse(xmlhttp.responseText.replace(/[\r\n]/g, "")); } // JavaScript Document function PostData(rest, success, error) { // $('#wrappers').css('display','block') var result; $.ajax({ headers: { Schema: $.cookie('schema'), Language: $.cookie('language'), User: $.cookie('staff_id'), Customer: $.cookie('customer') }, url: '', type: 'POST', async: false, cache: false, dataType: 'json', contentType: 'application/json', data: '/rest/' + rest + '/rest', success: function (data) { // console.log(data); $.messager.progress('close'); // $.messager.progress('close'); $('#wrapper').remove(); // $('#wrappers').css('display','none') // console.log('success') result = data }, error: function (XMLHttpRequest, textStatus, errorThrown) { result = XMLHttpRequest.responseJSON.error; // $.messager.alert(getShowMessage('MSGTITLE:提示'), XMLHttpRequest.responseJSON.error); throw (XMLHttpRequest.responseJSON.error) } }) // console.log(res); return result; } function PostData1(rest, success, error) { let result const defer = new jQuery.Deferred() const isOpen = true $.ajax({ headers: { Schema: $.cookie('schema'), Language: $.cookie('language'), User: $.cookie('user'), // Customer: $.cookie("customer") Customer: $.cookie('customer') }, url: '', type: 'POST', async: false, cache: false, dataType: 'json', data: '/rest/' + rest + '/rest', // /bllAuth/factlist/GetData/rest success: function (data) { // defer.resolve(data); result = data // result = defer.promise(); }, error: function (XMLHttpRequest, textStatus, errorThrown) { throw (XMLHttpRequest.responseJSON.error) } }) // console.log(result); return result } function PostData2(rest, success, error) { let result $.ajax({ // headers: { // Schema: $.cookie('schema'), // Language:$.cookie("language"), // User:$.cookie("user"), // Customer: $.cookie("customer") // }, url: '', type: 'POST', // async:false, cache: false, dataType: 'json', data: '/rest/' + rest + '/rest', success: function (data) { result = data; // const { total } = data if (data.rows.length <= 0) { return } console.log(data) $('#paginator').bootstrapPaginator({ // 配置bootstrap版本 bootstrapMajorVersion: 3, // async: true, // 当前页 currentPage: data.currentpage, // 总页数 totalPages: data.ttlpage, // 位置 // alignment:"right", // 给页码添加点击事件 // 页眉显示的样式 itemTexts: function (type, page, current) { switch (type) { case 'first': return '首页' case 'prev': return '上一页' case 'next': return '下一页' case 'last': return '末页' case 'page': return page } }, onPageClicked: function (a, b, c, page) { // 将选中的页码更新到 currentPage // console.log(currentPage); console.log(a) // if(page>1){ // page--; currentPageNum = page // } console.log(currentPageNum) pageForm(typeIkey) // // console.log(currentPageNum); // // console.log(currentPage); // // console.log(pageForm(2)); // clickModi(); } }) }, error: function (XMLHttpRequest, textStatus, errorThrown) { throw (XMLHttpRequest.responseJSON.error) } }) // console.log(result); return result } Date.prototype.Format = function (fmt) { // author: meizz const o = { 'M+': this.getMonth() + 1, // 月份 'd+': this.getDate(), // 日 'h+': this.getHours(), // 小时 'm+': this.getMinutes(), // 分 's+': this.getSeconds(), // 秒 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度 S: this.getMilliseconds() // 毫秒 } if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)) for (var k in o) { if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) } return fmt } function stringtoJson(data) { // console.log(data); return '/string/' + data.replace(/\//g, '/');// .replaceAll('/', '/') } function inttoJson(data) { return '/int/' + data } function int64toJson(data) { return '/int64/' + data } function doubletoJson(data) { return '/double/' + data } function datetimtoJson(data) { return '/datetime/' + data.Format('yyyyMMddhhmmss') } function fdtoJson1(data) { return JSON.stringify(data).replace(/\//g, '/'); } function fdto(data) { return JSON.stringify(data) } function fdtoJson(data) { return '/FactData/' + JSON.stringify(data).replace(/\//g, '/'); } function fltoJson(data) { return '/factlist/' + JSON.stringify(data).replace(/\//g, '/'); } function bytearraytoJson(data) { return '/ba/' + data; } function booltoJson(data) { return '/bool/' + data }