Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/tousseImage.jsp =================================================================== diff -u -r27632 -r27635 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/tousseImage.jsp (.../tousseImage.jsp) (revision 27632) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/tousseImage.jsp (.../tousseImage.jsp) (revision 27635) @@ -27,6 +27,7 @@ var clientHeight = '${param.clientHeight}'; var parentPageName = '${param.parentPageName}'; var parentMaterialId = '${param.materialId}'; +var parentImgName = '${param.imgName}'; //动态加载JS和CSS document.write(''); @@ -172,8 +173,45 @@ amount = 1; } currentTypeMap[imageType] = {count:amount,page:1,objId:objId,imageType:imageType}; - currentType = imageType;//器械包图片 - document.getElementById('tousseOrMaterialImage').src = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + objId + '&imageType=' + imageType + '&page=' + number +'&time='+new Date().getTime(); + currentType = imageType;//器械包图片 + var imgUrl; + if(parentImgName == '器械包装配教学图片'){ + imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+objId+'&page='+number+'&imageType='+parentImgName+'&originalImg=true'; + }else { + imgUrl = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + objId + '&imageType=' + imageType + '&page=' + number +'&time='+new Date().getTime(); + } + document.getElementById('tousseOrMaterialImage').src = imgUrl; + var img = new Image(); + img.src = imgUrl; + img.onload =function(){ + var divWidth = $('#tousseOrMaterialImageDiv').width(); + var divHeight = $('#tousseOrMaterialImageDiv').height(); + if(img.width > img.height){ + if(img.width > divWidth){ + $('#tousseOrMaterialImage').css({ + width:'100%', + height:'auto' + }); + }else { + $('#tousseOrMaterialImage').css({ + width:divWidth, + height:img.height*(divWidth/img.width) + }); + } + }else { + if(img.height > divHeight){ + $('#tousseOrMaterialImage').css({ + width:'auto', + height:'100%' + }); + }else { + $('#tousseOrMaterialImage').css({ + width:img.width*(divHeight/img.height), + height:divHeight + }); + } + } + } }, error:function(XMLHttpRequest, textStatus, errorThrown){ } @@ -198,7 +236,13 @@ }else{ cur.page = parseInt(cur.page) + 1; } - document.getElementById('tousseOrMaterialImage').src = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + cur.objId + '&imageType=' + cur.imageType + '&page=' + cur.page +'&time='+new Date().getTime(); + var imgUrl; + if(parentImgName == '器械包装配教学图片'){ + imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+cur.objId+'&page='+cur.page+'&imageType='+parentImgName+'&originalImg=true'; + }else { + imgUrl = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + cur.objId + '&imageType=' + cur.imageType + '&page=' + cur.page +'&time='+new Date().getTime(); + } + document.getElementById('tousseOrMaterialImage').src = imgUrl; } function prevPage(){ if(isUndefinedOrNullOrEmpty(currentType)){ @@ -215,7 +259,13 @@ }else{ cur.page = parseInt(cur.page) - 1; } - document.getElementById('tousseOrMaterialImage').src = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + cur.objId + '&imageType=' + cur.imageType + '&page=' + cur.page +'&time='+new Date().getTime(); + var imgUrl; + if(parentImgName == '器械包装配教学图片'){ + imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+cur.objId+'&page='+cur.page+'&imageType='+parentImgName+'&originalImg=true'; + }else { + imgUrl = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + cur.objId + '&imageType=' + cur.imageType + '&page=' + cur.page +'&time='+new Date().getTime(); + } + document.getElementById('tousseOrMaterialImage').src = imgUrl; } /** * 图片放大 @@ -558,8 +608,8 @@ 查看包图片 -