package nckd.jxccl.hr.psms.plugin.form.performance;

import kd.bos.form.IFormView;
import kd.bos.form.control.Button;
import kd.bos.form.control.Control;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.sdk.plugin.Plugin;
import java.util.EventObject;

/**
* 年度绩效排名导入引导页面
* 实体标识：nckd_perfrankmgmt_imp
* @author W.Y.C
* @date 2025/10/30 10:56
* @version 1.0
*/
public class PerfrankMgmtImpFormPlugin extends AbstractFormPlugin implements Plugin {

    @Override
    public void registerListener(EventObject e) {
        super.registerListener(e);
        Button button = (Button) this.getControl("nckd_btndowntpl");
        button.addClickListener(this);
    }


    @Override
    public void click(EventObject e) {
        super.click(e);
        Control control = (Control) e.getSource();
        if ("nckd_btndowntpl".equalsIgnoreCase(control.getKey())) {
            // 1. 获取父页面视图
            IFormView parentView = this.getView().getParentView();
            // 2. 调用父页面的操作（例如刷新操作）
            parentView.invokeOperation("export_multientry_hr");
            this.getView().sendFormAction(parentView);
        }
    }

}