提交 2ea0ccea 编写于 作者: Mosher's avatar Mosher

update:调整部件模型支持获取快速工具栏和批操作工具栏

上级 88e37e90
package cn.ibizlab.codegen.model;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
......@@ -10,11 +12,11 @@ import net.ibizsys.model.control.IPSControl;
import net.ibizsys.model.control.IPSControlContainer;
import net.ibizsys.model.control.dashboard.IPSDBContainerPortletPart;
import net.ibizsys.model.control.dashboard.IPSDBPortletPart;
import net.ibizsys.model.control.toolbar.IPSDETBUIActionItem;
import net.ibizsys.model.control.toolbar.IPSDEToolbar;
import net.ibizsys.model.view.IPSUIAction;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
@Getter
@Setter
......@@ -64,6 +66,21 @@ public class CtrlModel extends BaseModel{
private Map<String, IPSAppViewRef> viewRefMap = new LinkedHashMap();
private String _quickToolbarName;
public String getQuickToolBarName() { return _quickToolbarName; };
private Collection<JSONObject> _quickToolbarItems = new ArrayList<>();
public Collection<JSONObject> getQuickToolBarItems(){
return _quickToolbarItems;
}
private String _batchToolbarName;
public String getBatchToolBarName() { return _batchToolbarName; };
private Collection<JSONObject> _batchToolbarItems = new ArrayList<>();
public Collection<JSONObject> getBatchToolBarItems(){
return _batchToolbarItems;
}
public CtrlModel addCtrl(String codeName,CtrlModel ctrlModel)
{
if(!ctrlsMap.containsKey(codeName))
......@@ -116,6 +133,70 @@ public class CtrlModel extends BaseModel{
if(!app.getCtrlsMap().containsKey(ctrlModel.getId())) {
app.getCtrlsMap().put(ctrlModel.getId(),ctrlModel);
}
if("TOOLBAR".equals(_control.getControlType())){
JSONObject mdToolbar = new JSONObject();
mdToolbar.put("codeName",_control.getCodeName());
mdToolbar.put("controlType",_control.getControlType());
mdToolbar.put("logicName",_control.getLogicName());
if(((IPSDEToolbar)_control).getPSDEToolbarItems() != null){
JSONArray items = new JSONArray();
((IPSDEToolbar)_control).getPSDEToolbarItems().forEach(singleItam ->{
JSONObject toolbarItem = new JSONObject();
toolbarItem.put("caption",singleItam.getCaption());
if(singleItam.getCapPSLanguageRes() != null && singleItam.getCapPSLanguageRes().getLanResTag() != null){
toolbarItem.put("capPSLanguageRes",singleItam.getCapPSLanguageRes().getLanResTag());
}
toolbarItem.put("tooltip",singleItam.getTooltip());
if(singleItam.getTooltipPSLanguageRes() != null && singleItam.getTooltipPSLanguageRes().getLanResTag() != null){
toolbarItem.put("tooltipPSLanguageRes",singleItam.getTooltipPSLanguageRes().getLanResTag());
}
toolbarItem.put("itemType",singleItam.getItemType());
toolbarItem.put("name",singleItam.getName());
toolbarItem.put("showCaption",singleItam.isShowCaption());
toolbarItem.put("showIcon",singleItam.isShowIcon());
if(singleItam.getPSSysImage() != null && singleItam.getPSSysImage().getCssClass() != null){
toolbarItem.put("iconClass",singleItam.getPSSysImage().getCssClass());
}
if(singleItam.getPSSysImage() != null && singleItam.getPSSysImage().getImagePath() != null){
toolbarItem.put("imgPath",singleItam.getPSSysImage().getImagePath());
}
if("DEUIACTION".equals(singleItam.getItemType())){
IPSDETBUIActionItem actionItem = (IPSDETBUIActionItem)singleItam;
toolbarItem.put("groupExtractMode",actionItem.getNoPrivDisplayMode());
toolbarItem.put("noPrivDisplayMode",actionItem.getNoPrivDisplayMode());
toolbarItem.put("id",actionItem.getPSAppViewUIAction().getId());
toolbarItem.put("xDataControlName",actionItem.getPSAppViewUIAction().getXDataControlName());
if(actionItem.getPSAppViewUIAction().getPSUIAction() != null){
IPSUIAction UIAction = actionItem.getPSAppViewUIAction().getPSUIAction();
JSONObject appUIAction = new JSONObject();
appUIAction.put("caption",UIAction.getCaption());
if(UIAction.getCapPSLanguageRes() != null && UIAction.getCapPSLanguageRes().getLanResTag() != null){
appUIAction.put("capPSLanguageRes",UIAction.getCapPSLanguageRes().getLanResTag());
}
appUIAction.put("codeName",UIAction.getCodeName());
appUIAction.put("fullCodeName",UIAction.getFullCodeName());
appUIAction.put("name",UIAction.getName());
appUIAction.put("uIActionMode",UIAction.getUIActionMode());
appUIAction.put("uIActionTag",UIAction.getUIActionTag());
appUIAction.put("uIActionType",UIAction.getUIActionType());
appUIAction.put("actionTarget",UIAction.getActionTarget());
appUIAction.put("dataAccessAction",UIAction.getDataAccessAction());
toolbarItem.put("uIAction",appUIAction);
}
}
items.add(toolbarItem);
});
mdToolbar.put("items", items);
}
if (_control.getName() != null && _control.getName().endsWith("quicktoolbar")) {
_quickToolbarItems.add(mdToolbar);
_quickToolbarName = _control.getName();
}
if (_control.getName() != null && _control.getName().endsWith("batchtoolbar")) {
_batchToolbarItems.add(mdToolbar);
_batchToolbarName = _control.getName();
}
}
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册