Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Superfluous argument passed to function, Unused variable and variable #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 11 additions & 32 deletions AspNetCore.Reporting/wwwroot/js/ReportViewer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function (factory) {
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
Expand Down Expand Up @@ -36,18 +36,18 @@
}
//exportType 2,4,6,9
//executeType 0 (show),1 export,2 findString,3 toggle
$this.request = { path: null, sessionId: null, pageIndex: 1, pageCount: 0, findString: null, exportType: null, executeType: 0,reset:false };
$this.request = { path: null, sessionId: null, pageIndex: 1, pageCount: 0, findString: null, exportType: null, executeType: 0,reset:false };



//loaded function return response as {status,data:{content,sessionId,pageIndex,pageCount,fileName,stream }}
//error function
this.loadReport = function () {
if ($this.loadding) { return;}
$this.loadding = true;
if (typeof options.onLoading === 'function') {
options.onLoading($this.request,$this);
}
var request = cloneDeep($this.request);
}
var request = cloneDeep($this.request);
if (!request) {
options.onError('Please set request.');
return;
Expand All @@ -61,8 +61,7 @@
if (!request.path || request.path.length == 0) {
options.onError('Please set the path of request for report.');
return;
}
//request.sessionId = getOrSetSession();
};
console.log(request);
jQuery.ajax({
url: options.server, type: "POST", contentType: 'application/json; charset=utf-8',
Expand All @@ -75,8 +74,7 @@
return;
}
try {
//getOrSetSession(response.data.sessionId);
loadedSuccess(response.data, response,$this);
loadedSuccess(response.data, response);
if (typeof options.onLoaded === 'function') {
options.onLoaded(response, request);
}
Expand All @@ -99,7 +97,7 @@
value[m] = obj[m];
}
return value;
}
};
$this.loadding = false;
var loadedSuccess = function (data, response) {
switch ($this.request.executeType) {
Expand All @@ -121,8 +119,7 @@
setTimeout(function () {
window.URL.revokeObjectURL(url);
}, 100);
//a.remove();
}
};
return;

case 2://findString
Expand Down Expand Up @@ -163,7 +160,7 @@
$this.request.executeType = 3;
$this.loadReport();
$this.request.toggleId = null;
}
}
});
$this.find("img").each(function (index, item) {
if ($(this).attr("alt") === "+") {
Expand All @@ -173,25 +170,7 @@
this.src = options.webRootPath + "/images/Minus.gif";
}
});
}
function scroll() {
var p = $this.find(".currentFind").position();
//console.log(p, $this.offset(), $this.find(".currentFind").offset(), $this.scrollTop());
//$("body").scrollTo(p.left, p.top);
}
function getOrSetSession(sessionId) {
if (sessionId) {
var Days = 3; //此 cookie 将被保存 3 天
var exp = new Date(); //new Date("December 31, 9998");
exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
document.cookie = "SSRS_SessionId=" + escape(sessionId) + ";expires=" + exp.toGMTString();
return sessionId;
}
var x = /(^| )SSRS_SessionId=([^;]+)(;|$)/gi.exec(document.cookie);
if (x) {
return unescape(x[2]);
}
}
};
function init() {
$("#ssrs_pageNum").text($this.request.pageCount);
$("#ssrs_page").val($this.request.pageIndex);
Expand Down