right.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <input type="hidden" id="avatar"
  2. {if condition="!$user['avatar']"}
  3. value="/static/img/girl.gif"
  4. {else/}
  5. value="{$user.avatar}"
  6. {/if}
  7. />
  8. <input type="hidden" id="name" value="{$user.name}">
  9. <input type="hidden" id="roleName" value="{$user.rolename}">
  10. <div id="page-wrapper" class="gray-bg dashbard-1">
  11. <div class="row border-bottom">
  12. <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
  13. <ul class="nav navbar-top-links navbar-right">
  14. <!--
  15. <li class="dropdown">
  16. <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#" onmouseover="$('.dropdown-toggle').dropdown()">
  17. <i class="fa fa-bell"></i>
  18. @if(dbsx>0){
  19. <span class="label label-danger">${dbsx}</span>
  20. @}
  21. </a>
  22. @if(tool.isEmpty(tasks)){
  23. @}else{
  24. <ul class="dropdown-menu dropdown-alerts" style="height: 300px;overflow: auto">
  25. @for(item in tasks){
  26. <li>
  27. <a href="javascript:void(0)">
  28. <div>
  29. <i class="fa fa-envelope fa-fw"></i> ${item.description}
  30. <span class="pull-right text-muted small">${item.createTime}</span>
  31. </div>
  32. </a>
  33. </li>
  34. <li class="divider"></li>
  35. @}
  36. </ul>
  37. @}
  38. </li>-->
  39. <li class="dropdown hidden-xs">
  40. <a class="dropdown-toggle" aria-expanded="false" style="font-weight: 900" onclick="javascript:lockScreen();">
  41. <i class="fa fa-lock"></i> 锁屏
  42. </a>
  43. </li>
  44. <li class="dropdown hidden-xs">
  45. <a class="right-sidebar-toggle" aria-expanded="false">
  46. <i class="fa fa-tasks"></i> 主题
  47. </a>
  48. </li>
  49. </ul>
  50. </nav>
  51. </div>
  52. <div class="row content-tabs">
  53. <button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i>
  54. </button>
  55. <nav class="page-tabs J_menuTabs">
  56. <div class="page-tabs-content">
  57. <a href="javascript:;" class="active J_menuTab" data-id="/common/notice">公告栏</a>
  58. </div>
  59. </nav>
  60. <div class="btn-group roll-nav roll-right">
  61. <button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span>
  62. </button>
  63. <ul role="menu" class="dropdown-menu dropdown-menu-right">
  64. <li class="J_tabShowActive"><a>定位当前选项卡</a>
  65. </li>
  66. <li class="divider"></li>
  67. <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
  68. </li>
  69. <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
  70. </li>
  71. </ul>
  72. </div>
  73. <a href="/index/auth/logout" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a>
  74. </div>
  75. <div class="row J_mainContent" id="content-main">
  76. <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="/common/notice" frameborder="0" data-id="/common/notice" seamless></iframe>
  77. </div>
  78. </div>
  79. <link href="/static/css/lockScreen.css" rel="stylesheet">
  80. <script src="/static/js/jquery.min.js?v=2.1.4"></script>
  81. <script src="/static/js/common/Feng.js"></script>
  82. <style type="text/css">
  83. .dbsx{
  84. line-height: 12px;
  85. padding: 1px 3px;
  86. position: absolute;
  87. top: 8px;
  88. background-color: #1ab394;
  89. color: #FFFFFF;
  90. font-size: 3px;
  91. }
  92. .dropdown-menu .divider {
  93. height: 1px;
  94. overflow: hidden;
  95. background-color: #333;
  96. }
  97. </style>
  98. <script type="text/javascript">
  99. var task = null;
  100. var time = 10;
  101. var isEnterpriseFull = '{$isEnterpriseFull}';
  102. window.onload=function (){
  103. var locked = sessionStorage.getItem('locked');
  104. if(locked)lockScreen();
  105. // setTimeLockScreen();
  106. initTime(time);
  107. if(!isEnterpriseFull){
  108. Feng.confirm("系统升级,您的资料需要同步更新,请移步机构用户中心进行修改【机构信息变更】。",function(){
  109. $(".J_menuItem[href='/enterprise/index/centerPage']").click();
  110. clkTab();
  111. })
  112. }
  113. }
  114. function clkTab(){
  115. setTimeout(function(){
  116. if($('iframe.J_iframe[data-id="/enterprise/index/centerPage"]').contents().find('a[href="#tab-2"]').length==1){
  117. $('iframe.J_iframe[data-id="/enterprise/index/centerPage"]').contents().find('*.active').removeClass('active');
  118. $('iframe.J_iframe[data-id="/enterprise/index/centerPage"]').contents().find('ul.nav-tabs li').eq(1).addClass('active');
  119. $('iframe.J_iframe[data-id="/enterprise/index/centerPage"]').contents().find('#tab-2').addClass('active');
  120. }else{
  121. clkTab();
  122. }
  123. },20)
  124. }
  125. // 锁屏
  126. function lockScreen() {
  127. document.onkeydown = function () {
  128. var e = window.event || arguments[0];
  129. // 屏蔽 F12
  130. if (e.keyCode === 123) {
  131. return false;
  132. // 屏蔽 Ctrl+Shift+I
  133. } else if ((e.ctrlKey) && (e.shiftKey) && (e.keyCode === 73)) {
  134. return false;
  135. // 屏蔽 Shift+F10
  136. } else if ((e.shiftKey) && (e.keyCode === 121)) {
  137. return false;
  138. }
  139. };
  140. // 屏蔽右键单击
  141. document.oncontextmenu = function () {
  142. return false;
  143. };
  144. $('#locking').remove();
  145. if ($("#avatar").val()) {
  146. $('body').append('<div id="locking"><figure onclick="lockInput(this);"><img src="' +$("#avatar").val() + '" ></figure><h3>' + $("#name").val() + '</h3></div>');
  147. }
  148. setTimeout(function () {
  149. $('#locking').addClass('lock-ani');
  150. }, 200);
  151. sessionStorage.setItem('locked', true);
  152. }
  153. // 锁屏输入
  154. function lockInput(dom) {
  155. $(dom).find('img').unwrap();
  156. $('#locking').append('<div class="input-group">' +
  157. ' <input class="form-control form-control-lg" id="lockPassword" style="color: #333;" type="password" placeholder="请输入登录密码解锁">' +
  158. ' <div class="input-group-addon" style="background-color: #ccc;border: 1px solid #ccc;" onclick="unlockScreen();">' +
  159. ' <span class="input-group-text">' +
  160. ' <i class="fa fa-key " style="color: #555;font-weight: 900;"></i>' +
  161. ' </span>' +
  162. ' </div>' +
  163. ' </div>');
  164. setTimeout(function () {
  165. $('#locking .input-group').addClass('lock-input-ani');
  166. }, 200);
  167. $('#locking input').focus();
  168. }
  169. // 解锁
  170. function unlockScreen() {
  171. var password = $('#lockPassword').val();
  172. var url = "/index/auth/valid_password";
  173. $.ajax({
  174. type: "post",
  175. url: url,
  176. dataType: "json",
  177. async: false,
  178. data: {"password":password},
  179. contentType : 'application/x-www-form-urlencoded ',
  180. success: function(data) {
  181. if(data.code==200){
  182. $('#locking').fadeOut(300, function () {
  183. $('#locking').remove();
  184. });
  185. sessionStorage.removeItem('locked');
  186. document.onkeydown = function () {
  187. var e = window.event || arguments[0];
  188. // 屏蔽 F12
  189. if (e.keyCode === 123) {
  190. return true;
  191. // 屏蔽 Ctrl+Shift+I
  192. } else if ((e.ctrlKey) && (e.shiftKey) && (e.keyCode === 73)) {
  193. return true;
  194. // 屏蔽 Shift+F10
  195. } else if ((e.shiftKey) && (e.keyCode === 121)) {
  196. return true;
  197. }
  198. };
  199. // 屏蔽右键单击
  200. document.oncontextmenu = function () {
  201. return true;
  202. };
  203. }else{
  204. if(data.status==1){
  205. Feng.error(data.msg);
  206. }else if(data.status==2){
  207. window.location.href = "/index/auth/login";
  208. }
  209. }
  210. },
  211. error: function(data) {
  212. window.location.href = "/index/auth/login";
  213. }
  214. });
  215. }
  216. function initTime(time) {
  217. var locked = sessionStorage.getItem('locked');
  218. var maxTime = 60*time;
  219. task = setInterval(function () {
  220. if(!locked){
  221. lockScreen();
  222. }
  223. },1000*maxTime);
  224. listenTime();
  225. }
  226. function listenTime() {
  227. var body = document.querySelector('html');
  228. body.addEventListener("click",restTime);
  229. body.addEventListener("keyup",restTime);
  230. body.addEventListener("keypress",restTime);
  231. body.addEventListener("keydown",restTime);
  232. body.addEventListener("mousemove",restTime);
  233. body.addEventListener("mousewheel",restTime);
  234. }
  235. function restTime(){
  236. if (task!=null){
  237. clearInterval(task);
  238. }
  239. initTime(time);
  240. }
  241. // function setTimeLockScreen(){
  242. // var locked = sessionStorage.getItem('locked');
  243. // (function($){
  244. // funObj = {
  245. // timeUserFun:'timeUserFun',
  246. // }
  247. // $[funObj.timeUserFun] = function(time){
  248. // var time = time || 5; // 默认参数
  249. // var userTime = time*60;
  250. // var testUser = "";
  251. // var objTime = {
  252. // init:0,
  253. // time:function(){
  254. // objTime.init += 1;
  255. // if(objTime.init == userTime && !locked){
  256. // lockScreen();
  257. // }
  258. // },
  259. // eventFun:function(){
  260. // clearInterval(testUser);
  261. // objTime.init = 0;
  262. // testUser = setInterval(objTime.time,1000);
  263. // }
  264. // }
  265. // testUser = setInterval(objTime.time,1000);
  266. // var body = document.querySelector('html');
  267. // body.addEventListener("click",objTime.eventFun);
  268. // body.addEventListener("keyup",objTime.eventFun);
  269. // body.addEventListener("keypress",objTime.eventFun);
  270. // body.addEventListener("keydown",objTime.eventFun);
  271. // body.addEventListener("mousemove",objTime.eventFun);
  272. // body.addEventListener("mousewheel",objTime.eventFun);
  273. // }
  274. // })(window);
  275. // timeUserFun(5);
  276. // }
  277. </script>