diff --git a/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java b/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java index da49dd026..4ae34e53a 100644 --- a/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java +++ b/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java @@ -21,6 +21,8 @@ import com.fr.stable.StringUtils; import com.fr.stable.js.WidgetName; import com.fr.util.ParameterApplyHelper; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -338,6 +340,22 @@ public abstract class DesignModelAdapter allParameterList = new ArrayList<>(Arrays.asList(parameters)); + List tableDataParameterList = new ArrayList<>(); + for (ParameterProvider parameterProvider : tableDataParameters) { + tableDataParameterList.add((Parameter) parameterProvider); + } + allParameterList.removeAll(tableDataParameterList); + parameters = allParameterList.toArray(new Parameter[0]); + } + + + public void updateAllParameters() { + parameters = getLatestParameters(); + } + protected void addGlobalParameters(Map map) { // 添加全局参数 Parameter[] glbParas = ParameterConfig.getInstance().getGlobalParameters(); diff --git a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java index 2903b12a1..8a6e7a7df 100644 --- a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java @@ -60,6 +60,7 @@ public class TableDataSourceAction extends TemplateComponentAction richEditorPane) { super(fieldAttrPane, richEditorPane); } + protected void initDefaultFieldButton() { + super.initDefaultFieldButton(); + + VanChartFieldListener listener = getFieldListener(); + setValueButton(new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Value_Pointer"), + new AttrTooltipValueFormat(), false, listener)); + targetValueButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Target_Value"), + new AttrTooltipTargetValueFormat(), false, listener); + } + protected void addDefaultFieldButton(JPanel fieldPane) { fieldPane.add(getCategoryNameButton()); fieldPane.add(getValueButton()); + fieldPane.add(targetValueButton); fieldPane.add(getPercentButton()); } @@ -27,8 +46,24 @@ public class VanChartFieldListPaneWithOutSeries extends VanChartFieldListPane { fieldButtonList.add(getCategoryNameButton()); fieldButtonList.add(getValueButton()); + fieldButtonList.add(targetValueButton); fieldButtonList.add(getPercentButton()); return fieldButtonList; } + + public void populateDefaultField(AttrTooltipContent tooltipContent) { + super.populateDefaultField(tooltipContent); + + if (tooltipContent instanceof GaugeValueTooltipContent) { + GaugeValueTooltipContent gaugeValueTooltipContent = (GaugeValueTooltipContent) tooltipContent; + populateButtonFormat(targetValueButton, gaugeValueTooltipContent.getRichTextTargetValueFormat()); + } + } + + public void updateDefaultField(AttrTooltipContent tooltipContent) { + super.updateDefaultField(tooltipContent); + GaugeValueTooltipContent gaugeValueTooltipContent = (GaugeValueTooltipContent) tooltipContent; + updateButtonFormat(targetValueButton, gaugeValueTooltipContent.getRichTextTargetValueFormat()); + } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java index 0dd2fcc15..a06cb1cd0 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java @@ -14,6 +14,8 @@ import com.fr.design.widget.FRWidgetFactory; import com.fr.form.main.Form; import com.fr.form.ui.FormWidgetHelper; import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WBodyLayoutType; +import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WSortLayout; import com.fr.form.ui.widget.CRBoundsWidget; @@ -123,9 +125,7 @@ public class MobileComponentFrozenPane extends BasicPane { } private List frozenWidgets() { - Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget(); - WLayout container = form.getContainer(); - WSortLayout wSortLayout = (WSortLayout) container.getWidget(container.getWidgetCount() - 1); + WSortLayout wSortLayout = getBodyWSortLayout(); List list = wSortLayout.getNonContainerWidgetList(); List widgets = new ArrayList<>(); for (String value : list) { @@ -137,6 +137,18 @@ public class MobileComponentFrozenPane extends BasicPane { return widgets; } + private WSortLayout getBodyWSortLayout() { + Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget(); + WLayout container = form.getContainer(); + WFitLayout wFitLayout = (WFitLayout) container.getWidget(container.getWidgetCount() - 1); + WSortLayout wSortLayout = wFitLayout; + if (wFitLayout.getBodyLayoutType() == WBodyLayoutType.ABSOLUTE) { + CRBoundsWidget boundsWidget = (CRBoundsWidget) wFitLayout.getWidget(0); + wSortLayout = (WSortLayout) boundsWidget.getWidget(); + } + return wSortLayout; + } + @Override protected String title4PopupWindow() { return "ComponentFrozenPane";