ElementStyleList.jsp
15.8 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
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<jsp:useBean id="esc" class="weaver.page.style.ElementStyleCominfo" scope="page"/>
<jsp:useBean id="mhsc" class="weaver.page.style.MenuHStyleCominfo" scope="page" />
<jsp:useBean id="mvsc" class="weaver.page.style.MenuVStyleCominfo" scope="page" />
<jsp:useBean id="su" class="weaver.page.style.StyleUtil" scope="page" />
<jsp:useBean id="sppb" class="weaver.general.SplitPageParaBean" scope="page"/>
<jsp:useBean id="spu" class="weaver.general.SplitPageUtil" scope="page"/>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<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" />
<STYLE TYPE="text/css">
.item a{
text-decoration: none!important;
}
.header{
background-position:left center;
}
.toolbar{
display:block;
}
.styleContainer{
margin:9px 9px 9px 9px;
position:relative;
}
.hoverDiv{
width: 100%;
height: 0px;
line-height: 43px;
border-top:1px solid #c8c8c8;
bottom:0px;
background:#f1f1f1;
opacity:0.9;
position: absolute;
}
.styleToolBar{
margin: auto;
height: 43px;
list-style-type:none;
width: 220px;
}
.styleToolBar li{
float: left;
width: 33px;
padding-left:10px;
padding-right:10px;
}
.edit{
background: url('/images/ecology8/homepage/element/style/edit_wev8.png') center center no-repeat;
cursor: pointer;
}
.saveAs{
background: url('/images/ecology8/homepage/element/style/saveAs_wev8.png') center center no-repeat;
cursor: pointer;
}
.download{
background: url('/images/ecology8/homepage/element/style/download_wev8.png') center center no-repeat;
cursor: pointer;
}
.del{
background: url('/images/ecology8/homepage/element/style/del_wev8.png') center center no-repeat;
cursor: pointer;
}
.weaverTableCurrentPageBg {
/*
background:url(table/pageNumBg_wev8.png) repeat-x;
background-color:#D9D9D9;
*/
background-color:#5b5b5b;
color:#fff !important;
}
.weaverTablePrevPage {
/*background:url(table/prev_wev8.png) 0 0 no-repeat;*/
}
.weaverTablePrevSltPage {
background:url(/wui/theme/ecology8/skins/default/table/prev_slt_wev8.png) 0 0 no-repeat;
}
.weaverTablePrevPageOfDisabled {
background:url(/wui/theme/ecology8/skins/default/table/prev_none_wev8.png) 0 0 no-repeat;
}
.weaverTableNextPage {
background:url(/wui/theme/ecology8/skins/default/table/next_wev8.png) 0 0 no-repeat;
}
.weaverTableNextSltPage {
background:url(/wui/theme/ecology8/skins/default/table/next_slt_wev8.png) 0 0 no-repeat;
}
.weaverTableNextPageOfDisabled {
background:url(/wui/theme/ecology8/skins/default/table/next_none_wev8.png) 0 0 no-repeat;
}
</STYLE>
</head>
<%
if(!HrmUserVarify.checkUserRight("homepage:Maint", user)){
response.sendRedirect("/notice/noright.jsp");
return;
}
String titlename="";
String sqlWhere=" menustyletype='element'";
String stylename = Util.null2String(request.getParameter("styleName"));
sqlWhere += "".equals(stylename)?"":" and menustylename like '%"+stylename+"%'";
%>
<body>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(82,user.getLanguage())+",javascript:onAdd(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<form id="searchStyleForm" name="searchStyleForm" method="post" action="ElementStyleList.jsp">
<input type="hidden" id="operate" name="operate" value=""/>
<table id="topTitle" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="75px">
</td>
<td class="rightSearchSpan" style="text-align:right; width:500px!important">
<input type="button" value="<%=SystemEnv.getHtmlLabelName(365,user.getLanguage())%>" class="e8_btn_top" onclick="onAdd();" />
<input type="button" value="<%=SystemEnv.getHtmlLabelName(18596,user.getLanguage())%>" class="e8_btn_top" onclick="onImp();" />
<input type="text" class="searchInput" name="styleName"/>
<input type="hidden" value="<%=SystemEnv.getHtmlLabelName(21995,user.getLanguage())%>" class="advancedSearch" onclick="jQuery('#advancedSearchDiv').toggle('fast');return false;"/>
<span title="<%=SystemEnv.getHtmlLabelName(23036,user.getLanguage())%>" class="cornerMenu"></span>
</td>
</tr>
</table>
<div class="advancedSearchDiv" id="advancedSearchDiv">
</div>
</form>
<%
//设置好搜索条件
/*String tableString="<table pagesize=\""+perpage+"\" tabletype=\"checkbox\" valign=\"top\" >"
+ "<checkboxpopedom popedompara=\"column:styleid\" showmethod=\"weaver.splitepage.transform.SptmForMenuStyle.getStyleDel\"/>"
+ "<sql backfields=\" styleid,menustylename,menustyledesc,menustyletype,menustylecreater,menustylelastdate \" sqlform=\" from hpMenuStyle \" sqlorderby=\"styleid\" sqlprimarykey=\"styleid\" sqlsortway=\"asc\" sqlwhere=\""+sqlWhere+"\" sqlisdistinct=\"false\" />"+
"<head >"+
"<col width=\"20%\" text=\""+SystemEnv.getHtmlLabelName(19621,user.getLanguage())+"\" column=\"menustylename\" otherpara=\"column:styleid+column:menustyletype\" transmethod=\"weaver.splitepage.transform.SptmForMenuStyle.getMenuStyleName\"/>"+
"<col width=\"20%\" text=\""+SystemEnv.getHtmlLabelName(23036,user.getLanguage())+SystemEnv.getHtmlLabelName(433,user.getLanguage())+"\" column=\"menustyledesc\"/>"+
"<col width=\"20%\" text=\""+SystemEnv.getHtmlLabelName(19054,user.getLanguage())+"\" column=\"menustyletype\" otherpara=\""+user.getLanguage()+"\" transmethod=\"weaver.splitepage.transform.SptmForMenuStyle.getMenuType\"/>"+
"<col width=\"15%\" text=\""+SystemEnv.getHtmlLabelName(882,user.getLanguage())+"\" column=\"menustylecreater\" transmethod=\"weaver.hrm.resource.ResourceComInfo.getLastname\"/>"+
"<col width=\"25%\" text=\""+SystemEnv.getHtmlLabelName(19520,user.getLanguage())+"\" column=\"menustylelastdate\"/>"+
"</head>"
+ "<operates><popedom otherpara=\"column:styleid\" transmethod=\"weaver.splitepage.transform.SptmForMenuStyle.getOperate\"></popedom> "
+ "<operate href=\"javascript:onPriview();\" text=\""+SystemEnv.getHtmlLabelName(221,user.getLanguage())+"\" target=\"_self\" index=\"0\"/>"
+ "<operate href=\"javascript:onEdit();\" text=\""+SystemEnv.getHtmlLabelName(26473,user.getLanguage())+"\" target=\"_blank\" index=\"1\"/>"
+ "<operate href=\"javascript:saveNew();\" text=\""+SystemEnv.getHtmlLabelName(350,user.getLanguage())+"\" target=\"_self\" index=\"2\"/>"
+ "<operate href=\"javascript:onDel();\" text=\""+SystemEnv.getHtmlLabelName(23777,user.getLanguage())+"\" target=\"_self\" index=\"3\"/>"
+ "</operates></table>"*/;
%>
<%
int perpage =9;
int pageIndex = Util.getIntValue(request.getParameter("pageIndex"));
sppb.setBackFields(" styleid,menustylename,menustyledesc,menustyletype,menustylecreater,menustylelastdate ");
sppb.setPrimaryKey("styleid");
sppb.setDistinct(true);
//sppb.setIsPrintExecuteSql(true);
sppb.setSqlFrom(" from hpMenuStyle");
sppb.setSqlWhere(sqlWhere);
sppb.setSqlOrderBy("styleid");
sppb.setSortWay(sppb.ASC);
spu.setSpp(sppb);
int sum = spu.getRecordCount();
int max = (sum/perpage)+((sum%perpage)>0?1:0);
pageIndex = (pageIndex<0)?1:pageIndex;
pageIndex = (max<pageIndex)?max:pageIndex;
int count=1;
int br = 1;
rs=spu.getCurrentPageRs(pageIndex,perpage);
StringBuffer estyleStr = new StringBuffer();
estyleStr.append("<table width=\"100%\" style='table-layout:fixed'><tbody><tr>");
while(rs.next()){
String styleid = rs.getString("styleid");
estyleStr.append("<td width='33%'>");
estyleStr.append("<div class='styleContainer' _titleState='").append(esc.getTitleState(styleid)).append("' _toolbarstate='").append(esc.getSettingState(styleid)).append("'>");
estyleStr.append(su.getContainerForStyle(styleid));
if("footer".equals(esc.getMoreLocal(styleid))){
estyleStr.append("<div class=\"footerDiv\" style=\"height:10px;float:right;clear:both;\" id=\"footerDiv_"+styleid+"\" ><a href=\"#\"><img class=\"iconMore\" border=\"0\" src=\"").append(esc.getIconMore(styleid))
.append("\"></a></div>");
}
estyleStr.append("<div class=\"hoverDiv\" id=\"hoverDiv_"+styleid+"\" >");
estyleStr.append("<ul class=\"styleToolBar\" styleid='"+styleid+"' >");
estyleStr.append("<li class='edit' title='"+SystemEnv.getHtmlLabelName(93,user.getLanguage())+"'>");
estyleStr.append(" ");
estyleStr.append("</li>");
estyleStr.append("<li class='saveAs' title='"+SystemEnv.getHtmlLabelName(350,user.getLanguage())+"'>");
estyleStr.append(" ");
estyleStr.append("</li>");
estyleStr.append("<li class='download' title='"+SystemEnv.getHtmlLabelName(31156,user.getLanguage())+"'>");
estyleStr.append(" ");
estyleStr.append("</li>");
if(!"template".equals(styleid)){
estyleStr.append("<li class='del' title='"+SystemEnv.getHtmlLabelName(91,user.getLanguage())+"'>");
estyleStr.append(" ");
estyleStr.append("</li>");
}
estyleStr.append("</ul>");
estyleStr.append("</div>");
estyleStr.append("</td>");
if(count/3==br){
estyleStr.append("<td width='1%'> </td></tr><tr class=\"sparator\" style=\"height:1px\" height=\"1px\"><td style=\"padding:0px\" colspan=\"4\"></td></tr><tr>");
br++;
}
count++;
}
if(count/3!=br)estyleStr.append("</tr>");
estyleStr.append("</tbody><table>");
out.print(estyleStr.toString());
%>
<form name="splitPageForm" action="ElementStyleList.jsp">
<input type="hidden" name="pageIndex" id="pageIndex" value="<%=pageIndex %>"/>
<table width="100%"><tbody><tr><td style="padding-left: 10px;">
</td><td>
<div align="right">
<span style="TEXT-DECORATION:none;height:21px;padding-top:2px;">
<%=SystemEnv.getHtmlLabelName(18609,user.getLanguage()) %><%=sum%><%=SystemEnv.getHtmlLabelName(24683,user.getLanguage()) %>
<%=SystemEnv.getHtmlLabelName(265,user.getLanguage()) %><%=perpage%><%=SystemEnv.getHtmlLabelName(18256,user.getLanguage()) %>
</span>
<span class="weaverTablePrevPageOfDisabled" onclick="goPage(<%=pageIndex==1?1:pageIndex-1 %>);" style="display:inline-block;cursor:pointer;TEXT-DECORATION:none;height:21px;margin-right:5px;width:21px;"> </span>
<%for(int i=1;i<=max;i++){ %>
<span style="display:inline-block;cursor:pointer;TEXT-DECORATION:none;height:19px;border:1px solid #BCBCBC;margin-right:5px;padding:0 5px 0 5px;" onclick="goPage(<%=i %>);" <%=i==pageIndex?"class=\"weaverTableCurrentPageBg\"":""%>><%=i %></span>
<%} %>
<span class="weaverTableNextPageOfDisabled" onclick="goPage(<%=pageIndex==max?pageIndex:pageIndex+1 %>);" style="display:inline-block;cursor:pointer;TEXT-DECORATION:none;height:21px;margin-right:5px;width:21px;"> </span>
<span style="TEXT-DECORATION:none;height:21px;line-height:21px;">
<%=SystemEnv.getHtmlLabelName(15323,user.getLanguage()) %> </span>
<input id="-weaverTable-0_XTABLE_GOPAGE_buttom" type="text" value="<%=pageIndex %>" size="3" class="text" onmouseover="this.select()" style="text-align:right;line-height:20px;height:20px;widht:30px;border:1px solid #BCBCBC;background:none;margin-right:5px;padding-right:2px;">
<span style="TEXT-DECORATION:none;height:21px;line-height:21px;">
<%=SystemEnv.getHtmlLabelName(23161,user.getLanguage()) %></span>
<span id="-weaverTable-0-goPage" onclick="goPage(0);" style="display:inline-block;line-height:21px;cursor:pointer;height:21px;width:30px;margin-right:5px;text-align:center;border:1px solid #BCBCBC;background-color:#D9D9D9;">
<%=SystemEnv.getHtmlLabelName(30911,user.getLanguage()) %></span>
</div></td></tr></tbody></table>
</form>
</body>
</html>
<!--For zDialog-->
<link rel="stylesheet" href="/wui/theme/ecology8/jquery/js/zDialog_e8_wev8.css"type="text/css"/>
<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 LANGUAGE="JavaScript">
<!--
var curIndex = <%=pageIndex%>;
var maxIndex = <%=max%>;
function goPage(pageIndex){
if(pageIndex==0)pageIndex=jQuery("#-weaverTable-0_XTABLE_GOPAGE_buttom").val();
jQuery("#pageIndex").val(pageIndex);
if(pageIndex<1||curIndex==pageIndex||pageIndex>maxIndex) return;
splitPageForm.submit();
}
function onAdd(){
var title = "<%=SystemEnv.getHtmlLabelName(365,user.getLanguage()) %>";
var url = "/page/maint/style/MenuStyleEdit.jsp?type=element";
showDialog(title,url,500,260,false);
}
function onImp(){
var title = "<%=SystemEnv.getHtmlLabelName(18596,user.getLanguage()) %>";
var url = "/page/maint/style/StyleImp.jsp?type=element";
showDialog(title,url,500,200,false);
}
function onDownload(styleid){
var stylepath = "/page/maint/style/StyleDownload.jsp?type=element&styleid="+styleid;
window.open(stylepath);
}
function onEdit(styleid){
var url="/page/maint/style/ElementStyleEdit.jsp?type=element&styleid="+styleid;
var title = "<%=SystemEnv.getHtmlLabelName(93,user.getLanguage()) %>";
showDialog(title,url,800,500,true);
}
function showDialog(title,url,width,height,showMax){
var Show_dialog = new window.top.Dialog();
Show_dialog.currentWindow = window; //传入当前window
Show_dialog.Width = width;
Show_dialog.Height = height;
Show_dialog.maxiumnable=showMax;
Show_dialog.Modal = true;
Show_dialog.Title = title;
Show_dialog.URL = url;
Show_dialog.show();
}
function onDel(styleid){
top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(15097,user.getLanguage())%>",function(){
jQuery.post("MenuStyleOprate.jsp?operate=delStyle&type=element&styleid="+styleid,
function(data){if(data.indexOf("OK")!=-1) location.reload();});
});
}
function onPriview(styleid){
var url = "MenuStylePriviewE.jsp?styleid="+styleid+"&type=element";
var title = "<%=SystemEnv.getHtmlLabelName(221,user.getLanguage()) %>";
showDialog(title,url,500,300,true);
}
function saveNew(styleid){
var url="/page/maint/style/MenuStyleEdit.jsp?operate=saveNew&styleid="+styleid+"&type=element";
var title = "<%=SystemEnv.getHtmlLabelName(350,user.getLanguage()) %>";
showDialog(title,url,500,200,false);
}
$(document).ready(function(){
jQuery("#topTitle").topMenuTitle({searchFn:onSearch});
jQuery(".topMenuTitle td:eq(0)").html($("#tabDiv").html());
jQuery("#tabDiv").remove();
jQuery(".content").css("padding",0);
jQuery(".styleContainer").hover(function(){
var showBtn = jQuery("#hoverDiv_"+jQuery(this).find(".item").attr("eid"));
jQuery(showBtn).animate({height:"43px"})
},function(){
var showBtn = jQuery("#hoverDiv_"+jQuery(this).find(".item").attr("eid"));
jQuery(showBtn).animate({height:"0px"})
})
jQuery(".styleToolBar").find("li").bind("click",function(){
if($(this).hasClass("edit")){
onEdit($(this).parent().attr("styleid"));
}
if($(this).hasClass("download")){
onDownload($(this).parent().attr("styleid"));
}
if($(this).hasClass("saveAs")){
saveNew($(this).parent().attr("styleid"));
}
if($(this).hasClass("del")){
onDel($(this).parent().attr("styleid"));
}
});
jQuery(".styleToolBar").find("li").hover(function(){
var type = $(this).attr("class");
$(this).css("background-image","url(/images/ecology8/homepage/element/style/"+type+"Over_wev8.png)")
},function(){
var type = $(this).attr("class");
$(this).css("background-image","url(/images/ecology8/homepage/element/style/"+type+"_wev8.png)")
});
$('.styleContainer[_titlestate=hidden]').find('.toolbar').hide();
$('.styleContainer[_toolbarstate=hidden]').find('.toolbar').hide();
$('.toolbar').find('img[display=none]').parent().parent().hide();
});
function onSearch(){
searchStyleForm.submit();
}
//-->
</SCRIPT>