Browse Source

Merge pull request #14996 in DESIGN/design from release/11.0 to bugfix/11.0

* commit '34084075b64ff79d3fdc04e8e3a0422a76e1376d':
  REPORT-134932【设计器】参数面板的背景颜色会在“撤回"报表主体设计时消失
  REPORT-135106 表格字体加载问题和语言导致的图表消失问题
  REPORT-132457 fix:设计器参数栏组件小窗设置展示不全
  按钮不用加tooltip,回滚一下
  REPORT-106743 fix:设计器地图英文显示问题
  增加AppTypeFilter过滤插件类型,如果为空则不过滤
  REPORT-132109 fix: FVS插件 浅色主题-表格内合并单元格导致键入文字颜色为白色(非默认)
  REPORT-117444 fix:模板主题管理2个相同的key,重复去掉一个
  REPORT-119602 fix:韩语设计器鼠标失焦,选不到数据脱敏
bugfix/11.0
superman 1 month ago
parent
commit
4fb9326a61
  1. 21
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java
  2. 1
      designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  4. 4
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  5. 2
      designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java
  6. 5
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java
  7. 3
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js
  8. 86
      designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js
  9. 2
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  10. 2
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  11. 44
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java
  12. 4
      designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

21
designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java

@ -7,6 +7,7 @@ import com.fr.design.file.NodeAuthProcessor;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.mainframe.App;
import com.fr.design.mainframe.manager.search.TemplateTreeSearchManager;
import com.fr.file.filetree.AppTypeFilter;
import com.fr.file.filetree.FileNode;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
@ -19,6 +20,7 @@ import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
@ -38,6 +40,8 @@ public class TemplateFileTree extends EnvFileTree {
private static final int MAX_NODE_EXPAND_NUM = 50;
private static final int MAX_MATCHED_NODE_NUM = 500;
protected AppTypeFilter appTypeFilter;
public TemplateFileTree() {
super(ProjectConstants.REPORTLETS_NAME, null, null);
}
@ -155,12 +159,17 @@ public class TemplateFileTree extends EnvFileTree {
supportTypes.add(FileExtension.parse(temp));
}
}
Set<App> apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING);
for (App temp : apps) {
for (String extendsion : temp.defaultExtensions()) {
supportTypes.add(FileExtension.parse(extendsion));
if (appTypeFilter != null) {
Collections.addAll(supportTypes, appTypeFilter.getSupportedTypes());
} else {
Set<App> apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING);
for (App temp : apps) {
for (String extendsion : temp.defaultExtensions()) {
supportTypes.add(FileExtension.parse(extendsion));
}
}
}
return supportTypes;
}
@ -360,6 +369,10 @@ public class TemplateFileTree extends EnvFileTree {
}
}
public void setAppTypeFilter(AppTypeFilter filter) {
appTypeFilter = filter;
}
private boolean notContained(String parentPath, ExpandMutableTreeNode treeNode) {
List<String> childList = currentTreeMode.getOrDefault(parentPath, new ArrayList<>());
String name = ((FileNode) (treeNode.getUserObject())).getName();

1
designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java

@ -968,6 +968,7 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript
templateReportletTree = new TemplateFileTree();
IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt"});
templateReportletTree.setFileNodeFilter(filter);
templateReportletTree.setAppTypeFilter(() -> new FileExtension[]{});
cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE");
this.refreshEnv();

2
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -84,7 +84,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30;
// 弹出对话框高度
private static final int POPUP_MIN_HEIGHT = 145;
private static final int POPUP_DEFAULT_HEIGHT = 356;
private static final int POPUP_DEFAULT_HEIGHT = 600;
public static final String KEY_CELL_ELEMENT = "cellElement";
public static final String KEY_CELL_ATTR = "cellAttr";
public static final String KEY_FLOAT_ELEMENT = "floatElement";

4
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -725,7 +725,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
public void undo() {
this.getUndoManager().undo();
// 撤销前模版使用主题可能已经被删除或修改,需要重置模版样式
checkAndResetTheme();
checkAndResetTheme(true);
fireSuperTargetModified();
}
@ -735,7 +735,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
public void redo() {
this.getUndoManager().redo();
// 重做前模版使用主题可能已经被删除或修改,需要重置模版样式
checkAndResetTheme();
checkAndResetTheme(true);
fireSuperTargetModified();
}

2
designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java

@ -63,7 +63,7 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Radius")), borderRadiusSpinner},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Icon_Color")), iconColorSelectBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Text_Style")), fontNameSelectBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Text_Style")), WidgetStyleComponentCombiner.combineTextStyleComponent(fontSizePane, fontColorButton, italic, bold)},
new Component[]{new UILabel(), WidgetStyleComponentCombiner.combineTextStyleComponent(fontSizePane, fontColorButton, italic, bold)},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Background_Select_Box")), selectBackgroundColorBox}
};
}

