欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

dorado7 动态生成图片

程序员文章站 2022-07-03 23:31:11
...
view.get("#updateActionEmergenciesDetails").execute(function(result){
	flag = true;
	if(flag){
		with (view.get("#dsEmergenciesDetailsLabel")){
			set("parameter",{
				emergenciesId:emergenciesId
			});
			flush();
		}
	
		//突发事件详情Set
		var detailSet = view.get("#dsEmergenciesDetailsLabel.data");	
		detailSet.each(function(record){
			var autoform =new dorado.widget.AutoForm({
				col:'*,*,*,*,*,*'
			});
			var titleLabel = new dorado.widget.Label({
				text:record.get("detailTitle")
			});
			var contentLabel = new dorado.widget.Label({
				text:record.get("detailContent")
			});
			autoform.addElement(titleLabel);
			autoform.addElement(contentLabel);
			
			with (view.get("#dsEmergenciesDetailsAtt")){
				set("parameter",{
					detailId:record.get("detailId")
				});
				flush();
			}
			var detailAttSet = view.get("#dsEmergenciesDetailsAtt.data");
	
			detailAttSet.each(function(result){
					//图片附件		
					var SimpleBlockRenderer2 = $extend(dorado.widget.blockview.DefaultBlockRenderer,{
					    render: function(dom, arg) {
					        dom.innerHTML = "<img src='"+ arg.data +"' class='attachment_operation_img' height='120' width='100' />";
					    }
					});
					var pic = new dorado.widget.BlockView({
						allowNoCurrent:true,
						lineSize:8,
						height:120,
						blockHeight:100,
						blockWidth:100,
						onReady: function(self, arg){
							self.set("renderer", new SimpleBlockRenderer2());//修改默认的块渲染器对象
							self.set("items",[result.get("fileUrl")]);;
						},
						onClick: function(self, arg){
							url='com.hisense.smartroad.common.view.ShowImg.d?fileUrl=' + result.get("fileUrl");
							tabName='查看图片'+result.get('attachmentName').split('.')[0];
							top.window.viewMain.openUrlInMainTab(url,tabName);
						}
				});	
				autoform.addElement(pic);				
			});
		
			container.addChild(autoform);	
		});
	}
//});
}