Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/updateAmount.jsp =================================================================== diff -u -r28950 -r29346 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/updateAmount.jsp (.../updateAmount.jsp) (revision 28950) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/updateAmount.jsp (.../updateAmount.jsp) (revision 29346) @@ -169,7 +169,114 @@ }else{ el.style.display='none'; } - } + } + + function isIE(value) { + var vals = value || ''; + if(!!window.ActiveXObject || "ActiveXObject" in window){ + if(vals !== ''){ + var DEFAULT_VERSION = 8.0; + var ua = navigator.userAgent.toLowerCase(); + var safariVersion = ua.match(/msie ([\d.]+)/) || ''; + if(safariVersion == ''){ + return false; + } + if(safariVersion[1] <= DEFAULT_VERSION ){ + return true; + }else { + return false; + } + } + + return true; + }else{ + return false; +    } + } + + function ChangeRatio(type){ + var ratio=0; + var screen=window.screen; + var ua=navigator.userAgent.toLowerCase(); + + if(window.devicePixelRatio !== undefined){ + ratio=window.devicePixelRatio; + }else if(~ua.indexOf('msie')){ + if(screen.deviceXDPI && screen.logicalXDPI) + { + ratio=screen.deviceXDPI/screen.logicalXDPI; + } + }else if(window.outerWidth !== undefined && window.innerWidth !== undefined){ + ratio=window.outerWidth/window.innerWidth; + } + + if(ratio){ + ratio=Math.round(ratio*100); + } + + var value; + if(type == 'width'){ + var width = window.screen.width; + if(isIE()){ + value = width*ratio/100; + }else { + value = width; + } + }else { + var height = window.screen.height; + if(isIE()){ + value = height*ratio/100; + }else { + value = height; + } + } + + return parseInt(value); + } + + $(document).ready(function(){ + var screenWidth = ChangeRatio('width'); + var screenHeight = ChangeRatio('height'); + if(screenWidth < 1030){ + if(!isIE()){ + document.getElementsByTagName('body')[0].style.zoom = 0.6; + }else { + document.getElementsByTagName('body')[0].style.zoom = 0.65; + document.getElementsByTagName('body')[0].getElementsByTagName('div')[0].style.width = '700px'; + } + }else if(screenWidth>1270 && screenWidth<1300){ + if(screenHeight<730){ + if(!isIE()){ + document.getElementsByTagName('body')[0].style.zoom = 0.7; + }else { + document.getElementsByTagName('body')[0].style.zoom = 0.88; + document.getElementsByTagName('body')[0].getElementsByTagName('div')[0].style.width = '700px'; + } + }else { + if(!isIE()){ + document.getElementsByTagName('body')[0].style.zoom = 0.75; + }else { + document.getElementsByTagName('body')[0].style.zoom = 0.88; + document.getElementsByTagName('body')[0].getElementsByTagName('div')[0].style.width = '700px'; + } + } + }else if(screenWidth>1350 && screenWidth<1370){ + if(!isIE()){ + document.getElementsByTagName('body')[0].style.zoom = 0.75; + }else { + document.getElementsByTagName('body')[0].style.zoom = 0.88; + document.getElementsByTagName('body')[0].getElementsByTagName('div')[0].style.width = '700px'; + } + }else if(screenWidth>1390 && screenWidth<1450){ + if(!isIE()){ + document.getElementsByTagName('body')[0].style.zoom = 0.85; + } + }else if(screenWidth>1590 && screenWidth<1610){ + if(!isIE()){ + document.getElementsByTagName('body')[0].style.zoom = 0.9; + } + } + }) Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js =================================================================== diff -u -r29334 -r29346 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 29334) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 29346) @@ -2378,15 +2378,15 @@ offsetLeft = ((clientWidth-width)/2)+'px'; } - var url = 'disinfectionTousseItems.jsp?resolution='+resolution+'&row='+row+'&tousseDefinitionID='+tousseDefinitionID+'&materials='+encodeURIComponent(materials); + var url = 'disinfectionTousseItems.jsp?resolution='+resolution+'&row='+row+'&tousseDefinitionID='+tousseDefinitionID+'&materials='+encodeURIComponent(materials)+'&width='+width+'&height='+height; if(isIE(8)){ openNewSizeWindow(url,'消毒物品明细',width,height); }else { layerIndex=layer.open({ type : 2, title : ['消毒物品明细',true], - content : 'disinfectionTousseItems.jsp?resolution='+resolution+'&row='+row+'&tousseDefinitionID='+tousseDefinitionID+'&materials='+encodeURIComponent(materials), + content : 'disinfectionTousseItems.jsp?resolution='+resolution+'&row='+row+'&tousseDefinitionID='+tousseDefinitionID+'&materials='+encodeURIComponent(materials)+'&width='+width+'&height='+height, area : [ width + 'px' , height + 'px'], border : [5, 0.3, '#fff', true], closeBtn : [2 , true], Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/disinfectionTousseItems.jsp =================================================================== diff -u -r28022 -r29346 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/disinfectionTousseItems.jsp (.../disinfectionTousseItems.jsp) (revision 28022) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/disinfectionTousseItems.jsp (.../disinfectionTousseItems.jsp) (revision 29346) @@ -23,6 +23,8 @@ var tousseDefinitionID = '${param.tousseDefinitionID}'; var row = '${param.row}'; var materials = '${param.materials}'; +var boxWidth = '${param.width}'; +var boxHeight = '${param.height}'; //动态加载JS和CSS document.write(''); function add(column){ @@ -152,21 +154,82 @@ }); } +function ChangeRatio(type){ + var ratio=0; + var screen=window.screen; + var ua=navigator.userAgent.toLowerCase(); + + if(window.devicePixelRatio !== undefined){ + ratio=window.devicePixelRatio; + }else if(~ua.indexOf('msie')){ + if(screen.deviceXDPI && screen.logicalXDPI) + { + ratio=screen.deviceXDPI/screen.logicalXDPI; + } + }else if(window.outerWidth !== undefined && window.innerWidth !== undefined){ + ratio=window.outerWidth/window.innerWidth; + } + + if(ratio){ + ratio=Math.round(ratio*100); + } + + var value; + if(type == 'width'){ + var width = window.screen.width; + if(isIE()){ + value = width*ratio/100; + }else { + value = width; + } + }else { + var height = window.screen.height; + if(isIE()){ + value = height*ratio/100; + }else { + value = height; + } + } + + return parseInt(value); + } + var openElement; function openUpdateAmount(obj,row){ obj.blur(); var width = 750; var height = 400; openElement = obj; - + var offsetTop = ((boxHeight-height)/2)+'px'; + if(isIE()){ + var screenWidth = ChangeRatio('width'); + var screenHeight = ChangeRatio('height'); + if(screenWidth < 1030){ + width = width*0.6; + height = height*0.6; + offsetTop = ((boxHeight-height)/2)+'px'; + }else if(screenWidth>1270 && screenWidth<1300){ + width = width*0.8; + height = height*0.8; + offsetTop = ((boxHeight-height)/2)+'px'; + }else if(screenWidth>1350 && screenWidth<1370){ + width = width*0.8; + height = height*0.8; + offsetTop = ((boxHeight-height)/2)+'px'; + }else if(screenWidth>1390){ + width = width*0.9; + height = height*0.9; + offsetTop = ((boxHeight-height)/2)+'px'; + } + } $.layer({ type : 2, title : ['修改数量',true], iframe : {src : 'updateAmount.jsp?resolution=1980&from=errors&row='+row}, area : [width + 'px' , height + 'px'], border : [5, 0.3, '#fff', true], closeBtn : [2 , true], - offset : ['250px',''] + offset : [offsetTop,''] }); }