根据业务数据字段动态显示审批同意按钮文案的实现方法

shao 使用操作 192

动态根据业务数据的字段值显示审批同意按钮的文案

回复

共1条回复 我来回复
  • shao的头像
    shao
    数式Oinone (oinone.top),专注解决复杂场景的开源低代码平台
    评论

    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个月前 0条评论