header.html 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>单仓档案管理系统</title>
  6. <link rel="stylesheet" type="text/css" href="/themes/metro-green/easyui.css">
  7. <link rel="stylesheet" type="text/css" href="/themes/icon.css">
  8. <link rel="stylesheet" href="/src/lib/flexslider/flexslider.css">
  9. <link rel="stylesheet" href="/themes/oneIndex.css">
  10. <link rel="stylesheet" href="/themes/reset_default.css">
  11. <link rel="stylesheet" href="/themes/rj/modle_index.css">
  12. <link rel="stylesheet" href="/themes/mt.css">
  13. <script src="/src/lib/jquery.min.js"></script>
  14. <script src="/src/config.js"></script>
  15. <script src="/src/funs.js"></script>
  16. <script src="/src/echarts.min.js"></script>
  17. <script type="text/javascript" src="/src/base.js"></script>
  18. <script type="text/javascript" src="/src/page.js"></script>
  19. <script type="text/javascript" src="/src/lib/jquery.easyui.min.js"></script>
  20. <script type="text/javascript" src="/src/lib/cookie.js"></script>
  21. <script type="text/javascript" src="/src/lib/jquery.ajaxfileupload.js"></script>
  22. <script type="text/javascript" src="/locale/easyui-lang-zh_CN.js"></script>
  23. <script type="text/javascript" src="/src/lib/flexslider/jquery.flexslider-min.js"></script>
  24. <!-- <script type="text/javascript" src="/plugins/jquery.uploadify.min.js"></script> -->
  25. <!-- <script type="text/javascript" src="/src/rj/template-native.js"></script> -->
  26. <script type="text/javascript" src="/src/mt.js"></script>
  27. <script src="/src/lib/jquery-editable-select.min.js"></script>
  28. <link href="/src/lib/jquery-editable-select.min.css" rel="stylesheet">
  29. <script src="/src/qrcode/jquery.qrcode.min.js" type="text/javascript"></script>
  30. <script src="/src/qrcode/qrcode.js" type="text/javascript"></script>
  31. <script src="/src/qrcode/jquery.jqprint-0.3.js" type="text/javascript"></script>
  32. <!-- <script type="text/javascript" src="/src/lib/echarts.common.min.js"></script> -->
  33. <script type="text/javascript" src="/src/stat.js"></script>
  34. <script type="text/javascript" src="/src/mustache.min.js"></script>
  35. <script type="text/javascript">
  36. window.modules={};
  37. window.treemap={};
  38. window.renderHtml = function(e){
  39. //debugger
  40. $(".username").html(e.realname);
  41. document.realname=e.realname;
  42. document.grainId = e.grainId;
  43. document.userId = e.id;
  44. document.getElementById('avator-img').src = e.avator;
  45. window.modules=e.modules;
  46. window.treemap=e.treemap;
  47. $.each( e.modules, function(index, content)
  48. {
  49. if(content.moduleId==13){
  50. content.moduleUrl=content.childenList[0].moduleUrl.substring(1,content.childenList[0].moduleUrl.length);
  51. return;
  52. }
  53. });
  54. var template="<li data-page=\"base\" id=\"home-item\"><a href=\"/{{defaultHome}}\">首页</a></li>" +
  55. "<!--<li data-page=\"base\" id=\"icontrol-item\"><a href=\"/pages/intelligentControl/index.html\">智能控制</a></li>-->{{#modules}}<li id=\"hea{{moduleEnname}}\" data-page=\"{{moduleEnname}}\"><a href=\"/{{moduleUrl}}\">{{moduleName}}</a></li>{{/modules}}";
  56. var views = Mustache.render(template, e);
  57. $("#head-nav-ul").html(views);
  58. $("#cansgl").attr("href",$("#heabasedata > a").attr("href"));
  59. $("#head-nav-ul").children().on('click', function(){
  60. sessionStorage.setItem('num', 0)
  61. });
  62. };
  63. $(function(){
  64. if(window.sessionStorage){
  65. var modules=JSON.parse(window.sessionStorage.getItem("modules"));
  66. if(modules){
  67. renderHtml(modules);
  68. }
  69. }
  70. $.ajax({
  71. type: 'get',
  72. dataType: 'json',
  73. url: config.baseUrl + "/sys/getUserInfo",
  74. success: function(e){
  75. if (e.code !== "0") {
  76. alert(e.msg);
  77. }else{
  78. window.localStorage.setItem("realname",e.realname);
  79. window.localStorage.setItem("cruuentGrainId",e.grainId); //重要修改
  80. if(window.sessionStorage){
  81. window.sessionStorage.setItem("modules",JSON.stringify(e));
  82. renderHtml(e);
  83. window.defaultHome=e.defaultHome;
  84. }
  85. }
  86. },
  87. error: function(e) {
  88. console.log(e);
  89. }
  90. });
  91. });
  92. /**
  93. * @author yukaizhao
  94. */
  95. $.extend($.fn.validatebox.defaults.rules, {
  96. /*必须和某个字段相等*/
  97. equalTo: {
  98. validator:function(value,param){
  99. return $(param[0]).val() == value;
  100. },
  101. message:'字段不匹配'
  102. },
  103. isNameExsit: {
  104. validator: function (value) {
  105. var flag = true;
  106. $.ajax({
  107. type: "post",
  108. dataType: 'json',
  109. async: false,
  110. url: "/sys/user/checkNameIsExsit?name="+value,
  111. success: function(data){//在验证函数里加载数据,加载过来后判断输入的值
  112. if(data.code==0){
  113. if(data.count!=0){
  114. flag= false;
  115. }
  116. }
  117. return true;
  118. }
  119. });
  120. return flag;
  121. },
  122. message: '用户名重复'
  123. }
  124. });
  125. $(function(){
  126. function getCookie( name ) {
  127. if (document.cookie.length > 0) {
  128. c_start = document.cookie.indexOf(name + "=")
  129. if (c_start != -1) {
  130. c_start = c_start + name.length + 1
  131. c_end = document.cookie.indexOf(";", c_start)
  132. if (c_end == -1) c_end = document.cookie.length
  133. return unescape(document.cookie.substring(c_start, c_end))
  134. } else {
  135. return false;
  136. }
  137. }
  138. return false;
  139. }
  140. function delCookie( name ) {
  141. var exp = new Date();
  142. exp.setTime(exp.getTime() - 1);
  143. var cval = getCookie(name);
  144. if (cval != null)
  145. document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString() + ";path=/";
  146. }
  147. function setCookie(name, value) {
  148. var Days = 30;
  149. var exp = new Date();
  150. exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
  151. document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/";
  152. }
  153. var flag = getCookie( 'status' );
  154. if( flag == false ) return;
  155. // debugger;
  156. base.ajaxFunc('get', '/sys/promptBoxInfo', {}, function(e){
  157. delCookie( 'status' );
  158. if( e.data ) {
  159. var msg = "",
  160. flag = true;
  161. for( var i in e.data ) {
  162. msg += e.data[i] + '<br />';
  163. flag = false;
  164. }
  165. if( flag ) return;
  166. var $html = $('<div class="PromptDiv"><div class="PromptDiv-title"><span class="close-span">×</span>提示消息</div><div class="PromptDiv-content">' + msg + '</div></div>');
  167. $('body').append($html);
  168. $html.slideDown(600);
  169. $('.close-span').off().on('click',function(e){
  170. e.preventDefault();
  171. $html.slideUp(600);
  172. })
  173. }
  174. })
  175. });
  176. </script>
  177. </head>
  178. <body>
  179. <div class="tool-wrap">
  180. <div class="tool">
  181. <span><a class="collection" style="cursor: pointer;">收藏</a></span>
  182. <span class="emp-item" style="position: relative;">
  183. <span class="emp-name"><a href="#"></a></span>
  184. <div class="albumn username-div">
  185. <!--
  186. <a class="to-do" href="/pages/toDo/index.html">代办事项<i>1</i></a>
  187. |-->
  188. <img id="avator-img" src="">
  189. <!-- /img/albumn.png -->
  190. <a href="/updateuserInfo.html" id="username" class="username"></a>
  191. |
  192. <a href="/password.html">修改密码</a>
  193. |
  194. <a href="/sys/logout">退出</a>
  195. <!-- <span class="albumn-arrow"></span>
  196. <div class="logout-div">
  197. <a href="/sys/logout">退出</a>
  198. </div> -->
  199. </div>
  200. </span>
  201. </div>
  202. </div>
  203. <div class="logo-wrap">
  204. <div class="logo">
  205. <img src="/img/logo.png" alt="logo">
  206. </div>
  207. </div>
  208. <div class="nav-wrap">
  209. <div class="nav" >
  210. <ul id="head-nav-ul">
  211. </ul>
  212. </div>
  213. </div>