5
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java

@ -57,14 +57,13 @@ public class WMSLayerPane extends JPanel implements UIObserver {
public WMSLayerPane() {
final double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, 84, 44};
double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, 84, 95};
wmsUrl = new UITextArea();
connectButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Connect_WMP"));
Component[][] comps = new Component[][]{
new Component[]{new UILabel("url"), wmsUrl, connectButton}
new Component[]{new UILabel("URL"), wmsUrl, connectButton}
};
JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, COLUMN_SIZE);
northPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER);

3
designer-chart/src/main/resources/com/fr/design/editor/script/editor.js

@ -128,6 +128,9 @@
if (key === "src") {
return;
}
value = window.transformI18nText(value);
str += " " + key + "=\"" + value + "\"";
if (key === "alt" && dataIdMap[value.trim()]) {

86
designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js

@ -21,7 +21,12 @@
"BI-Basic_Save": "保存",
"BI-Basic_More": "更多",
"BI-Custom_Color": "自定义颜色",
"BI-Transparent_Color": "透明"
"BI-Transparent_Color": "透明",
"Fine-Design_Chart_Category_Use_Name": "分类名",
"Fine-Design_Chart_Series_Name": "系列名",
"Fine-Design_Chart_Use_Value": "值",
"Fine-Design_Chart_Use_Percent": "百分比",
"Fine-Design_Chart_Use_Summary_Value": "汇总值"
};
var taiwan = {
@ -45,7 +50,12 @@
"BI-Basic_Save": "保存",
"BI-Basic_More": "更多",
"BI-Custom_Color": "自定義顏色",
"BI-Transparent_Color": "透明"
"BI-Transparent_Color": "透明",
"Fine-Design_Chart_Category_Use_Name": "分類名",
"Fine-Design_Chart_Series_Name": "系列名",
"Fine-Design_Chart_Use_Value": "值",
"Fine-Design_Chart_Use_Percent": "百分比",
"Fine-Design_Chart_Use_Summary_Value": "匯總值"
};
var english = {
@ -69,7 +79,12 @@
"BI-Basic_Save": "Save",
"BI-Basic_More": "More",
"BI-Custom_Color": "Custom Color",
"BI-Transparent_Color": "Transparent Color"
"BI-Transparent_Color": "Transparent Color",
"Fine-Design_Chart_Category_Use_Name": "Category Name",
"Fine-Design_Chart_Series_Name": "Series",
"Fine-Design_Chart_Use_Value": "Value",
"Fine-Design_Chart_Use_Percent": "Percentage",
"Fine-Design_Chart_Use_Summary_Value": "Summary Value"
};
var japanese = {
@ -93,7 +108,12 @@
"BI-Basic_Save": "セーブ",
"BI-Basic_More": "もっと",
"BI-Custom_Color": "カスタムカラー",
"BI-Transparent_Color": "トランスペアレント"
"BI-Transparent_Color": "トランスペアレント",
"Fine-Design_Chart_Category_Use_Name": "分類名",
"Fine-Design_Chart_Series_Name": "系列名",
"Fine-Design_Chart_Use_Value": "値",
"Fine-Design_Chart_Use_Percent": "パーセンテージ",
"Fine-Design_Chart_Use_Summary_Value": "まとめ値"
};
var korean = {
@ -117,7 +137,12 @@
"BI-Basic_Save": "저장",
"BI-Basic_More": "더",
"BI-Custom_Color": "맞춤 색상",
"BI-Transparent_Color": "투명한"
"BI-Transparent_Color": "투명한",
"Fine-Design_Chart_Category_Use_Name": "카테고리 명",
"Fine-Design_Chart_Series_Name": "표시값",
"Fine-Design_Chart_Use_Value": "값",
"Fine-Design_Chart_Use_Percent": "백분율",
"Fine-Design_Chart_Use_Summary_Value": "요약 값"
};
function transformI18n(language) {
@ -144,5 +169,56 @@
}
}
/**
* 将一个text转换成当前国际化语言环境的text
* @param text
* @returns {*}
*/
function transformI18nText(text) {
var i18nKey = _findI18nKey(text);
return window.BI.i18nText(i18nKey);
}
/**
* 根据text找到i18n的key
* @param text
* @returns {string}
* @private
*/
function _findI18nKey(text) {
for (var [key, value] of Object.entries(chinese)) {
if (value === text) {
return key;
}
}
for ([key, value] of Object.entries(taiwan)) {
if (value === text) {
return key;
}
}
for ([key, value] of Object.entries(english)) {
if (value === text) {
return key;
}
}
for ([key, value] of Object.entries(japanese)) {
if (value === text) {
return key;
}
}
for ([key, value] of Object.entries(korean)) {
if (value === text) {
return key;
}
}
return '';
}
window.transformI18n = transformI18n;
window.transformI18nText = transformI18nText;
}());

