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>
45 lines
1.6 KiB
Groovy
45 lines
1.6 KiB
Groovy
// === EIP4 P4 脚本迁移产出 ===
|
||
// template_id : 26fe10ae-93a9-45c4-9f58-2183e6050100
|
||
// template_name: 专业分包合同评审
|
||
// seq : 3
|
||
// label : HARD
|
||
// 硬 S3 原因 : 动态创建 Vaadin Button(无法自动改写形态)
|
||
// 处置 : 原文保留,进人工排期(amis dialog/service 重写)
|
||
import com.vaadin.ui.Button;
|
||
import com.vaadin.ui.Button.ClickEvent;
|
||
import com.vaadin.ui.Button.ClickListener;
|
||
import com.vaadin.ui.Notification;
|
||
import com.vaadin.ui.Notification.Type;
|
||
|
||
def contents = group.getField("CONTENTS");
|
||
final Object table = contents?.table;
|
||
table?.setImmediate(true);//设置验证
|
||
|
||
def opertor = group.getField("BUTTON");
|
||
def vl = opertor?.parent;
|
||
Button button = new Button("根据分包明细计算合同价款");
|
||
vl.addComponent(button,0);
|
||
button.addClickListener(new Button.ClickListener() {
|
||
@Override
|
||
public void buttonClick(Button.ClickEvent event) {
|
||
def balancedetails = getFieldValue("CONTENTS");
|
||
def sumamount = new BigDecimal("0");;
|
||
def summoney = new BigDecimal("0");;
|
||
if(balancedetails != null && balancedetails.size()>0){
|
||
balancedetails?.each{
|
||
if(it.get('VALENCE') !=null && it.get('VALENCE') !=""){
|
||
summoney = summoney.add(new BigDecimal(it.get('VALENCE')))
|
||
}
|
||
}
|
||
}
|
||
bindField("CONTRACTMONEY",summoney);
|
||
}
|
||
});
|
||
|
||
|
||
import com.dsasp.client.viewframework.util.TableImportExport;
|
||
def tie = new TableImportExport(contents,"com.dsasp.pm.specialtycontract.client.ContentsImport");
|
||
tie.addImportButton(2);
|
||
tie.addExportButton(3);
|
||
|