index.jsp
8.67 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
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="weaver.hrm.HrmUserVarify"%>
<%@page import="weaver.hrm.User"%>
<%@page import="weaver.rdeploy.portal.PortalUtil"%>
<%@page import="weaver.conn.RecordSet"%>
<%@page import="weaver.general.Util"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
/*用户验证*/
User user = HrmUserVarify.getUser (request , response) ;
if(user==null) {
response.sendRedirect("/login/Login.jsp");
return;
}
//门户编辑权限验证
if(!HrmUserVarify.checkUserRight("homepage:Maint", user)){
response.sendRedirect("/notice/noright.jsp");
return;
}
String modename = "门户";
String modeurl = "/homepage/maint/HomepageManit.jsp";
String sql = "select * from hpinfo ORDER by isuse desc ";
RecordSet rs = new RecordSet();
rs.executeSql(sql);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="/js/select/script/jquery-1.8.3.min_wev8.js"></script>
<script type="text/javascript" src="/wui/theme/ecology8/jquery/js/zDrag_wev8.js"></script>
<script type="text/javascript" src="/wui/theme/ecology8/jquery/js/zDialog_wev8.js"></script>
<LINK href="/wui/theme/ecology8/jquery/js/e8_zDialog_btn_wev8.css" type=text/css rel=STYLESHEET>
<script type="text/javascript" src="/js/ecology8/lang/weaver_lang_<%=user.getLanguage()%>_wev8.js"></script>
<link href="/rdeploy/assets/css/index.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
$(function () {
//鼠标移到图标上触发事件,显示设置和启用图标
$(".item .itemico img").hover(function (e) {
//var imgobj = $(this).children();
if (!!$(this).closest(".additem")[0]) {
$(this).attr("src", "/rdeploy/assets/img/new_slt.png");
} else {
$(this).attr("src", "/rdeploy/assets/img/portal/portal_slt.png");
$(this).closest(".item").find(".itemoperation").show();
$(this).closest(".item").find(".itemclose").show();
}
});
//只有鼠标移除整个item范围才会隐藏图标
$(".item").hover(null, function () {
var imgobj = $(this).children(".itemico").find("img");
if (!!$(this).closest(".additem")[0]) {
imgobj.attr("src", "/rdeploy/assets/img/new.png");
} else {
var status = 1;
try {
status = parseInt($(this).find(".operationspan").attr("status"));
} catch (e) {}
if (status == 1) {
imgobj.attr("src", "/rdeploy/assets/img/portal/portal.png");
} else {
imgobj.attr("src", "/rdeploy/assets/img/portal/portal_dis.png");
}
$(this).find(".itemoperation").hide();
$(this).find(".itemclose").hide();
}
});
$(".item .itemclose img").hover(function (e) {
$(this).attr("src", "/rdeploy/assets/img/close_slt.png");
}, function () {
$(this).attr("src", "/rdeploy/assets/img/close.png");
});
$(".item .itemclose img").bind("click", function (e) {
var hpid = $(this).closest(".item").find("input[name=hpinfoid]").val();
var subCompanyId = $(this).closest(".item").find("input[name=subcompanyid]").val();
top.Dialog.confirm("确定要删除吗?",function(){
jQuery.post("/homepage/maint/HomepageMaintOperate.jsp?method=delhp&hpid="+hpid,
function(data){if(data.indexOf("OK")!=-1) location.reload();});
});
});
//是否启用
$(".operationspan").bind("click", function () {
var status = 1;
try {
status = parseInt($(this).attr("status"));
} catch (e) {}
if (status == 1) {
//$(this).css("backgroundImage", "url('/rdeploy/assets/img/wf/stop.png')");
$(this).addClass("operationspan2");
$(this).attr("status", "0");
} else {
//$(this).css("backgroundImage", "url('/rdeploy/assets/img/wf/start.png')");
$(this).removeClass("operationspan2");
$(this).attr("status", "1");
}
var hpid = $(this).closest(".item").find("input[name=hpinfoid]").val();
try {
status = parseInt($(this).attr("status"));
var btntitle = (status==0 ? "点击启用" : "点击禁用");
$(this).attr("title", btntitle);
} catch (e) {}
var imgobj = $(this).closest(".item").find(".itemclose").children();
$.ajax({
url : "/rdeploy/portal/portalUseOperate.jsp?isuse=" + status + "&infoid=" + hpid,
contentType : "charset=UTF-8",
type : "GET",
error:function(ajaxrequest){
},
success:function(content) {
var isdel = $.trim(content);
if (isdel == '1') {
imgobj.show();
} else {
imgobj.hide();
}
}
});
});
//弹出设置界面
$(".item .itemico img").bind("click", function () {
var hpid = $(this).closest(".item").find("input[name=hpinfoid]").val();
var subcompanyid = $(this).closest(".item").find("input[name=subcompanyid]").val();
var dialog = new window.top.Dialog();
dialog.currentWindow = window;
if (!!$(this).closest(".additem")[0]) {
dialog.URL = "/rdeploy/portal/newportal.jsp";
dialog.Title = "新建门户";
dialog.Width = 515;
dialog.Height = 200;
dialog.normalDialog = false;
} else {
//
/*
RSS阅读器:1
文档中心:7
流程中心:8
未读文档:6
消息提醒:9
文档内容:25
公告栏元素:notice
图片元素:picture
幻灯片:Slide
天气元素:weather
便签元素:scratchpad
个人数据:DataCenter
日历日程:MyCalendar
通讯录:contacts
新建流程:addwf
图片幻灯片:imgSlide
公告:newNotice
old:7,8,9,DataCenter,MyCalendar,scratchpad,Slide,notice
new:1,7,8,6,9,25,notice,picture,Slide,weather,scratchpad,DataCenter,MyCalendar,contacts,addwf
new:2015-07-31:
7,8,6,25,DataCenter,MyCalendar,contacts,addwf
*/
dialog.URL = "/homepage/maint/HomepageTabs.jsp?_fromURL=ElementSetting&isSetting=true&hpid=" + hpid + "&from=setElement&pagetype=&opt=edit&subCompanyId=" + subcompanyid +"&isshowelemflag=1"+"&elemids=7,8,6,25,DataCenter,MyCalendar,contacts,addwf,imgSlide,newNotice";
dialog.Title = "设置元素";
dialog.maxiumnable = true;
dialog.Width = window.top.window.document.body.offsetWidth*0.9 ;
dialog.Height = window.top.window.document.body.offsetHeight*0.8 ;;
}
dialog.callbackfun = function (paramobj, id1) {
};
dialog.Drag = true;
dialog.show();
});
});
</script>
</head>
<body>
<!-- 顶部 -->
<jsp:include page="/rdeploy/indexTop.jsp" flush="false">
<jsp:param name="modename" value="<%=modename %>"/>
<jsp:param name="modeurl" value="<%=modeurl %>"/>
</jsp:include>
<div class="content">
<%
while (rs.next()) {
String infoid = rs.getString("id");
String infoname = rs.getString("infoname");
int isuse = Util.getIntValue(Util.null2String(rs.getString("isUse")), 0);
String subcompanyid = rs.getString("Subcompanyid");
boolean isdel = PortalUtil.isdelhp(infoid);
%>
<!-- item block -->
<div class="item">
<div class="itemtitle">
<%=infoname %>
</div>
<div class="itemico">
<img src="/rdeploy/assets/img/portal/portal<%=isuse==0 ? "_dis" : "" %>.png" title="点击进入详细设置">
</div>
<div class="itemoperation">
<span class="operationspan <%=isuse==0 ? "operationspan2" : "" %>" status="<%=isuse %>" title="<%=isuse==0 ? "点击启用" : "点击禁用" %>"></span>
</div>
<div class="itemclose" title="删除">
<%
String imgstyle = "";
if (!isdel) {
imgstyle = " style='display:none;' ";
}
%>
<img src="/rdeploy/assets/img/close.png" width="25px" height="25px" <%=imgstyle %>>
</div>
<input type="hidden" name="hpinfoid" value="<%=infoid %>">
<input type="hidden" name="subcompanyid" value="<%=subcompanyid %>">
</div>
<%
}
%>
<!-- add item block -->
<div class="item additem">
<div class="itemtitle">
新建门户
</div>
<div class="itemico">
<img src="/rdeploy/assets/img/new.png">
</div>
<!--
<div class="itemoperation">
<span class="operationspan" status="1"></span>
</div>
<div class="itemclose">
<img src="/rdeploy/assets/img/close.png" width="25px" height="25px">
</div>
-->
</div>
</div>
</body>
</html>