Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/tousseImage.jsp =================================================================== diff -u -r27635 -r27639 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/tousseImage.jsp (.../tousseImage.jsp) (revision 27635) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/tousseImage.jsp (.../tousseImage.jsp) (revision 27639) @@ -175,10 +175,15 @@ currentTypeMap[imageType] = {count:amount,page:1,objId:objId,imageType:imageType}; currentType = imageType;//器械包图片 var imgUrl; + if(parentImgName == '器械包装配教学图片'){ - imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+objId+'&page='+number+'&imageType='+parentImgName+'&originalImg=true'; + if(td == undefined || td == ''){ + imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+objId+'&page='+number+'&imageType='+encodeURIComponent(parentImgName)+'&originalImg=true'; + }else { + imgUrl = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + objId + '&imageType=' + encodeURIComponent(imageType) + '&page=' + number; + } }else { - imgUrl = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + objId + '&imageType=' + imageType + '&page=' + number +'&time='+new Date().getTime(); + imgUrl = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + objId + '&imageType=' + encodeURIComponent(imageType) + '&page=' + number; } document.getElementById('tousseOrMaterialImage').src = imgUrl; var img = new Image(); @@ -194,8 +199,8 @@ }); }else { $('#tousseOrMaterialImage').css({ - width:divWidth, - height:img.height*(divWidth/img.width) + width:'auto', + height:'auto' }); } }else { @@ -206,8 +211,8 @@ }); }else { $('#tousseOrMaterialImage').css({ - width:img.width*(divHeight/img.height), - height:divHeight + width:'auto', + height:'auto' }); } } @@ -238,11 +243,42 @@ } var imgUrl; if(parentImgName == '器械包装配教学图片'){ - imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+cur.objId+'&page='+cur.page+'&imageType='+parentImgName+'&originalImg=true'; + imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+cur.objId+'&page='+cur.page+'&imageType='+encodeURIComponent(parentImgName)+'&originalImg=true'; }else { - imgUrl = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + cur.objId + '&imageType=' + cur.imageType + '&page=' + cur.page +'&time='+new Date().getTime(); + imgUrl = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + cur.objId + '&imageType=' +encodeURIComponent(cur.imageType) + '&page=' + cur.page; } 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:'auto', + height:'auto' + }); + } + }else { + if(img.height > divHeight){ + $('#tousseOrMaterialImage').css({ + width:'auto', + height:'100%' + }); + }else { + $('#tousseOrMaterialImage').css({ + width:'auto', + height:'auto' + }); + } + } + } } function prevPage(){ if(isUndefinedOrNullOrEmpty(currentType)){ @@ -261,11 +297,42 @@ } var imgUrl; if(parentImgName == '器械包装配教学图片'){ - imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+cur.objId+'&page='+cur.page+'&imageType='+parentImgName+'&originalImg=true'; + imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+cur.objId+'&page='+cur.page+'&imageType='+encodeURIComponent(parentImgName)+'&originalImg=true'; }else { - imgUrl = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + cur.objId + '&imageType=' + cur.imageType + '&page=' + cur.page +'&time='+new Date().getTime(); + imgUrl = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + cur.objId + '&imageType=' + encodeURIComponent(cur.imageType) + '&page=' + cur.page; } 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:'auto', + height:'auto' + }); + } + }else { + if(img.height > divHeight){ + $('#tousseOrMaterialImage').css({ + width:'auto', + height:'100%' + }); + }else { + $('#tousseOrMaterialImage').css({ + width:'auto', + height:'auto' + }); + } + } + } } /** * 图片放大 Index: ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js =================================================================== diff -u -r27635 -r27639 --- ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 27635) +++ ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 27639) @@ -2118,9 +2118,9 @@ function loadGoodsImage(tousseName,type,materialId,currentPage,vedioName,td_id,imgName){ var url; if(imgName == '器械包装配教学图片'){ - url = WWWROOT+'/disinfectSystem/packingAction!getImage.do?id='+td_id+'&page='+currentPage+'&imageType='+imgName+'&originalImg=true'; + url = WWWROOT+'/disinfectSystem/packingAction!getImage.do?id='+td_id+'&page='+currentPage+'&imageType='+encodeURIComponent(imgName)+'&originalImg=true'; }else { - url = WWWROOT + "/disinfectSystem/baseData/showImageAction!getToussePic.do?imageType=" + type +'&materialId='+materialId+'&tousseId='+td_id+'&page='+currentPage + '&name='+encodeURIComponent(tousseName); + url = WWWROOT + "/disinfectSystem/baseData/showImageAction!getToussePic.do?imageType=" + encodeURIComponent(type) +'&materialId='+materialId+'&tousseId='+td_id+'&page='+currentPage + '&name='+encodeURIComponent(tousseName); } Ext4.getCmp('imageName').setText(tousseName); Ext4.getCmp('imageType').setValue(type);