FilecheckGetReport.jsp
3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<%
//判断只有管理员才有权限
int userid = user.getUID();
if (userid != 1) {
response.sendRedirect("/notice/noright.jsp");
return;
}
String ruleid = Util.null2String(request.getParameter("ruleid")).trim();
String workflowids = Util.null2String(request.getParameter("workflowids")).trim();
if (!"".equals(workflowids) && workflowids.endsWith(",")) {
workflowids = workflowids.substring(0, workflowids.length() - 1);
}
String filepath = Util.null2String(request.getParameter("filepath"));
StringBuilder queryString=new StringBuilder("?1=1");
Map<String, String[]> queryData=request.getParameterMap();
for (Map.Entry<String, String[]> entry : queryData.entrySet()) {
queryString.append("&"+entry.getKey()+"="+entry.getValue()[0]);
}
%>
<html>
<div id="message_table_Div2" class="xTable_message" style="display: none; position: absolute; top: 203px; left:50%;">正在加载数据,请稍候...</div>
</html>
<script type="text/javascript">
$(document).ready(function(){
matchWorkflow();
});
function checkstatus() {
$.ajax({
url:"WorkflowReportOperation.jsp",
type:"post",
data:{
"operation":"matchworkflow",
"ruleid":"<%=ruleid%>",
"workflowids": "<%=workflowids%>",
"filepath":"<%=filepath%>"
},
dataType:"json",
success:function(data){
var status =data.status;
if(status=='isrunning'){
initIntervals()
return;
}else{
stopAjaxHideDiv();
}
}
});
}
//开始检查
function matchWorkflow() {
startAjaxShowDiv();
$.ajax({
url:"WorkflowReportOperation.jsp",
type:"post",
data:{
"operation":"matchworkflow",
"ruleid":"<%=ruleid%>",
"workflowids": "<%=workflowids%>",
"filepath":"<%=filepath%>"
},
dataType:"json",
success:function(data){
stopAjaxHideDiv();
var status =data.status;
if(status=='isrunning'){
initIntervals();
return;
}
window.location.href='/templetecheck/filecheck/WorkflowCheckResult.jsp<%=queryString.toString()%>';
}
});
}
var detailProcessInterval;
//初始化定时器
function initIntervals() {
var intervaltime = 1000;
detailProcessInterval = setInterval('getRunningStatus()',intervaltime);
}
//清空定时器
function clearIntarvals() {
clearInterval(detailProcessInterval);
}
function getRunningStatus() {
$.ajax({
url: "WorkflowReportOperation.jsp",
type: "post",
data: {
"operation": "getRunningStatus",
},
dataType: "json",
success: function (data) {
var status =data.status;
if(status=='ok'){
clearIntarvals();
stopAjaxHideDiv();
window.location.href='/templetecheck/filecheck/WorkflowCheckResult.jsp<%=queryString.toString()%>';
}
}
});
}
function startAjaxShowDiv(){
$("#message_table_Div2").ajaxStart(function(){//div是要进行数据提示时显示的块
$("#message_table_Div2").show();
sleep(3000);
});
}
function stopAjaxHideDiv(){
$("#message_table_Div2").hide();
$("#resulttab").show();
}
</script>