main_top.jspf 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. <%@page import="java.util.Properties"%>
  2. <%@page import="java.io.InputStream"%>
  3. <%@page pageEncoding="UTF-8"%>
  4. <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  5. <%@taglib prefix="security" uri="http://www.springframework.org/security/tags"%>
  6. <%
  7. Properties prop = new Properties();
  8. InputStream in;
  9. in = this.getClass().getResourceAsStream("/conf/app.properties");//加载配置文件
  10. prop.load(in);
  11. %>
  12. <f:link href="jquery/plugins/jquery.chosen.css"></f:link>
  13. <script type="text/javascript" src="${ctx}/js/jquery/plugins/jquery.tips.js"></script>
  14. <script type="text/javascript" src="${ctx}/js/im/im.js"></script>
  15. <script type="text/javascript" src="${ctx}/js/jquery/plugins/jquery.chosen.js"></script>
  16. <script type="text/javascript" src="${ctx}/js/jquery/plugins/jquery.htselect.js"></script>
  17. <script type="text/javascript">
  18. var serverUrl = "<%=prop.getProperty("serverUrl")%>";
  19. var socketUrl = "<%=prop.getProperty("socketUrl")%>";
  20. var isStop = false,pWidth,sWidth;
  21. $(function(){
  22. jQuery("#setSubSystem").chosen();
  23. $(".moreinfo").htselect();
  24. $("a.normalOrg").click(function(){
  25. var posid=$(this).attr("posid"),
  26. form=new com.hotent.form.Form();
  27. form.creatForm("orgform", "${ctx}/platform/console/switchCurrentOrg.ht");
  28. form.addFormEl("posId", posid);
  29. form.submit();
  30. });
  31. $("a.normalSysLanguage").click(function(){
  32. var language=$(this).attr("language"),
  33. form=new com.hotent.form.Form();
  34. form.creatForm("sysLanguageform", "${ctx}/platform/console/switchSysLanguage.ht");
  35. form.addFormEl("language", language);
  36. form.submit();
  37. });
  38. if("${message.message}" != "") {
  39. alert("${message.message}");
  40. }
  41. });
  42. function selectSystem() {
  43. if ($(".show_sys").css("display") == "none") {
  44. $(".show_sys").css("display", "block");
  45. } else {
  46. $(".show_sys").css("display", "none");
  47. }
  48. };
  49. function rollLeft() {
  50. var lef = pWidth - sWidth;
  51. var cLeft = parseInt($("div.menuPanel").css("left").replace("px", ""));
  52. if (cLeft <= lef)
  53. return;
  54. $("div.menuPanel").animate({
  55. left : "-=30px"
  56. }, 20, function() {
  57. if (!isStop) {
  58. rollLeft();
  59. }
  60. });
  61. };
  62. function startRoll(e) {
  63. isStop = false;
  64. if (e == 0) {
  65. pWidth = $("div.menuParent").width();
  66. sWidth = parseInt($("div.menuPanel").css("padding-left")
  67. + $("div.menuPanel").css("padding-left"));
  68. var count = 0, temp = 0;
  69. $("a.menuItem").each(
  70. function() {
  71. count++;
  72. temp = parseInt($(this).css("margin-left"))
  73. + parseInt($(this).css("margin-right"))
  74. + parseInt($(this).css("padding-left"))
  75. + parseInt($(this).css("padding-right"));
  76. sWidth += $(this).width();
  77. });
  78. sWidth += (count + 1) * temp;
  79. rollLeft();
  80. } else {
  81. rollRight();
  82. }
  83. };
  84. function breakRoll() {
  85. isStop = true;
  86. };
  87. function rollRight() {
  88. var cLeft = parseInt($("div.menuPanel").css("left").replace("px", ""));
  89. if (cLeft >= 0)
  90. return;
  91. $("div.menuPanel").animate({
  92. left : "+=30px"
  93. }, 20, function() {
  94. if (!isStop) {
  95. rollRight();
  96. }
  97. });
  98. };
  99. // 刷新未读信息
  100. function refresh() {
  101. $.post(__ctx + "/platform/system/messageSend/notReadMsg.ht", function(data) {
  102. $('#labMsgSize').text(data);
  103. if (data == 0) {
  104. $('#inMsg').attr('src',
  105. __ctx + '/styles/default/images/msg_none.png');
  106. }
  107. });
  108. $("iframe[name='home']").attr('src',__ctx+'/platform/console/home.ht');
  109. if(this.win)
  110. this.win.close();
  111. }
  112. function showReadMsgDlg(id) {
  113. var msgLength = $('#labMsgSize').text();
  114. if (msgLength > 0) {
  115. var url = __ctx + '/platform/system/messageSend/readMsgDialog.ht';
  116. if(typeof id!='undefined'){
  117. url += '?id='+id
  118. }
  119. win = $.ligerDialog.open({
  120. allowClose: false,
  121. url : url,
  122. height : 450,
  123. width : 600,
  124. isResize : false,
  125. title : '站内消息'
  126. });
  127. }
  128. }
  129. function changeSkin(styleName){
  130. $.post(__ctx + "/platform/system/sysPaur/changeSkin.ht",{'styleName':styleName}, function(response) {
  131. var json=$.parseJSON(response);
  132. if(json.result){
  133. window.location.reload(true);
  134. }
  135. else{
  136. alert(json.message);
  137. }
  138. });
  139. }
  140. //更改指定皮肤分风格
  141. function setLink(linktitle,styleName,obj){
  142. var updatelogo=true;
  143. $('link[rel=stylesheet]:[title='+linktitle+']',obj).each(
  144. function(){
  145. var curhref=this.href;
  146. var startIndex=curhref.indexOf("/styles/");
  147. var endIndex=curhref.indexOf("/css/");
  148. var substr=curhref.substring((startIndex+8),endIndex);
  149. this.href=curhref.replace(substr,styleName) ;
  150. if(updatelogo){
  151. var newlogo=$('#logoImg').attr("src").replace(substr,styleName);
  152. $('#logoImg').attr("src",function(){ return newlogo});
  153. updatelogo=false;
  154. }
  155. }
  156. );
  157. }
  158. function showList(o) {
  159. if($(".dropdown-content").hasClass("show")){
  160. hideList("dropdown-content" + o.id);
  161. }else{
  162. hideList("dropdown-content" + o.id);
  163. document.getElementById("dropdown-" + o.id).classList.toggle("show");
  164. }
  165. }
  166. function hideList(option) {
  167. var dropdowns = document.getElementsByClassName("dropdown-content");
  168. for (var i = 0; i < dropdowns.length; i++) {
  169. var openDropdown = dropdowns[i];
  170. if (openDropdown.id != option) {
  171. if (openDropdown.classList.contains('show')) {
  172. openDropdown.classList.remove('show');
  173. }
  174. }
  175. }
  176. }
  177. </script>
  178. <!-- div 横排 -display:inline-->
  179. <style>
  180. .moreinfo{ display:inline}
  181. .msg_div{ display:inline}
  182. .jstx{
  183. display:block;
  184. width: 33px;
  185. height: 33px;
  186. }
  187. .jstx2{
  188. animation:move 3s 0s infinite;
  189. -webkit-animation:move 3s 0s infinite;
  190. transform-origin:bottom;
  191. -webkit-transform-origin:bottom;
  192. }
  193. @keyframes move
  194. {
  195. 0%, 65%{
  196. -webkit-transform:rotate(0deg);
  197. transform:rotate(0deg);
  198. }
  199. 70% {
  200. -webkit-transform:rotate(6deg);
  201. transform:rotate(6deg);
  202. }
  203. 75% {
  204. -webkit-transform:rotate(-6deg);
  205. transform:rotate(-6deg);
  206. }
  207. 80% {
  208. -webkit-transform:rotate(6deg);
  209. transform:rotate(6deg);
  210. }
  211. 85% {
  212. -webkit-transform:rotate(-6deg);
  213. transform:rotate(-6deg);
  214. }
  215. 90% {
  216. -webkit-transform:rotate(6deg);
  217. transform:rotate(6deg);
  218. }
  219. 95% {
  220. -webkit-transform:rotate(-6deg);
  221. transform:rotate(-6deg);
  222. }
  223. 100% {
  224. -webkit-transform:rotate(0deg);
  225. transform:rotate(0deg);
  226. }
  227. }
  228. @-webkit-keyframes move
  229. {
  230. 0%, 65%{
  231. -webkit-transform:rotate(0deg);
  232. transform:rotate(0deg);
  233. }
  234. 70% {
  235. -webkit-transform:rotate(6deg);
  236. transform:rotate(6deg);
  237. }
  238. 75% {
  239. -webkit-transform:rotate(-6deg);
  240. transform:rotate(-6deg);
  241. }
  242. 80% {
  243. -webkit-transform:rotate(6deg);
  244. transform:rotate(6deg);
  245. }
  246. 85% {
  247. -webkit-transform:rotate(-6deg);
  248. transform:rotate(-6deg);
  249. }
  250. 90% {
  251. -webkit-transform:rotate(6deg);
  252. transform:rotate(6deg);
  253. }
  254. 95% {
  255. -webkit-transform:rotate(-6deg);
  256. transform:rotate(-6deg);
  257. }
  258. 100% {
  259. -webkit-transform:rotate(0deg);
  260. transform:rotate(0deg);
  261. }
  262. }
  263. .dropdown-content {
  264. display: none;
  265. position: absolute;
  266. background-color: #4482eb;
  267. min-width: 239px;
  268. box-shadow: 0px 8px 16px 5px rgba(0, 0, 0, 0.2);
  269. margin-top:15px;
  270. margin-left:-7px;
  271. }
  272. .dropdown-content a {
  273. color: black;
  274. padding: 12px 24px;
  275. text-decoration: none;
  276. display: block;
  277. text-align: left;
  278. }
  279. .dropdown-content a:hover {
  280. color: white;
  281. background-color: #81d0f2;
  282. }
  283. .show {
  284. display: block;
  285. }
  286. .dropItem {
  287. cursor:pointer;
  288. }
  289. .dropItem img{
  290. float:left;
  291. margin-left: 33px;
  292. }
  293. .dropItem span{
  294. font-size: 14px;
  295. line-height: 31px;
  296. font-weight: 900;
  297. padding-left: 9px;
  298. color:#fff;
  299. }
  300. </style>
  301. <c:set var="ctx" value="${pageContext.request.contextPath }" />
  302. <div class="index_top" >
  303. <div class="left_logo">
  304. <a id="a" href="javascript:void(0)" class="dropbtn" onclick="showList(this)" >
  305. <img id="logoImg" src="${ctx}${currentSystem.logo}" />
  306. </a>
  307. <div class="dropdown-content" id="dropdown-a" onmouseleave="hideList(this)">
  308. </div>
  309. </div>
  310. <div class="search_welcome">
  311. <!--<div class="welDive" >
  312. 欢迎您,
  313. <security:authentication property="principal.fullname" />
  314. </div>-->
  315. <div class="welDive">
  316. <a class="more loginButtonIndex" href="${ctx}/platform/console/main.ht" title="主页"></a>
  317. <%-- <span class="more messageIndex" href="${ctx}/platform/console/main.ht" title="信息"><i>66</i><span id="loginButton" ></span>
  318. <ul style="padding: 3px" class="messageul">
  319. <li><a class="more " resid="-001" target="_blank"><span style="margin-bottom: 3px">信息111</span></a></li>
  320. <li style="border-top-style: solid;border-top-width: 1px"><a class="more " resid="-002" href="/xtbg/platform/system/sysUser/get.ht?userId=1&amp;canReturn=1" target="_blank">
  321. <span style="margin-bottom: 3px">信息222</span></a></li>
  322. </ul>
  323. </span>
  324. --%>
  325. <%--<span class="moreinfo" style="display:block;float:left;margin-left: 17px;margin-right:22px;cursor:pointer;">
  326. <a id="ima" onclick="openIm()" class="jstx" title="即时通讯"><img src="${ctx}/styles/im/im.png"/></a >
  327. </span>--%>
  328. <!-- <span class="moreinfo" style="display:block;float:left;margin-right:10px;"> -->
  329. <!-- <a class="more switch2" resid="-003" href="javascript:;" title="切换岗位"></a> -->
  330. <%-- <c:if test="${curPosition!=null}"> --%>
  331. <!-- <ul> -->
  332. <%-- <c:forEach var="position" items="${positions}"> --%>
  333. <%-- <c:choose> --%>
  334. <%-- <c:when test="${position.posId==curPosition.posId}"> --%>
  335. <%-- <li><a class="curOrg" posid="${position.posId}">${position.posName}</a></li> --%>
  336. <%-- </c:when> --%>
  337. <%-- <c:otherwise> --%>
  338. <%-- <li><a class="normalOrg" posid="${position.posId}" href="javascript:;">${position.posName}</a></li> --%>
  339. <%-- </c:otherwise> --%>
  340. <%-- </c:choose> --%>
  341. <%-- </c:forEach> --%>
  342. <!-- </ul> -->
  343. <%-- </c:if> --%>
  344. <!-- </span> -->
  345. <span class="moreinfo" style="display:block;float:left;margin-right: 3px;">
  346. <span style="cursor: pointer;text-decoration: underline;" title='设置'> <span id="loginButton" ></span></span>
  347. <!--<span class="xiala"></span>-->
  348. <ul style="padding: 3px">
  349. <li><a class="more edit2" href="${ctx}/platform/system/sysUser/modifyPwdView.ht?userId=${userId}" resid="-001" href="javascript:;" target="_blank"><span style="margin-bottom: 3px">修改密码</span></a></li>
  350. <li style="border-top-style: solid;border-top-width: 1px"><a class="more detail2" resid="-002" href="${ctx}/platform/system/sysUser/get.ht?userId=${userId}&canReturn=1" target="_blank"><span style="margin-bottom: 3px">个人资料</span></a></li>
  351. </ul>
  352. </span>
  353. <%-- <span style="display:block;float:left;margin-right:18px;cursor:pointer;">
  354. <a style="display:block;width:33px;height:33px; margin-top:14px;" onclick="daka()" title="打卡签到"><img src="${ctx}/styles/im/daka.png"/></a>
  355. </span>--%>
  356. <a class="more exit2" href="${ctx}/logout" title='退出切换用户'></a>
  357. <%-- </c:if> --%>
  358. <c:if test="${not empty cookie.origSwitch}">
  359. <a href="${ctx}/j_spring_security_exit_user?j_username=${cookie.origSwitch.value}">退出切换用户</a>
  360. </c:if>
  361. </div>
  362. <!--<div colspan="2" class="welDive">
  363. <select id="setSubSystem" onchange="saveCurrentSys();" hasSearch="0">
  364. <c:forEach var="subSystemItem" items="${subSystemList}">
  365. <option value="${subSystemItem.systemId}"
  366. <c:if test="${subSystemItem.systemId==currentSystem.systemId }">selected="selected"</c:if>>
  367. ${subSystemItem.sysName}</option>
  368. </c:forEach>
  369. </select>
  370. </div>-->
  371. </div>
  372. </div>
  373. <div class="index_menu">
  374. <div class="menuParent" >
  375. <div id="menuPanel" class="menuPanel"></div>
  376. </div>
  377. <div class="nav_button">
  378. <a class="nav_left" href="javascript:;" onclick="rollRight()" onmousedown="startRoll(1)" onmouseup="breakRoll()" title="向左移动"></a>
  379. <a class="nav_right" href="javascript:;" onclick="rollLeft()" onmousedown="startRoll(0)" onmouseup="breakRoll()" title="向右移动"></a>
  380. </div>
  381. </div>
  382. <%--<div class="changge_skin" title='换肤'>
  383. <a href="javascript:void(0)" onclick="changeSkin('bjxg')" ><img src="${ctx}/styles/bjxg/images/icons/icons_40-68.png" /> </a>
  384. <img src="${ctx}/styles/default/images/icons/icons_44-73.png" onclick="changeSkin('other')"/>
  385. <img src="${ctx}/styles/default/images/icons/icons_41-71.png" onclick="changeSkin('blue')"/>
  386. </div>--%>
  387. <div class="changge_div">
  388. <a class="changge_a1" href="javascript:void(0)" onclick="changeSkin('default')" style="text-decoration: none !important;" > </a>
  389. <a class="changge_a2" href="javascript:void(0)" onclick="changeSkin('green')" style="text-decoration: none !important;"></a>
  390. <a class="changge_a3" href="javascript:void(0)" onclick="changeSkin('blue')" style="text-decoration: none !important;"> </a>
  391. <a class="changge_a4" href="javascript:void(0)" onclick="changeSkin('red')" style="text-decoration: none !important;"></a>
  392. </div>
  393. <script>
  394. //记录即时通讯未读消息数量
  395. var msgCount = 0;
  396. $(function(){
  397. var user=$("#useraccount").val();
  398. $(".changge_skin").toggle(function(){
  399. $('.changge_div').animate({opacity:'1'});
  400. $(".search_welcome").animate({right:'125px'});
  401. $(".changge_skin").animate({right:'165px'});
  402. },function(){
  403. $('.changge_div').animate({opacity:'0'});
  404. $(".search_welcome").animate({right:'0px'});
  405. $(".changge_skin").animate({right:'43px'});
  406. });
  407. $(".messageIndex").hover(function(){
  408. $(".messageul").toggle();
  409. });
  410. // 定时发送心跳
  411. setInterval(reConnect, 5000);
  412. // 构建聊天业务CHAT
  413. window.CHAT = {
  414. socket: null,
  415. init: function() {
  416. if (window.WebSocket) {
  417. if (CHAT.socket != null
  418. && CHAT.socket != undefined
  419. && CHAT.socket.readyState === WebSocket.OPEN) {
  420. return false;
  421. }
  422. // CHAT.socket = new WebSocket(socketUrl);
  423. CHAT.socket.onopen = CHAT.wsonopen,
  424. CHAT.socket.onclose = CHAT.wsonclose,
  425. CHAT.socket.onerror = CHAT.wsonerror,
  426. CHAT.socket.onmessage = CHAT.wsonmessage;
  427. } else {
  428. alert("浏览器不支持websocket协议...");
  429. }
  430. },
  431. wsonopen: function() {
  432. console.log("websocket连接已建立...");
  433. // 发送websocket
  434. CHAT.socket.send(',fhadmin-join,'+user+ "oa_pc"); //传入用户名
  435. },
  436. wsonclose: function() {
  437. console.log("连接关闭...");
  438. //发送下线消息
  439. CHAT.socket.send(',fhadmin-leave,');
  440. CHAT.socket = null;
  441. },
  442. wsonerror: function() {
  443. console.log("发生错误...");
  444. CHAT.socket = null;
  445. },
  446. wsonmessage: function(e) {
  447. var message = JSON.parse(e.data);
  448. console.log("接受到消息:" + message);
  449. if('friend' == message.type || 'group' == message.type){ //接收好友或群发送的消息
  450. msgCount ++ ;
  451. }else if('user_join' == message.type){
  452. //上线了
  453. }else if('user_leave' == message.type){
  454. //下线了
  455. }else if('user_online' == message.type){
  456. msgCount ++ ; //好友设置在线状态
  457. }else if('user_hide' == message.type){
  458. msgCount ++ ; //好友设置隐身状态
  459. }else if('user_applyfriend' == message.type){
  460. msgCount ++ ; //申请加好友
  461. }else if('user_emove' == message.type){
  462. msgCount ++ ; //删除好友(被动删,被拉黑)
  463. }else if('agreefriend' == message.type){
  464. msgCount ++ ; //对方同意添加好友
  465. }else if('applyqgroup' == message.type){
  466. msgCount ++ ; //申请加群申请
  467. }else if('agreeqgroup' == message.type){
  468. msgCount ++ ; //对方同意群申请
  469. }else if('kickoutqgroup' == message.type){
  470. msgCount ++ ; //踢出群
  471. }else if('delqgroup' == message.type){
  472. msgCount ++ ; //群解散
  473. }
  474. showImMessage(message.username, message.content, msgCount);
  475. },
  476. keepalive: function() {
  477. console.log("websocket心跳...");
  478. // 发送心跳
  479. CHAT.socket.send(',fhadmin-keepalive,');
  480. }
  481. };
  482. /**
  483. * 与FH即时通讯后台连接,能实时收到消息提醒
  484. */
  485. // CHAT.init();
  486. /**
  487. * 获取离线未读消息
  488. $.ajax({
  489. type: "POST",
  490. url: '${ctx}/im/imController/getNoreadMsgByUserName.ht', //未读消息(离线消息)接口
  491. data: {fh_url:serverUrl,username:user,tm:new Date().getTime()},
  492. dataType:'json',
  493. cache: false,
  494. success: function(json){
  495. if (json.result === 1) {
  496. var message = $.parseJSON(json.message);
  497. var result = $.parseJSON(message.message);
  498. if('has' == result.result){
  499. $.each(result.list, function(i, list){
  500. msgCount++;
  501. showImMessage(list.NAME, list.CONTENT, msgCount);
  502. });
  503. } else if('no' == result.result) {
  504. // $("#ima").tips({
  505. // side:3,
  506. // msg: "消息数量为0",
  507. // bg:'#AE81FF',
  508. // time:10
  509. // });
  510. }
  511. }else {
  512. alert(json.message);
  513. }
  514. }
  515. });
  516. });
  517. */
  518. //打卡
  519. function daka(){
  520. $.ligerDialog.confirm("确认打卡?","提示",function(rtn){
  521. if(!rtn){
  522. return;
  523. }
  524. $.ajax({
  525. type: "POST",
  526. url: '${ctx}/platform/console/savePunch.ht',
  527. data: {tm:new Date().getTime()},
  528. dataType:'json',
  529. cache: false,
  530. success: function(json){
  531. if(json.result == 1){
  532. if (json.message=='0'){
  533. $.ligerDialog.success("谢谢,打卡成功!", '提示', function(rtn) {
  534. window.location.href = "${ctx}/platform/console/main.ht";
  535. } );
  536. }else if(json.message=='1'){
  537. $.ligerDialog.warn("温馨提示,上班迟到!", '提示', function(rtn) {
  538. window.location.href = "${ctx}/platform/console/main.ht";
  539. } );
  540. }
  541. else if(json.message=='2'){
  542. $.ligerDialog.warn("温馨提示,下班早退!", '提示', function(rtn) {
  543. window.location.href = "${ctx}/platform/console/main.ht";
  544. } );
  545. }
  546. else if(json.message=='4'){
  547. $.ligerDialog.warn("您已完成上下班打卡,无需重复打卡!", '提示' );
  548. }
  549. }
  550. }
  551. });
  552. });
  553. }
  554. /**
  555. * 更新未读消息数量
  556. * 显示消息内容
  557. */
  558. function showImMessage(user, content, count) {
  559. //$("#msgCount").html("消息("+count+")");
  560. $("#ima").tips({
  561. side:3,
  562. msg: '【'+user+'】:'+content,
  563. bg:'#AE81FF',
  564. time:10
  565. });
  566. }
  567. //websocket重新连接
  568. //心跳连接
  569. function reConnect() {
  570. $("#ima").removeClass();
  571. if(msgCount==0){
  572. $("#ima").addClass("jstx");
  573. }else{
  574. $("#ima").addClass("jstx2 jstx");
  575. }
  576. if (CHAT.socket == null || CHAT.socket === undefined || CHAT.socket.readyState != WebSocket.OPEN) {
  577. // CHAT.init();
  578. }else {
  579. // 定时发送心跳
  580. // CHAT.keepalive();
  581. }
  582. }
  583. /**
  584. * 点击消息图标,跳转FH首页,需要传递当前登录用户的帐号和密码
  585. * 需要注意的是,当前帐号和密码,必须与FH帐号密码同步
  586. * 否则,即时通讯不好使
  587. * 懂????
  588. */
  589. function openIm() {
  590. var user=$("#useraccount").val();
  591. $.ajax({
  592. type: "POST",
  593. url: '${ctx}/im/imController/encrypt.ht', //加密接口
  594. data: {username:user, tm:new Date().getTime()},//传入用户名
  595. dataType:'json',
  596. cache: false,
  597. success: function(json){
  598. if(json.result === 1) {
  599. msgCount = 0;
  600. $("#msgCount").html("消息("+msgCount+")");
  601. window.open(serverUrl+"/appiminterface/im_login?param="+json.message);
  602. }
  603. }
  604. });
  605. }
  606. </script>
  607. <div class="head_bg">
  608. </div>
  609. <input id="useraccount" value="<security:authentication property="principal.account" />" type="hidden" />
  610. </div>