// === EIP4 P4 脚本迁移产出 === // template_id : 3cfaeaa6-2cf9-4364-8f98-25aee16cbda3 // template_name: 项目部危险源申报 // seq : 1 // label : PARTIAL // 余留模式 : 残留字段句柄链(未覆盖动词) // 处置 : 大部分已自动改写,余留行人工补全(见作业单) import com.dsasp.viewframework.MultiSelectField; final def group1 = group; if (lists == null) { return; } final MultiSelectField field = new MultiSelectField('3acc8bb1-f787-4968-88cf-121fbd30b292', '公司危险源'); 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_DANGERLISTITEM",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("DANGERLISTNAME", data.remove("DANGERID")); } 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);