Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/tousseImage.jsp =================================================================== diff -u -r27648 -r27654 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/tousseImage.jsp (.../tousseImage.jsp) (revision 27648) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/tousseImage.jsp (.../tousseImage.jsp) (revision 27654) @@ -161,25 +161,24 @@ } var currentType = ''; var currentTypeMap = {}; -function loadImage(objId,imageType,td,imgName){ - var type = (imgName == '器械包装配教学图片')?imgName:imageType +function loadImage(objId,imageType,td){ $.ajax({ type:'post', url:'${ctx}/disinfectSystem/baseData/showImageAction!getToussePictureAmount.do', - data:{id:objId,imageType:type,time:new Date().getTime()}, + data:{id:objId,imageType:imageType,time:new Date().getTime()}, dataType:'json', success:function(msg){ var amount = msg.count; if(amount <=0){ amount = 1; } - currentTypeMap[type] = {count:amount,page:1,objId:objId,imageType:type}; - currentType = type;//器械包图片 + currentTypeMap[imageType] = {count:amount,page:1,objId:objId,imageType:imageType}; + currentType = imageType;//器械包图片 var imgUrl; - if(imgName == '器械包装配教学图片'){ + if(imageType == '器械包装配教学图片'){ if(td == undefined || td == ''){ - imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+objId+'&page='+number+'&imageType='+encodeURIComponent(parentImgName)+'&originalImg=true'; + imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+objId+'&page='+number+'&imageType='+encodeURIComponent(imageType)+'&originalImg=true'; }else { imgUrl = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + objId + '&imageType=' + encodeURIComponent(imageType) + '&page=' + number; } @@ -221,7 +220,8 @@ $('#tousseOrMaterialImage').css({ left:'auto', - top:'auto' + top:'auto', + position:'static' }) }, error:function(XMLHttpRequest, textStatus, errorThrown){ @@ -237,7 +237,6 @@ jShowResult('请先选择要显示的内容'); return; } - var imgNameValue = $('#imgNameValue').val(); var cur = currentTypeMap[currentType]; if(isUndefinedOrNull(cur)){ jShowResult('要显示的内容不存在'); @@ -249,8 +248,8 @@ cur.page = parseInt(cur.page) + 1; } var imgUrl; - if(imgNameValue == '器械包装配教学图片'){ - imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+cur.objId+'&page='+cur.page+'&imageType='+encodeURIComponent(parentImgName)+'&originalImg=true'; + if(currentType == '器械包装配教学图片'){ + imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+cur.objId+'&page='+cur.page+'&imageType='+encodeURIComponent(currentType)+'&originalImg=true'; }else { imgUrl = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + cur.objId + '&imageType=' +encodeURIComponent(cur.imageType) + '&page=' + cur.page; } @@ -289,15 +288,15 @@ $('#tousseOrMaterialImage').css({ left:'auto', - top:'auto' + top:'auto', + position:'static' }) } function prevPage(){ if(isUndefinedOrNullOrEmpty(currentType)){ jShowResult('请先选择要显示的内容'); return; } - var imgNameValue = $('#imgNameValue').val(); var cur = currentTypeMap[currentType]; if(isUndefinedOrNull(cur)){ jShowResult('要显示的内容不存在'); @@ -309,8 +308,8 @@ cur.page = parseInt(cur.page) - 1; } var imgUrl; - if(imgNameValue == '器械包装配教学图片'){ - imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+cur.objId+'&page='+cur.page+'&imageType='+encodeURIComponent(parentImgName)+'&originalImg=true'; + if(currentType == '器械包装配教学图片'){ + imgUrl = '${ctx}/disinfectSystem/packingAction!getImage.do?id='+cur.objId+'&page='+cur.page+'&imageType='+encodeURIComponent(currentType)+'&originalImg=true'; }else { imgUrl = '${ctx}/disinfectSystem/baseData/showImageAction!getToussePic.do?id=' + cur.objId + '&imageType=' + encodeURIComponent(cur.imageType) + '&page=' + cur.page; } @@ -394,6 +393,7 @@ box.style.left = x + 'px'; box.style.top = y + 'px'; + box.style.position = 'absolute'; } // 图形移出父盒子取消移动事件,防止移动过快触发鼠标移出事件,导致鼠标弹起事件失效 fa.onmouseleave = function () { @@ -465,14 +465,13 @@ }); } //加载器械包图片 -function loadTousseImage(imgName){ +function loadTousseImage(){ loadTousseBagNotice(); - $('#imgNameValue').val(imgName); if(isUndefinedOrNullOrEmpty(tousseDefinitionID)){ return; } var imageType = '<%=ImageFile.IMAGE_TYPE_TOUSSE%>'; - loadImage(tousseDefinitionID,imageType,'',imgName); + loadImage(tousseDefinitionID,imageType,''); jQuery("#materialTable tr").css("background","#FFFFFF"); } function getMaterialNameWithAmount(that){ @@ -523,8 +522,15 @@ } }); }else { - var imgName = parentImgName || ''; - loadTousseImage(imgName); + if(parentImgName == '器械包装配教学图片'){ + onPackingTeachClick(); + }else if(parentImgName == '器械包说明书'){ + onInstructionBookClick(); + }else if(parentImgName == '清洗操作指引图片'){ + onOperationGuideClick(); + }else { + loadTousseImage(); + } } getTousseMaterial(); }else{ @@ -717,7 +723,6 @@ -
Index: ssts-web/src/main/webapp/disinfectsystem/packing/tousesPackingTeachingImage.js =================================================================== diff -u -r27640 -r27654 --- ssts-web/src/main/webapp/disinfectsystem/packing/tousesPackingTeachingImage.js (.../tousesPackingTeachingImage.js) (revision 27640) +++ ssts-web/src/main/webapp/disinfectsystem/packing/tousesPackingTeachingImage.js (.../tousesPackingTeachingImage.js) (revision 27654) @@ -7,101 +7,20 @@ } loadToussePackingTeachingImage(lastLoadObj.tousseName,lastLoadObj.td_id,lastLoadObj.imgType,lastLoadObj.currentPage,""); } -function loadToussePackingTeachingImage(tousseName,td_id,imgType,currentPage,imgId){ - lastLoadObj = { - tousseName: tousseName, - td_id: td_id, - imgType: imgType, - currentPage: currentPage +function loadToussePackingTeachingImage(tousseName,td_id,imgType,page,pageName){ + var tousseName = tousseName; + var tousseDefinitionID = td_id; + var currentPage = page; + var iframeHeight = window.screen.height; + var parentPageName; + if(imgType == '器械包装配教学图片'){ + parentPageName = 'packingView'; + }else { + parentPageName = ''; } - - var url = ""; - var viewOriginalImg_url = ""; - var title = ""; - if(imgId){//器械包定义 - url = WWWROOT + "/disinfectSystem/baseData/showImageAction!getToussePic.do?imageType=" + encodeURIComponent(imgType) +'&id='+td_id+'&page='+currentPage+'&isOriginalPic=true'; - viewOriginalImg_url = WWWROOT + "/disinfectSystem/baseData/showImageAction!getToussePic.do?imageType=" + encodeURIComponent(imgType) +'&id='+td_id+'&page='+currentPage; - }else{//装配 - url = WWWROOT + '/disinfectSystem/packingAction!getImage.do?id=' + td_id + '&page=' + currentPage +'&imageType='+encodeURIComponent(imgType); - viewOriginalImg_url = WWWROOT + '/disinfectSystem/packingAction!getImage.do?id=' + td_id + '&page=' + currentPage +'&imageType='+encodeURIComponent(imgType)+'&originalImg=true' ; - title = '双击预览图片'; - } + var url = WWWROOT+'/disinfectsystem/touchScreen/recycle/tousseImage.jsp?resolution=1980&clientHeight='+iframeHeight+'&parentPageName='+parentPageName+'w&tousseDefinitionID='+tousseDefinitionID+'&tousseName='+encodeURIComponent(tousseName)+'&imgName='+encodeURIComponent(imgName)+'&number='+currentPage; - Ext4.getCmp('imageName').setText(tousseName); - Ext4.getCmp('imageType').setValue(imgType); - Ext4.getCmp('currentPage').setValue(currentPage); - Ext4.getCmp('materialId').setValue(imgId); - Ext4.getCmp('td_id').setValue(td_id); - - var panel = Ext4.getCmp('imageContentPanel'); - var image = Ext4.getCmp('browseImage'); - panel.remove(image); - - var newImage = Ext4.create('Ext4.Img', { - id : 'browseImage', - fieldLabel : "预览图片", - title:'双击预览图片', - listeners: { - render: function() { - var imgCmp = this; - imgCmp.getEl().on("dblclick" , function(e){ - if(this.el.dom.src && this.el.dom.src != ''){ - showImage(viewOriginalImg_url,tousseName,function(){ - var obj = { - tousseName: tousseName, - td_id: td_id, - imgType: imgType, - currentPage: currentPage - } - showTousseImages_restore(obj); - }); - } - }); - var img = this.imgEl - img.on('load',function(){ - var img = this; - var panel = Ext4.getCmp('imageContentPanel'); - var panelSize = panel.getSize(true); - - var boundaryWidth = panelSize.width; - var boundaryHeight = panelSize.height; - var originalWidth = img.getWidth(); - var originalHeight = img.getHeight(); - var scaledWidth = originalWidth; - var scaledHeight = originalHeight; - var x=0,y=0; - // 计算出合适的大小 - var desScaleYX = boundaryHeight*1.0/boundaryWidth; // 屏幕的高宽比 - var srcScaleYX = originalHeight*1.0/originalWidth; // 图像的高宽比 - if(originalWidth > boundaryWidth || originalHeight > boundaryHeight) - { - // 任何一边大于屏幕时,等比例缩放 - if(srcScaleYX>desScaleYX) - { - scaledHeight = boundaryHeight; - scaledWidth = parseInt(boundaryHeight*1.0/originalHeight*originalWidth);// 保证为2的倍数 - }else - { - scaledWidth = boundaryWidth; - scaledHeight = parseInt(boundaryWidth*1.0/originalWidth*originalHeight); - } - x = (boundaryWidth - scaledWidth)/2; - y = (boundaryHeight - scaledHeight)/2; - }else{ - x = (boundaryWidth - scaledWidth)/2; - y = (boundaryHeight - scaledHeight)/2; - } - imgCmp.setSize(scaledWidth,scaledHeight); - imgCmp.setPosition(x,y); -// Ext.Msg.alert('x='+x+',y='+y+',w='+scaledWidth+',h='+scaledHeight+',bw='+boundaryWidth+',bh='+boundaryHeight); - - }); - } - }, - src : url - }); - - panel.add(newImage); + openFullSizeWindowWithName(url,false,imgType); } function showTousseSpecificationImage(tousseName,td_id){ showTousseImages(tousseName,td_id,imageType_specification); @@ -111,7 +30,7 @@ } function showTousseImages(tousseName,td_id,imgType){ - loadToussePackingTeachingImage(tousseName,td_id,imgType,1,""); + loadToussePackingTeachingImage(tousseName,td_id,imgType,1); } //获取器械包定义图片的行号 Index: ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js =================================================================== diff -u -r27639 -r27654 --- ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 27639) +++ ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 27654) @@ -1171,8 +1171,9 @@ var imageName = Ext4.getCmp('imageName').getText(); var materialId = Ext4.getCmp('materialId').getValue(); if(imageName != "" && materialId == ""){ - var td_id = Ext4.getCmp('td_id').getValue(); - showTousseSpecificationImage(imageName,td_id); + var td_id = Ext4.getCmp('td_id').getValue(); + loadGoodsImage(imageName ,'器械包说明书' ,'',1 ,'' ,td_id); + //showTousseSpecificationImage(imageName,td_id); } } }, @@ -1184,11 +1185,10 @@ hidden : teachingPicture, handler : function(){ var imageName = Ext4.getCmp('imageName').getText(); - var imageType = Ext4.getCmp('imageType').getValue(); var materialId = Ext4.getCmp('materialId').getValue(); if(imageName != "" && materialId == ""){ var td_id = Ext4.getCmp('td_id').getValue(); - loadGoodsImage(imageName ,imageType ,'',1 ,'' ,td_id,'器械包装配教学图片'); + loadGoodsImage(imageName ,'器械包装配教学图片' ,'',1 ,'' ,td_id); //showToussePackingTeachingImage(imageName,td_id); } } @@ -2080,45 +2080,21 @@ var tousseDefinitionID = row.td_id; var currentPage = row.currentPage; var materialId = row.materialId; - var imgName = row.imgName; - var iframeHeight = $('body').height(); - var url = WWWROOT+'/disinfectsystem/touchScreen/recycle/tousseImage.jsp?resolution=1980&clientHeight='+iframeHeight+'&parentPageName=packingView&tousseDefinitionID='+tousseDefinitionID+'&materialId='+materialId+'&tousseName='+encodeURIComponent(tousseName)+'&imgName='+imgName+'&number='+currentPage; - - $.magnificPopup.open({ - items: [{ - src:url, - type :'iframe' - },{ - //只是为了让箭头出现,如果可以有其他办法,这里可以去掉。因为在tousseImage.jsp内部,修改了下一页和上一页的处理 - src: '
永远看不到我
', - type: 'inline' - }], - tClose: '关闭(Esc)', - gallery: { - enabled: true, - tPrev: '上一页 (左箭头)', // Alt text on left arrow - tNext: '下一页 (右箭头)' - }, - image: { - verticalFit: true - }, - type: 'image' // this is default type - }); - var windowScreenH = window.screen.height; - if(windowScreenH == 1080){ - $(".mfp-iframe-scaler iframe").css({"top":"10px","height":"100%"}); - $(".mfp-iframe-holder .mfp-close").css({"top":"12px"}); - }else if(windowScreenH == 1050){ - $(".mfp-iframe-scaler iframe").css({"top":"10px","height":"100%"}); - $(".mfp-iframe-holder .mfp-close").css({"top":"0px"}); - }else{ - $(".mfp-iframe-scaler iframe").css({"top":"10px","height":"100%"}); + var imgName = row.type; + var iframeHeight = window.screen.height; + var parentPageName; + if(imgName == '器械包装配教学图片'){ + parentPageName = 'packingView'; + }else { + parentPageName = ''; } + var url = WWWROOT+'/disinfectsystem/touchScreen/recycle/tousseImage.jsp?resolution=1980&clientHeight='+iframeHeight+'&parentPageName='+parentPageName+'&tousseDefinitionID='+tousseDefinitionID+'&materialId='+materialId+'&tousseName='+encodeURIComponent(tousseName)+'&imgName='+encodeURIComponent(imgName)+'&number='+currentPage; + openFullSizeWindowWithName(url,false,imgName); } -function loadGoodsImage(tousseName,type,materialId,currentPage,vedioName,td_id,imgName){ +function loadGoodsImage(tousseName,type,materialId,currentPage,vedioName,td_id){ var url; - if(imgName == '器械包装配教学图片'){ - url = WWWROOT+'/disinfectSystem/packingAction!getImage.do?id='+td_id+'&page='+currentPage+'&imageType='+encodeURIComponent(imgName)+'&originalImg=true'; + if(type == '器械包装配教学图片'){ + url = WWWROOT+'/disinfectSystem/packingAction!getImage.do?id='+td_id+'&page='+currentPage+'&imageType='+encodeURIComponent(type)+'&originalImg=true'; }else { url = WWWROOT + "/disinfectSystem/baseData/showImageAction!getToussePic.do?imageType=" + encodeURIComponent(type) +'&materialId='+materialId+'&tousseId='+td_id+'&page='+currentPage + '&name='+encodeURIComponent(tousseName); } @@ -2147,8 +2123,7 @@ td_id:td_id, type:type, materialId:materialId, - currentPage:currentPage, - imgName:imgName || '' + currentPage:currentPage } amendDisinfectionTousse(row); //showImage(this.el.dom.src,tousseName);