Browse Source

Merge pull request #9508 in DESIGN/design from final/11.0 to persist/11.0

* commit 'ff262162793157652afb496ff91dd0beffb8ab4a':
  REPORT-74118 单元格数据源老模板切换到数据集数据并添加多分类,多分类不可修改
  KERNEL-11853 抽数缓存最小更新间隔限制1分钟,不允许小数
  KERNEL-11853 抽数缓存最小更新间隔限制1分钟,不允许小数
  KERNEL-11853 抽数缓存最小更新间隔限制1分钟,不允许小数
  KERNEL-11853 抽数缓存最小更新间隔限制1分钟,不允许小数
  抽数缓存最小更新间隔限制1分钟,不允许小数
  REPORT-74775 【设计器】内置数据集预览数据,多列情况,显示有问题
  REPORT-75174 FR11新自适应-PC端自适应属性报表块选择自定义,报表块右侧Pc浏览器自适应设置项选择双向自适应,切换为新模式后,报表块变为不自动调整
  REPORT-74603 嵌入式数据库的限制访问
  REPORT-74664 重新打开新模式模板按钮显示老模式
  REPORT-73491 聚合报表条件属性配置面板,在设计器重启后该面板不能正确显示
  REPORT-71824 frm打开报表块编辑页面,切换工作目录无法打开当前frm
fix-lag
superman 2 years ago
parent
commit
922600130a
  1. 29
      designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java
  2. 3
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java
  3. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateTableDataContentPane.java
  4. 24
      designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
  5. 10
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  6. 2
      designer-form/src/main/java/com/fr/design/fit/NewJForm.java
  7. 23
      designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java
  8. 17
      designer-realize/src/main/java/com/fr/poly/creator/ECBlockEditor.java

29
designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java

