Index: ssts-web/src/main/webapp/disinfectsystem/packing/tousesPackingTeachingImage.js =================================================================== diff -u -r27099 -r27630 --- ssts-web/src/main/webapp/disinfectsystem/packing/tousesPackingTeachingImage.js (.../tousesPackingTeachingImage.js) (revision 27099) +++ ssts-web/src/main/webapp/disinfectsystem/packing/tousesPackingTeachingImage.js (.../tousesPackingTeachingImage.js) (revision 27630) @@ -9,68 +9,58 @@ } function loadToussePackingTeachingImage(tousseName,td_id,imgType,currentPage,imgId){ lastLoadObj = { - tousseName: tousseName, - td_id: td_id, - imgType: imgType, - currentPage: currentPage + tousseName: tousseName, + td_id: td_id, + imgType: imgType, + currentPage: currentPage } - var viewOriginalImgPressed = top.Ext4.getCmp('pt_view_originalImg').pressed; var url = ""; var viewOriginalImg_url = ""; var title = ""; if(imgId){//器械包定义 url = WWWROOT + "/disinfectSystem/baseData/showImageAction!getToussePic.do?imageType=" + imgType +'&id='+td_id+'&page='+currentPage+'&isOriginalPic=true'; viewOriginalImg_url = WWWROOT + "/disinfectSystem/baseData/showImageAction!getToussePic.do?imageType=" + imgType +'&id='+td_id+'&page='+currentPage; }else{//装配 - url = WWWROOT + '/disinfectSystem/packingAction!getImage.do?id=' + td_id + '&page=' + currentPage +'&imageType='+imgType+'&originalImg='+viewOriginalImgPressed; + url = WWWROOT + '/disinfectSystem/packingAction!getImage.do?id=' + td_id + '&page=' + currentPage +'&imageType='+imgType; viewOriginalImg_url = WWWROOT + '/disinfectSystem/packingAction!getImage.do?id=' + td_id + '&page=' + currentPage +'&imageType='+imgType+'&originalImg=true' ; title = '双击预览图片'; } - url += '&time='+new Date(); - viewOriginalImg_url += '&time='+new Date(); + 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 image = top.Ext4.getCmp('pt_browseImage'); -// image.setSrc(''); -// image.setSrc(url);// 覆盖原来的图片 - top.Ext4.getCmp('pt_imageName').setText(tousseName); - top.Ext4.getCmp('pt_currentPage').setValue(currentPage); - - var panel = top.Ext4.getCmp('pt_imageContentPanel'); - var image = top.Ext4.getCmp('pt_browseImage'); + var panel = Ext4.getCmp('imageContentPanel'); + var image = Ext4.getCmp('browseImage'); panel.remove(image); - var newImage = top.Ext4.create('Ext4.Img', { - id : 'pt_browseImage', + var newImage = Ext4.create('Ext4.Img', { + id : 'browseImage', fieldLabel : "预览图片", - title:title, -// autoScroll: true, + title:'双击预览图片', listeners: { render: function() { var imgCmp = this; - var imgEl = this.getEl(); - if(!imgId){//装配模块才要双击预栏 - imgCmp.getEl().on("dblclick" , function(e){ - if(this.el.dom.src && this.el.dom.src != ''){ - // alert(this.el.dom.src) - showImage(viewOriginalImg_url,tousseName,function(){ - var obj = { - tousseName: tousseName, - td_id: td_id, - imgType: imgType, - currentPage: currentPage - } - showTousseImages_restore(obj); - }); - tousesPackingTeachingImage_window.close(); - } - }); - } - - imgEl.on('load',function(){ + 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 = top.Ext4.getCmp('pt_imageContentPanel'); + var panel = Ext4.getCmp('imageContentPanel'); var panelSize = panel.getSize(true); var boundaryWidth = panelSize.width; @@ -101,19 +91,6 @@ x = (boundaryWidth - scaledWidth)/2; y = (boundaryHeight - scaledHeight)/2; } - if(viewOriginalImgPressed){ -// if(originalWidth > boundaryWidth){ -// x=0; -// } -// if(originalHeight > boundaryHeight){ -// y=0; -// } - x=0; - y=0; - scaledWidth = originalWidth; - scaledHeight = originalHeight; - - } imgCmp.setSize(scaledWidth,scaledHeight); imgCmp.setPosition(x,y); // Ext.Msg.alert('x='+x+',y='+y+',w='+scaledWidth+',h='+scaledHeight+',bw='+boundaryWidth+',bh='+boundaryHeight); @@ -122,7 +99,7 @@ } }, src : url - }); + }); panel.add(newImage); } @@ -134,10 +111,7 @@ } function showTousseImages(tousseName,td_id,imgType){ - - showTousseImages_newWindow(tousseName,td_id,imgType,""); - - loadToussePackingTeachingImage(tousseName,td_id,imgType,1,""); + loadToussePackingTeachingImage(tousseName,td_id,imgType,1,""); } //获取器械包定义图片的行号 @@ -156,110 +130,9 @@ /* 器械包定义图片信息 */ function showTousseDefinitionImages(tousseName,td_id,imgType,imgId){ - showTousseImages_newWindow(tousseName,td_id,imgType,imgId); - loadToussePackingTeachingImage(tousseName,td_id,imgType,getRowSeque(imgId),imgId); + loadToussePackingTeachingImage(tousseName,td_id,imgType,getRowSeque(imgId),imgId); } -function showTousseImages_newWindow(tousseName,td_id,imgType,imgId){ - var totalPage = 0; - var imgId = imgId; - if(imgId){//器械包定义 - Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/baseData/showImageAction!getToussePictureAmount.do', - params : { - id : td_id, - imageType:imgType - }, - success : function(result){ - var pageCount = Ext4.JSON.decode(result.responseText); - totalPage = parseInt(pageCount.count); - }, - failure : function(){} - }); - }else{//装配 - Ext.Ajax.request({ - url :WWWROOT + '/disinfectSystem/packingAction!getUploadPicTotalPage.do', - params : { - td_id : td_id, - imageType:imgType - }, - success : function(result){ - var pageStr = result.responseText; - totalPage = parseInt(pageStr); - }, - failure : function(){} - }); - } - - var imagePanel = new top.Ext4.Panel({ - id : 'pt_imagePanel', -// height:297, - border : true, - layout:'fit', - items : [{ - xtype : 'panel', - layout:'absolute', -// autoScroll: true, - id: 'pt_imageContentPanel', - items: [{ - xtype : 'image', - id : 'pt_browseImage', - fieldLabel : "预览图片", -// title:'双击预览图片', - src : Ext4.BLANK_IMAGE_URL - }] - }], - bbar: [ - { id:'pt_imageName'}, - {xtype:'hidden',id:'pt_currentPage'}, - '->', - {xtype:'button',id:'pt_view_originalImg',text:'查看原图',tooltip :"查看原图", hidden: true, - enableToggle: true, - handler : function(){ - viewOriginalImg(); - }}, - {xtype:'button',text:'<<',tooltip :"上一页", handler : function(){ - var imageName = top.Ext4.getCmp('pt_imageName').getText(); - var currentPage = top.Ext4.getCmp('pt_currentPage').getValue(); - if(currentPage == 1){ - showResult("已是第一页!"); - }else{ - loadToussePackingTeachingImage(imageName,td_id,imgType,parseInt(currentPage)-1,imgId); - } - }}, - {xtype:'button',text:'>>', tooltip :"下一页", handler : function(){ - var imageName = top.Ext4.getCmp('pt_imageName').getText(); - var currentPage = top.Ext4.getCmp('pt_currentPage').getValue(); -// alert(currentPage+','+totalPage) - if(currentPage >= totalPage){ - showResult("已是最后一页!"); - }else{ - loadToussePackingTeachingImage(imageName,td_id,imgType,parseInt(currentPage)+1,imgId); - } - }} - ] - }); - - tousesPackingTeachingImage_window = new top.Ext4.Window({ - id : 'packageImg', - title : imgType, - width : document.body.clientHeight > 768 ? 1024 : 800, // 动态计算窗口大小,支持在1024x768分辨率下的显示 - height :document.body.clientHeight > 768 ? 768 : 600, - border : false, - autoScroll: true, - layout : 'border', - modal : true, - items : [{ - region : 'center', - layout : 'fit', - width : '100%', - items : imagePanel - }] - }); - tousesPackingTeachingImage_window.show(); -} function showTousseImages_restore(lastLoadObj){ - showTousseImages_newWindow(lastLoadObj.tousseName,lastLoadObj.td_id,lastLoadObj.imgType,""); - - loadToussePackingTeachingImage(lastLoadObj.tousseName,lastLoadObj.td_id,lastLoadObj.imgType,lastLoadObj.currentPage,""); + loadToussePackingTeachingImage(lastLoadObj.tousseName,lastLoadObj.td_id,lastLoadObj.imgType,lastLoadObj.currentPage,""); } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js =================================================================== diff -u -r27624 -r27630 --- ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 27624) +++ ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 27630) @@ -1186,9 +1186,9 @@ var imageName = Ext4.getCmp('imageName').getText(); var materialId = Ext4.getCmp('materialId').getValue(); if(imageName != "" && materialId == ""){ - var td_id = Ext4.getCmp('td_id').getValue(); + var td_id = Ext4.getCmp('td_id').getValue(); showToussePackingTeachingImage(imageName,td_id); - } + } } }, { @@ -2076,131 +2076,43 @@ function amendDisinfectionTousse(row){ var tousseName = row.tousseName; var tousseDefinitionID = row.td_id; - var tousseType = row.type.split('图片')[0]; - var materials = row.materialId; var currentPage = row.currentPage; + var materialId = row.materialId; var iframeHeight = $('body').height(); - - if(tousseType == '消毒物品' || tousseType == '灭菌物品'){ - var width = 740; - var height = 400; - - layerIndex=layer.open({ - type : 2, - title : ['消毒物品明细',true], - content : 'disinfectionTousseItems.jsp?resolution=1980&row=0&tousseDefinitionID='+tousseDefinitionID+'&materials='+encodeURIComponent(materials), - area : [ width + 'px' , height + 'px'], - border : [5, 0.3, '#fff', true], - closeBtn : [2 , true], - offset : ['100px',''] - }); - }else if(tousseType == '器械包'){ - $.magnificPopup.open({ - items: [{ - src:WWWROOT+'/disinfectsystem/touchScreen/recycle/tousseImage.jsp?resolution=1980&clientHeight='+iframeHeight+'&parentPageName=packingView&tousseDefinitionID='+tousseDefinitionID+'&tousseName='+encodeURIComponent(tousseName)+'&number='+currentPage, - type :'iframe' - - },{ - //只是为了让箭头出现,如果可以有其他办法,这里可以去掉。因为在tousseImage.jsp内部,修改了下一页和上一页的处理 - src: '