Browse Source

Merge pull request #3626 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit 'de057086f73d4e8f586f292f9594b1b3e00129db':
  merge code
  update
  REPORT-48124 内置缓存插件漏掉了其它提交&方法改个名字
  REPORT-46915 重命名
  单元测试
  REPORT-47034 FRM新前端&新自适应合入主JAR
  添加单元测试
  REPORT-47034 FRM新前端&新自适应合入主JAR
  REPORT-46916 修复单元测试
  REPORT-46916 调整包名,兼容性调整
  REPORT-46916 调整包名
  REPORT-46916 新引擎内置,调整代码结构,适配代码调用方式
  REPORT-46916 新引擎内置,添加模块
  REPORT-46916 新引擎内置,添加模块
  esd-design内置融合
  REPORT-46915 内置
feature/10.0
superman 4 years ago
parent
commit
858f2c1596
  1. 94
      designer-base/src/main/java/com/fr/design/DesignModelAdapter.java
  2. 5
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
  3. 1
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java
  4. 8
      designer-base/src/main/resources/com/fr/design/images/buttonicon/prewidget_normal.svg
  5. 7
      designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/files_up_normal.svg
  6. 16
      designer-base/src/main/resources/com/fr/design/images/control/addPopup_disabled.svg
  7. 14
      designer-base/src/main/resources/com/fr/design/images/control/addPopup_normal.svg
  8. 8
      designer-base/src/main/resources/com/fr/design/images/control/edit_disabled.svg
  9. 8
      designer-base/src/main/resources/com/fr/design/images/control/edit_normal.svg
  10. 11
      designer-base/src/main/resources/com/fr/design/images/control/remove_disabled.svg
  11. 9
      designer-base/src/main/resources/com/fr/design/images/control/remove_normal.svg
  12. 11
      designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg
  13. 9
      designer-base/src/main/resources/com/fr/design/images/m_file/preview_normal.svg
  14. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java
  15. 3
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  16. 16
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java
  17. 23
      designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java
  18. 35
      designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java
  19. 26
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

94
designer-base/src/main/java/com/fr/design/DesignModelAdapter.java

