perform.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /**
  2. *
  3. */
  4. var basePath;
  5. var company_code;
  6. var V_LOGINNAME;
  7. var V_PASSWORD;
  8. var theme;
  9. var menuidx = 'm1';
  10. var body_resize = function() {
  11. $("#proform_bg_mm").css('display','none');
  12. if($(document).innerWidth()>=1370){
  13. $("#proform_bg_tm").css('display','block');
  14. $("#proform_bg_tm").css('width',($(document).innerWidth()-1370)+'px');
  15. $("#proform_bg_bm").css('display','block');
  16. $("#proform_bg_bm").css('width',($(document).innerWidth()-1370)+'px');
  17. }else{
  18. $("#proform_bg_tm").css('display','none');
  19. $("#proform_bg_bm").css('display','none');
  20. }
  21. if($(document).innerHeight()>=922){
  22. $("#proform_bg_ml").css('display','block');
  23. $("#proform_bg_mr").css('display','block');
  24. $("#proform_bg_ml").css('height',($(document).innerHeight()-922)+'px');
  25. $("#proform_bg_mr").css('height',($(document).innerHeight()-922)+'px');
  26. if($(document).innerWidth()>=1370){
  27. $("#proform_bg_mm").css('display','block');
  28. $("#proform_bg_mm").css('height',($(document).innerHeight()-922)+'px');
  29. $("#proform_bg_mm").css('width',($(document).innerWidth()-1370)+'px');
  30. }
  31. }else{
  32. $("#proform_bg_ml").css('display','none');
  33. $("#proform_bg_mr").css('display','none');
  34. }
  35. $("#main_page").css('width',($(document).innerWidth()-449)+'px');
  36. $("#main_page").css('height',($(document).innerHeight()-208)+'px');
  37. }
  38. var mouseon = function(obj){
  39. var id = obj.id;
  40. $("#"+id).removeClass(id);
  41. $("#"+id).addClass(id+'_on');
  42. }
  43. var mouseoff = function(obj){
  44. var mid = "proform_";
  45. // var id = obj.id;
  46. // $("#"+id).removeClass(id+'_on');
  47. // $("#"+id).addClass(id);
  48. for(var i=1;i<5;i++){
  49. var id = "proform5zx_menu_"+i;
  50. $("#"+id).removeClass(id+'_on');
  51. $("#"+id).addClass(id);
  52. }
  53. if(menuidx=='m1')
  54. mid += 'menu_1';
  55. else if(menuidx=='m2')
  56. mid += 'menu_2';
  57. else if(menuidx=='m3')
  58. mid += 'menu_3';
  59. else if(menuidx=='m4')
  60. mid += 'menu_4';
  61. $("#"+mid).removeClass(mid);
  62. $("#"+mid).addClass(mid+'_on');
  63. }
  64. var menu_click = function(obj){
  65. var id = obj.id;
  66. if(id=='proform5zx_menu_1'){
  67. menuidx = 'm1';
  68. show_page();
  69. }
  70. else if(id=='proform5zx_menu_2'){
  71. menuidx = 'm2';
  72. show_page();
  73. }
  74. else if(id=='proform5zx_menu_3'){
  75. menuidx = 'm3';
  76. show_page();
  77. }
  78. else if(id=='proform5zx_menu_4'){
  79. menuidx = 'm4';
  80. show_page();
  81. }
  82. }
  83. var show_page = function(){
  84. var mid = "proform5zx_";
  85. var div = document.getElementById('main_page');
  86. if(menuidx=='m1'){
  87. mid += 'menu_1';
  88. try{
  89. div.innerHTML='<iframe frameborder=0 width="100%" height="100%" allowtransparency="true" scrolling=auto src="'+basePath+'view/pzb/index.jsp?theme='+theme+($("#company_code").val().length>0?('&company_code='+$("#company_code").val()):'')+'"></iframe>';
  90. // div.innerHTML='<iframe frameborder=0 width="100%" height="100%" allowtransparency="true" scrolling=auto src="'+basePath+'view/checkrecord/index.jsp?theme='+theme+($("#company_code").val().length>0?('&company_code='+$("#company_code").val()):'')+'"></iframe>';
  91. }catch(e){}
  92. }else if(menuidx=='m2'){
  93. mid += 'menu_2';
  94. try{
  95. div.innerHTML='<iframe frameborder=0 width="100%" height="100%" allowtransparency="true" scrolling=auto src="'+basePath+'view/companyxx/index.jsp?theme='+theme+($("#company_code").val().length>0?('&company_code='+$("#company_code").val()):'')+'"></iframe>';
  96. // div.innerHTML='<iframe frameborder=0 width="100%" height="100%" allowtransparency="true" scrolling=auto src="'+basePath+'view/patrolplan/index.jsp?theme='+theme+($("#company_code").val().length>0?('&company_code='+$("#company_code").val()):'')+'"></iframe>';
  97. }catch(e){}
  98. }else if(menuidx=='m3'){
  99. mid += 'menu_3';
  100. try{
  101. div.innerHTML='<iframe frameborder=0 width="100%" height="100%" allowtransparency="true" scrolling=auto src="'+basePath+'view/czjl/index.jsp?theme='+theme+($("#company_code").val().length>0?('&company_code='+$("#company_code").val()):'')+'"></iframe>';
  102. // div.innerHTML='<iframe frameborder=0 width="100%" height="100%" allowtransparency="true" scrolling=auto src="'+basePath+'view/inspectors/index.jsp?theme='+theme+($("#company_code").val().length>0?('&company_code='+$("#company_code").val()):'')+'"></iframe>';
  103. }catch(e){}
  104. }
  105. else if(menuidx=='m4'){
  106. mid += 'menu_4';
  107. try{
  108. div.innerHTML='<iframe frameborder=0 width="100%" height="100%" allowtransparency="true" scrolling=auto src="'+basePath+'view/xhxx/index.jsp?theme='+theme+($("#company_code").val().length>0?('&company_code='+$("#company_code").val()):'')+'"></iframe>';
  109. // div.innerHTML='<iframe frameborder=0 width="100%" height="100%" allowtransparency="true" scrolling=auto src="'+basePath+'view/patrolpoint/index.jsp?theme='+theme+($("#company_code").val().length>0?('&company_code='+$("#company_code").val()):'')+'"></iframe>';
  110. }catch(e){}
  111. }
  112. for(var i=1;i<5;i++){
  113. var id = "proform5zx_menu_"+i;
  114. $("#"+id).removeClass(id+'_on');
  115. $("#"+id).addClass(id);
  116. }
  117. $("#"+mid).removeClass(mid);
  118. $("#"+mid).addClass(mid+'_on');
  119. }
  120. Ext.onReady(function(){
  121. basePath = $("#basePath").val();
  122. $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
  123. $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
  124. V_LOGINNAME = $("#V_LOGINNAME").val();
  125. V_PASSWORD = $("#V_PASSWORD").val();
  126. company_code = $("#company_code").val();
  127. theme = $("#theme").val();
  128. $(window).resize(function(){
  129. body_resize();
  130. });
  131. body_resize();
  132. show_page();
  133. });