banner.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
  2. <%@ page import="cn.sinobest.framework.comm.iface.IOperator" %>
  3. <%@ page import="cn.sinobest.sysmngr.comm.ConVar" %>
  4. <%@ page import="cn.sinobest.framework.util.Util,cn.sinobest.framework.util.DTOUtil,cn.sinobest.framework.util.DateUtil,cn.sinobest.framework.util.ConfUtil,cn.sinobest.framework.comm.Environment"%>
  5. <%@ page import="java.util.List,java.util.Map" %> <%@ page import="cn.sinobest.sysmngr.service.blank.BlankService" %>
  6. <%@ page import="cn.sinobest.sysmngr.service.blank.BlankService" %>
  7. <%@ page import="java.text.DateFormat,java.text.SimpleDateFormat,java.util.Date" %>
  8. <%@include file="./taglib.jsp" %>
  9. <%
  10. final String token = DTOUtil.getToken(response,session);
  11. final String headtoken=Environment.HEADER_TOKEN;
  12. //字典获取方法
  13. final String DICT_MODE = ConfUtil.getSysParam("app.dictMode","server");
  14. IOperator Operator = null;
  15. Object obj = request.getSession().getAttribute(ConVar.LOGIN_SESSION_ID);
  16. String CurDate = DateUtil.CurDate.YYYYMMDD_ZH.getDate();
  17. //始终比设定的时间多1分钟,这样系统超时的话就会自动跳到登录界面
  18. //例如系统有可能在SESSION 50分钟的时候,开始不用,那么需要等到1个小时以后,才会自动转到登录界面
  19. long timeout = 3700*1000;
  20. String LoginID ="";
  21. String SessionID ="";
  22. String OperName ="";
  23. String OperUnitName="";
  24. String LoginType = (String)request.getSession().getAttribute("LOGINTYPE");
  25. String OperId = "";
  26. String shortcutHtml = "";
  27. String OperType2 = "";
  28. if(obj != null){
  29. Operator = (IOperator)obj;
  30. LoginID = Operator.getLoginID();
  31. OperName = Operator.getOperName();
  32. OperId = Operator.getOperID();
  33. OperUnitName = Operator.getOperUnitName();
  34. SessionID = (String)request.getSession().getId();
  35. OperType2 = Operator.getOperType2();
  36. BlankService blankService = (BlankService)Util.getBean("blankService");
  37. shortcutHtml = blankService.getShortcutHtml(OperId,request.getContextPath());
  38. }
  39. if(LoginType==null){
  40. LoginType="loginsb";
  41. }
  42. boolean isSheBaoUser = true;
  43. if(OperType2 != null && !"1".equals(OperType2)){
  44. isSheBaoUser = false;
  45. }
  46. String jsMin = "";
  47. if (Environment.getAppProductMode()) {
  48. jsMin = "-min";
  49. }
  50. Cookie[] cookies=request.getCookies();
  51. String styleMode="blue";
  52. for(Cookie cookie:cookies){
  53. if("b2cPlatform".equals(cookie.getName())){
  54. styleMode=cookie.getValue();
  55. }
  56. }
  57. %>
  58. <html>
  59. <head>
  60. <title>系统标题栏</title>
  61. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  62. <%-- <% if ("-min".equals(jsMin)) { %>
  63. <link href="${ctx}/themes/default/fw-all-default<%=jsMin%>.css?v=${deployVersion}" rel="stylesheet" type="text/css">
  64. <% } else { %> --%>
  65. <link href="${ctx}/themes/default/default.css?v=${deployVersion}" rel="stylesheet" type="text/css">
  66. <%-- <% } %> --%>
  67. <link href="${ctx}/themes/default/banner.css?v=${deployVersion}" rel="stylesheet" type="text/css">
  68. <link href="${ctx}/themes/default/style_<%=styleMode%>.css?v=${deployVersion}"
  69. rel="stylesheet" type="text/css" id="cssfile" />
  70. <!--[if IE 6]>
  71. <link href="${ctx}/themes/default/ie6.css" rel="stylesheet" type="text/css">
  72. <![endif]-->
  73. <script src="${ctx}/js/comm/lib/jquery<%=jsMin%>.js"></script>
  74. <script src="${ctx}/js/comm/lib/jquery.cookie<%=jsMin%>.js"></script>
  75. <script src="${ctx}/js/comm/lib/json2<%=jsMin%>.js?v=${deployVersion}"></script>
  76. <script src="${ctx}/js/comm/fw/ajax<%=jsMin%>.js?v=${deployVersion}"></script>
  77. </head>
  78. <body leftmargin="0" topmargin="0">
  79. <FORM name="frm" method="post" action="<%=request.getContextPath()%>/framework/security/<%=LoginType%>!logout.do" >
  80. <input type="hidden" name="_rtnURL" value="<%=request.getContextPath()%>/framework/banner.do" />
  81. <div id="_bannerbutton" class="bannerbutton">
  82. <div class="leftHeader"></div>
  83. <div class="rightHeader"></div>
  84. <div class="colorScheme" style="text-align:right;">
  85. <!-- <a href="javascript:setCssFile('blue');" class="blue" title="">a</a>-->
  86. <!-- <a href="javascript:setCssFile('green');" class="orange">b</a>-->
  87. <!-- <a href="javascript:setCssFile('gray');" class="grey">c</a>-->
  88. </div>
  89. <div class="bannerTitle" style="padding-top:30px;padding-left:400px;">
  90. <span class="topover" ><%=CurDate%></span>
  91. <%if("true".equals(Environment.BPM_WORKFLOW_ON)){%>
  92. <a class="topover" href="${ctx}/jsp/framework/blank_bpm.jsp?RightID=blank" target=workspace style="text-decoration:underline;">首页</a>
  93. <%}else{%>
  94. <a class="topover" href="${ctx}/jsp/framework/blank.jsp?RightID=blank" target=workspace style="text-decoration:underline;">首页</a>
  95. <%}%>
  96. <%if(isSheBaoUser){//如果是社保局用户,则显示"查阅公告"链接%>
  97. <a class="topover" href="javascript:void(0);" onclick="showBulletinDialog();" style="text-decoration:underline;">公告查阅</a>
  98. <%}%>
  99. <a class="topover" href="javascript:void(0);" onclick="showShortcut();" style="text-decoration:underline;">常用菜单</a>
  100. <a class="topover" href="javascript:void(0);" onclick="mpass();" style="text-decoration:underline;">修改密码</a>
  101. <a class="topover" href="javascript:void(0);" onclick="relogon();" style="text-decoration:underline;">重新登录</a>
  102. <a class="topover" href="javascript:void(0);" onclick="doclose();" style="text-decoration:underline;">退出系统</a>
  103. <a class="topover" href="javascript:doLink();" style="text-decoration:underline;">帮助</a>
  104. <span class="topover" style="padding-left:80px;">姓名:</span>
  105. <span class="topover"><%=OperName%></span>
  106. <span class="topover">&nbsp;单位:</span>
  107. <span class="topover"><%=OperUnitName%></span>
  108. </div>
  109. </div>
  110. </FORM>
  111. </body>
  112. <script language="javascript">
  113. var contextPath='${ctx}';
  114. var GVAR = {'dictMode':'<%=DICT_MODE%>',
  115. 'dicts':{}
  116. };
  117. var token = '<%=token%>';
  118. var headtoken= '<%=headtoken%>';
  119. var shortData = null;
  120. //窗口的非正常退出时调用
  121. //window.attachEvent("onunload",doCloseWin);
  122. //document.all._bannerbutton.style.top="20px";
  123. setTimeout("doReload()",<%=timeout%>);//刷新
  124. function doReload(){
  125. unBindListener(self.top.window,'unload',doCloseWin);
  126. var services=[{serviceId:'seccuritySession',method:'iftimeout',parameters:{ifjy:true}}];
  127. $.ajax({
  128. url:contextPath+'/ajaxAdapter.do'
  129. ,data:{parameters:JSON.stringify(services)}
  130. ,dataType :'json'
  131. ,cache:false
  132. ,async:false
  133. ,type:'post'
  134. ,error:function (request, textStatus, errorThrown) {}
  135. ,success:function (data, textStatus) {
  136. if(data!=null && data[headtoken]!=null){
  137. token=data[headtoken];//更新全局变量token标志
  138. }
  139. //校验业务处理是否正确执行
  140. if("1"!=data.FHZ){//出错了,弹出错误提醒
  141. if ("loginTimeout" == data.FHZ) {
  142. var flag=window.confirm("登陆超时,是否重新登录?");
  143. if(flag){
  144. var nWidth = screen.availWidth-10;
  145. var nHeight = screen.availHeight-50;
  146. window.open("<%=request.getContextPath()%>"+"/index.jsp","","top=0,left=0,width="+nWidth+",height="+nHeight+",toolbar=no,resizable=yes,status=1,scrollbars")
  147. window.opener=null;
  148. window.open("","_self");
  149. window.close();
  150. try{ window.parent.close();}catch(e){}
  151. }
  152. }else if("CSRF" == data.FHZ){
  153. showMsg(data.MSG||'',3);
  154. return;
  155. }
  156. }else{
  157. self.location.reload();
  158. }
  159. },
  160. beforeSend:function(XMLHttpRequest ){
  161. var cToken = $.cookie(headtoken) || token;XMLHttpRequest.setRequestHeader(headtoken,cToken);
  162. }
  163. });
  164. }
  165. function relogon(){
  166. if (!window.confirm("是否退出系统?")) {
  167. return;
  168. }
  169. unBindListener(window,'unload',doCloseWin);
  170. doCloseWin();
  171. window.top.location.href="${ctx}/jsp/framework/security/<%=LoginType%>_i.jsp";
  172. }
  173. function doclose(){
  174. if (window.confirm("是否退出系统?")) {
  175. window.parent.close();
  176. }
  177. }
  178. function mpass(){
  179. unBindListener(window,'unload',doCloseWin);
  180. window.top.location.href="${ctx}/jsp/framework/security/pwdrest_u.jsp";
  181. }
  182. <%-- 此处用AJAX去销毁SESSION 销毁的动作在类 AjaxAction 内完成 --%>
  183. function doCloseWin(){
  184. var args = {'SD':'<%=SessionID%>'};
  185. var services=[{serviceId:'securityLogoutService',method:'logout',parameters:args}];
  186. $.ajax({
  187. url:contextPath+'/ajaxAdapter.do'
  188. ,data:{parameters:JSON.stringify(services)}
  189. ,dataType :'json'
  190. ,cache:false
  191. ,async:false
  192. ,type:'post'
  193. ,error:function (request, textStatus, errorThrown) {}
  194. ,success:function (data, textStatus) {
  195. if(data!=null && data[headtoken]!=null){
  196. token=data[headtoken];//更新全局变量token标志
  197. }
  198. },
  199. beforeSend:function(XMLHttpRequest ){
  200. var cToken = $.cookie(headtoken) || token;XMLHttpRequest.setRequestHeader(headtoken,cToken);
  201. }
  202. });
  203. }
  204. <%-- 弹出常用菜单窗口 --%>
  205. window.shortcut = {operId:"<%=OperId%>",shortcutHtml: "<%=shortcutHtml%>"};
  206. function showShortcut(){
  207. var title = encodeURIComponent('常用菜单');
  208. var url = "shortcut.jsp?title=" + title + "&_t=" + new Date().getTime();
  209. var position = "resizable:1;status:0;help:0;scroll:1;center:1;dialogWidth:900px;dialogHeight:450px";
  210. window.showModalDialog(url,window,position);
  211. }
  212. <%-- 弹出查阅公告窗口 --%>
  213. function showBulletinDialog(){
  214. var title = encodeURIComponent('查阅公告');//对话框的标题
  215. var url = "blank_bulletin.jsp?title="+title;
  216. var position="resizable:1;status:0;help:0;scroll:1;center:1;dialogWidth:1024px;dialogHeight:500px";
  217. window.showModalDialog(url,window,position);
  218. }
  219. function bindListener(obj,eventName,fun) {
  220. if (obj.addEventListener) {
  221. obj.addEventListener(eventName,fun,false);
  222. } else if (obj.attachEvent) {
  223. obj.attachEvent('on'+eventName,fun);
  224. } else {
  225. obj['on'+eventName] = fun;
  226. }
  227. }
  228. function unBindListener(obj,eventName,fun) {
  229. if (obj.removeEventListener) {
  230. obj.removeEventListener(eventName,fun,false);
  231. } else if (obj.detachEvent) {
  232. obj.detachEvent('on'+eventName,fun);
  233. } else {
  234. obj['on'+eventName] = '';
  235. }
  236. }
  237. // 设置样式
  238. function setCssFile(id){
  239. var csspath="${ctx}/themes/default/style_"+ id +".css";
  240. try{//设置不同皮肤
  241. $(window.parent.frames['TreeMenu'].document).find("#cssfile").attr("href",csspath);
  242. $(window.parent.frames['TreeMenuHideShow'].document).find("#cssfile").attr("href",csspath);
  243. $(window.parent.frames['contentFrameset'].document).find("#cssfile").attr("href",csspath);
  244. $(window.parent.frames['navigation'].document).find("#cssfile").attr("href",csspath);
  245. $(window.parent.frames['workspace'].document).find("#cssfile").attr("href",csspath);
  246. $(window.parent.frames['banner'].document).find("#cssfile").attr("href",csspath);
  247. }catch(e){ }
  248. $.cookie( "b2cPlatform" , id , { path: '/', expires: 10 });
  249. }
  250. </script>
  251. <script>
  252. parent.mLoadStatus.banner = true;
  253. </script>
  254. </html>