package nckd.jxccl.base.common.plugins;

import kd.bos.form.control.events.BeforeItemClickEvent;
import kd.bos.form.control.events.ItemClickListener;
import kd.bos.list.plugin.AbstractListPlugin;
import kd.sdk.plugin.Plugin;

import java.util.EventObject;

/**
* Tab标签基础插件
* @author W.Y.C
* @date 2025/12/23 16:58
* @version 1.0
*/
public class TabBaseListPlugin extends AbstractListPlugin implements ItemClickListener {

    public void registerListener(EventObject event) {
        super.registerListener(event);
        this.addItemClickListeners(new String[]{"btnclose"});
    }

    public void beforeItemClick(BeforeItemClickEvent evt) {
        super.beforeItemClick(evt);
        String itemKey = evt.getItemKey();
        if ("nckd_tblclose".equals(itemKey)) {
            this.getView().getParentView().invokeOperation("close");
            this.getView().sendFormAction(this.getView().getParentView());
        }

    }
}