Index: ssts-web/src/main/webapp/disinfectsystem/packing/tousesPackingTeachingImage.js =================================================================== diff -u -r21472 -r22320 --- ssts-web/src/main/webapp/disinfectsystem/packing/tousesPackingTeachingImage.js (.../tousesPackingTeachingImage.js) (revision 21472) +++ ssts-web/src/main/webapp/disinfectsystem/packing/tousesPackingTeachingImage.js (.../tousesPackingTeachingImage.js) (revision 22320) @@ -1,5 +1,21 @@ + +var lastLoadObj = null; + +function viewOriginalImg(){ + if(lastLoadObj == null){ + return; + } + loadToussePackingTeachingImage(lastLoadObj.tousseName,lastLoadObj.td_id,lastLoadObj.imgType,lastLoadObj.currentPage); +} function loadToussePackingTeachingImage(tousseName,td_id,imgType,currentPage){ - var url = WWWROOT + '/disinfectSystem/packingAction!getImage.do?id=' + td_id + '&page=' + currentPage +'&imageType='+imgType ; + lastLoadObj = { + tousseName: tousseName, + td_id: td_id, + imgType: imgType, + currentPage: currentPage + } + var viewOriginalImgPressed = top.Ext4.getCmp('pt_view_originalImg').pressed; + var url = WWWROOT + '/disinfectSystem/packingAction!getImage.do?id=' + td_id + '&page=' + currentPage +'&imageType='+imgType+'&originalImg='+viewOriginalImgPressed ; // var image = top.Ext4.getCmp('pt_browseImage'); // image.setSrc(''); // image.setSrc(url);// 覆盖原来的图片 @@ -14,10 +30,16 @@ id : 'pt_browseImage', fieldLabel : "预览图片", // title:'双击预览图片', +// autoScroll: true, listeners: { render: function() { var imgCmp = this; var imgEl = this.getEl(); +// imgCmp.getEl().on("dblclick" , function(e){ +// if(this.el.dom.src && this.el.dom.src != ''){ +// showImage(this.el.dom.src,tousseName); +// } +// }); imgEl.on('load',function(){ var img = this; var panel = top.Ext4.getCmp('pt_imageContentPanel'); @@ -51,6 +73,19 @@ 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); @@ -94,6 +129,7 @@ items : [{ xtype : 'panel', layout:'absolute', + autoScroll: true, id: 'pt_imageContentPanel', items: [{ xtype : 'image', @@ -107,6 +143,11 @@ { id:'pt_imageName'}, {xtype:'hidden',id:'pt_currentPage'}, '->', + {xtype:'button',id:'pt_view_originalImg',text:'查看原图',tooltip :"查看原图", + 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();