package com.yem.wm.bd.customer.from;

import kd.bos.form.field.BasedataEdit;
import kd.bos.form.field.events.BeforeF7SelectEvent;
import kd.bos.form.field.events.BeforeF7SelectListener;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.list.ListShowParameter;

import java.util.EventObject;

/**
 * @Description 基础资料显示暂存数据
 * @Date 2024/3/13 17:39
 * @Created by ZZSLL
 */

public class CustomerFormPlugin extends AbstractFormPlugin implements BeforeF7SelectListener
{
    @Override
    public void registerListener(EventObject e)
    {
        super.registerListener(e);
        BasedataEdit groupcustomers = this.getControl("yem_groupcustomers");
        if (groupcustomers != null) {
            groupcustomers.addBeforeF7SelectListener(this);
        }

    }

    @Override
    public void beforeF7Select(BeforeF7SelectEvent e)
    {
        String fieldKey = e.getProperty().getName();
        if ("yem_groupcustomers".equals(fieldKey)){
            ListShowParameter showParameter = (ListShowParameter)e.getFormShowParameter();
            //是否展示审核的改为false
            showParameter.setShowApproved(false);
        }
    }
}
