提交 3a6f02ee 编写于 作者: Mosher's avatar Mosher

update:更新部件发布逻辑,增加子部件添加逻辑

上级 d67f1831
...@@ -8,6 +8,7 @@ import lombok.experimental.Accessors; ...@@ -8,6 +8,7 @@ import lombok.experimental.Accessors;
import net.ibizsys.model.app.view.IPSAppViewRef; import net.ibizsys.model.app.view.IPSAppViewRef;
import net.ibizsys.model.control.IPSControl; import net.ibizsys.model.control.IPSControl;
import net.ibizsys.model.control.IPSControlContainer; import net.ibizsys.model.control.IPSControlContainer;
import net.ibizsys.model.control.dashboard.IPSDBContainerPortletPart;
import java.util.Collection; import java.util.Collection;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
...@@ -44,6 +45,7 @@ public class CtrlModel extends BaseModel{ ...@@ -44,6 +45,7 @@ public class CtrlModel extends BaseModel{
}); });
} }
} }
handleChildControls();
} }
public Map<String,CtrlModel> ctrlsMap = new LinkedHashMap(); public Map<String,CtrlModel> ctrlsMap = new LinkedHashMap();
...@@ -86,4 +88,37 @@ public class CtrlModel extends BaseModel{ ...@@ -86,4 +88,37 @@ public class CtrlModel extends BaseModel{
return this.viewRefMap.values(); return this.viewRefMap.values();
} }
public void handleChildControls() {
IPSControl control = getControl();
if (control instanceof IPSControlContainer) {
IPSControlContainer controlContainer = (IPSControlContainer)control;
List<IPSControl> controls = controlContainer.getPSControls();
if (controls != null && controls.size() > 0) {
for (IPSControl _control : controls) {
CtrlModel ctrlModel = new CtrlModel(app, _control);
if(ctrlModel.getControl().getPSAppDataEntity() != null) {
AppEntityModel ctrlAppEntity = app.getAppEntity(ctrlModel.getControl().getPSAppDataEntity().getCodeName());
ctrlModel.setAppEntity(ctrlAppEntity);
ctrlAppEntity.addCtrl(ctrlModel.getId(), ctrlModel);
}
addCtrl(ctrlModel.getId(), ctrlModel);
if(!app.getCtrlsMap().containsKey(ctrlModel.getId())) {
app.getCtrlsMap().put(ctrlModel.getId(),ctrlModel);
}
}
}
}
}
// 忽略发布
public Boolean ignore() {
IPSControl control = getControl();
// 忽略容器门户部件
if (control instanceof IPSDBContainerPortletPart) {
return true;
}
// 后续有忽略发布的部件在此处补充
return false;
}
} }
...@@ -195,8 +195,10 @@ public class ModelStorage { ...@@ -195,8 +195,10 @@ public class ModelStorage {
{ {
getSystemModel().getApps().forEach(app->{ getSystemModel().getApps().forEach(app->{
app.getCtrls().forEach(item->{ app.getCtrls().forEach(item->{
CliOption opt=newCliOption(TemplateFileType.ctrl).setCliSubType(item.getTempFilter().toUpperCase()).baseData(item,StringAdvUtils.spinalcase(item.getCodeName())).set("apps",app.getCodeName().toLowerCase()).set("appEntities",item.getFolder().toSpinalCase()); if (!item.ignore()) {
rt.addOption(opt); CliOption opt=newCliOption(TemplateFileType.ctrl).setCliSubType(item.getTempFilter().toUpperCase()).baseData(item,StringAdvUtils.spinalcase(item.getCodeName())).set("apps",app.getCodeName().toLowerCase()).set("appEntities",item.getFolder().toSpinalCase());
rt.addOption(opt);
}
}); });
}); });
} }
......
...@@ -50,36 +50,6 @@ public class PageModel extends BaseModel{ ...@@ -50,36 +50,6 @@ public class PageModel extends BaseModel{
if(!this.ctrlsMap.containsKey(ctrl.getId())){ if(!this.ctrlsMap.containsKey(ctrl.getId())){
this.ctrlsMap.put(ctrl.getId(),ctrl); this.ctrlsMap.put(ctrl.getId(),ctrl);
} }
String ctrlType = ctrl.getControl().getControlType();
// 树导航栏获取数据部件
if ("TREEEXPBAR".equals(ctrlType) || "DASHBOARD".equals(ctrlType) || "TABEXPPANEL".equals(ctrlType)) {
List<IPSControl> controls = new ArrayList<>();
switch (ctrlType) {
case "TREEEXPBAR":
controls = ((IPSExpBar)item).getPSControls();
break;
case "DASHBOARD":
controls = ((IPSDashboard)item).getPSControls();
break;
case "TABEXPPANEL":
controls = ((IPSTabExpPanel)item).getPSControls();
break;
}
if (controls.size() > 0) {
for (IPSControl control : controls) {
CtrlModel ctrlModel = new CtrlModel(appModel, control);
if(ctrlModel.getControl().getPSAppDataEntity()!=null) {
AppEntityModel ctrlAppEntity = app.getAppEntity(ctrlModel.getControl().getPSAppDataEntity().getCodeName());
ctrlModel.setAppEntity(ctrlAppEntity);
ctrlAppEntity.addCtrl(ctrlModel.getId(), ctrlModel);
}
ctrl.addCtrl(ctrlModel.getId(), ctrlModel);
if(!this.app.getCtrlsMap().containsKey(ctrlModel.getId())) {
this.app.getCtrlsMap().put(ctrlModel.getId(),ctrlModel);
}
}
}
}
}); });
} }
// 初始化工具栏数据 // 初始化工具栏数据
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册