package nckd.jxccl.hrmp.hbpm.plugin.form.hr;

import kd.bos.form.control.SplitContainer;
import kd.bos.form.control.SplitDirection;
import kd.bos.form.events.PreOpenFormEventArgs;
import kd.bos.list.plugin.AbstractListPlugin;

import java.util.EventObject;
import java.util.Map;


/**
 * 上级岗位列表插件
 * @author: jtd
 * @date: 2025-10-24 10:24
 */
public class ParentPositionListPlugin extends AbstractListPlugin {

    @Override
    public void preOpenForm(PreOpenFormEventArgs e) {
        super.preOpenForm(e);

        // 指定显示岗位数据
        Map<String, Object> customParams = e.getFormShowParameter().getCustomParams();
        customParams.put("showBasedata", "0");
    }

    @Override
    public void beforeBindData(EventObject e) {
        super.beforeBindData(e);

        // 默认隐藏左树
        SplitContainer splitContainer = (SplitContainer)this.getView().getControl("splitcontainerap");
        if (splitContainer != null) {
            splitContainer.hidePanel(SplitDirection.left, true);
        }
    }
}