perform.js 4.7 KB

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