function(button, e) { debugger; // 中断调试指令,可以手动删除它 var me = this, view = me.getView(), grid = view.down('list') || view.down('grid'), store = grid.getStore(), records = grid.getSelections(), record = records[0]; if( record.get('JianChaQiYeMenMian')==null|| record.get('JianChaQiYeMenMian')==''){ alert('检查人员没有上传图片'); return false; } // Ajax(GET)请求传递到后台的参数 var params = { FuJian: record.get('JianChaQiYeMenMian') }; var url1='/UploadManager/ViewFile?ID='; var url2='.jpg'; // Ajax(GET)请求。params后面省略了bool参数(true) ajax.post('/Pc/ShiPinJingYingRiChangJianChaJiLu/ShiPinBoFang', params).then(function (response, opts) { // ajax请求回调函数。返回值response.Success==true时代表成功,否则为出错。 if (response.Success) { var win = Ext.create({ xtype: 'container', plugins: 'pushnavigatemoremenu', close: function() { util.closeByFullScreen(this); }, title: '查看门面图片', header: false, scrollable: false, cls: 'edit-page', //bodypadding: '0 0 0 0', layout:'fit', items:[{ xtype:'button', text:'导航条菜单', hidden: true, menu:{ width: 100 } },{ xtype: 'container', layout:'fit', items:[{ xtype: 'image', src: util.urlFillAll(url1+response.Data), style: 'width: auto;height: auto;max-width: 100%;max-height: 100%;' }] }] }); util.showByFullScreen(win); // 全屏显示 } else { alert(response.Errors.join('')); // 弹出信息框,显示后台返回的错误或失败信息 return false; } }); }
来源:https://www.cnblogs.com/jiaowoyaoshu/p/12468093.html