main.jsp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <%@page import="com.uas.erp.model.Master"%>
  2. <%@page import="com.uas.erp.model.Employee"%>
  3. <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
  4. <%
  5. String path = request.getContextPath();
  6. String basePath = request.getScheme() + "://"
  7. + request.getServerName() + ":" + request.getServerPort()
  8. + path + "/";
  9. %>
  10. <!DOCTYPE html>
  11. <html>
  12. <head>
  13. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  14. <title>优软ERP主页</title>
  15. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
  16. <meta name="format-detection" content="telephone=no">
  17. <meta name="apple-mobile-web-app-capable" content="yes">
  18. <meta name="apple-mobile-web-app-status-bar-style" content="default">
  19. <meta name="msapplication-tap-highlight" content="no" />
  20. <link rel="stylesheet" href="<%=basePath%>resource/ext/resources/css/ext-all-gray.css" type="text/css" />
  21. <link rel="stylesheet" href="<%=basePath%>jsps/mobile/main.css" type="text/css" />
  22. <script type="text/javascript">
  23. var basePath = (function() {
  24. var fullPath = window.document.location.href;
  25. var path = window.document.location.pathname;
  26. var subpos = fullPath.indexOf('//');
  27. var subpath = subpos > -1 ? fullPath.substring(0, subpos + 2) : '';
  28. if (subpos > -1)
  29. fullPath = fullPath.substring(subpos + 2);
  30. var pos = fullPath.indexOf(path), sname = path.substring(0, path.substr(1).indexOf('/') + 1);
  31. return subpath + fullPath.substring(0, pos) + (sname == '/ERP' ? '/ERP/' : '/');
  32. })();
  33. </script>
  34. </head>
  35. <body>
  36. <div id="loading">加载中...</div>
  37. </body>
  38. <script type="text/javascript" src="<%=basePath%>resource/ext/ext-all.js"></script>
  39. <script type="text/javascript">
  40. var em_name = '<%=session.getAttribute("em_name")%>';
  41. var em_uu = '<%=session.getAttribute("em_uu")%>';
  42. var en_uu = '<%=session.getAttribute("en_uu")%>';
  43. var em_code = '<%=session.getAttribute("em_code")%>';
  44. Ext.Loader.setConfig({
  45. enabled: true
  46. });
  47. Ext.application({
  48. name: 'erp',
  49. appFolder: basePath + 'app',
  50. controllers : [ 'mobile.Main' ],
  51. launch : function() {
  52. Ext.create('erp.view.mobile.Main');
  53. }
  54. });
  55. </script>
  56. <script>
  57. <%
  58. Object obj = session.getAttribute("employee");
  59. String sob = "";
  60. String sobText = "";
  61. if(obj != null) {
  62. Employee employee = (Employee)obj;
  63. sob = employee.getEm_master();
  64. Master master = employee.getCurrentMaster();
  65. if(master != null)
  66. sobText = master.getMa_function();
  67. }
  68. %>
  69. var sob = '<%=sob%>';
  70. var sobText = '<%=sobText%>';
  71. </script>
  72. </html>