// === EIP4 P4 脚本迁移产出 === // template_id : 2b39c3e1-3bf9-4664-8e02-53d426c5db84 // template_name: 项目部污染源申报 // seq : 1 // label : PARTIAL // 余留模式 : 残留字段句柄链(未覆盖动词) // 处置 : 大部分已自动改写,余留行人工补全(见作业单) import com.dsasp.viewframework.MultiSelectField; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.Property.ValueChangeEvent; final def group1 = group; if (lists == null) { return; } final MultiSelectField field = new MultiSelectField('e9cdcd53-9bc9-4503-84f7-94c074f89789', '公司污染源'); field.setWidth("130px"); field.setButtonCaption("从公司库选择"); field.addValueChangeListener(new ValueChangeListener() { public void valueChange(ValueChangeEvent event) { def listvalue = event.getProperty()?.getValue(); if (listvalue == null) { return; } def list = []; for (def value : listvalue) { def data = GetServicesFunction.loadPOJO(value,"PM_POLLUTIONLISTITEM",true)?.toMap(); if (data == null) { return; } if (data.get("LIST") != null) { def tmplist = []; for (def d : data.remove("LIST")) { tmplist.add(d.toMap()); } data.put("SCORES", tmplist); data.put("ISNEW", 0); data.put("POLLUTIONLISTNAME", data.remove("POLLUTIONID")); } list.add(data); } def oldlists = getFieldValue(group1, "LISTS"); if (oldlists == null) { oldlists = []; } oldlists.addAll(list); bindField(group1, "LISTS", null); bindField(group1, "LISTS", oldlists); field.setValue(null); } }); group.getField("LISTS").addButton(field, 0);