Browse Source

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

* commit 'c157d33aca26b7204075d9bd46d5a23abe9df8c8':
  REPORT-65502 【外包验收】分页设置-按行分页,设置超过500时值会保存为空而不是1或500
  REPORT-65290 设计器-水印,平台改变水印开关,模板水印变成了模板单独设置 1.判断水印的有效值
  REPORT-65576 框选单元格,切换主题,会影响单元格内容的格式
  REPORT-65515【稳定共创】公式编辑器-存在插件函数时,选择数据集参数函数显示跳转显示有问题 1.选择参数的时候返回默认值
  REPORT-61615 设计器未安装数据集/数据连接插件 但服务器安装了 设计器端保存数据集/数据连接会造成连接丢失
persist/11.0
superman 3 years ago
parent
commit
35ce67eb0e
  1. 20
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
  2. 19
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  3. 10
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  4. 6
      designer-base/src/main/java/com/fr/design/report/WatermarkSettingPane.java
  5. 6
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  6. 17
      designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java
  7. 17
      designer-realize/src/main/java/com/fr/design/webattr/PageWebSettingPane.java

20
designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java

@ -17,9 +17,12 @@ import com.fr.event.EventDispatcher;
import com.fr.file.ProcedureConfig; import com.fr.file.ProcedureConfig;
import com.fr.file.TableDataConfig; import com.fr.file.TableDataConfig;
import com.fr.file.TableDataOperator; import com.fr.file.TableDataOperator;
import com.fr.file.TableDataOperatorImpl;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -246,7 +249,13 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
tableDataBeans.add(new TableDataBean(nameObject.getName(), oldName, (TableData) nameObject.getObject())); tableDataBeans.add(new TableDataBean(nameObject.getName(), oldName, (TableData) nameObject.getObject()));
} }
try { try {
WorkContext.getCurrent().get(TableDataOperator.class).saveTableData(tableDataBeans); WorkContext.getCurrent().get(TableDataOperator.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
// 走老的方式
return saveByOldWay(tableDataBeans);
}
}).saveTableData(new ArrayList<>(tableDataConfig.getTableDatas().keySet()), tableDataBeans);
if (!WorkContext.getCurrent().isLocal()) { if (!WorkContext.getCurrent().isLocal()) {
EventDispatcher.fire(RemoteConfigEvent.EDIT, TableDataConfig.getInstance().getNameSpace()); EventDispatcher.fire(RemoteConfigEvent.EDIT, TableDataConfig.getInstance().getNameSpace());
} }
@ -255,6 +264,15 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
} }
} }
private boolean saveByOldWay(List<TableDataBean> tableDataBean) {
try {
return TableDataOperatorImpl.getInstance().saveTableData(tableDataBean);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return false;
}
}
@Override @Override
public void update(TableDataSource tds) { public void update(TableDataSource tds) {
tds.clearAllTableData(); tds.clearAllTableData();

19
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -16,8 +16,11 @@ import com.fr.design.i18n.Toolkit;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionConfig;
import com.fr.file.ConnectionOperator; import com.fr.file.ConnectionOperator;
import com.fr.file.ConnectionOperatorImpl;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -170,7 +173,12 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
connectionBeans.add(new ConnectionBean(nameObject.getName(), oldName, (Connection) nameObject.getObject())); connectionBeans.add(new ConnectionBean(nameObject.getName(), oldName, (Connection) nameObject.getObject()));
} }
try { try {
WorkContext.getCurrent().get(ConnectionOperator.class).saveConnection(connectionBeans); WorkContext.getCurrent().get(ConnectionOperator.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
return saveByOldWay(connectionBeans);
}
}).saveConnection(new ArrayList<>(connectionConfig.getConnections().keySet()), connectionBeans);
if (!WorkContext.getCurrent().isLocal()) { if (!WorkContext.getCurrent().isLocal()) {
EventDispatcher.fire(RemoteConfigEvent.EDIT, ConnectionConfig.getInstance().getNameSpace()); EventDispatcher.fire(RemoteConfigEvent.EDIT, ConnectionConfig.getInstance().getNameSpace());
} }
@ -179,6 +187,15 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
} }
} }
private boolean saveByOldWay(List<ConnectionBean> connectionBeans) {
try {
return ConnectionOperatorImpl.getInstance().saveConnection(connectionBeans);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return false;
}
}
public static void showDialog(Window parent) { public static void showDialog(Window parent) {
final ConnectionConfig connectionConfig = ConnectionConfig.getInstance(); final ConnectionConfig connectionConfig = ConnectionConfig.getInstance();
final ConnectionManagerPane connectionManagerPane = new ConnectionManagerPane() { final ConnectionManagerPane connectionManagerPane = new ConnectionManagerPane() {

10
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -555,6 +555,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
private void fixFunctionNameList(String functionName) { private void fixFunctionNameList(String functionName) {
int signOfContinue = 1; int signOfContinue = 1;
int indexOfFunction = 0; int indexOfFunction = 0;
boolean found = false;
for (int i = 0; i < functionTypeListModel.size(); i++) { for (int i = 0; i < functionTypeListModel.size(); i++) {
int signOfType = 0; int signOfType = 0;
FunctionGroup functionType = (FunctionGroup) functionTypeListModel.getElementAt(i); FunctionGroup functionType = (FunctionGroup) functionTypeListModel.getElementAt(i);
@ -568,6 +569,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
signOfType = 1; signOfType = 1;
signOfContinue = 0; signOfContinue = 0;
indexOfFunction = k; indexOfFunction = k;
found = true;
} }
} }
@ -577,8 +579,12 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
} }
} }
} }
functionNameList.setSelectedIndex(indexOfFunction); if (found) {
functionNameList.ensureIndexIsVisible(indexOfFunction); functionNameList.setSelectedIndex(indexOfFunction);
functionNameList.ensureIndexIsVisible(indexOfFunction);
} else {
functionTypeList.setSelectedIndex(0);
}
} }
private int getBeginPosition() { private int getBeginPosition() {

6
designer-base/src/main/java/com/fr/design/report/WatermarkSettingPane.java

@ -34,6 +34,7 @@ public class WatermarkSettingPane extends AbstractTemplateServerSettingPane {
@Override @Override
protected void populateServerSettings() { protected void populateServerSettings() {
WatermarkAttr watermarkAttr = ReportUtils.getWatermarkAttrFromServerConfig(); WatermarkAttr watermarkAttr = ReportUtils.getWatermarkAttrFromServerConfig();
watermarkAttr.setValid(true);
watermarkPane.populate(watermarkAttr); watermarkPane.populate(watermarkAttr);
} }
@ -55,8 +56,9 @@ public class WatermarkSettingPane extends AbstractTemplateServerSettingPane {
public WatermarkAttr update() { public WatermarkAttr update() {
WatermarkAttr watermark = watermarkPane.update(); WatermarkAttr watermark = watermarkPane.update();
if (isUsingServerSettings()) { if (!isUsingServerSettings()) {
watermark.setValid(false); watermark.setValid(true);
watermark.setWaterMarkProvider(WaterMarkProvideConstant.TEMPLATE);
} }
return watermark; return watermark;
} }

6
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java

@ -11,7 +11,6 @@ import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.style.BorderUtils; import com.fr.design.style.BorderUtils;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
@ -20,7 +19,7 @@ import javax.swing.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Rectangle; import java.text.Format;
/** /**
* @author zhou * @author zhou
@ -118,7 +117,10 @@ public class CellStylePane extends AbstractCellAttrPane {
AdjustWorkBookDefaultStyleUtils.adjustCellElement(cellElement); AdjustWorkBookDefaultStyleUtils.adjustCellElement(cellElement);
elementCase.addCellElement(cellElement); elementCase.addCellElement(cellElement);
} }
Format format = cellElement.getStyle().getFormat();
Style style = stylePane.updateBean(); Style style = stylePane.updateBean();
// 格式不能通过样式面板中的配置项修改,因此需要保留
style = style.deriveFormat(format);
cellElement.setStyle(style); cellElement.setStyle(style);
} }
}); });

17
designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java

@ -60,7 +60,7 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
private UICheckBox isPageFixedRowBox; private UICheckBox isPageFixedRowBox;
private UITextField pageFixedRowCountTextField; private UITextField pageFixedRowCountTextField;
private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92); private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92);
private static final Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]{0,2}$"); private static final Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]*$|^0");
//固定行数分页,每页最多500行,最少1行数据 //固定行数分页,每页最多500行,最少1行数据
private static final int MAX_ROW_COUNT = 500; private static final int MAX_ROW_COUNT = 500;
@ -275,18 +275,21 @@ public class PageToolBarPane extends AbstractEditToolBarPane {
@Override @Override
public void keyReleased(KeyEvent e) { public void keyReleased(KeyEvent e) {
String rowCount = pageFixedRowCountTextField.getText(); String rowCount = pageFixedRowCountTextField.getText();
if (!isRowCountValid(rowCount)) { pageFixedRowCountTextField.setText(convert2ValidRowCount(rowCount));
pageFixedRowCountTextField.setText(StringUtils.EMPTY);
}
} }
}; };
private boolean isRowCountValid(String rowCount) { private String convert2ValidRowCount(String rowCount) {
Matcher matcher = ROW_COUNT.matcher(rowCount); Matcher matcher = ROW_COUNT.matcher(rowCount);
if (matcher.find()) { if (matcher.find()) {
int count = Integer.parseInt(matcher.group()); int count = Integer.parseInt(matcher.group());
return count >= MIN_ROW_COUNT && count <= MAX_ROW_COUNT; if (count > MAX_ROW_COUNT) {
count = MAX_ROW_COUNT;
} else if (count < MIN_ROW_COUNT) {
count = MIN_ROW_COUNT;
}
return String.valueOf(count);
} }
return false; return StringUtils.EMPTY;
} }
} }

17
designer-realize/src/main/java/com/fr/design/webattr/PageWebSettingPane.java

@ -41,7 +41,7 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
private UICheckBox isPageFixedRowBox; private UICheckBox isPageFixedRowBox;
private UITextField pageFixedRowCountTextField; private UITextField pageFixedRowCountTextField;
private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92); private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92);
private static final Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]{0,2}$"); private static final Pattern ROW_COUNT = Pattern.compile("^[1-9][\\d]*$|^0");
private static final String DEFAULT_ROW_COUNT = "30"; private static final String DEFAULT_ROW_COUNT = "30";
//固定行数分页,每页最多500行,最少1行数据 //固定行数分页,每页最多500行,最少1行数据
@ -82,9 +82,7 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
@Override @Override
public void keyReleased(KeyEvent e) { public void keyReleased(KeyEvent e) {
String rowCount = pageFixedRowCountTextField.getText(); String rowCount = pageFixedRowCountTextField.getText();
if (!isRowCountValid(rowCount)) { pageFixedRowCountTextField.setText(convert2ValidRowCount(rowCount));
pageFixedRowCountTextField.setText(StringUtils.EMPTY);
}
} }
}); });
pageFixedRowCountTextField.addInputMethodListener(new InputMethodListener() { pageFixedRowCountTextField.addInputMethodListener(new InputMethodListener() {
@ -207,12 +205,17 @@ public class PageWebSettingPane extends WebSettingPane<WebPage> {
reportWebAttr.setWebPage(webContent); reportWebAttr.setWebPage(webContent);
} }
private boolean isRowCountValid(String rowCount) { private String convert2ValidRowCount(String rowCount) {
Matcher matcher = ROW_COUNT.matcher(rowCount); Matcher matcher = ROW_COUNT.matcher(rowCount);
if (matcher.find()) { if (matcher.find()) {
int count = Integer.parseInt(matcher.group()); int count = Integer.parseInt(matcher.group());
return count >= MIN_ROW_COUNT && count <= MAX_ROW_COUNT; if (count > MAX_ROW_COUNT) {
count = MAX_ROW_COUNT;
} else if (count < MIN_ROW_COUNT) {
count = MIN_ROW_COUNT;
}
return String.valueOf(count);
} }
return false; return StringUtils.EMPTY;
} }
} }

Loading…
Cancel
Save