Browse Source

Merge remote-tracking branch 'origin/feature/x' into feature/x

feature/x
Leo.Qin 2 years ago
parent
commit
262f094ab3
  1. 10
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  2. 49
      designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java
  3. 13
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/PreviewTableDesensitizationPane.java
  4. 10
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java
  5. 17
      designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java
  6. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  7. 3
      designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java
  8. 11
      designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java
  9. 26
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  10. 4
      designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java
  11. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java
  12. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java
  13. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java
  14. 36
      designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java
  15. 5
      designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java

10
designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

@ -661,4 +661,14 @@ public abstract class DesignTableDataManager {
public static void setThreadLocal(String value) { public static void setThreadLocal(String value) {
threadLocal.set(value); threadLocal.set(value);
} }
/**
* 根据数据集名称判断是否为服务器数据集或服务器存储过程
*
* @param tableDataName 数据集名称
* @return
*/
public static boolean isGlobalTableData(String tableDataName) {
return globalDsCache.containsKey(tableDataName);
}
} }

49
designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java

@ -33,6 +33,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
import com.fr.esd.query.StrategicTableData;
import com.fr.function.TIME; import com.fr.function.TIME;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.data.DataModel; import com.fr.general.data.DataModel;
@ -223,6 +224,18 @@ public class PreviewTablePane extends BasicPane {
* 点击脱敏配置后的操作 * 点击脱敏配置后的操作
*/ */
public void clickDesensitizationLabel() { public void clickDesensitizationLabel() {
// 埋点记录
recordDesensitization();
// 判断数据集类型
if (isGlobalTableData()) {
// 服务器数据集不允许在设计器端修改脱敏配置
FineJOptionPane.showMessageDialog(
this,
Toolkit.i18nText("Fine-Design_Report_Cannot_Modify_Desensitization_Config_Of_ServerTableData"),
Toolkit.i18nText("Fine-Design_Basic_Alert"),
FineJOptionPane.WARNING_MESSAGE);
return;
}
TableDataDesensitizationSettingPane settingPane = new TableDataDesensitizationSettingPane((DesensitizationTableData) tableData); TableDataDesensitizationSettingPane settingPane = new TableDataDesensitizationSettingPane((DesensitizationTableData) tableData);
settingPane.populateBean((DesensitizationTableData) tableData); settingPane.populateBean((DesensitizationTableData) tableData);
BasicDialog dialog = settingPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(PreviewTablePane.this), new DialogActionAdapter() { BasicDialog dialog = settingPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(PreviewTablePane.this), new DialogActionAdapter() {
@ -248,25 +261,41 @@ public class PreviewTablePane extends BasicPane {
} }
/** /**
* 设置脱敏设置的个数 * 触发数据脱敏埋点记录
*
* @return 数据脱敏字段数量
*/
private int recordDesensitization() {
return getCurrentTableDataDesensitizaitionCount();
}
/**
* 当前tableData是否为服务器数据集或服务器存储过程
* *
* @param model * @return
*/ */
private void setDesensitizationCount(TableModel model) { public boolean isGlobalTableData() {
desensitizationPane.setDesensitizationCount(isDesensitizeOpened(), return this.tableData instanceof StrategicTableData &&
model instanceof DesensitizedPreviewTableModel ? DesignTableDataManager.isGlobalTableData(((StrategicTableData) this.tableData).getDsName());
((DesensitizedPreviewTableModel) model).getDesensitizeColumnsCount() :
0);
} }
/** /**
* 根据TableData设置脱敏设置的个数 * 根据TableData设置脱敏设置的个数
*/ */
private void setDesensitizationCountByTableData() { private void setDesensitizationCountByTableData() {
desensitizationPane.setDesensitizationCount(isDesensitizeOpened(), desensitizationPane.setDesensitizationCount(isDesensitizeOpened(), getCurrentTableDataDesensitizaitionCount());
this.tableData instanceof DesensitizationTableData ? desensitizationPane.dealWithTableDataType(isGlobalTableData());
}
/**
* 获取当前数据集中设置脱敏规则的个数
*
* @return
*/
private int getCurrentTableDataDesensitizaitionCount() {
return this.tableData instanceof DesensitizationTableData ?
((DesensitizationTableData) this.tableData).getDesensitizationConfig().getDesensitizationItems().size() : ((DesensitizationTableData) this.tableData).getDesensitizationConfig().getDesensitizationItems().size() :
0); 0;
} }
/** /**

13
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/PreviewTableDesensitizationPane.java

@ -112,9 +112,22 @@ public class PreviewTableDesensitizationPane extends JPanel {
return previewToggle; return previewToggle;
} }
/**
* 设置Label的值主要是需要动态修改配置的脱敏规则的数量
*
* @param desensitizeOpen
* @param count
*/
public void setDesensitizationCount(boolean desensitizeOpen, int count) { public void setDesensitizationCount(boolean desensitizeOpen, int count) {
desensitizationLabel.setText(desensitizeOpen ? desensitizationLabel.setText(desensitizeOpen ?
DATA_DESENSITIZATION_CONFIG + LEFT_BRACKET + count + RIGHT_BRACKET + COUNT : DATA_DESENSITIZATION_CONFIG + LEFT_BRACKET + count + RIGHT_BRACKET + COUNT :
DATA_DESENSITIZATION_CONFIG); DATA_DESENSITIZATION_CONFIG);
} }
/**
* 服务器数据集时Label需要置灰
*/
public void dealWithTableDataType(boolean globalTableData) {
desensitizationLabel.setForeground(globalTableData ? UIConstants.DISABLED_ICON_COLOR : UIConstants.NORMAL_BLUE);
}
} }

10
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java

@ -2,6 +2,7 @@ package com.fr.design.data.datapane.preview.desensitization.view.rule;
import com.fr.data.desensitize.rule.base.DesensitizationCondition; import com.fr.data.desensitize.rule.base.DesensitizationCondition;
import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRule;
import com.fr.data.desensitize.rule.base.DesensitizationRuleSource;
import com.fr.data.desensitize.rule.base.DesensitizationRuleType; import com.fr.data.desensitize.rule.base.DesensitizationRuleType;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
@ -271,6 +272,15 @@ public class DesensitizationRuleEditPane extends BasicBeanPane<DesensitizationRu
@Override @Override
public DesensitizationRule updateBean() { public DesensitizationRule updateBean() {
rule.setRuleName(this.ruleNameTextField.getText());
rule.setRuleSource(DesensitizationRuleSource.CUSTOM);
DesensitizationRuleType ruleType = DesensitizationRuleType.matchByTypeName(String.valueOf(this.ruleTypeComboBox.getSelectedItem()));
rule.setRuleType(ruleType);
rule.getCondition().setRetainFront((int) this.retainFrontTextField.getValue());
rule.getCondition().setRetainBack((int) this.retainBackTextField.getValue());
rule.getCondition().setSymbol(ruleType == DesensitizationRuleType.CHARACTER_REPLACE ?
this.firstSymbolTextField.getText() :
this.secondSymbolTextField.getText());
rule.setEnable(true); rule.setEnable(true);
return rule; return rule;
} }

17
designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java

@ -265,34 +265,31 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
int lineStyle = currentLineCombo.getSelectedLineStyle(); int lineStyle = currentLineCombo.getSelectedLineStyle();
Color lineColor = currentLineColorPane.getSelectObject(); Color lineColor = currentLineColorPane.getSelectObject();
CellBorderStyle cellBorderStyle = new CellBorderStyle(); CellBorderStyle cellBorderStyle = new CellBorderStyle();
if (lineColor != null) {
if (topToggleButton.isSelected()) { if (topToggleButton.isSelected()) {
cellBorderStyle.setTopColor(lineColor); cellBorderStyle.setTopColor(lineColor);
} }
cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (bottomToggleButton.isSelected()) { if (bottomToggleButton.isSelected()) {
cellBorderStyle.setBottomColor(lineColor); cellBorderStyle.setBottomColor(lineColor);
} }
cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (leftToggleButton.isSelected()) { if (leftToggleButton.isSelected()) {
cellBorderStyle.setLeftColor(lineColor); cellBorderStyle.setLeftColor(lineColor);
} }
cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (rightToggleButton.isSelected()) { if (rightToggleButton.isSelected()) {
cellBorderStyle.setRightColor(lineColor); cellBorderStyle.setRightColor(lineColor);
} }
cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (verticalToggleButton.isSelected()) { if (verticalToggleButton.isSelected()) {
cellBorderStyle.setVerticalColor(lineColor); cellBorderStyle.setVerticalColor(lineColor);
} }
cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (horizontalToggleButton.isSelected()) { if (horizontalToggleButton.isSelected()) {
cellBorderStyle.setHorizontalColor(lineColor); cellBorderStyle.setHorizontalColor(lineColor);
} }
}
cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
outerToggleButton.setSelected(leftToggleButton.isSelected() && bottomToggleButton.isSelected() && rightToggleButton.isSelected() && topToggleButton.isSelected()); outerToggleButton.setSelected(leftToggleButton.isSelected() && bottomToggleButton.isSelected() && rightToggleButton.isSelected() && topToggleButton.isSelected());

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

@ -329,7 +329,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/** /**
* 为另存的模板创建新的模板id * 为另存的模板创建新的模板id
*/ */
private void generateNewTemplateIdForSaveAs() { protected void generateNewTemplateIdForSaveAs() {
generateTemplateId(); generateTemplateId();
} }

3
designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java

@ -11,6 +11,7 @@ import com.fr.intelli.record.Measurable;
import com.fr.intelli.record.MeasureObject; import com.fr.intelli.record.MeasureObject;
import com.fr.intelli.record.MeasureUnit; import com.fr.intelli.record.MeasureUnit;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.log.message.AbstractMessage;
import com.fr.measure.DBMeterFactory; import com.fr.measure.DBMeterFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.net.bytebuddy.asm.Advice; import com.fr.third.net.bytebuddy.asm.Advice;
@ -75,7 +76,7 @@ public class MonitorAdvice implements DesignerAnalyzerAdvice {
List<Object> newArgs = new ArrayList<>(Arrays.asList(args)); List<Object> newArgs = new ArrayList<>(Arrays.asList(args));
newArgs.add(id); newArgs.add(id);
recordSQLDetail(id); recordSQLDetail(id);
Object message = null; AbstractMessage message = null;
try { try {
message = measurable.durableEntity(measureObject, newArgs.toArray()); message = measurable.durableEntity(measureObject, newArgs.toArray());
} catch (Throwable throwable) { } catch (Throwable throwable) {

11
designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java

@ -118,6 +118,8 @@ public class UpdateMainDialog extends UIDialog {
private ArrayList<Object[]> updateInfoList; private ArrayList<Object[]> updateInfoList;
private Set<String> titleSet;
private boolean getUpdateInfoSuccess; private boolean getUpdateInfoSuccess;
private UpdateInfoCachePropertyManager cacheProperty; private UpdateInfoCachePropertyManager cacheProperty;
@ -267,6 +269,7 @@ public class UpdateMainDialog extends UIDialog {
String keyword = searchUpdateInfoKeyword.getText(); String keyword = searchUpdateInfoKeyword.getText();
if (ComparatorUtils.equals(keyword, StringUtils.EMPTY) && getUpdateInfoSuccess) { if (ComparatorUtils.equals(keyword, StringUtils.EMPTY) && getUpdateInfoSuccess) {
updateInfoList.clear(); updateInfoList.clear();
titleSet.clear();
getUpdateInfo(keyword).execute(); getUpdateInfo(keyword).execute();
} }
} }
@ -281,6 +284,7 @@ public class UpdateMainDialog extends UIDialog {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (getUpdateInfoSuccess) { if (getUpdateInfoSuccess) {
updateInfoList.clear(); updateInfoList.clear();
titleSet.clear();
getUpdateInfo(searchUpdateInfoKeyword.getText()).execute(); getUpdateInfo(searchUpdateInfoKeyword.getText()).execute();
} }
} }
@ -388,6 +392,7 @@ public class UpdateMainDialog extends UIDialog {
private SwingWorker<JSONArray, Void> getUpdateInfo(final String keyword) { private SwingWorker<JSONArray, Void> getUpdateInfo(final String keyword) {
updateInfoList = new ArrayList<>(); updateInfoList = new ArrayList<>();
titleSet = new HashSet<>();
lastUpdateCacheTime = UpdateConstants.CHANGELOG_X_START; lastUpdateCacheTime = UpdateConstants.CHANGELOG_X_START;
String cacheConfigPath = getUpdateCacheConfig(); String cacheConfigPath = getUpdateCacheConfig();
cacheProperty = new UpdateInfoCachePropertyManager(StableUtils.pathJoin(WorkContext.getCurrent().getPath(), "resources", "offlineres", cacheConfigPath)); cacheProperty = new UpdateInfoCachePropertyManager(StableUtils.pathJoin(WorkContext.getCurrent().getPath(), "resources", "offlineres", cacheConfigPath));
@ -489,6 +494,7 @@ public class UpdateMainDialog extends UIDialog {
} }
} }
if (isValid(updateInfo, GeneralUtils.objectToString(curJarDate))) { if (isValid(updateInfo, GeneralUtils.objectToString(curJarDate))) {
titleSet.add(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]);
updateInfoList.add(new Object[]{UPDATELOG_FORMAT.format(updateTime), updateInfo[UpdateInfoTable.UPDATE_VERSION_INDEX], updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX], updateTime.after(curJarDate)}); updateInfoList.add(new Object[]{UPDATELOG_FORMAT.format(updateTime), updateInfo[UpdateInfoTable.UPDATE_VERSION_INDEX], updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX], updateTime.after(curJarDate)});
} }
} }
@ -501,7 +507,7 @@ public class UpdateMainDialog extends UIDialog {
private boolean isValid(String[] updateInfo, String curJarDate) { private boolean isValid(String[] updateInfo, String curJarDate) {
return isValidLogInfo(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]) && curJarDate != null && curJarDate.compareTo(updateInfo[UpdateInfoTable.UPDATE_DATE_INDEX]) <= 0; return isValidLogInfo(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]) && curJarDate != null && curJarDate.compareTo(updateInfo[UpdateInfoTable.UPDATE_DATE_INDEX]) <= 0 && !titleSet.contains(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]);
} }
private void updateCachedInfoFile(JSONArray jsonArray) throws Exception { private void updateCachedInfoFile(JSONArray jsonArray) throws Exception {
@ -561,6 +567,7 @@ public class UpdateMainDialog extends UIDialog {
} }
Date curDate = UPDATE_INFO_TABLE_FORMAT.parse(currentNO, new ParsePosition(currentNO.indexOf("-") + 1)); Date curDate = UPDATE_INFO_TABLE_FORMAT.parse(currentNO, new ParsePosition(currentNO.indexOf("-") + 1));
if (isValid4GenerateInfo(updateTitle, GeneralUtils.objectToString(curDate), updateTimeStr)) { if (isValid4GenerateInfo(updateTitle, GeneralUtils.objectToString(curDate), updateTimeStr)) {
titleSet.add(updateTitle);
updateInfoList.add(new Object[]{updateTimeStr, updateVersionStr, updateTitle, updateTime.after(curJarDate)}); updateInfoList.add(new Object[]{updateTimeStr, updateVersionStr, updateTitle, updateTime.after(curJarDate)});
} }
} }
@ -568,7 +575,7 @@ public class UpdateMainDialog extends UIDialog {
} }
private boolean isValid4GenerateInfo(String updateTitle, String curDate, String updateTimeStr) { private boolean isValid4GenerateInfo(String updateTitle, String curDate, String updateTimeStr) {
return isValidLogInfo(updateTitle) && curDate.compareTo(updateTimeStr) <= 0; return isValidLogInfo(updateTitle) && curDate.compareTo(updateTimeStr) <= 0 && !titleSet.contains(updateTitle);
} }
private boolean containsKeyword(String str, String keyword) { private boolean containsKeyword(String str, String keyword) {

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

@ -6,8 +6,6 @@ import com.fr.base.Parameter;
import com.fr.base.Releasable; import com.fr.base.Releasable;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
import com.fr.base.iofile.attr.ExtendSharableAttrMark; import com.fr.base.iofile.attr.ExtendSharableAttrMark;
import com.fr.base.theme.FineColorGather;
import com.fr.base.theme.FineColorManager;
import com.fr.base.theme.FineColorSynchronizer; import com.fr.base.theme.FineColorSynchronizer;
import com.fr.base.theme.FormTheme; import com.fr.base.theme.FormTheme;
import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateTheme;
@ -17,8 +15,8 @@ import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.FormMobileAttrAction;
import com.fr.design.actions.FormECParallelCalAction; import com.fr.design.actions.FormECParallelCalAction;
import com.fr.design.actions.FormMobileAttrAction;
import com.fr.design.actions.TemplateParameterAction; import com.fr.design.actions.TemplateParameterAction;
import com.fr.design.actions.core.WorkBookSupportable; import com.fr.design.actions.core.WorkBookSupportable;
import com.fr.design.actions.file.export.EmbeddedFormExportExportAction; import com.fr.design.actions.file.export.EmbeddedFormExportExportAction;
@ -56,8 +54,8 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECCompositeProvider;
import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.form.FormECDesignerProvider;
import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.ComponentShareUtil; import com.fr.design.mainframe.share.ComponentShareUtil;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.template.info.JFormProcessInfo; import com.fr.design.mainframe.template.info.JFormProcessInfo;
import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo;
import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog; import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog;
@ -71,7 +69,6 @@ import com.fr.design.parameter.ParameterPropertyPane;
import com.fr.design.preview.FormPreview; import com.fr.design.preview.FormPreview;
import com.fr.design.preview.MobilePreview; import com.fr.design.preview.MobilePreview;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FILEChooserPane; import com.fr.file.FILEChooserPane;
@ -110,7 +107,14 @@ import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@ -1266,8 +1270,9 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
private void refreshTarget(Form form) { private void refreshTarget(Form form) {
setTarget(form); setTarget(form);
if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate() == this) { if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate() != this) {
if (this.index == FORM_TAB) { return;
}
// save state // save state
FormArea formArea = formDesign.getArea(); FormArea formArea = formDesign.getArea();
int horizontalValue = formArea.getHorizontalValue(); int horizontalValue = formArea.getHorizontalValue();
@ -1298,15 +1303,16 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
} }
} }
} }
} else {
if (this.index != FORM_TAB) {
String widgetName = this.formDesign.getElementCaseContainerName(); String widgetName = this.formDesign.getElementCaseContainerName();
FormElementCaseProvider dataTable = form.getElementCaseByName(widgetName); FormElementCaseProvider dataTable = form.getElementCaseByName(widgetName);
this.reportComposite.setSelectedWidget(dataTable); this.reportComposite.setSelectedWidget(dataTable);
formDesign.setElementCase(dataTable); formDesign.setElementCase(dataTable);
} }
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView(); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView();
} }
}
@Override @Override
public void generateForBiddenTemplate() { public void generateForBiddenTemplate() {

4
designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java

@ -134,7 +134,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query")); displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query"));
UIComponentUtils.setLineWrap(displayReport); UIComponentUtils.setLineWrap(displayReport);
useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template")); useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template"));
fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("触发编辑结束事件")); fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Trigger_Editing_End_Event"));
fireAfterEditor.setEnabled(false); fireAfterEditor.setEnabled(false);
fireAfterEditor.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); fireAfterEditor.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0));
useParamsTemplate.addChangeListener(e -> { useParamsTemplate.addChangeListener(e -> {
@ -189,7 +189,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query")); displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query"));
UIComponentUtils.setLineWrap(displayReport); UIComponentUtils.setLineWrap(displayReport);
useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template")); useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template"));
fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("触发编辑结束事件")); fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Trigger_Editing_End_Event"));
fireAfterEditor.setEnabled(false); fireAfterEditor.setEnabled(false);
fireAfterEditor.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); fireAfterEditor.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0));
useParamsTemplate.addChangeListener(e -> { useParamsTemplate.addChangeListener(e -> {

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java

@ -68,7 +68,7 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
int[][] rowCount = {{1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
UILabel widgetValueLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value")); UILabel widgetValueLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value"));
widgetValueLabel.setVerticalAlignment(SwingConstants.TOP); widgetValueLabel.setVerticalAlignment(SwingConstants.TOP);
UILabel fontLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size")); UILabel fontLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font"));
fontLabel.setVerticalAlignment(SwingConstants.TOP); fontLabel.setVerticalAlignment(SwingConstants.TOP);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{widgetValueLabel, formWidgetValuePane}, new Component[]{widgetValueLabel, formWidgetValuePane},

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java

@ -44,7 +44,7 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField},
new Component[]{widgetValueLabel, formWidgetValuePane}, new Component[]{widgetValueLabel, formWidgetValuePane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")), dictionaryEditor}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")), dictionaryEditor},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_FR_Font")), fontSizePane}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size")), fontSizePane},
new Component[]{buttonGroupDictPane, null} new Component[]{buttonGroupDictPane, null}
}; };
double[] rowSize = {p, p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p, p};

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java

