Index: ssts-web/src/main/webapp/js/showUploadImagesForExtWin.js =================================================================== diff -u -r31458 -r31468 --- ssts-web/src/main/webapp/js/showUploadImagesForExtWin.js (.../showUploadImagesForExtWin.js) (revision 31458) +++ ssts-web/src/main/webapp/js/showUploadImagesForExtWin.js (.../showUploadImagesForExtWin.js) (revision 31468) @@ -12,6 +12,8 @@ var showSourceImg = false; //图片类型 var imageType = ''; +//图片id +var currentImageId = ''; //定义接口 var action = '/disinfectSystem/baseData/showImageAction'; var getPicFun = '!getImage.do'; @@ -50,31 +52,6 @@ ImgView.superclass.initComponent.call(this); }, - afterRender: function () { - curRotateIndex = 0; - ImgView.superclass.afterRender.call(this); - Ext.get(this.img_view_id).parent = this; - /*Ext.get(this.img_view_id).center(); */ - new Ext.dd.DD(Ext.get(this.img_view_id), 'pic');//能够图片在容器中拖动 - - Ext.get(this.img_view_id).dom.title = '双击放大 右击缩小'; - Ext.get(this.img_view_id).on({ - 'dblclick': { - fn: function () { - Ext.get(this).parent.zoom(Ext.get(this), scale, true); - - currentScalePercent = currentScalePercent * scale; - } - }, - 'contextmenu': { - fn: function () { - Ext.get(this).parent.zoom(Ext.get(this), scale, false); - - currentScalePercent = currentScalePercent / scale; - } - } - }); - }, //放大、缩小 zoom: function (el, offset, type) { var width = el.getWidth(); @@ -125,7 +102,12 @@ showResult('图片不存在!'); return; } - Ext.get(currentImageId).parent.zoom(Ext.get(currentImageId), scale, true); + srcWidth = srcWidth * scale; + srcHeight = srcHeight * scale; + var imageBrowse = top.Ext.get(currentImageId); + var image = imageBrowse.dom; + image.style.width = srcWidth + 'px'; + image.style.height = srcHeight + 'px'; } }, { xtype: 'button', @@ -135,7 +117,12 @@ showResult('图片不存在!'); return; } - Ext.get(currentImageId).parent.zoom(Ext.get(currentImageId), scale, false); + srcWidth = srcWidth / scale; + srcHeight = srcHeight / scale; + var imageBrowse = top.Ext.get(currentImageId); + var image = imageBrowse.dom; + image.style.width = srcWidth + 'px'; + image.style.height = srcHeight + 'px'; } }, { xtype: 'button', @@ -234,7 +221,7 @@ imageType = windowTitle; - var url = WWWROOT + action + getPicFun + '?objectId=' + id + '&page=' + page + '&imageType=' + windowTitle + '&rotateIndex=' + curRotateIndex + '&showSourceImg=' + showSourceImg + '&time=' + new Date().getTime(); + var url = WWWROOT + action + getPicFun + '?objectId=' + id + '&page=' + page + '&imageType=' + encodeURIComponent(imageType) + '&rotateIndex=' + curRotateIndex + '&showSourceImg=' + showSourceImg + '&time=' + new Date().getTime(); var img = new ImgView({ src: [url] @@ -364,7 +351,7 @@ pageElement.update('第' + page + '页'); var totalPageElement = top.Ext.get(toolbarTotalPage.el); totalPageElement.update('共' + totalPage + '页'); - var url = WWWROOT + action + getPicFun + '?objectId=' + id + '&page=' + page + '&imageType=' + imageType + '&rotateIndex=' + curRotateIndex + '&showSourceImg=' + showSourceImg + '&time=' + new Date().getTime(); + var url = WWWROOT + action + getPicFun + '?objectId=' + id + '&page=' + page + '&imageType=' + encodeURIComponent(imageType) + '&rotateIndex=' + curRotateIndex + '&showSourceImg=' + showSourceImg + '&time=' + new Date().getTime(); image.parentElement.style.cssText = 'margin:0 auto;padding-top: ' + paddingTop + 'px;width:' + wh.width + 'px;height:' + wh.height + 'px'; image.style.width = wh.width + 'px'; image.style.height = wh.height + 'px';