| | |
| | | }var p='?';for(var _key2 in parameters){if(p==='?'){p+=_key2+'='+parameters[_key2];}else{p+='&'+_key2+'='+parameters[_key2];}}if(p.indexOf('_n')<0){p+='&_n='+encodeURI(window._name);}return p;};function buildPrintStyle(paper){var marginLeft=(0,_Utils.pointToMM)(paper.leftMargin);var marginTop=(0,_Utils.pointToMM)(paper.topMargin);var marginRight=(0,_Utils.pointToMM)(paper.rightMargin);var marginBottom=(0,_Utils.pointToMM)(paper.bottomMargin);var paperType=paper.paperType;var page=paperType;if(paperType==='CUSTOM'){page=(0,_Utils.pointToMM)(paper.width)+'mm '+(0,_Utils.pointToMM)(paper.height)+'mm';}var style='\n @media print {\n .page-break{\n display: block;\n page-break-before: always;\n }\n }\n @page {\n size: '+page+' '+paper.orientation+';\n margin-left: '+marginLeft+'mm;\n margin-top: '+marginTop+'mm;\n margin-right:'+marginRight+'mm;\n margin-bottom:'+marginBottom+'mm;\n }\n ';return style;};window.buildPaging=function(pageIndex,totalPage){if(totalPage===0){return;}if(!pageIndex){return;}if(!window._currentPageIndex){window._currentPageIndex=pageIndex;}pageIndex=window._currentPageIndex;if(!window._totalPage){window._totalPage=totalPage;}var pageSelector=$('#pageSelector');pageSelector.change(function(){if(JSON.parse(localStorage.getItem("foreignPreviewParams"))){var parameters=window.buildLocationSearchParameters('_i',"json");window.$("#loadingIframe").css("display","block");var url=window.contextPath+'/res/report-html/html-preview.html';// window.open(url,'_self'); |
| | | parameters._i=$(this).val();$.post(url,parameters,function(res){window.$("#previewForeign").html(res);});}else{var _parameters=window.buildLocationSearchParameters('_i');parent.$("#loadingIframe").css("display","block");var _url2=window.contextPath+('/res/report-html/html-preview.html'+_parameters+'&_i='+$(this).val());window.open(_url2,'_self');}});pageSelector.val(pageIndex);if(totalPage===1){return;}var pagingContainer=$('#pageLinkContainer');pagingContainer.empty();if(JSON.parse(localStorage.getItem("foreignPreviewParams"))){var parameters=window.buildLocationSearchParameters('_i',"json");if(pageIndex>1){var url=window.contextPath+'/res/report-html/html-preview.html';var prevPage=$('<button type="button" class="btn btn-link btn-sm">\u4E0A\u4E00\u9875</button>');pagingContainer.append(prevPage);prevPage.click(function(){parameters._i=pageIndex-1;window.$("#loadingIframe").css("display","block");// window.open(url,'_self'); |
| | | $.post(url,parameters,function(res){window.$("#previewForeign").html(res);});});}if(pageIndex<totalPage){var _url3=window.contextPath+'/res/report-html/html-preview.html';var nextPage=$('<button type="button" class="btn btn-link btn-sm">\u4E0B\u4E00\u9875</button>');pagingContainer.append(nextPage);nextPage.click(function(){parameters._i=pageIndex+1;window.$("#loadingIframe").css("display","block");$.post(_url3,parameters,function(res){window.$("#previewForeign").html(res);});// window.open(url,'_self'); |
| | | });}}else{var _parameters2=window.buildLocationSearchParameters('_i');if(pageIndex>1){var _url4=window.contextPath+('/res/report-html/html-preview.html'+_parameters2+'&_i='+(pageIndex-1));var _prevPage=$('<button type="button" class="btn btn-link btn-sm">\u4E0A\u4E00\u9875</button>');pagingContainer.append(_prevPage);_prevPage.click(function(){window.open(_url4,'_self');});}if(pageIndex<totalPage){var _url5=window.contextPath+('/res/report-html/html-preview.html'+_parameters2+'&_i='+(pageIndex+1));var _nextPage=$('<button type="button" class="btn btn-link btn-sm">\u4E0B\u4E00\u9875</button>');pagingContainer.append(_nextPage);_nextPage.click(function(){window.open(_url5,'_self');});}}};window._intervalRefresh=function(value,totalPage){if(!value){return;}window._totalPage=totalPage;var second=value*1000;setTimeout(function(){_refreshData(second);},second);};function _refreshData(second){$("#loadinggif").css("display","block");var params=buildLocationSearchParameters('_i');var url=window._server+('/preview/loadData'+params);var totalPage=window._totalPage;if(totalPage>0){if(window._currentPageIndex){if(window._currentPageIndex>totalPage){window._currentPageIndex=1;}url+="&_i="+window._currentPageIndex+"";}$("#pageSelector").val(window._currentPageIndex);}$.ajax({url:url,type:'GET',success:function success(report){(0,_Utils.overtimeLogin)(report);var tableContainer=$('#_ureport_table');tableContainer.empty();window._totalPage=report.totalPageWithCol;tableContainer.append(report.content);_buildChartDatas(report.chartDatas);buildPaging(window._currentPageIndex,window._totalPage);if(window._currentPageIndex){window._currentPageIndex++;}setTimeout(function(){_refreshData(second);},second);$("#loadinggif").css("display","none");},error:function error(response){$("#loadinggif").css("display","none");if(response&&response.responseText){(0,_MsgBox.alert)("服务端错误:"+response.responseText+"");}else{(0,_MsgBox.alert)('加载数据失败!');}}});};window._buildChartDatas=function(chartData){if(!chartData){return;}console.log('---------------------------');console.log(chartData);chartData=JSON.parse(chartData);var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=chartData[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var d=_step.value;console.log(d);var json=d.json;console.log(json);json=JSON.parse(json);_buildChart(d.id,json);}}catch(err){_didIteratorError=true;_iteratorError=err;}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return();}}finally{if(_didIteratorError){throw _iteratorError;}}}};window._buildChart=function(canvasId,chartJson){var ctx=document.getElementById(canvasId);var options=chartJson.options;if(!options){options={};chartJson.options=options;}var animation=options.animation;if(!animation){animation={};options.animation=animation;}animation.onComplete=function(event){var chart=event.chart;var base64Image=chart.toBase64Image();var urlParameters=window.location.search;var url=window._server+'/chart/storeData'+urlParameters;var canvas=$("#"+canvasId);var width=parseInt(canvas.css('width'));var height=parseInt(canvas.css('height'));$.ajax({type:'POST',data:(0,_Utils.returnEncryptStr)({_base64Data:base64Image,_chartId:canvasId,_width:width,_height:height},"val"),url:url});};var chart=new _chart2.default(ctx,chartJson);};window.submitSearchForm=function(file,customParameters){$("#loadinggif").css("display","block");$(".error_info").html("");window.searchFormParameters={};var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2=window.formElements[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var fun=_step2.value;var json=fun.call(this);for(var key in json){var value=json[key];if(inputProp[key]==true&&json[key]==""){$("input[name='"+key+"']").parents(".form-group").find(".error_info").html("该条件为必填项!");$("#loadinggif").css("display","none");debugger;return;}value=encodeURI(value);window.searchFormParameters[key]=value;}}}catch(err){_didIteratorError2=true;_iteratorError2=err;}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return){_iterator2.return();}}finally{if(_didIteratorError2){throw _iteratorError2;}}}var parameters=window.buildLocationSearchParameters('_i',"json");var url=window._server+"/preview/loadData";var pageSelector=$('#pageSelector');if(pageSelector.length>0){if(JSON.parse(localStorage.getItem("foreignPreviewParams"))){parameters._i=1;}else{url+='?_i=1';}}$.ajax({url:url,type:'POST',data:parameters,success:function success(report){(0,_Utils.overtimeLogin)(report);if(report.style){$("#_ureport_table_style").text(report.style);}window._currentPageIndex=1;var tableContainer=$('#_ureport_table');tableContainer.empty();tableContainer.append(report.content);_buildChartDatas(report.chartDatas);var totalPage=report.totalPage;window._totalPage=totalPage;if(pageSelector.length>0){pageSelector.empty();for(var i=1;i<=totalPage;i++){pageSelector.append('<option>'+i+'</option>');}var pageIndex=report.pageIndex||1;pageSelector.val(pageIndex);$('#totalPageLabel').html(totalPage);buildPaging(pageIndex,totalPage);}$("#loadinggif").css("display","none");},error:function error(response){$("#loadinggif").css("display","none");if(response&&response.responseText){(0,_MsgBox.alert)("服务端错误:"+response.responseText+"");}else{(0,_MsgBox.alert)('查询操作失败!');}}});}; |
| | | });}}else{var _parameters2=window.buildLocationSearchParameters('_i');if(pageIndex>1){var _url4=window.contextPath+('/res/report-html/html-preview.html'+_parameters2+'&_i='+(pageIndex-1));var _prevPage=$('<button type="button" class="btn btn-link btn-sm">\u4E0A\u4E00\u9875</button>');pagingContainer.append(_prevPage);_prevPage.click(function(){window.open(_url4,'_self');});}if(pageIndex<totalPage){var _url5=window.contextPath+('/res/report-html/html-preview.html'+_parameters2+'&_i='+(pageIndex+1));var _nextPage=$('<button type="button" class="btn btn-link btn-sm">\u4E0B\u4E00\u9875</button>');pagingContainer.append(_nextPage);_nextPage.click(function(){window.open(_url5,'_self');});}}};window._intervalRefresh=function(value,totalPage){if(!value){return;}window._totalPage=totalPage;var second=value*1000;setTimeout(function(){_refreshData(second);},second);};function _refreshData(second){$("#loadinggif").css("display","block");var params=buildLocationSearchParameters('_i');var url=window._server+('/preview/loadData'+params);var totalPage=window._totalPage;if(totalPage>0){if(window._currentPageIndex){if(window._currentPageIndex>totalPage){window._currentPageIndex=1;}url+="&_i="+window._currentPageIndex+"";}$("#pageSelector").val(window._currentPageIndex);}$.ajax({url:url,type:'GET',success:function success(report){(0,_Utils.overtimeLogin)(report);var tableContainer=$('#_ureport_table');tableContainer.empty();window._totalPage=report.totalPageWithCol;tableContainer.append(report.content);_buildChartDatas(report.chartDatas);buildPaging(window._currentPageIndex,window._totalPage);if(window._currentPageIndex){window._currentPageIndex++;}setTimeout(function(){_refreshData(second);},second);$("#loadinggif").css("display","none");},error:function error(response){$("#loadinggif").css("display","none");if(response&&response.responseText){(0,_MsgBox.alert)("服务端错误:"+response.responseText+"");}else{(0,_MsgBox.alert)('加载数据失败!');}}});};window._buildChartDatas=function(chartData){if(!chartData||chartData.length<1){return;}console.log('--------------------------1');console.log(chartData);chartData=JSON.parse(chartData);console.log('--------------------------------2');var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=chartData[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var d=_step.value;var json=d.json;json=JSON.parse(json);_buildChart(d.id,json);}}catch(err){_didIteratorError=true;_iteratorError=err;}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return();}}finally{if(_didIteratorError){throw _iteratorError;}}}};window._buildChart=function(canvasId,chartJson){var ctx=document.getElementById(canvasId);var options=chartJson.options;if(!options){options={};chartJson.options=options;}var animation=options.animation;if(!animation){animation={};options.animation=animation;}animation.onComplete=function(event){var chart=event.chart;var base64Image=chart.toBase64Image();var urlParameters=window.location.search;var url=window._server+'/chart/storeData'+urlParameters;var canvas=$("#"+canvasId);var width=parseInt(canvas.css('width'));var height=parseInt(canvas.css('height'));$.ajax({type:'POST',data:(0,_Utils.returnEncryptStr)({_base64Data:base64Image,_chartId:canvasId,_width:width,_height:height},"val"),url:url});};var chart=new _chart2.default(ctx,chartJson);};window.submitSearchForm=function(file,customParameters){$("#loadinggif").css("display","block");$(".error_info").html("");window.searchFormParameters={};var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2=window.formElements[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var fun=_step2.value;var json=fun.call(this);for(var key in json){var value=json[key];if(inputProp[key]==true&&json[key]==""){$("input[name='"+key+"']").parents(".form-group").find(".error_info").html("该条件为必填项!");$("#loadinggif").css("display","none");debugger;return;}value=encodeURI(value);window.searchFormParameters[key]=value;}}}catch(err){_didIteratorError2=true;_iteratorError2=err;}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return){_iterator2.return();}}finally{if(_didIteratorError2){throw _iteratorError2;}}}var parameters=window.buildLocationSearchParameters('_i',"json");var url=window._server+"/preview/loadData";var pageSelector=$('#pageSelector');if(pageSelector.length>0){if(JSON.parse(localStorage.getItem("foreignPreviewParams"))){parameters._i=1;}else{url+='?_i=1';}}$.ajax({url:url,type:'POST',data:parameters,success:function success(report){(0,_Utils.overtimeLogin)(report);if(report.style){$("#_ureport_table_style").text(report.style);}window._currentPageIndex=1;var tableContainer=$('#_ureport_table');tableContainer.empty();tableContainer.append(report.content);_buildChartDatas(report.chartDatas);var totalPage=report.totalPage;window._totalPage=totalPage;if(pageSelector.length>0){pageSelector.empty();for(var i=1;i<=totalPage;i++){pageSelector.append('<option>'+i+'</option>');}var pageIndex=report.pageIndex||1;pageSelector.val(pageIndex);$('#totalPageLabel').html(totalPage);buildPaging(pageIndex,totalPage);}$("#loadinggif").css("display","none");},error:function error(response){$("#loadinggif").css("display","none");if(response&&response.responseText){(0,_MsgBox.alert)("服务端错误:"+response.responseText+"");}else{(0,_MsgBox.alert)('查询操作失败!');}}});}; |
| | | |
| | | /***/ }), |
| | | /* 1 */, |
| | |
| | | }; |
| | | |
| | | window._buildChartDatas=function(chartData){ |
| | | if(!chartData){ |
| | | if(!chartData || chartData.length < 1){ |
| | | return; |
| | | } |
| | | chartData = JSON.parse(chartData); |