showModule.jsp
15.6 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
<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ page import="weaver.general.Util"%>
<%@ page import="weaver.workflow.exceldesign.FormTemplateManager" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<%
int wfid = Util.getIntValue(request.getParameter("wfid"));
int nodeid = Util.getIntValue(request.getParameter("nodeid"), 0);
boolean isFormLayout = FormTemplateManager.isFormVirtualNode(nodeid);
int formid = Util.getIntValue(request.getParameter("formid"), 0);
int isbill = Util.getIntValue(request.getParameter("isbill"), -1);
int layouttype = Util.getIntValue(request.getParameter("layouttype"), 0);
%>
<html>
<head>
<link type="text/css" rel="stylesheet" href="/workflow/exceldesign/css/showModule_wev8.css" />
<script type='text/javascript' src='/workflow/exceldesign/js/openExcelDesign_wev8.js'></script>
</head>
<body>
<%
String par1 = wfid+"+"+formid+"+"+isbill+"+"+layouttype+"+"+user.getLanguage();
if(isFormLayout){
String oraclesql = ("oracle".equalsIgnoreCase(rs.getDBType())) ? "from dual" : "";
String sqlform = " (select "+nodeid+" as nodeid "+oraclesql+") ";
String tableString = ""+
"<table instanceid=\"module\" needPage=\"false\" tabletype=\"none\" pagesize=\"\" >"+
"<sql backfields=\"nodeid\" sqlform=\""+Util.toHtmlForSplitPage(sqlform)+"\" sqlprimarykey=\"nodeid\" sqlsortway=\"asc\" />"+
"<head>"
+ "<col width=\"130px\" text=\""+SystemEnv.getHtmlLabelName(15615, user.getLanguage())+"\" column=\"nodeid\" "
+ " transmethod=\"weaver.workflow.exceldesign.HtmlLayoutOperate.transFormLayoutType\" otherpara=\""+layouttype+"+"+user.getLanguage()+"\" />"
+ "<col width=\"*\" text=\""+SystemEnv.getHtmlLabelName(19853, user.getLanguage())+"\" column=\"nodeid\" "
+ " transmethod=\"weaver.workflow.exceldesign.HtmlLayoutOperate.transLayoutInfo\" otherpara=\""+par1+"\" />"
+ "<col width=\"510px\" text=\""+SystemEnv.getHtmlLabelName(104, user.getLanguage())+"\" column=\"nodeid\" "
+ " transmethod=\"weaver.workflow.exceldesign.HtmlLayoutOperate.transOperBtn\" otherpara=\""+par1+"\" />"+
"</head>"+
"</table>";
%>
<div style="margin:50px 30px">
<wea:SplitPageTag isShowTopInfo="false" tableString="<%=tableString%>" mode="run" />
</div>
<%
}else{
String nodename = Util.null2String(request.getParameter("searchVal"));
String backfields = " fn.nodeid,nb.nodename,fn.nodetype ";
String sqlform = " workflow_flownode fn,workflow_nodebase nb ";
String sqlwhere = " nb.id=fn.nodeid and fn.workflowid="+wfid+" and (nb.IsFreeNode is null or nb.IsFreeNode!='1') ";
if(!nodename.equals(""))
sqlwhere += " and nb.nodename like '%"+nodename+"%'";
String sqlorder = " fn.nodetype, fn.nodeorder ";
String tableString = ""+
"<table instanceid=\"module\" tabletype=\"none\" pagesize=\""+PageIdConst.getPageSize(PageIdConst.WF_WORKFLOW_SHOWMODULE,user.getUID())+"\" >"+
"<sql backfields=\""+backfields+"\" sqlwhere=\""+Util.toHtmlForSplitPage(sqlwhere)+"\" sqlform=\""+Util.toHtmlForSplitPage(sqlform)+"\" sqlorderby=\""+sqlorder+"\" sqlprimarykey=\"nodeid\" sqlsortway=\"asc\" sqlisdistinct=\"false\" />"+
"<head>"
+ "<col width=\"130px\" text=\""+SystemEnv.getHtmlLabelName(15615, user.getLanguage())+"\" column=\"nodetype\" "
+ " transmethod=\"weaver.workflow.exceldesign.HtmlLayoutOperate.transNodeInfo\" otherpara=\"column:nodename"+"+"+user.getLanguage()+"\" />"
+ "<col width=\"*\" text=\""+SystemEnv.getHtmlLabelName(19853, user.getLanguage())+"\" column=\"nodeid\" "
+ " transmethod=\"weaver.workflow.exceldesign.HtmlLayoutOperate.transLayoutInfo\" otherpara=\""+par1+"\" />"
+ "<col width=\"650px\" text=\""+SystemEnv.getHtmlLabelName(104, user.getLanguage())+"\" column=\"nodeid\" "
+ " transmethod=\"weaver.workflow.exceldesign.HtmlLayoutOperate.transOperBtn\" otherpara=\""+par1+"\" />"+
"</head>"+
"</table>";
%>
<style type="text/css">
.operarea{display:none}
</style>
<form id="weaverform" name="weaverform" style="height:100%;" method="post" action="/workflow/exceldesign/showModule.jsp">
<input type="hidden" name="wfid" value="<%=wfid %>" />
<input type="hidden" name="formid" value="<%=formid %>" />
<input type="hidden" name="isbill" value="<%=isbill %>" />
<input type="hidden" name="layouttype" value="<%=layouttype %>" />
<div class="topsearch"><%=SystemEnv.getHtmlLabelName(501844 , user.getLanguage())%>
<span class="searchInputSpan" style="background: #fff; margin-top: 2px;">
<input type="text" class="searchInput" name="searchVal" value="<%=nodename %>"
onkeypress="if(event.keyCode==13) {searchTable();}" />
</input>
<span>
<img src="/images/ecology8/request/search-input_wev8.png" onclick="searchTable()"></img>
</span>
</span>
</div>
<div class="layoutContent">
<input type="hidden" name="pageId" id="pageId" value="<%=PageIdConst.WF_WORKFLOW_SHOWMODULE%>" />
<wea:SplitPageTag isShowTopInfo="false" tableString="<%=tableString%>" mode="run" />
</div>
</form>
<%} %>
</body>
<script type="text/javascript">
$(document).unbind("contextmenu").bind("contextmenu", function (e) {
return false;
});
function afterDoWhenLoaded(){ //分页控件加载完成回调方法
$("table.ListStyle").find(".HeaderForXtalbe").remove();
$("table.ListStyle").find("td").attr("title", "");
var winheight = $(window).height();
$(".layoutContent").css("height",(winheight-25-14)+"px");
//编辑节点展开历史模板
var editing_nodeid = window.parent.wfinfo.nodeid;
var editingObj = jQuery("[name='nodeid'][isactive='1'][value='"+editing_nodeid+"']");
if(editingObj.size() > 0){ //编辑节点非第一页不用处理
var nodeimgObj = editingObj.closest("tr").find("div.nodeimg");
extendHistoryLayout(nodeimgObj[0]);
}
controlOperArea();
}
//展开对应节点历史模板
function extendHistoryLayout(vthis){
var tablelist = jQuery(vthis).closest("table");
var spacingObj = tablelist.find("tr.Spacing").first();
var curTrObj = jQuery(vthis).closest("tr");
var nodeid = curTrObj.find("[name='nodeid']").val();
var extendRow = tablelist.find("tr[extendRow='y'][extendNodeid='"+nodeid+"']");
if(extendRow.size() > 0){
extendRow.remove();
return;
}
jQuery.ajax({
type: "post",
url: "/workflow/exceldesign/excelAjaxData.jsp",
data: {src:"getHistoryLayout", wfid:"<%=wfid %>", nodeid:nodeid, formid:"<%=formid %>", isbill:"<%=isbill %>", layouttype:"<%=layouttype %>", languageid:"<%=user.getLanguage() %>"},
dataType: "JSON",
success: function(result){
var datas = JSON.parse(result);
//if(window.console) console.dir(datas);
for(var i=0; i<datas.length; i++){
var extendTrObj = curTrObj.clone();
extendTrObj.removeClass("Selected");
extendTrObj.find("td").html("");
extendTrObj.find("td:eq(2)").html(datas[i].layoutInfo);
extendTrObj.find("td:eq(3)").html(datas[i].operArea);
var extendSpacing = spacingObj.clone();
extendSpacing.attr("class", spacingObj.attr("class")).attr("style", spacingObj.attr("style"));
extendTrObj.add(extendSpacing).attr("extendRow", "y").attr("extendNodeid", nodeid);
curTrObj.after(extendTrObj).after(extendSpacing);
}
setEditingMark();
controlOperArea();
}
});
}
//编辑中模板加标示
function setEditingMark(){
if(jQuery(".layoutediting").size() > 0)
return;
var editing_layoutid = window.parent.wfinfo.modeid;
var layoutinput = jQuery("[name='layoutid'][value='"+editing_layoutid+"']");
var editing='<div class="layoutediting"><img src="/workflow/exceldesign/image/shortBtn/module/editing_wev8.png"/><span><%=SystemEnv.getHtmlLabelName(128079, user.getLanguage())%></span></div>';
layoutinput.closest("td").find("div.layoutname").append(editing);
layoutinput.closest("tr").find("div.oper_delete").attr("onclick", "")
.find("div").removeClass("operbtn_delete").addClass("operbtn_deletedisabled");
//页面加载执行,编辑活动模板被切为非活动,需改变设计器编辑区isactive属性
var curedit_isactive = layoutinput.parent().find("[name='nodeid']").attr("isactive");
window.parent.wfinfo.isactive = curedit_isactive;
jQuery("#hiddenAttrDiv input[name='isactive']",window.parent.document).val(curedit_isactive);
}
//控制按钮区
function controlOperArea(){
<%if(!isFormLayout){ %>
jQuery("div.operarea[hasBind!='y']").each(function(){
var vthis = jQuery(this);
var version = parseInt(vthis.closest("tr").find("[name='version']").val());
var layoutid = parseInt(vthis.closest("tr").find("[name='layoutid']").val());
var belform = parseInt(vthis.closest("tr").find("[name='belform']").val());
if(version != 2){
vthis.find("div.oper_edit").attr("onclick", "").find("div").removeClass("operbtn_edit").addClass("operbtn_editdisabled");
vthis.find("div.oper_preview").attr("onclick", "").find("div").removeClass("operbtn_preview").addClass("operbtn_previewdisabled");
}
if(version != 2 || belform == 1)
vthis.find("div.oper_sync").attr("onclick", "").find("div").removeClass("operbtn_sync").addClass("operbtn_syncdisabled");
if(layoutid <= 0 || belform == 1)
vthis.find("div.oper_delete").attr("onclick", "").find("div").removeClass("operbtn_delete").addClass("operbtn_deletedisabled");
vthis.closest("tr").mouseover(function(){
vthis.show();
}).mouseout(function(){
vthis.hide();
});
vthis.attr("hasBind", "y");
});
<%} %>
}
//新建
function createBtnClick(vthis){
var nodeid=jQuery(vthis).closest("tr").find("[name='nodeid']").val();
switchEditLayout(nodeid, "0");
}
//编辑模板
function editBtnClick(vthis){
var layoutid = parseInt(jQuery(vthis).closest("tr").find("[name='layoutid']").val());
var version = parseInt(jQuery(vthis).closest("tr").find("[name='version']").val());
if(layoutid<=0 || version!=2)
return;
var editing_layoutid = window.parent.wfinfo.modeid;
if(layoutid == editing_layoutid){
//只是切换tab页
parent.changeTab4SameModeid();
}else{
var nodeid=jQuery(vthis).closest("tr").find("[name='nodeid']").val();
switchEditLayout(nodeid, layoutid);
}
}
//模板切换
function switchEditLayout(nodeid, layoutid){
if(parent.judgeDesignHasModify()){
window.top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(128080, user.getLanguage())%>",function(){
//重新加载
parent.reloadExcelMain(nodeid, "<%=layouttype%>", layoutid);
});
}else{
parent.reloadExcelMain(nodeid, "<%=layouttype%>", layoutid);
}
}
//预览
function previewBtnClick(vthis){
var nodeid = jQuery(vthis).closest("tr").find("input[name='nodeid']").val();
var layoutid = jQuery(vthis).closest("tr").find("input[name='layoutid']").val();
preViewExcelDesignLayout("<%=wfid %>", nodeid, "<%=formid %>", "<%=isbill %>", "<%=layouttype %>", layoutid);
}
//选择
function chooseBtnClick(vthis){
var nodeid = jQuery(vthis).closest("tr").find("input[name='nodeid']").val();
var layoutid = jQuery(vthis).closest("tr").find("input[name='layoutid']").val();
var dialog = new window.top.Dialog();
dialog.currentWindow = window;
var url = "/workflow/exceldesign/chooseHtmlTemplateTab.jsp?wfid=<%=wfid %>&nodeid=<%=nodeid %>&formid=<%=formid %>&isbill=<%=isbill %>&choosetype=<%=layouttype %>&curlayoutid="+layoutid+"&fromwhere=showModule";
dialog.Title = "<%=SystemEnv.getHtmlLabelName(18214,user.getLanguage()) %>";
dialog.Width = 750;
dialog.Height = 650;
dialog.maxiumnable = false;
dialog.URL = url;
dialog.callback = function(datas){
var chooselayoutid = datas.id;
if(chooselayoutid){
jQuery.ajax({
type: "post",
url: "/workflow/exceldesign/excelAjaxData.jsp",
data: {src:"saveChooseLayout", wfid:"<%=wfid %>", nodeid:nodeid, formid:"<%=formid %>", isbill:"<%=isbill %>", layouttype:"<%=layouttype %>", choose_layoutid:chooselayoutid, operuser:"<%=user.getUID() %>", languageid:"<%=user.getLanguage() %>"},
dataType: "JSON",
success: function(result){
if(result.trim() == "success"){
dialog.close();
if(chooselayoutid != "-1" && layoutid == window.parent.wfinfo.modeid){ //当前编辑模板选择了其它模板需刷新设计器
parent.reloadExcelMain(nodeid, "<%=layouttype%>", layoutid);
}
window.location.reload();
}
}
});
}
}
dialog.show();
}
//删除
function deleteBtnClick(vthis){
window.top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(128081, user.getLanguage())%>",function(){
var layoutid = jQuery(vthis).closest("tr").find("[name='layoutid']").val();
jQuery.ajax({
type: "post",
url: "/workflow/exceldesign/excelAjaxData.jsp",
data: {src:"deleteLayout", layoutid:layoutid},
dataType: "JSON",
success: function(result){
if(result.trim() == "success");
window.location.reload();
}
});
});
}
//Excel导入
function excelimpBtnClick(vthis){
if("<%=isbill %>"!="1"){
window.top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(129028, user.getLanguage())%>!");
return;
}
var nodeid = jQuery(vthis).closest("tr").find("[name='nodeid']").val();
var url = "/workflow/exceldesign/importExcelTemplate.jsp?wfid=<%=wfid%>&nodeid="+nodeid+"&formid=<%=formid%>&isbill=<%=isbill%>&layouttype=<%=layouttype%>";
var dlg=new window.top.Dialog();
dlg.currentWindow=window;
dlg.Model=true;
dlg.Width=550;
dlg.Height=400;
dlg.URL=url;
dlg.Title="<%=SystemEnv.getHtmlLabelName(128060, user.getLanguage())%>";
dlg.show();
}
//初始化模板
function initBtnClick(vthis){
var nodeid=jQuery(vthis).closest("tr").find("[name='nodeid']").val();
var layoutid=jQuery(vthis).closest("tr").find("[name='layoutid']").val();
var dialog = new window.top.Dialog();
dialog.currentWindow = window;
var url = "/workflow/exceldesign/excelInitModule.jsp?wfid=<%=wfid%>&layouttype=<%=layouttype%>&nodeid="+nodeid+"&formid=<%=formid%>&isbill=<%=isbill%>&modeid="+layoutid;
dialog.Title = "<%=SystemEnv.getHtmlLabelName(129435, user.getLanguage())%>";
dialog.Width = 810;
dialog.Height = 570;
dialog.maxiumnable=true;
dialog.hideDraghandle = true;
dialog.URL = url;
dialog.show();
}
//同步节点
function syncBtnClick(vthis){
var version=jQuery(vthis).closest("tr").find("[name='version']").val();
if(version != "2"){
window.top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(128082, user.getLanguage())%>");
return;
}
var nodeid=jQuery(vthis).closest("tr").find("[name='nodeid']").val();
var layoutid=jQuery(vthis).closest("tr").find("[name='layoutid']").val();
var dlg=new window.top.Dialog();
dlg.currentWindow=window;
dlg.Model=true;
dlg.Width=450;
dlg.Height=550;
dlg.URL="/workflow/exceldesign/syncNodesBrowser.jsp?wfid=<%=wfid%>&layouttype=<%=layouttype%>&from_nodeid="+nodeid+"&from_modeid="+layoutid;
dlg.Title="<%=SystemEnv.getHtmlLabelName(129029, user.getLanguage())%>";
dlg.show();
}
//设为活动模板
function setLayoutToActive(vthis){
var nodeid = jQuery(vthis).closest("tr").find("[name='nodeid']").val();
var layoutid = jQuery(vthis).closest("tr").find("[name='layoutid']").val();
jQuery.ajax({
type: "post",
url: "/workflow/exceldesign/excelAjaxData.jsp",
data: {src:"setLayoutToActive", wfid:"<%=wfid %>", nodeid:nodeid, formid:"<%=formid %>", isbill:"<%=isbill %>", layouttype:"<%=layouttype %>", layoutid:layoutid},
dataType: "JSON",
success: function(result){
if(result.trim() == "success");
window.location.reload();
}
});
}
//初始化模板 dialog[excelInitModule.jsp] 中的回调方法
function setInitModule(styleid, nodeid, layoutid){
var isInit = 1; //如果 isInit = 1,那么 模板将被覆盖
parent.reloadExcelMain(nodeid, "<%=layouttype%>", layoutid);
}
function searchTable(){
weaverform.submit();
}
</script>
</html>