/** * @Title: UIUtils.java * @Description: TODO * @author zhanglf * @date 2024-2-4下午03:13:17 */ package com.kingdee.eas.custom.ws.util; import com.ibm.db2.jcc.am.mo; import com.kingdee.bos.BOSException; import com.kingdee.bos.ctrl.extendcontrols.KDBizPromptBox; import com.kingdee.bos.metadata.entity.EntityViewInfo; import com.kingdee.bos.metadata.entity.FilterInfo; import com.kingdee.bos.metadata.entity.FilterItemInfo; /** * @Description: TODO * @author zhanglf * @date 2024-2-4下午03:13:17 */ public class UIUtils { /** * * @Description: 获取F7过滤条件 * @author zhanglf 2024-2-4下午03:18:46 * @param prmt * @return FilterInfo */ public static FilterInfo getF7Filter(KDBizPromptBox prmt){ EntityViewInfo evi = null; if (prmt.getEntityViewInfo() !=null) { evi = prmt.getEntityViewInfo(); }else { evi = new EntityViewInfo(); } FilterInfo filter = null; if (evi.getFilter() !=null) { filter = evi.getFilter(); }else{ filter = new FilterInfo(); } evi.setFilter(filter); prmt.setEntityViewInfo(evi); return filter; } /** * * @Description: F7控件增加过滤条件,可选择新增还是追加、以及追加的逻辑FilterItemInfo增加 * @author zhanglf 2024-2-4下午03:24:59 * @param prmt * @param filterItemInfo * @param mode append:追加 | new :删除全部过滤条件后再新增当前条件 * @param logic and | or * @throws BOSException void */ public static void addF7Filter(KDBizPromptBox prmt,FilterItemInfo filterItemInfo,String mode,String logic) throws BOSException{ FilterInfo filter = getF7Filter(prmt); FilterInfo filterTemp = new FilterInfo(); //构建添加的条件 filterTemp.getFilterItems().add(filterItemInfo); if ("append".equals(mode)) { filter.mergeFilter(filterTemp, logic); } if ("new".equals(mode)) { filter.getFilterItems().clear(); filter.mergeFilter(filterTemp, logic); } } /** * * @Description: F7控件增加过滤条件,可选择新增还是追加、以及追加的逻辑FilterItemInfo增加 * @author zhanglf 2024-2-4下午03:24:59 * @param prmt * @param FilterInfo * @param mode append:追加 | new :删除全部过滤条件后再新增当前条件 * @param logic and | or * @throws BOSException void */ public static void addF7Filter(KDBizPromptBox prmt,FilterInfo filterInfo,String mode,String logic) throws BOSException{ FilterInfo filter = getF7Filter(prmt); //构建添加的条件 if ("append".equals(mode)) { filter.mergeFilter(filterInfo, logic); } if ("new".equals(mode)) { filter = filterInfo; } } }
标签:FilterInfo,F7,param,filter,prmt,过滤,mode,new,eas From: https://www.cnblogs.com/ketoli/p/18056782