@ -1,8 +1,11 @@
package com.fr.design;
import com.fr.base.Parameter;
import com.fr.base.ParameterConfig;
import com.fr.base.TableData;
import com.fr.base.io.BaseBook;
import com.fr.data.TableDataSource;
import com.fr.data.operator.DataOperator;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.design.mainframe.JTemplate;
@ -11,9 +14,14 @@ import com.fr.form.ui.DataControl;
import com.fr.form.ui.MultiFileEditor;
import com.fr.form.ui.Widget;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Filter;
import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
import com.fr.stable.js.WidgetName;
import com.fr.util.ParameterApplyHelper;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@ -40,7 +48,7 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
/**
* 全部的参数包括全局参数模板参数和数据集参数
*/
private Parameter[] parameters;
protected Parameter[] parameters;
/**
* 数据集参数
@ -52,6 +60,12 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
*/
private Parameter[] templateParameters;
/**
* 数据集参数缓存 更新时刷新
*/
protected Map<String, ParameterProvider[]> tableDataParametersMap = new HashMap<>();
public DesignModelAdapter(S jTemplate) {
this.jTemplate = jTemplate;
@ -241,6 +255,79 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
}
protected void addTableDataParameters(Map<String, ParameterProvider> map, Filter<ParameterProvider> filter) {
Iterator<String> it = this.getBook().getTableDataNameIterator();
try {
// 清空下缓存
tableDataParametersMap.clear();
while (it.hasNext()) {
String name = it.next();
TableData tableData = this.getBook().getTableData(name);
ParameterProvider[] parameterProviders = DataOperator.getInstance().getTableDataParameters(tableData);
if (filter != null) {
ParameterApplyHelper.addPara2Map(map, parameterProviders, filter);
} else {
ParameterApplyHelper.addPara2Map(map, parameterProviders);
}
tableDataParametersMap.put(name, parameterProviders);
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
protected void updateTableDataParameters(String oldName,
String tdName,
TableData tableData,
Map<String, ParameterProvider> map,
Filter<ParameterProvider> filter) {
ParameterProvider[] providers = null;
if (!ComparatorUtils.equals(oldName, tdName)) {
// 更新下缓存名称 替换下数据集名称
providers = tableDataParametersMap.remove(oldName);
if (providers != null) {
tableDataParametersMap.put(tdName, providers);
}
}
try {
for (Map.Entry<String, ParameterProvider[]> entry : tableDataParametersMap.entrySet()) {
ParameterProvider[] parameterProviders;
if (ComparatorUtils.equals(entry.getKey(), tdName)) {
parameterProviders = DataOperator.getInstance().getTableDataParameters(tableData);
// 用来更新缓存
providers = parameterProviders;
} else {
parameterProviders = entry.getValue();
}
if (filter != null) {
ParameterApplyHelper.addPara2Map(map, parameterProviders, filter);
} else {
ParameterApplyHelper.addPara2Map(map, parameterProviders);
}
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
if (providers != null) {
// 更新缓存
tableDataParametersMap.put(tdName, providers);
}
}
protected void addGlobalParameters(Map<String, ParameterProvider> map) {
// 添加全局参数
Parameter[] glbParas = ParameterConfig.getInstance().getGlobalParameters();
ParameterApplyHelper.addPara2Map(map, glbParas);
}
/**
* 环境改变.
*/
@ -251,6 +338,11 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
*/
public abstract void parameterChanged();
/**
* 数据集参数改变
*/
public abstract void tableDataParametersChanged(String oldName, String tdName, TableData tableData);
/**
* 控件配置改变.
*/

5
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java

@ -1,5 +1,6 @@
package com.fr.design.data.datapane;
import com.fr.base.BaseUtils;
import com.fr.base.TableData;
import com.fr.data.TableDataSource;
import com.fr.data.impl.TableDataSourceDependent;
@ -227,7 +228,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
}
fireDSChanged(map);
tc.fireTargetModified();
tc.parameterChanged();
tc.tableDataParametersChanged(oldName, tdName, td);
int[] rows = dataTree.getSelectionRows();
dataTree.refreshChildByName(tdName);
dataTree.setSelectionRows(rows);
@ -365,7 +366,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
}
fireDSChanged(map);
tc.fireTargetModified();
tc.parameterChanged();
tc.tableDataParametersChanged(oldName, tdName, td);
int[] rows = dataTree.getSelectionRows();
dataTree.refreshChildByName(tdName);
dataTree.setSelectionRows(rows);

1
designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

@ -1,6 +1,5 @@
package com.fr.design.mainframe.vcs.common;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager;
import com.fr.design.file.HistoryTemplateListCache;

8
designer-base/src/main/resources/com/fr/design/images/buttonicon/prewidget_normal.svg

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="20px" viewBox="0 0 30 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_控件管理 有小箭头_normal</title>
<g id="icon_控件管理-有小箭头_normal" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M16.0758389,11.7597783 L17.7397914,13.4242307 L14.4118864,16.7516357 L11.4999696,17.9996 L12.747934,15.0876832 L16.0758389,11.7597783 Z M17,3 C17.5522847,3 18,3.44771525 18,4 L18.0005048,10.107534 C17.6771796,10.0020594 17.3340722,9.9742129 17.0003341,10.0239839 L17,4 L5,4 L5,15 L11.697,15 L11.268,16 L5,16 C4.44771525,16 4,15.5522847 4,15 L4,4 C4,3.44771525 4.44771525,3 5,3 L17,3 Z M18,14.577 L18,15 C18,15.5522847 17.5522847,16 17,16 L16.576,16 L18,14.577 Z M18.1553795,11.3442402 C18.6148663,11.803727 18.6148663,12.5487057 18.1553795,13.0081926 L16.491427,11.3442402 C16.9509139,10.8852533 17.6958926,10.8852533 18.1553795,11.3442402 Z M15,10 L15,11.42 L13.42,13 L9,13 L9,10 L15,10 Z M8,10 L8,12 L6,12 L6,10 L8,10 Z M14,11 L10,11 L10,12 L14,12 L14,11 Z M15,6 L15,9 L9,9 L9,6 L15,6 Z M8,6 L8,8 L6,8 L6,6 L8,6 Z M14,7 L10,7 L10,8 L14,8 L14,7 Z" id="Combined-Shape" fill="#333334" fill-rule="nonzero"></path>
<path d="M23.3414214,10.3414214 L27,14 L27,14 L23.3414214,17.6585786 C23.2633165,17.7366835 23.1366835,17.7366835 23.0585786,17.6585786 C23.0210714,17.6210714 23,17.5702006 23,17.5171573 L23,10.4828427 C23,10.3723858 23.0895431,10.2828427 23.2,10.2828427 C23.2530433,10.2828427 23.3039141,10.3039141 23.3414214,10.3414214 Z" id="Rectangle-2" fill="#333334"></path>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

7
designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/files_up_normal.svg

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_控件_文件控件_normal</title>
<g id="icon_控件_文件控件_normal" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M11,-1.28785871e-13 L15,4.001 L15,14 L4,14 L4,3 L2,3 L2,15 L11,15 L11,14 L12,14 L12,16 L1,16 L1,2 L4,2 L4,-1.35780276e-13 L11,-1.28785871e-13 Z M10.586,1 L5,1 L5,13 L14,13 L13.999,4.415 L11,4.415 L10.999,4.405 L11,4.415 L10.586,4.415 L10.586,1 Z M13,10 L13,11 L6,11 L6,10 L13,10 Z M13,8 L13,9 L6,9 L6,8 L13,8 Z M13,6 L13,7 L6,7 L6,6 L13,6 Z" id="形状结合" fill="#333334"></path>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 758 B

16
designer-base/src/main/resources/com/fr/design/images/control/addPopup_disabled.svg

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="16px" viewBox="0 0 24 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组</title>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.3">
<g id="工具栏/导入数据集" transform="translate(-8.000000, -6.000000)">
<g id="编组" transform="translate(8.000000, 6.000000)">
<g fill="#333334" id="Combined-Shape">
<path d="M8,2 C8.38659932,2 8.7,2.32097101 8.7,2.69703907 L8.7,7.3 L13.3029609,7.3 C13.6558446,7.3 13.9474813,7.56107882 13.9936369,7.90444795 L14,8 C14,8.38659932 13.679029,8.7 13.3029609,8.7 L8.7,8.699 L8.7,13.3029609 C8.7,13.6558446 8.43892118,13.9474813 8.09555205,13.9936369 L8,14 C7.61340068,14 7.3,13.679029 7.3,13.3029609 L7.3,8.699 L2.69703907,8.7 C2.34415536,8.7 2.05251868,8.43892118 2.00636315,8.09555205 L2,8 C2,7.61340068 2.32097101,7.3 2.69703907,7.3 L7.3,7.3 L7.3,2.69703907 C7.3,2.34415536 7.56107882,2.05251868 7.90444795,2.00636315 L8,2 Z"></path>
</g>
<g transform="translate(16.000000, 4.000000)" fill="#8F8F92" id="Rectangle-6">
<path d="M2,0.997030139 C2,0.446385598 2.31387329,0.313873291 2.70591205,0.705912054 L6,4 L2.70591205,7.29408795 C2.31604759,7.68395241 2,7.54696369 2,7.00296986 L2,0.997030139 Z" transform="translate(4.000000, 4.000000) rotate(90.000000) translate(-4.000000, -4.000000) "></path>
</g>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

14
designer-base/src/main/resources/com/fr/design/images/control/addPopup_normal.svg

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="16px" viewBox="0 0 24 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组备份</title>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组备份">
<g id="Combined-Shape" fill="#333334">
<path d="M8,2 C8.38659932,2 8.7,2.32097101 8.7,2.69703907 L8.7,7.3 L13.3029609,7.3 C13.6558446,7.3 13.9474813,7.56107882 13.9936369,7.90444795 L14,8 C14,8.38659932 13.679029,8.7 13.3029609,8.7 L8.7,8.699 L8.7,13.3029609 C8.7,13.6558446 8.43892118,13.9474813 8.09555205,13.9936369 L8,14 C7.61340068,14 7.3,13.679029 7.3,13.3029609 L7.3,8.699 L2.69703907,8.7 C2.34415536,8.7 2.05251868,8.43892118 2.00636315,8.09555205 L2,8 C2,7.61340068 2.32097101,7.3 2.69703907,7.3 L7.3,7.3 L7.3,2.69703907 C7.3,2.34415536 7.56107882,2.05251868 7.90444795,2.00636315 L8,2 Z"></path>
</g>
<g id="Rectangle-6" transform="translate(16.000000, 4.000000)" fill="#8F8F92">
<path d="M2,0.997030139 C2,0.446385598 2.31387329,0.313873291 2.70591205,0.705912054 L6,4 L2.70591205,7.29408795 C2.31604759,7.68395241 2,7.54696369 2,7.00296986 L2,0.997030139 Z" transform="translate(4.000000, 4.000000) rotate(90.000000) translate(-4.000000, -4.000000) "></path>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

8
designer-base/src/main/resources/com/fr/design/images/control/edit_disabled.svg

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_编辑_disable</title>
<g id="icon_编辑_disable" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.299107143">
<path d="M9.95422984,2.34704298 L13.4897637,5.88257688 L6.18790578,13.1844348 L0.884604926,14.9522018 L2.65237188,9.64890094 L9.95422984,2.34704298 Z M13.4897637,1.6399362 L14.1968705,2.34704298 C14.9368113,3.08698374 14.9757555,4.2624679 14.3137033,5.04825533 L14.1968705,5.1754701 L10.6613366,1.6399362 C11.4423852,0.858887612 12.7087152,0.858887612 13.4897637,1.6399362 Z" id="形状结合" fill="#333334"></path>
<rect id="矩形" fill="#333334" x="7" y="14" width="7" height="1"></rect>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 864 B

8
designer-base/src/main/resources/com/fr/design/images/control/edit_normal.svg

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_编辑_normal</title>
<g id="icon_编辑_normal" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M9.95422984,2.34704298 L13.4897637,5.88257688 L6.18790578,13.1844348 L0.884604926,14.9522018 L2.65237188,9.64890094 L9.95422984,2.34704298 Z M13.4897637,1.6399362 L14.1968705,2.34704298 C14.9368113,3.08698374 14.9757555,4.2624679 14.3137033,5.04825533 L14.1968705,5.1754701 L10.6613366,1.6399362 C11.4423852,0.858887612 12.7087152,0.858887612 13.4897637,1.6399362 Z" id="形状结合" fill="#333334"></path>
<rect id="矩形" fill="#333334" x="7" y="14" width="7" height="1"></rect>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 840 B

11
designer-base/src/main/resources/com/fr/design/images/control/remove_disabled.svg

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_删除_normal</title>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.3">
<g id="工具栏/导入数据集" transform="translate(-78.000000, -7.000000)" fill="#333334">
<g id="icon_删除_normal" transform="translate(77.000000, 6.000000)">
<path d="M11,1 L11,3 L15,3 L15,4 L13,4 L13,15 L3,15 L3,4 L1,4 L1,3 L5,3 L5,1 L11,1 Z M12,4 L4,4 L4,14 L12,14 L12,4 Z M7,6 L7,12 L6,12 L6,6 L7,6 Z M10,6 L10,12 L9,12 L9,6 L10,6 Z M10,2 L6,2 L6,3 L10,3 L10,2 Z" id="Combined-Shape"></path>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 804 B

9
designer-base/src/main/resources/com/fr/design/images/control/remove_normal.svg

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_删除_normal备份</title>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Combined-Shape" transform="translate(-1.000000, -1.000000)" fill="#333334">
<path d="M11,1 L11,3 L15,3 L15,4 L13,4 L13,15 L3,15 L3,4 L1,4 L1,3 L5,3 L5,1 L11,1 Z M12,4 L4,4 L4,14 L12,14 L12,4 Z M7,6 L7,12 L6,12 L6,6 L7,6 Z M10,6 L10,12 L9,12 L9,6 L10,6 Z M10,2 L6,2 L6,3 L10,3 L10,2 Z"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 660 B

11
designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="12px" height="14px" viewBox="0 0 12 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_报表web属性_打印预览_normal</title>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.3">
<g id="工具栏/导入数据集" transform="translate(-116.000000, -7.000000)" fill="#333334">
<g id="icon_报表web属性_打印预览_normal" transform="translate(114.000000, 6.000000)">
<path d="M9.5,7 C11.432875,7 13,8.567125 13,10.5 C13,11.1075915 12.845147,11.679042 12.5727578,12.1770349 C12.6203353,12.2075319 12.6650188,12.2450114 12.7069,12.287 L13.7129,13.293 C14.1039,13.684 14.1039,14.316 13.7129,14.707 C13.5179,14.902 13.2619,15 13.0059,15 C12.7499,15 12.4939,14.902 12.2989,14.707 L11.2929,13.701 C11.251507,13.6597129 11.2144961,13.6157024 11.1818672,13.5695439 C10.6844106,13.8436886 10.110446,14 9.5,14 C7.567125,14 6,12.432875 6,10.5 C6,8.567125 7.567125,7 9.5,7 Z M10,1 L14,5 L14,8 L13,8 L13,6 L9,6 L9,2 L3,2 L3,14 L7,14 L7,15 L2,15 L2,1 L10,1 Z M9.5,8 C10.8783333,8 12,9.12166667 12,10.5 C12,11.8783333 10.8783333,13 9.5,13 C8.12166667,13 7,11.8783333 7,10.5 C7,9.12166667 8.12166667,8 9.5,8 Z M12.587,5 L10,2.414 L10,5 L12.587,5 Z" id="Combined-Shape"></path>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

9
designer-base/src/main/resources/com/fr/design/images/m_file/preview_normal.svg

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="12px" height="14px" viewBox="0 0 12 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_报表web属性_打印预览_normal备份</title>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Combined-Shape" transform="translate(-2.000000, -1.000000)" fill="#333334">
<path d="M9.5,7 C11.432875,7 13,8.567125 13,10.5 C13,11.1075915 12.845147,11.679042 12.5727578,12.1770349 C12.6203353,12.2075319 12.6650188,12.2450114 12.7069,12.287 L13.7129,13.293 C14.1039,13.684 14.1039,14.316 13.7129,14.707 C13.5179,14.902 13.2619,15 13.0059,15 C12.7499,15 12.4939,14.902 12.2989,14.707 L11.2929,13.701 C11.251507,13.6597129 11.2144961,13.6157024 11.1818672,13.5695439 C10.6844106,13.8436886 10.110446,14 9.5,14 C7.567125,14 6,12.432875 6,10.5 C6,8.567125 7.567125,7 9.5,7 Z M10,1 L14,5 L14,8 L13,8 L13,6 L9,6 L9,2 L3,2 L3,14 L7,14 L7,15 L2,15 L2,1 L10,1 Z M9.5,8 C10.8783333,8 12,9.12166667 12,10.5 C12,11.8783333 10.8783333,13 9.5,13 C8.12166667,13 7,11.8783333 7,10.5 C7,9.12166667 8.12166667,8 9.5,8 Z M12.587,5 L10,2.414 L10,5 L12.587,5 Z"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

11
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java

@ -47,6 +47,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@ -463,9 +464,15 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
private void refreshTableFieldParams(Map<String, String> params) {
List<String> tableFieldNames = VanChartRichEditorPane.getFieldNames();
List<String> defaultParams = Arrays.asList(getRichTextFieldNames());
if (tableFieldNames != null && params != null) {
for (String fieldName : tableFieldNames) {
if (tableFieldNames == null || params == null) {
return;
}
for (String fieldName : tableFieldNames) {
// 富文本默认参数和数据集字段重名时,显示默认参数
if (!defaultParams.contains(fieldName)) {
params.put(fieldName, "${" + fieldName + "_" + fieldName.hashCode() + "}");
}
}

3
designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java

@ -267,9 +267,6 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
if (editingMouseListener.stopEditing()) {
if (this != (XCreator) designer.getRootComponent()) {
ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this);
if (isEditing) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
}
editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter);
if (isEditing) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);

16
designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java

@ -194,7 +194,7 @@ public class EditingMouseListener extends MouseInputAdapter {
e.translatePoint(oldX - e.getX(), oldY - e.getY());
}
private void offsetEventPoint(MouseEvent e) {
private void offsetEventPoint(MouseEvent e){
int x = designer.getRelativeX(e.getX());
int y = designer.getRelativeY(e.getY());
e.translatePoint(x - e.getX(), y - e.getY());
@ -206,8 +206,8 @@ public class EditingMouseListener extends MouseInputAdapter {
* @param e 鼠标事件
*/
public void mouseReleased(MouseEvent e) {
MouseEvent transEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton());
MouseEvent clickEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton());
MouseEvent transEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton());
MouseEvent clickEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton());
int oldX = e.getX();
int oldY = e.getY();
offsetEventPoint(e);
@ -240,7 +240,7 @@ public class EditingMouseListener extends MouseInputAdapter {
}
}
private boolean isAutoFire(MouseEvent transEvent, MouseEvent clickEvent) {
private boolean isAutoFire(MouseEvent transEvent, MouseEvent clickEvent ) {
offsetEventPoint(transEvent);
XCreator xCreator = designer.getComponentAt(transEvent);
return (pressX != clickEvent.getX() || pressY != clickEvent.getY())
@ -728,15 +728,15 @@ public class EditingMouseListener extends MouseInputAdapter {
/**
* 刷新顶层组件
*/
public void refreshTopXCreator(boolean isEditing) {
* */
public void refreshTopXCreator(boolean isEditing){
designer.refreshTopXCreator(isEditing);
}
/**
* 刷新顶层组件
*/
public void refreshTopXCreator() {
* */
public void refreshTopXCreator(){
refreshTopXCreator(false);
}

23
designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java

@ -11,11 +11,15 @@ import com.fr.form.ui.BaseChartEditor;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.ui.Widget;
import com.fr.script.Calculator;
import com.fr.stable.EmbParaFilter;
import com.fr.stable.ParameterProvider;
import com.fr.stable.js.WidgetName;
import com.fr.util.ParameterApplyHelper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class FormModelAdapter extends DesignModelAdapter<Form, BaseJForm<Form>> {
@ -42,6 +46,16 @@ public class FormModelAdapter extends DesignModelAdapter<Form, BaseJForm<Form>>
jTemplate.populateParameter();
}
@Override
public void tableDataParametersChanged(String oldName, String tdName, TableData tableData) {
Map<String, ParameterProvider> map = new HashMap<>();
addGlobalParameters(map);
updateTableDataParameters(oldName, tdName, tableData, map, parameterProvider -> !EmbParaFilter.isFRLayerTypePara(parameterProvider));
ParameterApplyHelper.addPara2Map(map, this.getBook().getTemplateParameters());
parameters = map.values().toArray(new Parameter[0]);
jTemplate.populateParameter();
}
/**
* 控件配置改变.
*/
@ -135,6 +149,13 @@ public class FormModelAdapter extends DesignModelAdapter<Form, BaseJForm<Form>>
@Override
protected Parameter[] getLatestParameters() {
return this.getBook().getParameters();
Map<String, ParameterProvider> map = new HashMap<>();
addGlobalParameters(map);
addTableDataParameters(map, parameterProvider -> !EmbParaFilter.isFRLayerTypePara(parameterProvider));
ParameterApplyHelper.addPara2Map(map, this.getBook().getTemplateParameters());
return map.values().toArray(new Parameter[0]);
}
}

35
designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java

@ -18,9 +18,12 @@ import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.js.WidgetName;
import com.fr.util.ParameterApplyHelper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* @author zhou
@ -72,6 +75,18 @@ public class WorkBookModelAdapter extends DesignModelAdapter<WorkBook, JWorkBook
jTemplate.populateReportParameterAttr();
}
@Override
public void tableDataParametersChanged(String oldName, String tdName, TableData tableData) {
Map<String, ParameterProvider> map = new HashMap<>();
addGlobalParameters(map);
updateTableDataParameters(oldName, tdName, tableData, map, null);
addReportParameters(map);
parameters = map.values().toArray(new Parameter[0]);
jTemplate.updateReportParameterAttr();
jTemplate.populateReportParameterAttr();
}
/**
* 控件改变.
*/
@ -107,9 +122,27 @@ public class WorkBookModelAdapter extends DesignModelAdapter<WorkBook, JWorkBook
@Override
protected Parameter[] getLatestParameters() {
return this.getBook().getParameters();
Map<String, ParameterProvider> map = new HashMap<>();
addGlobalParameters(map);
addTableDataParameters(map, null);
addReportParameters(map);
return map.values().toArray(new Parameter[0]);
}
private void addReportParameters(Map<String, ParameterProvider> map) {
// 添加模板参数
ReportParameterAttr parameterAttr = this.getBook().getReportParameterAttr();
if (parameterAttr != null) {
ParameterApplyHelper.addPara2Map(map, parameterAttr.getParameters());
}
}
/**
* 返回控件的名字
*

26
designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

@ -310,9 +310,9 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
// 单元格组要记录下之前的选中情况
private CellSelection oriCellSelection = null;
private List<ColumnRow> newAdd = new ArrayList<>();
private List<String> newAdd = new ArrayList<String>();
private List<ColumnRow> oldAdd = new ArrayList<>();
private List<String> oldAdd = new ArrayList<String>();
public SmartJTablePane4DB(KeyColumnTableModel model, ElementCasePane actionReportPane) {
this(model, actionReportPane, false);
@ -433,8 +433,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
if (!allColumnRow.contains(columnRow.toString())) {
add.addColumnRow(columnRow);
}
// 重新更换区域框选单元格后 清理历史框选
oldAdd.clear();
}
if (add.getSize() > 0) {
@ -460,11 +459,10 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
TemplateCellElement cellElement = ePane.getEditingElementCase().getTemplateCellElement(c + i, r + j);
if (cellElement != null && ((i + c) != 0 || (r + j) != 0)) {
String value = cellElement.toString();
ColumnRow columnRow = ColumnRow.valueOf(value);
if (!newAdd.contains(columnRow) && !allColumnRow.contains(value)) {
add.addColumnRow(columnRow);
if (!newAdd.contains(value) && !allColumnRow.contains(value)) {
add.addColumnRow(ColumnRow.valueOf(value));
}
newAdd.add(columnRow);
newAdd.add(value);
}
if (cellElement == null) {
@ -472,14 +470,16 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
if (!allColumnRow.contains(columnRow.toString())) {
add.addColumnRow(columnRow);
}
newAdd.add(columnRow);
newAdd.add(columnRow.toString());
}
}
}
// 计算出前后两次选中的差值
oldAdd.removeAll(newAdd);
// 移除差值部分
newValue.removeAll(oldAdd);
int oldSize = oldAdd.size();
int newSize = newAdd.size();
if (oldSize > newSize && oldAdd.containsAll(newAdd)) {
int diff = oldSize - newSize;
newValue.splice(newValue.getSize() - diff, diff);
}
oldAdd.clear();
oldAdd.addAll(newAdd);
}

Loading…
Cancel
Save