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>
43 lines
1.6 KiB
Groovy
43 lines
1.6 KiB
Groovy
// === EIP4 P4 脚本迁移产出 ===
|
||
// template_id : cf71f83a-0428-4e69-a736-97c91f998d19
|
||
// 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;
|
||
import com.dsasp.client.viewframework.util.TableImportExport;
|
||
|
||
//将自定义的按钮添加至
|
||
def materialList = group.getField("MATERIALDETAILS");
|
||
|
||
materialList?.addButton(group.getField("SELECT"),0);
|
||
//导入按钮
|
||
def tie = new TableImportExport(materialList,"com.dsasp.pm.materialcontract.client.MaterialContractDetailImport");
|
||
tie.addImportButton(3);
|
||
tie.addExportButton(4);
|
||
//绑定合计按钮
|
||
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 meterialDetails = getFieldValue("MATERIALDETAILS");
|
||
def summoney = new BigDecimal("0");;
|
||
if(meterialDetails != null && meterialDetails.size()>0){
|
||
meterialDetails?.each{
|
||
if(it.get('TOTAL') !=null && it.get('TOTAL') !=""){
|
||
summoney = summoney.add(new BigDecimal(it.get('TOTAL')))
|
||
}
|
||
}
|
||
}
|
||
bindField("CONTRACTMONEY",summoney);
|
||
}
|
||
}) |