@ -214,7 +214,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
} }
return time; return time;
} }
})); }).reversed());
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e, e.getMessage()); FineLoggerFactory.getLogger().error(e, e.getMessage());
} }

36
designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java

@ -1,7 +1,6 @@
package com.fr.design.report; package com.fr.design.report;
import com.fr.base.CustomConfig; import com.fr.base.CustomConfig;
import com.fr.config.Configuration;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
@ -11,16 +10,20 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.BrowseUtils; import com.fr.design.utils.BrowseUtils;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.io.attr.ReportExportAttr;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade; import com.fr.transaction.WorkerFacade;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
/** /**
* 通用
*
* @author hades * @author hades
* @version 11.0 * @version 11.0
* Created by hades on 2022/5/26 * Created by hades on 2022/5/26
@ -30,13 +33,15 @@ public class ExportUniversalPane extends BasicPane {
private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("help.alt_font.zh_CN", "https://help.fanruan.com/finereport/doc-view-4707.html"); private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("help.alt_font.zh_CN", "https://help.fanruan.com/finereport/doc-view-4707.html");
private UICheckBox specialCharacterExport; private UICheckBox specialCharacterExport;
// 密码支持公式
private UICheckBox passwordSupportFormula;
public ExportUniversalPane() { public ExportUniversalPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel outerNorthPane =FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Config")); JPanel outerNorthPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Config"));
JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
JPanel specialCharacterExportPane =FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); JPanel specialCharacterExportPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
specialCharacterExport = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Special_Character")); specialCharacterExport = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Special_Character"));
specialCharacterExport.setSelected(true); specialCharacterExport.setSelected(true);
specialCharacterExportPane.add(specialCharacterExport); specialCharacterExportPane.add(specialCharacterExport);
@ -55,6 +60,11 @@ public class ExportUniversalPane extends BasicPane {
labelPane.add(centerLabel, BorderLayout.CENTER); labelPane.add(centerLabel, BorderLayout.CENTER);
labelPane.add(rightLabel, BorderLayout.EAST); labelPane.add(rightLabel, BorderLayout.EAST);
northPane.add(labelPane); northPane.add(labelPane);
JPanel passwordSupportPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
passwordSupportFormula = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Password_Support_Formula"));
passwordSupportFormula.setSelected(false);
passwordSupportPane.add(passwordSupportFormula);
northPane.add(passwordSupportPane);
outerNorthPane.add(northPane); outerNorthPane.add(northPane);
this.add(outerNorthPane); this.add(outerNorthPane);
} }
@ -64,15 +74,27 @@ public class ExportUniversalPane extends BasicPane {
return "ExportUniversalPane"; return "ExportUniversalPane";
} }
public void populate() { /**
* 填充数据
*
* @param reportExportAttr 报表导出属性
*/
public void populate(ReportExportAttr reportExportAttr) {
this.specialCharacterExport.setSelected(CustomConfig.getInstance().isOptimizedSpecialCharacterExport()); this.specialCharacterExport.setSelected(CustomConfig.getInstance().isOptimizedSpecialCharacterExport());
this.passwordSupportFormula.setSelected(reportExportAttr.isPwdSupportFormula());
} }
public void update() { /**
* 更新界面
*
* @param reportExportAttr 报表导出属性
*/
public void update(ReportExportAttr reportExportAttr) {
Configurations.modify(new WorkerFacade(CustomConfig.class) { Configurations.modify(new WorkerFacade(CustomConfig.class) {
@Override @Override
public void run() { public void run() {
CustomConfig.getInstance().setOptimizedSpecialCharacterExport(specialCharacterExport.isSelected()); CustomConfig.getInstance().setOptimizedSpecialCharacterExport(specialCharacterExport.isSelected());
reportExportAttr.setPwdSupportFormula(passwordSupportFormula.isSelected());
} }
}); });
} }

5
designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java

@ -61,7 +61,7 @@ public class ReportExportAttrPane extends BasicPane {
} }
if (this.exportUniversalPane != null) { if (this.exportUniversalPane != null) {
this.exportUniversalPane.populate(); this.exportUniversalPane.populate(reportExportAttr);
} }
if (this.excelExportPane != null) { if (this.excelExportPane != null) {
@ -84,9 +84,8 @@ public class ReportExportAttrPane extends BasicPane {
public ReportExportAttr update() { public ReportExportAttr update() {
ReportExportAttr reportExportAttr = new ReportExportAttr(); ReportExportAttr reportExportAttr = new ReportExportAttr();
if (this.exportUniversalPane != null) { if (this.exportUniversalPane != null) {
this.exportUniversalPane.update(); this.exportUniversalPane.update(reportExportAttr);
} }
if (this.excelExportPane != null) { if (this.excelExportPane != null) {

Loading…
Cancel
Save