2
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -686,7 +686,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
protected void applyUndoState(FormUndoState u) {
try {
Form undoForm = (Form) u.getForm().clone();
undoForm.checkAndResetTheme();
undoForm.checkAndResetTheme(true);
undoForm = (Form) FineColorSynchronizer.flush(undoForm, undoForm.getTemplateTheme());
if (this.index == FORM_TAB) {
//JForm的target重置

2
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -790,7 +790,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
protected void applyUndoState(WorkBookUndoState u) {
try {
WorkBook undoWorkBook = (WorkBook) u.getWorkBook().clone();
undoWorkBook.checkAndResetTheme();
undoWorkBook.checkAndResetTheme(true);
undoWorkBook = (WorkBook) FineColorSynchronizer.flush(undoWorkBook, undoWorkBook.getTemplateTheme());
this.setTarget(undoWorkBook);
if (!DesignerMode.isAuthorityEditing()) {

44
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java

@ -1,6 +1,5 @@
package com.fr.design.mainframe.cell.settingpane.desensitization.model;
import com.fr.base.operator.org.OrganizationOperator;
import com.fr.data.desensitize.rule.DesensitizationRuleManager;
import com.fr.data.desensitize.rule.base.DesensitizationRule;
import com.fr.data.desensitize.rule.base.DesensitizationRuleSource;
@ -10,27 +9,19 @@ import com.fr.design.data.datapane.preview.desensitization.view.rule.Desensitiza
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.event.UIObserverListener;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombocheckbox.UIComboCheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JTemplateActionListener;
import com.fr.report.cell.desensitization.CellDesensitizationBean;
import com.fr.stable.StringUtils;
import com.fr.third.org.apache.commons.collections4.map.HashedMap;
import com.fr.workspace.WorkContext;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
@ -43,7 +34,10 @@ import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 单元格脱敏规则设置面板
@ -78,12 +72,10 @@ public class DesensitizationCellPane extends BasicBeanPane {
}
private void initComponent() {
editPanel = new JPanel();
editPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true));
editPanel = new JPanel(new BorderLayout());
label = new UILabel();
label.setEnabled(false);
editPanel.add(label);
ruleButton = new UIButton(APOSTROPHE);
@ -102,25 +94,25 @@ public class DesensitizationCellPane extends BasicBeanPane {
emptyTextField.setEnabled(false);
emptyTextField.setOpaque(false);
editPanel.add(initTableCellPanel());
editPanel.add(
column(
row(cell(label)),
cell(initTableCellPanel()).weight(2)
).weight(1).getComponent()
);
}
/**
* 初始化单元格中的panel
*/
private JPanel initTableCellPanel() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = new double[]{f, f};
double[] columnSize = new double[]{p, f};
Component[][] components = new Component[][]{
new Component[]{ruleButton, ruleTextField},
new Component[]{emptyTextField, rolesComboBox}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 0);
private Component initTableCellPanel() {
return column(
row(cell(ruleButton).weight(1), cell(ruleTextField).weight(4)),
row(cell(emptyTextField).weight(1), cell(rolesComboBox).weight(4))
).getComponent();
}
private void addListener() {

4
designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

@ -407,7 +407,9 @@ public class CellSelection extends Selection {
if (hasCellElement) {
ec.merge(row, row + rowSpan - 1, column, column + columnSpan - 1);
} else {
ec.addCellElement(DefaultThemedTemplateCellElementCase.createInstance(column, row, columnSpan, rowSpan, null), true);
TemplateCellElement cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row, columnSpan, rowSpan, null);
AdjustWorkBookDefaultStyleUtils.adjustCellElement(cellElement);
ec.addCellElement(cellElement, true);
}
return true;

Loading…
Cancel
Save