WorkflowCheckResult.jsp
20.5 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
<%@ page import="weaver.templetecheck.filecheck.CheckRule" %>
<%@ page import="weaver.templetecheck.filecheck.ReplaceOperation" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea" %>
<HTML>
<HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
<link rel="stylesheet" href="/css/ecology8/request/requestTopMenu_wev8.css" type="text/css"/>
<link rel="stylesheet" href="/wui/theme/ecology8/jquery/js/zDialog_e8_wev8.css" type="text/css"/>
<script type="text/javascript" src="/js/dragBox/parentShowcol_wev8.js"></script>
<link rel="stylesheet" href="/css/ecology8/request/requestView_wev8.css" type="text/css"/>
<link rel="stylesheet" href="/wui/theme/ecology8/weaveredittable/css/WeaverEditTable_wev8.css">
<script src="/wui/theme/ecology8/weaveredittable/js/WeaverEditTable_wev8.js"></script>
<link href="/js/checkbox/jquery.tzCheckbox_wev8.css" type=text/css rel=STYLESHEET>
<script type="text/javascript" src="/js/ecology8/jNice/jNice/jquery.jNice_wev8.js"></script>
<%
//判断只有管理员才有权限
int userid = user.getUID();
if (userid != 1) {
response.sendRedirect("/notice/noright.jsp");
return;
}
String tabtype = Util.null2String(request.getParameter("tabtype"));
String filepath = Util.null2String(request.getParameter("filepath"));
String fromtab = Util.null2String(request.getParameter("fromtab"));
if("".equals(fromtab)){
fromtab="myworkflowcheck";
}
String ishtml = "";
String path = "";
%>
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery("td[_samepair='rulelist']").css("padding", "0px!important");
});
</script>
</head>
<%
String imagefilename = "/images/hdMaintenance_wev8.gif";
String titlename = "流程模板检测结果";
String needfav = "1";
String needhelp = "";
String type = Util.null2String(request.getParameter("type"));
String description = Util.null2String(request.getParameter("description")).trim();
String nodename = Util.null2String(request.getParameter("nodename")).trim();
String rulename = Util.null2String(request.getParameter("rulename")).trim();
String ruleid = Util.null2String(request.getParameter("ruleid")).trim();
String navName = java.net.URLDecoder.decode(Util.null2String(request.getParameter("navName")), "UTF-8");
String workflowname = Util.null2String(request.getParameter("workflowname")).trim();
String workflowname1 = Util.null2String(request.getParameter("workflowname1")).trim();
if(!"".equals(workflowname1)){
workflowname = workflowname1;
}
String workflowids = Util.null2String(request.getParameter("workflowids")).trim();
if (!"".equals(workflowids) && workflowids.endsWith(",")) {
workflowids = workflowids.substring(0, workflowids.length() - 1);
}
%>
<BODY>
<iframe name="downiframe" id="downiframe" src="" style="display:none"></iframe>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
RCMenu += "{批量替换,javascript:replaceBatch(),_self} ";
RCMenuHeight += RCMenuHeightStep;
String PageConstId = "upgradecheckworkflowresult11";
String backfields = " nodehtmllayoutid,isactive,workflowname,nodename,filepath,htmlparsescheme,w.nodeid,w.formid,w.isbill,w.type,workflowid,w.opertime,w.version ";
String fromSql = " upgradecheckworkflowresult u,workflow_nodehtmllayout w ";
String sqlWhere = " u.nodehtmllayoutid=w.id ";
if(fromtab.equals("myworkflowcheck")){
sqlWhere = sqlWhere + " and content <> '^[\\s\\S]*.*[^\\s][\\s\\S]*$' ";
}
if (!"".equals(ruleid)) {
sqlWhere = sqlWhere + " and ruleid in (" + ReplaceOperation.formatIds(ruleid) + ")";
}
if (!"".equals(nodename)) {
sqlWhere = sqlWhere + " and nodename like ('%" + nodename + "%') ";
}
if (!"".equals(description)) {
sqlWhere = sqlWhere + " and description like ('%" + description + "%') ";
}
if (!"".equals(rulename)) {
sqlWhere = sqlWhere + " and rulename like ('%" + rulename + "%') ";
}
if (!"".equals(workflowname)) {
sqlWhere = sqlWhere + " and workflowname like ('%" + workflowname + "%') ";
}
if (!"".equals(workflowids)) {
sqlWhere = sqlWhere + " and workflowid in (" + workflowids + ") ";
}
String orderby = "workflowid,nodeid";
String tableStringrule = "<table instanceid=\"upgradecheckworkflowresult11\" tabletype=\"checkbox\" pagesize=\"" + PageIdConst.getPageSize("upgradecheckworkflowresult11", user.getUID()) + "\" >" +
" <sql backfields=\"" + backfields + "\" sqlform=\"" + fromSql + "\" sqlorderby=\"" + orderby + "\" sqlwhere=\"" + Util.toHtmlForSplitPage(sqlWhere) + "\" sqlprimarykey=\"u.nodehtmllayoutid\" sqlsortway=\"asc\" sqlisdistinct=\"true\"/>" +
" <head>";
tableStringrule += "<col width=\"10%\" text=\"htmlID\" column=\"nodehtmllayoutid\" display=\"false\"/>"+
"<col width=\"10%\" text=\"流程名称\" column=\"workflowname\"/>"+
"<col width=\"10%\" text=\"节点名称\" column=\"nodename\" />"+
"<col width=\"5%\" text=\"模板类型\" column=\"filepath\" transmethod=\"weaver.templetecheck.filecheck.FileCheckReport.getHtmlparsescheme\"/>"+
"<col width=\"5%\" text=\"使用状态\" column=\"isactive\" transmethod=\"weaver.templetecheck.filecheck.FileCheckReport.getHtmlLayoutResult\"/>"+
"<col width=\"30%\" text=\"文件路径\" column=\"nodehtmllayoutid\" transmethod=\"weaver.templetecheck.filecheck.FileCheckReport.getCheckContent\"/>"+
"<col width=\"10%\" text=\"被检测内容\" column=\"nodehtmllayoutid\" otherpara=\"column:nodehtmllayoutid\" transmethod=\"weaver.templetecheck.transmethod.RuleTrans.showResourceContent\"/>"+
"<col width=\"10%\" text=\"最后修改时间\" column=\"opertime\" otherpara=\"column:filepath\" transmethod=\"weaver.templetecheck.transmethod.RuleTrans.showLastModifyTime\" />"+
"</head>"+
" <operates>" +
" <popedom transmethod=\"weaver.templetecheck.transmethod.RuleTrans.getOperatesForWorkflowCheckResult\" otherpara=\"column:nodehtmllayoutid+"+ruleid+"\" ></popedom> " +
" <operate href=\"javascript:fastEdit();\" otherpara=\"column:nodeid+column:formid+column:isbill+column:type+column:workflowid+column:version+column:nodehtmllayoutid\" text=\"快捷编辑\" index=\"0\"/>" +
" <operate href=\"javascript:replaceSingle();\" otherpara=\"column:nodehtmllayoutid\" text=\"替换\" index=\"1\"/>" +
" <operate href=\"javascript:showdetail();\" otherpara=\"column:nodehtmllayoutid\" text=\"详情\" index=\"2\"/>" +
"</operates></table>";
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<form action="" method="post" name="form1" id="form1">
<jsp:include page="/systeminfo/commonTabHead.jsp">
<jsp:param name="mouldID" value="check"/>
<jsp:param name="navName" value="<%=titlename %>"/>
</jsp:include>
<table id="topTitle" cellpadding="0" cellspacing="0">
<tr>
<td></td>
<td class="rightSearchSpan" style="text-align:right; width:500px!important">
<input class="searchInput" id="name2" name="workflowname1"/>
<input type="button" value="批量替换" style="width:100%;max-width:120px;margin-right: 10px!important;" class="e8_btn_top" onclick="replaceBatch()"/>
<input type="button" value="导出报告" style="width:100%;max-width:120px!important;" class="e8_btn_top_first" onclick="exportReport()"/>
<span id="advancedSearch" class="advancedSearch">高级搜索</span>
<span title="菜单" class="cornerMenu"></span>
</td>
</tr>
</table>
<div id="tabDiv">
<span style="font-size:14px;font-weight:bold;">流程模板检查</span>
</div>
<div class="cornerMenuDiv"></div>
<div class="advancedSearchDiv" id="advancedSearchDiv">
<wea:layout type="4col">
<wea:group context="高级搜索">
<wea:item>流程名称</wea:item>
<wea:item><input type="text" name="workflowname" value="<%=workflowname%>"></wea:item>
<wea:item>节点名称</wea:item>
<wea:item><input type="text" name="nodename" value="<%=nodename%>"></wea:item>
<wea:item>规则名称</wea:item>
<wea:item><input type="text" name="rulename" value="<%=rulename%>"></wea:item>
</wea:group>
<wea:group context="" attributes="{'groupDisplay':'none'}">
<wea:item type="toolbar">
<input type="submit" onclick="doRefresh()" value="搜索" class="zd_btn_submit"/>
<input type="button" value="重置" class="e8_btn_cancel" onclick="resetCondtion();"/>
<input type="button" value="取消" class="e8_btn_cancel" id="cancel"/>
</wea:item>
</wea:group>
</wea:layout>
</div>
<TABLE width="100%" id="resulttab">
<tr>
<td valign="top">
<input type="hidden" name="pageId" id="pageId" value="upgradecheckworkflowresult11"/>
<wea:SplitPageTag tableString="<%=tableStringrule %>" isShowTopInfo="true" mode="run"/>
<a id="a1" href="/filesystem/templetecheck/WorkflowCheckResult.zip" download='流程模板检测报告'></a>
</td>
</tr>
</TABLE>
<input name="type" value="" type="hidden"/>
<input name="ruleid" value="<%=ruleid %>" type="hidden"/>
<input name="tabtype" value="<%=tabtype %>" type="hidden"/>
<input name="ishtml" value="<%=ishtml %>" type="hidden"/>
<input type="hidden" name="navName" value="<%=navName%>"/>
<input type="hidden" name="type" value="<%=type%>"/>
</form>
<div id="message_table_Div2" class="xTable_message" style="display: none; position: absolute; top: 203px; left:50%;">正在加载数据,请稍候...</div>
<iframe id="excels" src="" style="display:none"></iframe>
</BODY>
</HTML>
<script language="javascript" src="/wui/theme/ecology8/jquery/js/zDialog_wev8.js"></script>
<script language="javascript" src="/wui/theme/ecology8/jquery/js/zDrag_wev8.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(parent.document.getElementById("objName")).html("<%=navName %>");
$("#tableitem").removeClass("fieldName");
$("#topTitle").topMenuTitle({searchFn:doRefresh});
$(".topMenuTitle td:eq(0)").html($("#tabDiv").html());
$("#tabDiv").remove();
});
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();
_table.reLoad();
}
}
});
}
function showContentDetail(id){
showResourceContentDialog("/templetecheck/filecheck/MessageDialog.jsp?id="+id+"&resultTableName=workflow_nodehtmllayout&contentColumnName=scripts")
}
function showResourceContentDialog(url) {
var dialog = new window.top.Dialog();
dialog.currentWindow = window;
dialog.Title = "内容详情";
dialog.Width = $(window).width() - 100;
dialog.Height = $(window).height() + 200;
dialog.maxiumnable = true;
dialog.Drag = true;
dialog.URL = url;
dialog.show();
}
//快捷编辑
function fastEdit(id, params) {
var paramsArr = params.split("+");
try {
var nodeid_t = paramsArr[0];
var formid_t = paramsArr[1];
var isbill_t = paramsArr[2];
var layouttype_t = paramsArr[3];
var workflowid_t = paramsArr[4];
var version_t = paramsArr[5];
var nodehtmllayoutid_t = paramsArr[6];
if (nodeid_t == "" || formid_t == "" || isbill_t == "" || layouttype_t == "" || workflowid_t == "" || id == "" || nodehtmllayoutid_t == "") {
top.Dialog.alert("内容为空!");
return;
}
if (version_t == '2') {
openDesignDialogForTempletecheck(workflowid_t, nodeid_t, formid_t, isbill_t, layouttype_t, nodehtmllayoutid_t, true);
//openDesignDialogForTempletecheck(formid_t, layouttype_t, layoutid_t, modeid_t,true);
} else {
openFullWindowHaveBarForTempletecheck("/workflow/html/LayoutEditFrame.jsp?formid=" + formid_t + "&wfid=" + workflowid_t + "&nodeid=" + nodeid_t + "&isform=0&isbill=" + isbill_t + "&layouttype=" + layouttype_t + "&modeid=" + nodehtmllayoutid_t + "&ajax=0");
}
} catch (e) {
top.Dialog.alert("快捷编辑窗口打开失败,参数不合法:" + params);
}
}
function openDesignDialogForTempletecheck(wfid, nodeid, formid, isbill, layouttype, modeid, needreload) {
var dlg = new window.top.Dialog(); //定义Dialog对象
dlg.currentWindow = window;
dlg.Model = true;
if ($.browser.msie && parseInt($.browser.version, 10) < 9) { //run for ie7/8
dlg.maxiumnable = false;
dlg.Width = 1000;
dlg.Height = 600;
dlg.URL = "/wui/common/page/sysRemind.jsp?labelid=124796";
dlg.hideDraghandle = false;
} else {
dlg.maxiumnable = true;
dlg.Width = $(window.top).width() - 60;
dlg.Height = $(window.top).height() - 80;
dlg.URL = "/workflow/exceldesign/excelMain.jsp?wfid=" + wfid + "&nodeid=" + nodeid + "&formid=" + formid + "&isbill=" + isbill
+ "&layouttype=" + layouttype + "&modeid=" + modeid;
dlg.hideDraghandle = true;
}
dlg.Title = "Design";
dlg.closeHandle = function (paramobj, datas) {
if (needreload)
_table.reLoad();
}
dlg.show();
}
function openFullWindowHaveBarForTempletecheck(url) {
var redirectUrl = url;
var width = screen.availWidth - 10;
var height = screen.availHeight - 50;
//if (height == 768 ) height -= 75 ;
//if (height == 600 ) height -= 60 ;
var szFeatures = "top=0,";
szFeatures += "left=0,";
szFeatures += "width=" + width + ",";
szFeatures += "height=" + height + ",";
szFeatures += "directories=no,";
szFeatures += "status=yes,toolbar=no,location=no,";
szFeatures += "menubar=no,";
szFeatures += "scrollbars=yes,";
szFeatures += "resizable=yes"; //channelmode
window.open(redirectUrl, "", szFeatures);
}
//开始检查
function matchWorkflow() {
startAjaxShowDiv();
$.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{
_table.reLoad();
stopAjaxHideDiv();
}
}*/
});
stopAjaxHideDiv();
}
var dialog = null;
function closeDialog(){
if(dialog)
dialog.close();
}
var dWidth = 600;
var dHeight = 500;
var clientWidth = document.body.clientWidth;
dWidth = clientWidth*0.9;
var clientHeight = document.body.clientHeight;
dHeight = clientHeight * 0.9;
function doOpen(url, title) {
if (typeof dialog == 'undefined' || dialog == null) {
dialog = new window.top.Dialog();
}
dialog.currentWindow = window;
dialog.Title = title;
dialog.Width = dWidth;
dialog.Height = dHeight;
dialog.Drag = true;
dialog.maxiumnable = true;
dialog.URL = url;
try {
dialog.show();
} catch (e) {
}
}
//显示详细
function showdetail(id) {
var url = "/templetecheck/filecheck/WorkflowCheckResultDetail.jsp?layoutid="+id+"&ruleid=<%=ruleid%>&fromtab=<%=fromtab%>";
doOpen(url, "详情");
}
function replaceSingle(id,nodehtmllayoutid) {
if(nodehtmllayoutid == "") {
top.Dialog.alert("内容为空!");
return;
}
top.Dialog.confirm("请确认模板已备份", function(){
startAjaxShowDiv();
$.ajax({
url:"ReplaceOperation.jsp",
dataType:'json',
type:'post',
data:{
"nodehtmllayoutids":nodehtmllayoutid,
"workflowname":"<%=workflowname%>",
"rulename":"<%=rulename%>",
"nodename":"<%=nodename%>",
"ruleids":"<%=ruleid%>",
"rulefrom":"workflow"
},
ayc:false,//同步加载
success:function(data){
stopAjaxHideDiv();
if(data) {
var res = data.status;
if(res == "ok") {
top.Dialog.alert("替换成功");
_table.reLoad();
return;
} else {
top.Dialog.alert("替换失败");
return;
}
}
}
});
});
}
function replaceBatch() {
var nodehtmllayoutids = _xtable_CheckedCheckboxId();
if (nodehtmllayoutids == "") {
alert("提示:此操作将替换当前所有分页的全部记录!");
}
top.Dialog.confirm("请确认文件已备份", function(){
startAjaxShowDiv();
$.ajax({
url:"ReplaceOperation.jsp",
dataType:'json',
data:{
"nodehtmllayoutids":nodehtmllayoutids,
"ruleids":"<%=ruleid%>",
"workflowname":"<%=workflowname%>",
"rulename":"<%=rulename%>",
"nodename":"<%=nodename%>",
"rulefrom":"workflow"
},
type:'post',
ayc:false,//同步加载
success:function(data){
stopAjaxHideDiv();
if(data) {
var res = data.status;
if(res == "ok") {
top.Dialog.alert("替换成功");
_table.reLoad();
return;
} else {
top.Dialog.alert("替换失败");
return;
}
}
}
});
});
}
/*$(function () {
//ajax请求过程中,显示加载中图片并显示图层,请求完成隐藏图片
$("#message_table_Div2").ajaxStop(function () {
//隐藏div
var lockwin = $(this);
lockwin.hide();
$("#resulttab").show();
});
});*/
//导出报告
function exportReport() {
$("#message_table_Div2").ajaxStart(function () {
$("#message_table_Div2").show();
});
$.ajax({
url: "WorkflowCheckReportOperation.jsp",
dataType: 'json',
data: {
"method": "exportWorkflowReport",
"workflowids": "<%=workflowids%>",
"ruleid": "<%=ruleid%>",
"fromtab": "<%=fromtab%>"
},
type: 'post',
ayc: false,//同步加载
success: function (data) {
if (data) {
$("#message_table_Div2").hide()
var res = data.status;
if (res == "ok") {
document.getElementById("a1").click();
}
}
},
error: function (msg) {
alert(msg)
}
});
}
function doRefresh() {
$("#form1").attr("action", "WorkflowCheckResult.jsp");
$("#form1").submit();
}
function startAjaxShowDiv(){
$("#message_table_Div2").ajaxStart(function(){//div是要进行数据提示时显示的块
$("#message_table_Div2").show();
sleep(3000);
});
}
function stopAjaxHideDiv(){
$("#message_table_Div2").hide();
$("#resulttab").show();
}
</script>