导出字符串拼接jquery

$(".rExport").click(function () {
var exportStr = "pageSize=" + $scope.pageSize + "&pageNum=" + $scope.pageNum;
if ($scope.taskName !== "") {
exportStr += "&taskName=" + $scope.taskName;
}
if ($("#data_three").val() !== "") {
var timeStr = $("#data_three").val().split(" - ");
var effecttime = timeStr[0];
var endtime = timeStr[1];
exportStr += "&launchTime=" + effecttime + "&launchedTimeOut=" + endtime;
}
if ($scope.taskType !== -1) {
exportStr += "&taskType=" + $scope.taskType;
}
if ($scope.needAudited !== -1) {
exportStr += "&needAudited=" + $scope.needAudited;
}
window.location.href = "/Excel?" + exportStr;
})

猜你喜欢

转载自www.cnblogs.com/loveAline/p/9291001.html