right.html 15 KB

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