perform.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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 = "proform2_";
  45. // var id = obj.id;
  46. // $("#"+id).removeClass(id+'_on');
  47. // $("#"+id).addClass(id);
  48. for(var i=1;i<6;i++){
  49. var id = "proform2_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. else if(menuidx=='m5')
  62. mid += 'menu_5';
  63. $("#"+mid).removeClass(mid);
  64. $("#"+mid).addClass(mid+'_on');
  65. }
  66. var menu_click = function(obj){
  67. var id = obj.id;
  68. if(id=='proform2_menu_1'){
  69. menuidx = 'm1';
  70. show_page();
  71. }
  72. else if(id=='proform2_menu_2'){
  73. menuidx = 'm2';
  74. show_page();
  75. }
  76. else if(id=='proform2_menu_3'){
  77. menuidx = 'm3';
  78. show_page();
  79. }
  80. else if(id=='proform2_menu_4'){
  81. menuidx = 'm4';
  82. show_page();
  83. }else if(id=='proform2_menu_5'){
  84. menuidx = 'm5';
  85. show_page();
  86. }
  87. }
  88. var show_page = function(){
  89. var mid = "proform2_";
  90. var div = document.getElementById('main_page');
  91. if(menuidx=='m1'){
  92. mid += 'menu_1';
  93. try{
  94. div.innerHTML='<iframe frameborder=0 width="100%" height="100%" allowtransparency="true" scrolling=auto src="'+basePath+'view/checkrecord2/index.jsp?theme='+theme+($("#company_code").val().length>0?('&company_code='+$("#company_code").val()):'')+'"></iframe>';
  95. }catch(e){}
  96. }else if(menuidx=='m2'){
  97. mid += 'menu_2';
  98. try{
  99. div.innerHTML='<iframe frameborder=0 width="100%" height="100%" allowtransparency="true" scrolling=auto src="'+basePath+'view/maintenanceplan/index.jsp?theme='+theme+($("#company_code").val().length>0?('&company_code='+$("#company_code").val()):'')+'"></iframe>';
  100. }catch(e){}
  101. }else if(menuidx=='m3'){
  102. mid += 'menu_3';
  103. try{
  104. div.innerHTML='<iframe frameborder=0 width="100%" height="100%" allowtransparency="true" scrolling=auto src="'+basePath+'view/maintenanceperson/index.jsp?theme='+theme+($("#company_code").val().length>0?('&company_code='+$("#company_code").val()):'')+'"></iframe>';
  105. }catch(e){}
  106. }else if(menuidx=='m4'){
  107. mid += 'menu_4';
  108. try{
  109. div.innerHTML='<iframe frameborder=0 width="100%" height="100%" allowtransparency="true" scrolling=auto src="'+basePath+'view/maintenance/index.jsp?theme='+theme+($("#company_code").val().length>0?('&company_code='+$("#company_code").val()):'')+'"></iframe>';
  110. }catch(e){}
  111. }else if(menuidx=='m5'){
  112. mid += 'menu_5';
  113. try{
  114. div.innerHTML='<iframe frameborder=0 width="100%" height="100%" allowtransparency="true" scrolling=auto src="'+basePath+'view/patrolAnalysis2/index.jsp?theme='+theme+($("#company_code").val().length>0?('&company_code='+$("#company_code").val()):'')+'"></iframe>';
  115. }catch(e){}
  116. }
  117. for(var i=1;i<6;i++){
  118. var id = "proform2_menu_"+i;
  119. $("#"+id).removeClass(id+'_on');
  120. $("#"+id).addClass(id);
  121. }
  122. $("#"+mid).removeClass(mid);
  123. $("#"+mid).addClass(mid+'_on');
  124. }
  125. Ext.onReady(function(){
  126. basePath = $("#basePath").val();
  127. $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
  128. $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
  129. V_LOGINNAME = $("#V_LOGINNAME").val();
  130. V_PASSWORD = $("#V_PASSWORD").val();
  131. company_code = $("#company_code").val();
  132. theme = $("#theme").val();
  133. $(window).resize(function(){
  134. body_resize();
  135. });
  136. body_resize();
  137. show_page();
  138. });