Template4.jsp
14.7 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
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="weaver.hrm.*"%>
<%@ page import="java.util.*"%>
<%@ page import="weaver.general.*"%>
<jsp:useBean id="cmutil" class="weaver.km.util.CommonTransUtil" scope="page" />
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<%
User user = HrmUserVarify.getUser (request , response) ;
if (user == null){
response.sendRedirect("/login/Login.jsp");
return;
}
String userId = user.getUID()+"";
String mapId = Util.null2String(request.getParameter("mapId"));
String name = "";
String remark = "";
rs.executeSql("select name,remark from KT_Map where deleted=0 and id="+mapId);
if(rs.next()){
name = Util.null2String(rs.getString("name"));
remark = Util.toHtmlMode(rs.getString("remark"));
}
int mprogress = Util.getIntValue((String)cmutil.getMapStatus(userId,mapId),0);
String detailPage = "/knowledgeMap/template/TemplateDetail1.jsp?mId="+mapId;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><%=name %></title>
<script type=text/javascript src="/js/jquery/jquery_wev8.js"></script>
<link href="../js/zDialog/zDialog_e8_wev8.css" type=text/css rel=stylesheet>
<link href="../js/zDialog/e8_zDialog_btn_wev8.css" type=text/css rel=stylesheet>
<script language="javascript" src="../js/zDialog/zDialog_wev8.js"></script>
<script language="javascript" src="../js/weaver_lang_7_wev8.js"></script>
<style>
html,body{
margin:0px;
height:100%;
background: #f3f3f3 url(/knowledgeMap/images/step_bg.png) repeat;
min-height:700px;
min-width:900px;
}
#left-cover{
left:0;
background:url(/knowledgeMap/images/left-cover-edge.png) right top repeat-y;
background-color:#f8f8f8;
float:left;
position:relative;
width:20%;
height:100%;
opacity:.90;
filter:alpha(opacity=90);
z-index:1;
cursor:pointer;
visibility:hidden;
}
#left-cover:hover{
background-color: #ebebeb;
}
#left-cover:hover #previous-arrow {
background-position: -40px -280px;
}
#previous-arrow {
width: 16px;
height: 29px;
top: 45%;
right: 15%;
position: absolute;
background:url(/knowledgeMap/images/steppage_head.png) 0 -280px;
}
#step-play-container{
float:left;
width:800px;
height:100%;
position:relative;
}
.right-cover{
right:0;
background:url(/knowledgeMap/images/right-cover-edge.png) left top repeat-y;
background-color: #f8f8f8;
float:left;
position:relative;
height:100%;
opacity:.90;
filter:alpha(opacity=90);
cursor:pointer;
}
#right-cover:hover{
background-color: #ebebeb;
}
#right-cover:hover #next-arrow{
background-position: -40px -280px;
}
#next-arrow:hover{
background-position: -40px -280px;
}
.next-arror{
width: 16px;
height: 29px;
top: 45%;
left: 20%;
position: absolute;
-moz-transform:scaleX(-1);
-webkit-transform:scaleX(-1);
-o-transform:scaleX(-1);
transform:scaleX(-1);
/*IE*/
filter:FlipH;
background:url(/knowledgeMap/images/steppage_head.png) 0 -280px;
}
.step-item-container {
width: 800px;
height: 100%;
display: inline-block;
float: left;
}
.testImg{
width:100%;
height:100%;
}
#step-pager-list{
list-style:none;
font-family: "宋体";
text-align:center;
height:40px;
margin:10px auto 0 auto;
}
#step-pager-list li{
float: left;
margin-right: 10px;
position: relative;
height:35px;
color: #fff;
}
#step-pager-list li a{
color: #fff;
background: url(/knowledgeMap/images/steppage_head.png) -120px -50px no-repeat;
display: inline-block;
width: 25px;
height: 25px;
text-align: center;
line-height: 25px;
font-size:14px;
text-decoration: none;
}
aVisited{
background-position: -120px -140px;
}
aHover{
background-position: -120px -80px;
}
#step-pager-list li a:hover{
background-position: -120px -80px;
}
.reatCls{
line-height:10px;
font-size:10px;
color:#f19115;
}
.knowledgeTitle{
font-family:"微软雅黑";
color:#e1f2ff;
padding-left:10px;
text-align:left;
height:30px;
line-height:30px;
font-size:16px;
background:url(/knowledgeMap/images/bg_contenttop.png) repeat-x
}
</style>
</head>
<body>
<!-- top div -->
<div style="width:100%;height:55px;text-align:center;color:#ccc;line-height:40px">
<div style="background:#555251;font-family: 微软雅黑">
<b><%=name %></b>
</div>
<div style="height:15px;width:100%"></div>
</div>
<!-- center div -->
<div id="center-part" style="width:100%;overflow:hidden;position:relative;">
<!-- center left div -->
<div id="left-cover">
<div id="previous-arrow">
</div>
</div>
<!-- center certer div -->
<div id="step-play-container" style="float:left;width:800px;height:100%;position:relative;">
<div id="step-play-list" style="height:100%;position: absolute;left:0;">
<div class="step-item-container">
<div style="height: 100%;background: url('/knowledgeMap/images/bg_contentbg.png') repeat;">
<div style="margin-left: 30px;line-height:44px;font-size: 16px;padding-top: 20px;font-weight: bold;font-family: 微软雅黑"><%=name %></div>
<div id="remarkComtainer" style="font-size: 12px;font-weight: normal;padding: 30px;font-family: 微软雅黑">
<%
session.setAttribute("remark_"+mapId,remark);
%>
<iframe src="/knowledgeMap/template/ShowFckEditorDesc.jsp?sessionname=remark_<%=mapId %>&seth=0" width="100%" height="100%" marginheight="0" marginwidth="0" allowTransparency="true" frameborder="0"></iframe>
</div>
</div>
</div>
<%
Map tsmap = cmutil.getMAllTStatus(userId,mapId);
String detailId = null;
double detailRate = 0;
double themeRate = 0.0d;
String pgtext = "";
String detailTitle = null;
Map<String,Object> idRateMap = null;
List<Map<String,Object>> detailList = new ArrayList<Map<String,Object>>();
rs.executeSql("select id,title,rate from KT_MapDetail where deleted=0 and mapId="+mapId+" order by sort,id");
while(rs.next()){
detailId = Util.null2String(rs.getString("id"));
detailTitle = Util.null2String(rs.getString("title"));
themeRate = Util.getDoubleValue(rs.getString("rate"),0.0);
detailRate = Util.getDoubleValue((String)tsmap.get(detailId),0.0);
idRateMap = new HashMap<String,Object>();
idRateMap.put("detailId",detailId);
idRateMap.put("detailRate",themeRate==0.0?100:detailRate);
idRateMap.put("detailTitle",detailTitle);
detailList.add(idRateMap);
%>
<div class="step-item-container">
<div class="knowledgeTitle">
<b><%=detailTitle %></b>
</div>
<div class="item-center">
<iframe id='contentFrame' name='contentFrame' height='100%' width='100%' allowTransparency= "true" style="background: none;"
marginwidth="0" marginheight="0" frameborder="0" scrolling='auto' src="<%=detailPage%>&tId=<%=detailId%>&themeRate=<%=themeRate %>"></iframe>
</div>
</div>
<%}%>
</div>
</div>
<!-- center right div -->
<div class="right-cover" id="right-cover">
<div id="next-arrow" class="next-arror">
</div>
</div>
</div>
<!-- foot div -->
<div style="width:100%;height:70px;text-align:center;color:#ccc;text-align:left;">
<div style="height:10px;background:#9B9EA3;position:relative;left:0;">
<div id="finishRate" style="height:10px;background:#FE9115;position:relative;left:0;"></div>
</div>
<ul id="step-pager-list">
<li id="mapFirst"><a style="background: url(/knowledgeMap/images/steppage_head.png) -120px -140px no-repeat;" href="javascript:;">封</a><br/><label class="reatCls"><%=mprogress%>%</label></li>
<%
for(int i=0;i<detailList.size();i++){
idRateMap = detailList.get(i);
detailId = (String)idRateMap.get("detailId");
detailRate = (Double)idRateMap.get("detailRate");
detailTitle = (String)idRateMap.get("detailTitle");
%>
<li id="page_<%=detailId %>" title="<%=detailTitle %>"><a href="javascript:;"><%=i+1 %></a><br/><label class="reatCls"><%=detailRate %>%</label></li>
<%
}
%>
</ul>
</div>
<script type="text/javascript">
//展示知识点顺序
var playListIndex = 0;
//展示列表左偏移量
var playListLeft = 0;
//展示区域宽度
var playContainerWidth=800;
//页码宽度
var pagerListWidth=40;
//屏幕的高宽
var winHeight,winWidth;
//设置中间展示div的宽度
function setRightLeftRateWidth(isSetTime){
winWidth = $('body').width();
winHeight = $('body').height();
var leftWidth = (winWidth - playContainerWidth)/2;
var rightWidth = winWidth - playContainerWidth -leftWidth;
//左箭头
$("#left-cover").css({"width":leftWidth+"px"});
//右箭头
$("#right-cover").css({"width":rightWidth+"px"});
//中部
$("#center-part").css({"height":(winHeight-55-70)+"px"});
//描述
$("#remarkComtainer").css({"height":(winHeight-55-70-64-60)+"px"});
//每个主题的展示区
$("#center-part .item-center").css({"height":(winHeight-55-70-30)+"px"});
finishRateChange(<%=mprogress%>,isSetTime);
};
//添加屏幕大小改变事件
$(window).resize(function(){
setRightLeftRateWidth(false);
});
/**
* 设置完成比
*/
function finishRateChange(rate,isSetTime){
$("#finishRate").attr("title","所有内容已完成" + rate + "%");
$("#finishRate").animate({"width":(winWidth*rate/100)+"px"},isSetTime?300:0);
$("#mapFirst label").text(rate + "%");
}
$(document).ready(function(){
//设置中间div宽度
setRightLeftRateWidth(false);
//设置中间展示区域宽度
$("#step-play-list").css("width",($("#step-play-list").children("div").length * playContainerWidth) + "px");
//设置页码宽度
$("#step-pager-list").css("width",($("#step-pager-list").children("li").length * pagerListWidth+100) + "px");
//添加下一页事件
$("#right-cover").click(function(){
//展示内容总宽度
var width = parseInt($("#step-play-list").css("width"));
//总宽度与左偏移之和大于展示区宽度则可以移动
if((width + playListLeft) > playContainerWidth){
playListLeft -= playContainerWidth;
playListIndex += 1;
setPagerStyle(playListIndex);
$("#step-play-list").animate({"left":playListLeft+"px"},500);
displayCover();
}
});
//添加前一页事件
$("#left-cover").click(function(){
var width = parseInt($("#step-play-list").css("width"));
if(playListLeft < 0){
playListLeft += playContainerWidth;
playListIndex -= 1;
setPagerStyle(playListIndex);
$("#step-play-list").animate({"left" : playListLeft+"px"},500);
displayCover();
}
});
/**
* 是否展示箭头
*/
function displayCover(){
//展示内容总宽度
var width = parseInt($("#step-play-list").css("width"));
//如果是第一页则前一页区域隐藏
if(playListIndex == 0){
$("#left-cover").css({"visibility":"hidden"});
}else{
$("#left-cover").css({"visibility":"visible"});
}
//如果移到了最后一页后一页区域隐藏
if((width + playListLeft) > playContainerWidth){
$("#right-cover").css({"visibility":"visible"});
}else{
$("#right-cover").css({"visibility":"hidden"});
}
}
//为页码添加事件
$("#step-pager-list li a").each(function(inx){
$(this).click(function(){
playListLeft = -playContainerWidth * inx;
playListIndex = inx;
$("#step-play-list").animate({"left":playListLeft+"px"},500);
displayCover();
setPagerStyle(inx);
});
});
/**
* 设置页码样式
*/
function setPagerStyle(index){
$("#step-pager-list li a").css({"background-position":"-120px -50px"});
$("#step-pager-list li a").mouseover(function(){
$(this).css({"background-position":"-120px -80px"});
}).mouseout(function(){
$(this).css({"background-position":"-120px -50px"});
});
$("#step-pager-list li a").eq(playListIndex).css({"background-position":"-120px -140px"}).unbind("mouseover mouseout");;
}
});
/**
* 设置总进度
*/
function setPg(_width){
finishRateChange(_width,true);
}
/**
* 设置知识点进度
*/
function setPg2(tId,_width){
$("#page_" + tId + " label").text(_width+"%");
}
</script>
</body>
</html>