Browse Source

REPORT-75998 添加注释、增加决策报表底层组件的搜索逻辑

feature/x
Destiny.Lin 2 years ago
parent
commit
2a810e445c
  1. 11
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/SearchComponentAction.java
  2. 7
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartMapDataFormulaAction.java
  3. 11
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchWidgetFormulaAction.java
  4. 3
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchWidgetFormulaManager.java

11
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/SearchComponentAction.java

@ -52,6 +52,8 @@ public class SearchComponentAction implements SearchAction {
content.setTemplateName(jTemplate.getTemplateName()); content.setTemplateName(jTemplate.getTemplateName());
content.addTRL(jTemplate.getTemplateName()); content.addTRL(jTemplate.getTemplateName());
content.setFrmFlag(true); content.setFrmFlag(true);
//处理最底层form组件
dealForm(componentInfos, content, form.getContainer());
//参数面板 //参数面板
dealPara(componentInfos, content, form.getParaContainer()); dealPara(componentInfos, content, form.getParaContainer());
//body面板 //body面板
@ -60,6 +62,15 @@ public class SearchComponentAction implements SearchAction {
setComponentInfos(componentInfos); setComponentInfos(componentInfos);
} }
private void dealForm(List<ComponentInfo> componentInfos, ITContent content, WLayout container) {
ITContent formContent = ITContent.copy(content);
formContent.setReplaceObject(container);
dealContent(formContent, container.getWidgetName());
formContent.addOtherPos(container.getWidgetName());
formContent.setJumpAble(false);
componentInfos.add(new ComponentInfo(formContent));
}
private void dealBody(List<ComponentInfo> componentInfos, ITContent content, Widget body) { private void dealBody(List<ComponentInfo> componentInfos, ITContent content, Widget body) {
if (body instanceof WLayout) { if (body instanceof WLayout) {
ITContent bodyContent = ITContent.copy(content); ITContent bodyContent = ITContent.copy(content);

7
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartMapDataFormulaAction.java

@ -159,6 +159,13 @@ public class SearchChartMapDataFormulaAction implements SearchChartDataFormula {
} }
} }
/**
* 处理区域名
* @param formulaInfos
* @param content
* @param object
* @param definition
*/
public void dealAreaName(List<FormulaInfo> formulaInfos, ITContent content, Object object, VanMapReportDefinition definition) { public void dealAreaName(List<FormulaInfo> formulaInfos, ITContent content, Object object, VanMapReportDefinition definition) {
if (object instanceof Formula) { if (object instanceof Formula) {
ITContent cateContent = ITContent.copy(content); ITContent cateContent = ITContent.copy(content);

11
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchWidgetFormulaAction.java

@ -20,6 +20,7 @@ import com.fr.form.ui.ChartEditor;
import com.fr.form.ui.Label; import com.fr.form.ui.Label;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.WScaleLayout; import com.fr.form.ui.container.WScaleLayout;
import com.fr.form.ui.container.WTitleLayout; import com.fr.form.ui.container.WTitleLayout;
import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.form.ui.widget.CRBoundsWidget;
@ -74,22 +75,21 @@ public class SearchWidgetFormulaAction extends AbstractSearchWidgetFormulaAction
private void searchFormulaFromWidgetValue(Info info, List<FormulaInfo> formulaInfos) { private void searchFormulaFromWidgetValue(Info info, List<FormulaInfo> formulaInfos) {
Widget widget = (Widget) info.getContent().getReplaceObject(); Widget widget = (Widget) info.getContent().getReplaceObject();
if (widget instanceof WScaleLayout) { if (widget instanceof WScaleLayout) {
widget = ((CRBoundsWidget) ((WScaleLayout) widget).getWidget(0)).getWidget(); widget = ((CRBoundsWidget) ((WScaleLayout) widget).getWidget(0)).getWidget();
info.getContent().setReplaceObject(widget); info.getContent().setReplaceObject(widget);
} }
if (widget instanceof WTitleLayout) { if (widget instanceof WTitleLayout) {
if (((WTitleLayout) widget).getTitleBoundsWidget() != null){ if (((WTitleLayout) widget).getTitleBoundsWidget() != null) {
CRBoundsWidget boundsWidget = ((WTitleLayout) widget).getTitleBoundsWidget(); CRBoundsWidget boundsWidget = ((WTitleLayout) widget).getTitleBoundsWidget();
if (boundsWidget.getWidget() instanceof Label){ if (boundsWidget.getWidget() instanceof Label) {
ITContent titleContent = ITContent.copy(info.getContent()); ITContent titleContent = ITContent.copy(info.getContent());
titleContent.setReplaceObject(((Label) boundsWidget.getWidget()).getWidgetValue().getValue()); titleContent.setReplaceObject(((Label) boundsWidget.getWidget()).getWidgetValue().getValue());
formulaInfos.add(new FormulaInfo(titleContent)); formulaInfos.add(new FormulaInfo(titleContent));
} }
} }
Widget tempWidget = (((WTitleLayout) widget).getBodyBoundsWidget()).getWidget(); Widget tempWidget = (((WTitleLayout) widget).getBodyBoundsWidget()).getWidget();
if (tempWidget instanceof ChartEditor && ((ChartEditor) tempWidget).getChartCollection() instanceof ChartCollection) { if (isChartValid(tempWidget)) {
SearchChartCollectionFormulaAction.getInstance().searchChartCollectionFormula(formulaInfos, info.getContent(), (ChartCollection) ((ChartEditor) tempWidget).getChartCollection()); SearchChartCollectionFormulaAction.getInstance().searchChartCollectionFormula(formulaInfos, info.getContent(), (ChartCollection) ((ChartEditor) tempWidget).getChartCollection());
} }
} }
@ -102,6 +102,9 @@ public class SearchWidgetFormulaAction extends AbstractSearchWidgetFormulaAction
} }
private boolean isChartValid(Widget tempWidget) {
return tempWidget instanceof ChartEditor && ((ChartEditor) tempWidget).getChartCollection() instanceof ChartCollection;
}
public boolean isReplaceObjectExist(Info info) { public boolean isReplaceObjectExist(Info info) {
return info.getContent() != null && info.getContent().getReplaceObject() != null; return info.getContent() != null && info.getContent().getReplaceObject() != null;

3
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchWidgetFormulaManager.java

@ -33,6 +33,7 @@ public class SearchWidgetFormulaManager implements SearchManager {
private static final String TREE_COMBO_BOX_EDITOR = "TreeComboBoxEditor"; private static final String TREE_COMBO_BOX_EDITOR = "TreeComboBoxEditor";
private static final String TREE_EDITOR = "TreeEditor"; private static final String TREE_EDITOR = "TreeEditor";
private static final String W_TITLE_LAYOUT = "WTitleLayout"; private static final String W_TITLE_LAYOUT = "WTitleLayout";
private static final String W_BORDER_LAYOUT = "WBorderLayout";
private SearchWidgetFormulaManager() { private SearchWidgetFormulaManager() {
/** /**
@ -48,7 +49,7 @@ public class SearchWidgetFormulaManager implements SearchManager {
register(NUMBER_EDITOR, SearchCommonWidgetFormulaAction.getInstance()); register(NUMBER_EDITOR, SearchCommonWidgetFormulaAction.getInstance());
register(TEXT_EDITOR, SearchCommonWidgetFormulaAction.getInstance()); register(TEXT_EDITOR, SearchCommonWidgetFormulaAction.getInstance());
register(W_TITLE_LAYOUT, SearchCommonWidgetFormulaAction.getInstance()); register(W_TITLE_LAYOUT, SearchCommonWidgetFormulaAction.getInstance());
register(W_BORDER_LAYOUT, SearchCommonWidgetFormulaAction.getInstance());
/** /**
* 日期类型 * 日期类型
*/ */

Loading…
Cancel
Save