package shkd.repc.resp.portal; import kd.bos.dataentity.resource.ResManager; import kd.bos.entity.datamodel.IDataModel; import kd.bos.form.IFormView; import kd.bos.form.control.Label; import kd.bos.form.control.events.ClickListener; import kd.bos.form.plugin.AbstractFormPlugin; import kd.bos.orm.util.CollectionUtils; import kd.repc.resp.formplugin.portal.PortalLableStyleChangeUtil; import java.util.EventObject; import java.util.List; public class NoticeCardEditNewPlugin extends AbstractFormPlugin implements ClickListener { public NoticeCardEditNewPlugin() { } public void initialize() { super.initialize(); } public void registerListener(EventObject eventobject) { this.addClickListeners(new String[]{"bidprojanno", "bidwinanno", "recruitanno", "qeug_notification"}); } public void click(EventObject eventobject) { super.click(eventobject); String[] moreLabels = new String[]{"bidprojanno", "bidwinanno", "recruitanno", "qeug_notification"}; List moreLabelLists = CollectionUtils.arrayToList(moreLabels); String key = ((Label)eventobject.getSource()).getKey(); if (moreLabelLists.contains(key)) { IFormView view = this.getView(); String parentPageId = (String)view.getFormShowParameter().getCustomParam("parentPageId"); IFormView parentView = view.getView(parentPageId); switch (key) { case "qeug_notification": (new PortalLableStyleChangeUtil()).addClickedLableStyle(parentView, "qeug_label_notification", ResManager.loadKDString("通知公告", "AnnounceCardEdit_5", "repc-resp-formplugin", new Object[0])); break; case "bidprojanno": (new PortalLableStyleChangeUtil()).addClickedLableStyle(parentView, "label_bidproj", ResManager.loadKDString("招标公告", "AnnounceCardEdit_0", "repc-resp-formplugin", new Object[0])); break; case "bidwinanno": (new PortalLableStyleChangeUtil()).addClickedLableStyle(parentView, "label_bidwon", ResManager.loadKDString("中标公告", "AnnounceCardEdit_1", "repc-resp-formplugin", new Object[0])); break; case "recruitanno": (new PortalLableStyleChangeUtil()).addClickedLableStyle(parentView, "label_recruit", ResManager.loadKDString("招募公告", "AnnounceCardEdit_2", "repc-resp-formplugin", new Object[0])); } IDataModel parentModel = (IDataModel)parentView.getService(IDataModel.class); parentModel.setValue("showcontrol", key); this.getView().sendFormAction(parentView); } } }