right.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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="/admin/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="https://office.jinjianghc.com/web-apps/apps/api/documents/api.js"></script>
  82. <script src="/static/js/common/Feng.js"></script>
  83. <style type="text/css">
  84. .dbsx{
  85. line-height: 12px;
  86. padding: 1px 3px;
  87. position: absolute;
  88. top: 8px;
  89. background-color: #1ab394;
  90. color: #FFFFFF;
  91. font-size: 3px;
  92. }
  93. .dropdown-menu .divider {
  94. height: 1px;
  95. overflow: hidden;
  96. background-color: #333;
  97. }
  98. </style>
  99. <script type="text/javascript">
  100. var task = null;
  101. var time = 10;
  102. window.onload=function (){
  103. var locked = sessionStorage.getItem('locked');
  104. if(locked)lockScreen();
  105. // setTimeLockScreen();
  106. initTime(time);
  107. }
  108. // 锁屏
  109. function lockScreen() {
  110. document.onkeydown = function () {
  111. var e = window.event || arguments[0];
  112. // 屏蔽 F12
  113. if (e.keyCode === 123) {
  114. return false;
  115. // 屏蔽 Ctrl+Shift+I
  116. } else if ((e.ctrlKey) && (e.shiftKey) && (e.keyCode === 73)) {
  117. return false;
  118. // 屏蔽 Shift+F10
  119. } else if ((e.shiftKey) && (e.keyCode === 121)) {
  120. return false;
  121. }
  122. };
  123. // 屏蔽右键单击
  124. document.oncontextmenu = function () {
  125. return false;
  126. };
  127. $('#locking').remove();
  128. if ($("#avatar").val()) {
  129. $('body').append('<div id="locking"><figure onclick="lockInput(this);"><img src="' +$("#avatar").val() + '" ></figure><h3>' + $("#name").val() + '</h3></div>');
  130. }
  131. setTimeout(function () {
  132. $('#locking').addClass('lock-ani');
  133. }, 200);
  134. sessionStorage.setItem('locked', true);
  135. }
  136. // 锁屏输入
  137. function lockInput(dom) {
  138. $(dom).find('img').unwrap();
  139. $('#locking').append('<div class="input-group">' +
  140. ' <input class="form-control form-control-lg" id="lockPassword" style="color: #333;" type="password" placeholder="请输入登录密码解锁">' +
  141. ' <div class="input-group-addon" style="background-color: #ccc;border: 1px solid #ccc;" onclick="unlockScreen();">' +
  142. ' <span class="input-group-text">' +
  143. ' <i class="fa fa-key " style="color: #555;font-weight: 900;"></i>' +
  144. ' </span>' +
  145. ' </div>' +
  146. ' </div>');
  147. setTimeout(function () {
  148. $('#locking .input-group').addClass('lock-input-ani');
  149. }, 200);
  150. $('#locking input').focus();
  151. }
  152. // 解锁
  153. function unlockScreen() {
  154. var password = $('#lockPassword').val();
  155. var url = "/admin/auth/valid_password";
  156. $.ajax({
  157. type: "post",
  158. url: url,
  159. dataType: "json",
  160. async: false,
  161. data: {"password":password},
  162. contentType : 'application/x-www-form-urlencoded ',
  163. success: function(data) {
  164. if(data.code==200){
  165. $('#locking').fadeOut(300, function () {
  166. $('#locking').remove();
  167. });
  168. sessionStorage.removeItem('locked');
  169. document.onkeydown = function () {
  170. var e = window.event || arguments[0];
  171. // 屏蔽 F12
  172. if (e.keyCode === 123) {
  173. return true;
  174. // 屏蔽 Ctrl+Shift+I
  175. } else if ((e.ctrlKey) && (e.shiftKey) && (e.keyCode === 73)) {
  176. return true;
  177. // 屏蔽 Shift+F10
  178. } else if ((e.shiftKey) && (e.keyCode === 121)) {
  179. return true;
  180. }
  181. };
  182. // 屏蔽右键单击
  183. document.oncontextmenu = function () {
  184. return true;
  185. };
  186. }else{
  187. if(data.status==1){
  188. Feng.error(data.msg);
  189. }else if(data.status==2){
  190. window.location.href = "/admin/auth/login";
  191. }
  192. }
  193. },
  194. error: function(data) {
  195. console.log(data);return;
  196. window.location.href = "/admin/auth/login";
  197. }
  198. });
  199. }
  200. function initTime(time) {
  201. var locked = sessionStorage.getItem('locked');
  202. var maxTime = 60*time;
  203. task = setInterval(function () {
  204. if(!locked){
  205. lockScreen();
  206. }
  207. },1000*maxTime);
  208. listenTime();
  209. }
  210. function listenTime() {
  211. var body = document.querySelector('html');
  212. body.addEventListener("click",restTime);
  213. body.addEventListener("keyup",restTime);
  214. body.addEventListener("keypress",restTime);
  215. body.addEventListener("keydown",restTime);
  216. body.addEventListener("mousemove",restTime);
  217. body.addEventListener("mousewheel",restTime);
  218. }
  219. function restTime(){
  220. if (task!=null){
  221. clearInterval(task);
  222. }
  223. initTime(time);
  224. }
  225. // function setTimeLockScreen(){
  226. // var locked = sessionStorage.getItem('locked');
  227. // (function($){
  228. // funObj = {
  229. // timeUserFun:'timeUserFun',
  230. // }
  231. // $[funObj.timeUserFun] = function(time){
  232. // var time = time || 5; // 默认参数
  233. // var userTime = time*60;
  234. // var testUser = "";
  235. // var objTime = {
  236. // init:0,
  237. // time:function(){
  238. // objTime.init += 1;
  239. // if(objTime.init == userTime && !locked){
  240. // lockScreen();
  241. // }
  242. // },
  243. // eventFun:function(){
  244. // clearInterval(testUser);
  245. // objTime.init = 0;
  246. // testUser = setInterval(objTime.time,1000);
  247. // }
  248. // }
  249. // testUser = setInterval(objTime.time,1000);
  250. // var body = document.querySelector('html');
  251. // body.addEventListener("click",objTime.eventFun);
  252. // body.addEventListener("keyup",objTime.eventFun);
  253. // body.addEventListener("keypress",objTime.eventFun);
  254. // body.addEventListener("keydown",objTime.eventFun);
  255. // body.addEventListener("mousemove",objTime.eventFun);
  256. // body.addEventListener("mousewheel",objTime.eventFun);
  257. // }
  258. // })(window);
  259. // timeUserFun(5);
  260. // }
  261. </script>