package nckd.jxccl.swc.mas.plugin.form.empmgt;

import kd.bos.form.events.AfterDoOperationEventArgs;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.sdk.plugin.Plugin;
import nckd.jxccl.base.common.constant.FormConstant;
import nckd.jxccl.swc.constants.MasConstant;

/**
* 载入党政职务履历弹窗
* 实体标识：nckd_loadpartypostpopup
* @author W.Y.C
* @date 2025/11/30 20:18
* @version 1.0
*/
public class LoadPartyPostPopupFormPlugin extends AbstractFormPlugin implements Plugin {

    @Override
    public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) {
        String operateKey = afterDoOperationEventArgs.getOperateKey();
        boolean success = afterDoOperationEventArgs.getOperationResult() != null && afterDoOperationEventArgs.getOperationResult().isSuccess();
        if (success && FormConstant.AFFIRM_OP.equalsIgnoreCase(operateKey)) {
            Object value = this.getModel().getValue(MasConstant.NCKD_TERM);
            this.getView().returnDataToParent(value);
            this.getView().close();
        }
    }
}