@ -15,6 +15,7 @@ import com.fr.esd.util.ESDUtils;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.third.org.quartz.CronExpression;
import javax.swing.AbstractAction;
import javax.swing.JPanel;
@ -25,9 +26,11 @@ import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URI;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Date;
/**
* @author rinoux
@ -36,7 +39,6 @@ import java.util.List;
*/
public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
private static final String CRON_HELP_URL = "http://help.fanruan.com/finereport/doc-view-693.html";
private UIRadioButton selectAutoUpdate;
private UIRadioButton selectBySchema;
private UICheckBox shouldEvolve;
@ -131,8 +133,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
ob = StrategyConfigHelper.createStrategyConfig(true, false, true);
}
this.strategyConfig = ob;
this.updateInterval.setText(ob.getUpdateInterval() <= 0 ? "0" : String.valueOf(ob.getUpdateInterval() / (double) CacheConstants.MILLIS_OF_MINUTE));
this.updateInterval.setText(ob.getUpdateInterval() <= 0 ? "0" : String.format("%.0f", ob.getUpdateInterval() / (double) CacheConstants.MILLIS_OF_MINUTE));
this.schemaTime.setText(StringUtils.join(",", ob.getUpdateSchema().toArray(new String[0])));
this.shouldEvolve.setSelected(ob.shouldEvolve());
this.selectBySchema.setSelected(ob.isScheduleBySchema());
@ -177,11 +178,19 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
if (ESDUtils.checkUpdateTimeSchema(text)) {
if (ESDUtils.isCronExpression(text)) {
if (checkCornTimeInterval(text)) {
schemaTimes.add(text);
} else {
this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Interval_Too_Short"));
this.schemaTimeCheckTips.setVisible(true);
throw new IllegalArgumentException("[ESD]Update schema time interval is to short.");
}
} else {
Collections.addAll(schemaTimes, text.split(","));
}
} else {
this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Format"));
this.schemaTimeCheckTips.setVisible(true);
throw new IllegalArgumentException("[ESD]Update schema time format error.");
}
@ -211,7 +220,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
private boolean checkUpdateInterval(String intervalValue) {
try {
return !StringUtils.isEmpty(intervalValue) && !(Double.parseDouble(intervalValue) <= 0);
return !StringUtils.isEmpty(intervalValue) && !(Integer.parseInt(intervalValue) <= 0);
} catch (NumberFormatException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
@ -219,6 +228,18 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
return false;
}
private boolean checkCornTimeInterval (String cronText) {
// 判断后两次更新时间间隔,如果小于1分钟就返回false
try {
CronExpression cron = new CronExpression(cronText);
Date next1 = cron.getNextValidTimeAfter(new Date());
Date next2 = cron.getNextValidTimeAfter(next1);
return next2.getTime() - next1.getTime() >= CacheConstants.MILLIS_OF_MINUTE;
} catch (ParseException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return false;
}
protected String title4PopupWindow() {
return InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cache_Strategy_Config_Title");

3
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java

@ -65,6 +65,9 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
dataJTable.setDefaultEditor(Date.class, new DateEditor(new UIDatePicker(UIDatePicker.STYLE_CN_DATE1)));
tableStructureChanged();
// 当前版本已经不会出现Float, 这里兜底一下防止报错
dataJTable.setDefaultRenderer(Float.class, new DoubleRenderer());
// 单击即可编辑
editbysingleclick(dataJTable, String.class);
editbysingleclick(dataJTable, Date.class);

3
designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateTableDataContentPane.java

@ -22,13 +22,14 @@ public class VanChartMoreCateTableDataContentPane extends CategoryPlotMoreCateTa
@Override
public void populateBean(ChartCollection collection) {
super.populateBean(collection);
VanChartRectanglePlot plot = (VanChartRectanglePlot) collection.getSelectedChart().getPlot();
VanChartRectanglePlot plot = collection.getSelectedChart().getPlot();
isSupportMultiCategory = plot.isSupportMultiCategory();
checkBoxList(isSupportMultiCategory);
}
protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) {
super.updateMoreCate(normal, plot);
isSupportMultiCategory = ((VanChartRectanglePlot) plot).isSupportMultiCategory();
((VanChartPlot) plot).setCategoryNum(getBoxList().size() + 1);
if (!getBoxList().isEmpty()) {
plot.getDataSheet().setVisible(false);

24
designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java

@ -4,9 +4,6 @@
package com.fr.design.designer.creator;
import com.fr.base.chart.BaseChartCollection;
import com.fr.base.theme.FineColorFlushUtils;
import com.fr.base.theme.FineColorGather;
import com.fr.base.theme.FineColorManager;
import com.fr.base.theme.FineColorSynchronizer;
import com.fr.base.theme.FormTheme;
import com.fr.base.theme.TemplateTheme;
@ -82,6 +79,9 @@ import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.report.fit.FitProvider;
import com.fr.report.fit.ReportFitAttr;
import com.fr.report.fit.ReportFitConfig;
import com.fr.stable.StringUtils;
import com.fr.third.javax.annotation.Nonnull;
import java.util.Set;
@ -486,4 +486,22 @@ public class XCreatorUtils {
}
}
public static ReportFitAttr getElementCaseEditorReportFitAttr(ElementCaseEditor editor, FitProvider wbTpl) {
//这边获取到的全局要考虑到服务器的配置
ReportFitAttr fitAttr = wbTpl.getReportFitAttr() == null ? ReportFitConfig.getInstance().getFrmFitAttr() : wbTpl.getReportFitAttr();
return getElementCaseEditorReportFitAttr(editor, fitAttr);
}
public static ReportFitAttr getElementCaseEditorReportFitAttr(ElementCaseEditor editor, ReportFitAttr fitAttr) {
//兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应)
if (editor.getFitStateInPC() == 0) {
editor.setReportFitAttr(null);
}
ReportFitAttr reportFit = editor.getReportFitAttr();
if (fitAttr != null) {
reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr;
}
return editor.getReportFitAttr() == null ? fitAttr : reportFit;
}
}

10
designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java

@ -131,15 +131,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
//这边获取到的全局要考虑到服务器的配置
ReportFitAttr fitAttr = wbTpl.getReportFitAttr() == null ? ReportFitConfig.getInstance().getFrmFitAttr() : wbTpl.getReportFitAttr();
ElementCaseEditor editor = this.toData();
//兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应)
if (editor.getFitStateInPC() == 0) {
editor.setReportFitAttr(null);
}
ReportFitAttr reportFit = editor.getReportFitAttr();
if (fitAttr != null) {
reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr;
}
ReportFitAttr reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit;
ReportFitAttr reportFitAttr = XCreatorUtils.getElementCaseEditorReportFitAttr(editor, fitAttr);
BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor();
CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr);
if (editor.getReportFitAttr() == null) {

2
designer-form/src/main/java/com/fr/design/fit/NewJForm.java

@ -55,7 +55,7 @@ public class NewJForm extends JForm {
public NewJForm(Form form) {
super(form);
//新建的模板都要加上新表单标志attr
form.addAttrMark(NewFormMarkAttr.createNewFormAttr());
getTarget().addAttrMark(NewFormMarkAttr.createNewFormAttr());
init();
}

23
designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java

@ -1,6 +1,7 @@
package com.fr.design.fit.common;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.fit.NewJForm;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
@ -11,6 +12,7 @@ import com.fr.file.MemFILE;
import com.fr.form.fit.NewFormMarkAttr;
import com.fr.form.main.Form;
import com.fr.form.main.WidgetGather;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout;
@ -94,15 +96,36 @@ public class AdaptiveSwitchUtil {
}
//如果是从旧的设计模板转化为新的设计模式,并且不是全局配置的模板。则更新新模板的Pc端自适应属性
if (newJForm.getTarget().getReportFitAttr() != null && newJForm.isNewJFrom()) {
//兼容处理老模式下报表块自适应属性设置为跟随报表整体自适应
compatibleProcessECReportFitAttr(newJForm.getTarget());
//修改自适应属性
newJForm.getTarget().setReportFitAttr(shiftReportFitAttr(oldForm, newJForm.getTarget().getReportFitAttr().isFitFont()));
//修改绝对布局中的缩放属性
processAbsoluteLayoutCompatible(newJForm.getTarget());
}
TemplateTool.saveForm(newJForm);
return newJForm;
}
private static void compatibleProcessECReportFitAttr(Form form) {
Form.traversalWidget(form.getContainer(), new WidgetGather() {
@Override
public void dealWith(Widget widget) {
ElementCaseEditor editor = (ElementCaseEditor) widget;
ReportFitAttr reportFitAttr = XCreatorUtils.getElementCaseEditorReportFitAttr(editor, form);
if (reportFitAttr.fitStateInPC() != 0) {
editor.setReportFitAttr(reportFitAttr);
}
}
@Override
public boolean dealWithAllCards() {
return true;
}
}, ElementCaseEditor.class);
}
private static void processAbsoluteLayoutCompatible(Form form) {
Form.traversalWidget(form.getContainer(), new WidgetGather() {

17
designer-realize/src/main/java/com/fr/poly/creator/ECBlockEditor.java

@ -3,7 +3,6 @@
*/
package com.fr.poly.creator;
import com.fr.base.BaseUtils;
import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
@ -11,7 +10,15 @@ import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.mainframe.*;
import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.design.mainframe.CellWidgetPropertyPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.HyperlinkGroupPaneActionImpl;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.mainframe.ReportFloatPane;
import com.fr.design.mainframe.cell.QuickEditorRegion;
import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.grid.GridUtils;
@ -26,8 +33,9 @@ import com.fr.report.poly.PolyECBlock;
import com.fr.stable.unit.UNITConstants;
import com.fr.stable.unit.UnitRectangle;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Dimension;
/**
* @author richer
@ -166,6 +174,7 @@ public class ECBlockEditor extends BlockEditor<ECBlockPane, PolyECBlock> {
// 条件属性
ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance();
conditionAttributesGroupPane.populate(editComponent);
EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane);
EastRegionContainerPane.getInstance().updateCellElementState(isSelectedOneCell());
if (chooseBlock) {

Loading…
Cancel
Save