right.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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" style='right:140px;{if condition="$backLogCount gt 0"}width:150px;{/if}'>
  61. <button class="dropdown J_tabClose" data-toggle="dropdown" style="width:100%">待办事项{if condition="$backLogCount gt 0"}(<span style="color:red;font-weight:bold;">{$backLogCount}</span>){/if}<span class="caret"></span>
  62. </button>
  63. {if condition="$backLogCount gt 0"}
  64. <ul role="menu" class="dropdown-menu dropdown-menu-right">
  65. {volist name="backlog" id="bl"}
  66. <li class="J_tabShowActive">
  67. <a href="javascript:void(0);" onclick="{$bl.url}">{$bl.title}(<span style="color:red;font-weight:bold;">{$bl.count}</span>)</a>
  68. </li>
  69. {/volist}
  70. </ul>
  71. {else/}
  72. <ul role="menu" class="dropdown-menu dropdown-menu-right">
  73. <li class="J_tabShowActive" style="text-align:center;">
  74. 暂无
  75. </li>
  76. </ul>
  77. {/if}
  78. </div>
  79. <div class="btn-group roll-nav roll-right">
  80. <button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span>
  81. </button>
  82. <ul role="menu" class="dropdown-menu dropdown-menu-right">
  83. <li class="J_tabShowActive"><a>定位当前选项卡</a>
  84. </li>
  85. <li class="divider"></li>
  86. <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
  87. </li>
  88. <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
  89. </li>
  90. </ul>
  91. </div>
  92. <a href="/index/auth/logout" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a>
  93. </div>
  94. <div class="row J_mainContent" id="content-main">
  95. <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="/common/notice" frameborder="0" data-id="/common/notice" seamless></iframe>
  96. </div>
  97. </div>
  98. <link href="/static/css/lockScreen.css" rel="stylesheet">
  99. <script src="/static/js/jquery.min.js?v=2.1.4"></script>
  100. <script src="/static/js/common/Feng.js"></script>
  101. <style type="text/css">
  102. .dbsx{
  103. line-height: 12px;
  104. padding: 1px 3px;
  105. position: absolute;
  106. top: 8px;
  107. background-color: #1ab394;
  108. color: #FFFFFF;
  109. font-size: 3px;
  110. }
  111. .dropdown-menu .divider {
  112. height: 1px;
  113. overflow: hidden;
  114. background-color: #333;
  115. }
  116. </style>
  117. <script type="text/javascript">
  118. var task = null;
  119. var time = 10;
  120. window.onload = function () {
  121. var locked = sessionStorage.getItem('locked');
  122. if (locked)
  123. lockScreen();
  124. // setTimeLockScreen();
  125. initTime(time);
  126. }
  127. // 锁屏
  128. function lockScreen() {
  129. document.onkeydown = function () {
  130. var e = window.event || arguments[0];
  131. // 屏蔽 F12
  132. if (e.keyCode === 123) {
  133. return false;
  134. // 屏蔽 Ctrl+Shift+I
  135. } else if ((e.ctrlKey) && (e.shiftKey) && (e.keyCode === 73)) {
  136. return false;
  137. // 屏蔽 Shift+F10
  138. } else if ((e.shiftKey) && (e.keyCode === 121)) {
  139. return false;
  140. }
  141. };
  142. // 屏蔽右键单击
  143. document.oncontextmenu = function () {
  144. return false;
  145. };
  146. $('#locking').remove();
  147. if ($("#avatar").val()) {
  148. $('body').append('<div id="locking"><figure onclick="lockInput(this);"><img src="' + $("#avatar").val() + '" ></figure><h3>' + $("#name").val() + '</h3></div>');
  149. }
  150. setTimeout(function () {
  151. $('#locking').addClass('lock-ani');
  152. }, 200);
  153. sessionStorage.setItem('locked', true);
  154. }
  155. // 锁屏输入
  156. function lockInput(dom) {
  157. $(dom).find('img').unwrap();
  158. $('#locking').append('<div class="input-group">' +
  159. ' <input class="form-control form-control-lg" id="lockPassword" style="color: #333;" type="password" placeholder="请输入登录密码解锁">' +
  160. ' <div class="input-group-addon" style="background-color: #ccc;border: 1px solid #ccc;" onclick="unlockScreen();">' +
  161. ' <span class="input-group-text">' +
  162. ' <i class="fa fa-key " style="color: #555;font-weight: 900;"></i>' +
  163. ' </span>' +
  164. ' </div>' +
  165. ' </div>');
  166. setTimeout(function () {
  167. $('#locking .input-group').addClass('lock-input-ani');
  168. }, 200);
  169. $('#locking input').focus();
  170. }
  171. // 解锁
  172. function unlockScreen() {
  173. var password = $('#lockPassword').val();
  174. var url = "/index/auth/valid_password";
  175. $.ajax({
  176. type: "post",
  177. url: url,
  178. dataType: "json",
  179. async: false,
  180. data: {"password": password},
  181. contentType: 'application/x-www-form-urlencoded ',
  182. success: function (data) {
  183. if (data.code == 200) {
  184. $('#locking').fadeOut(300, function () {
  185. $('#locking').remove();
  186. });
  187. sessionStorage.removeItem('locked');
  188. document.onkeydown = function () {
  189. var e = window.event || arguments[0];
  190. // 屏蔽 F12
  191. if (e.keyCode === 123) {
  192. return true;
  193. // 屏蔽 Ctrl+Shift+I
  194. } else if ((e.ctrlKey) && (e.shiftKey) && (e.keyCode === 73)) {
  195. return true;
  196. // 屏蔽 Shift+F10
  197. } else if ((e.shiftKey) && (e.keyCode === 121)) {
  198. return true;
  199. }
  200. };
  201. // 屏蔽右键单击
  202. document.oncontextmenu = function () {
  203. return true;
  204. };
  205. } else {
  206. if (data.status == 1) {
  207. Feng.error(data.msg);
  208. } else if (data.status == 2) {
  209. window.location.href = "/index/auth/login";
  210. }
  211. }
  212. },
  213. error: function (data) {
  214. window.location.href = "/index/auth/login";
  215. }
  216. });
  217. }
  218. function initTime(time) {
  219. var locked = sessionStorage.getItem('locked');
  220. var maxTime = 60 * time;
  221. task = setInterval(function () {
  222. if (!locked) {
  223. lockScreen();
  224. }
  225. }, 1000 * maxTime);
  226. listenTime();
  227. }
  228. function listenTime() {
  229. var body = document.querySelector('html');
  230. body.addEventListener("click", restTime);
  231. body.addEventListener("keyup", restTime);
  232. body.addEventListener("keypress", restTime);
  233. body.addEventListener("keydown", restTime);
  234. body.addEventListener("mousemove", restTime);
  235. body.addEventListener("mousewheel", restTime);
  236. }
  237. function restTime() {
  238. if (task != null) {
  239. clearInterval(task);
  240. }
  241. initTime(time);
  242. }
  243. // function setTimeLockScreen(){
  244. // var locked = sessionStorage.getItem('locked');
  245. // (function($){
  246. // funObj = {
  247. // timeUserFun:'timeUserFun',
  248. // }
  249. // $[funObj.timeUserFun] = function(time){
  250. // var time = time || 5; // 默认参数
  251. // var userTime = time*60;
  252. // var testUser = "";
  253. // var objTime = {
  254. // init:0,
  255. // time:function(){
  256. // objTime.init += 1;
  257. // if(objTime.init == userTime && !locked){
  258. // lockScreen();
  259. // }
  260. // },
  261. // eventFun:function(){
  262. // clearInterval(testUser);
  263. // objTime.init = 0;
  264. // testUser = setInterval(objTime.time,1000);
  265. // }
  266. // }
  267. // testUser = setInterval(objTime.time,1000);
  268. // var body = document.querySelector('html');
  269. // body.addEventListener("click",objTime.eventFun);
  270. // body.addEventListener("keyup",objTime.eventFun);
  271. // body.addEventListener("keypress",objTime.eventFun);
  272. // body.addEventListener("keydown",objTime.eventFun);
  273. // body.addEventListener("mousemove",objTime.eventFun);
  274. // body.addEventListener("mousewheel",objTime.eventFun);
  275. // }
  276. // })(window);
  277. // timeUserFun(5);
  278. // }
  279. </script>