根据业务数据字段动态显示审批同意按钮文案的实现方法
使用操作 192
动态根据业务数据的字段值显示审批同意按钮的文案
-
import { ActionType, ActionWidget, DialogViewActionWidget, SPI, ViewActionTarget, Widget } from ‘@kunlun/dependencies’;
@SPI.ClassFactory(ActionWidget.Token({ actionType: ActionType.View, target: ViewActionTarget.Dialog, model: ‘workflow.WorkflowUserTask’, name: ‘workflow_agree’ }))
class WorkflowAgreeDialogViewActionWidget extends DialogViewActionWidget {
@Widget.Reactive()
protected get label(): string {
const nodeContext = this.activeRecords?.[0].nodeContext;
if (nodeContext) {
try {
const nodeInfo = JSON.parse(nodeContext) as any;
if (nodeInfo.status == ‘ACTIVE’) {
return ‘激活状态审批’;
} else if (nodeInfo.status == ‘INACTIVE’) {
return ‘无效状态审批’;
}
} catch (e) {
console.log(e);
}
}
return super.label;
}
}8个月前