Index: ssts-web/src/main/webapp/homepage/portalPage.jsp =================================================================== diff -u -r18546 -r19361 --- ssts-web/src/main/webapp/homepage/portalPage.jsp (.../portalPage.jsp) (revision 18546) +++ ssts-web/src/main/webapp/homepage/portalPage.jsp (.../portalPage.jsp) (revision 19361) @@ -206,10 +206,18 @@ <%session.removeAttribute("fromLogin");%> } var timer, target, current, ab; + +/** + * 创建消息列表的Tab(看到所有发布的消息). + */ function createTab(){ window.parent.addTab("messageView",'消息列表','${ctx}/disinfectsystem/message/message.jsp?departCode='+dirOrgCode); hide(); } + +/** + * 展现发布的消息的div(如果有多条展现最新的一条,其他给一个连接,连接到全部消息列表视图). + */ function alertDiv(){ SystemMessageTableManager.getMessage(dirOrgCode,'个人桌面',function(result){ if(result.length!=0){ @@ -239,7 +247,10 @@ }); } - function hide(){ +/** + * 隐藏发布消息的div窗口. + */ +function hide(){ target = -ab.box.offsetHeight; current = 0; hideDiv(); @@ -253,15 +264,19 @@ timer = setTimeout(hideDiv,1); } } + +/** + * 30秒钟检测一下当前用户是否切换,如果切换了,必须强制刷新首页 + */ +function initOnLoad(){ + setInterval("detectCurrentUserPeriodically()", 30 * 1000); +} var getLoginUserDataPending = false; -// 30秒钟检测一下当前用户是否切换 function detectCurrentUserPeriodically(){ if(getLoginUserDataPending){ return; } - //PortalDWRManager.getLoginUserData(function(user){ - //onGetLoginUserData(user); - //}); + // ext 异步请求 getLoginUserDataPending = true; Ext4.Ajax.request({ @@ -308,17 +323,14 @@ } location.reload(true); } -function initOnLoad(){ - setInterval("detectCurrentUserPeriodically()", 30 * 1000); -} + +/** + * 300分钟激活一下会话. + */ function initForActivateSession() { - //alert('initForActivateSession'); - // 300分钟激活一下会话 setInterval("activateSessionPeriodically()", 300 * 1000 * 60); - //setInterval("activateSessionPeriodically()", 5*1000);// test } function activateSessionPeriodically() { - //alert('activateSession'); PortalDWRManager.activateSession(); }