From 5d329defea5d8a825303dd35661ced0b03530bf9 Mon Sep 17 00:00:00 2001 From: ptt <2403326863@qq.com> Date: Wed, 18 Jun 2025 13:42:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=96=E7=BD=91=E9=97=A8=E6=88=B7=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repc/resp/portal/IndexEditNewPlugin.java | 59 ++++++++++++++++++- .../resp/portal/NewNoticeCardEditPlugin.java | 32 ++++++++++ 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 main/java/shkd/repc/resp/portal/NewNoticeCardEditPlugin.java diff --git a/main/java/shkd/repc/resp/portal/IndexEditNewPlugin.java b/main/java/shkd/repc/resp/portal/IndexEditNewPlugin.java index cc9c950..632ee6b 100644 --- a/main/java/shkd/repc/resp/portal/IndexEditNewPlugin.java +++ b/main/java/shkd/repc/resp/portal/IndexEditNewPlugin.java @@ -8,6 +8,11 @@ import kd.bos.form.*; import kd.bos.form.container.Container; import kd.bos.form.control.Control; import kd.bos.form.control.Label; +import kd.bos.form.control.Search; +import kd.bos.form.control.events.SearchEnterEvent; +import kd.bos.form.control.events.SearchEnterListener; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; import kd.repc.common.util.CacheMCData; import kd.repc.resp.formplugin.portal.IndexEditNew; import kd.repc.resp.formplugin.portal.PortalLableStyleChangeUtil; @@ -16,7 +21,7 @@ import java.util.EventObject; import java.util.HashMap; import java.util.Map; -public class IndexEditNewPlugin extends IndexEditNew { +public class IndexEditNewPlugin extends IndexEditNew implements SearchEnterListener { protected static final String companyLogoFlag = "companylogo"; protected static final String COMPANYLOGOFLEXPANEL = "companylogoflexpanel"; @@ -48,13 +53,23 @@ public class IndexEditNewPlugin extends IndexEditNew { case "label_home": (new PortalLableStyleChangeUtil()).addClickedLableStyle(view, "label_home", ResManager.loadKDString("首页", "IndexEditNew_2", "repc-resp-formplugin", new Object[0])); this.getView().invokeOperation("refresh"); + Search search = this.getView().getControl("qeug_searchap"); + search.setSearchKey(""); + this.getView().updateView("qeug_searchap"); break; case "label_bidproj": (new PortalLableStyleChangeUtil()).addClickedLableStyle(view, "label_bidproj", ResManager.loadKDString("询比价公告", "IndexEditNew_3", "repc-resp-formplugin", new Object[0])); + this.loadCards(portalConfigId, this.getCardInfo("bidprojannolarge"), (Map)null); + Search search1 = this.getView().getControl("qeug_searchap"); + search1.setSearchKey(""); + this.getView().updateView("qeug_searchap"); break; case "label_recruit": (new PortalLableStyleChangeUtil()).addClickedLableStyle(view, "label_recruit", ResManager.loadKDString("招募公告", "IndexEditNew_4", "repc-resp-formplugin", new Object[0])); this.loadCards(portalConfigId, this.getCardInfo("recruitannolarge"), (Map)null); + Search search2 = this.getView().getControl("qeug_searchap"); + search2.setSearchKey(""); + this.getView().updateView("qeug_searchap"); break; case "label_bidwon": (new PortalLableStyleChangeUtil()).addClickedLableStyle(view, "label_bidwon", ResManager.loadKDString("中标公告", "IndexEditNew_5", "repc-resp-formplugin", new Object[0])); @@ -134,4 +149,46 @@ public class IndexEditNewPlugin extends IndexEditNew { showParameter.setCloseCallBack(back); this.getView().showForm(showParameter); } + + @Override + public void registerListener(EventObject e) { + super.registerListener(e); + Search search = this.getView().getControl("qeug_searchap"); + //插件类实现SearchEnterListener接口,才能注册 + search.addEnterListener(this); + + } + + @Override + public void search(SearchEnterEvent evt) { + Search search = (Search)evt.getSource(); + //搜索控件标识,可以根据该标识,判断是哪个控件,然后做逻辑处理 + String key = search.getKey(); + //搜索的文本内容 + String text = evt.getText(); + + // 招募公告 + QFilter filterInfo = new QFilter("annorecruittitle", QCP.like,"%"+ text +"%"); + String filter = filterInfo == null ? null : filterInfo.toSerializedString(); + Map custom = new HashMap(); + custom.put("filterInfo", filter); + this.loadCards(this.getPortalConfigId(), this.getCardInfo("recruitannosmall"), custom); + this.loadCards(this.getPortalConfigId(), this.getCardInfo("recruitannolarge"), custom); + + //通知公告 + QFilter filterInfo1 = new QFilter("notification_title", QCP.like,"%"+ text +"%"); + String filter1 = filterInfo1 == null ? null : filterInfo1.toSerializedString(); + Map custom1 = new HashMap(); + custom1.put("filterInfo", filter1); + this.loadCards(this.getPortalConfigId(), this.getCardInfo("notice"), custom1); + + //招标公告 + QFilter filterInfo2 = new QFilter("annotitle", QCP.like,"%"+ text +"%"); + String filter2 = filterInfo2 == null ? null : filterInfo2.toSerializedString(); + Map custom2 = new HashMap(); + custom2.put("filterInfo", filter2); + this.loadCards(this.getPortalConfigId(), this.getCardInfo("bidprojannosmall"), custom2); + this.loadCards(this.getPortalConfigId(), this.getCardInfo("bidprojannolarge"), custom2); + + } } diff --git a/main/java/shkd/repc/resp/portal/NewNoticeCardEditPlugin.java b/main/java/shkd/repc/resp/portal/NewNoticeCardEditPlugin.java new file mode 100644 index 0000000..c67ac5e --- /dev/null +++ b/main/java/shkd/repc/resp/portal/NewNoticeCardEditPlugin.java @@ -0,0 +1,32 @@ +package shkd.repc.resp.portal; + +import kd.bos.dataentity.utils.StringUtils; +import kd.bos.form.IFormView; +import kd.bos.form.events.SetFilterEvent; +import kd.bos.form.plugin.AbstractFormPlugin; +import kd.bos.list.BillList; +import kd.bos.orm.query.QFilter; +import kd.scm.bid.common.enums.BillStatusEnum; + +import java.util.Date; + +public class NewNoticeCardEditPlugin extends AbstractFormPlugin{ + + @Override + public void initialize() { + super.initialize(); + ((BillList)this.getControl("billlistap")).addSetFilterListener((setFilterEvent) -> { + this.setFilter(setFilterEvent); + }); + } + + public void setFilter(SetFilterEvent e) { + IFormView view = this.getView(); + String filter = (String)view.getFormShowParameter().getCustomParam("filterInfo"); + QFilter qfilter = new QFilter("billstatus", "=", "RELEASED"); + if (!StringUtils.isEmpty(filter)) { + qfilter.and(QFilter.fromSerializedString(filter)); + } + e.getQFilters().add(qfilter); + } +}