Files
eip4-platform/tools/s3_rewriter/output/rewritten/5a51c93c-a758-413a-b174-63b3ba05efaa/2.HARD.groovy
zhengwr 43fdfd1830 F2-3:运行时动词闭包子指令机制 + staging 晋级(FULL_AUTO 507/HARD 74)
ScriptFacade:addFieldButton 扩第3参闭包(onClick 子指令数组)+ showConfirm
新动词,服务端急切求值闭包,子指令收进子缓冲,输出嵌套指令 JSON。
前端 scriptCommands.ts/registerReplayAction.ts:处理 addButton onClick/
confirmDialog onOk 嵌套重放,onClickActions/onOkActions 透传给 amis。
ScriptFacadeTest 补 7 个正反例(24/24 全绿)。
staging 晋级:FULL_AUTO 507(+10)/HARD 74(-12)/自动化率 82.7%,
双库各更新 801 条,e2e 30/30 全绿。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 22:24:08 +08:00

62 lines
2.7 KiB
Groovy
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// === EIP4 P4 脚本迁移产出 ===
// template_id : 5a51c93c-a758-413a-b174-63b3ba05efaa
// template_name: 文件监控
// seq : 2
// label : HARD
// 硬 S3 原因 : 同步确认框 showConfirmDialog
// 处置 : 原文保留,进人工排期(amis dialog/service 重写)
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.Property.ValueChangeEvent;
import com.dsasp.client.viewframework.listener.ConfirmDialogListener;
def reads = group.getField("UNDERTAKES");
final Button cb = new Button("催办");
final Object table = reads?.table;
table?.setImmediate(true);
final group1 = group;
cb?.addClickListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
Object o = table?.getValue();
if (o == null)
return;
final id = o?.getField("VIEW_OA_UNDERTAKETOME_ID")?.getValue();
final pojo = GetServicesFunction.loadPOJO(id,"VIEW_OA_UNDERTAKETOME",true);
def user = GetServicesFunction.loadPOJO(pojo?.get_Value("RECEIVER"),"SYS_USER",true)?.get_Value("NAME");
showConfirmDialog("确定要对" + user + "进行催办吗?",new ConfirmDialogListener(){
public void yes(){
def message = [:];
message.put("title", "收到新的承办催办");
message.put("file", "文件名称:" + pojo?.get_Value("FILENAME")); //文件名
message.put("user", pojo?.get_Value("RECEIVER")); //接收人
message.put("type", 6); //阅读消息
message.put("id", id); //uuid
/*
if ("收文".equals(pojo?.get_Value("FILECLASS"))) //标记
message.put("flag", "#R");
else
message.put("flag", "#S");
*/
message.put("flag", "");
GetServicesFunction.excuteFlow(message,"VIEW_OA_FILEMONITORING_MESSAGE");
}
public void no(){}
});
}
});
table?.addValueChangeListener(new ValueChangeListener() {
public void valueChange(Property.ValueChangeEvent event) {
Object o = table?.getValue();
final id = o?.getField("VIEW_OA_UNDERTAKETOME_ID")?.getValue();
final pojo = GetServicesFunction.loadPOJO(id,"VIEW_OA_UNDERTAKETOME",true);
if (o == null || pojo.get_Value("ISFINISH") == 1)
cb.setEnabled(false);
else
cb.setEnabled(true);
}
});
cb?.setEnabled(false);
reads?.addButton(cb, 1);