From d64049244c7723940aa9e24d40bfa778c20f029f Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 27 Sep 2022 10:06:10 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-75998=20=E6=94=B9=E5=8F=98=E5=BA=95?= =?UTF-8?q?=E5=B1=82=E5=85=B3=E9=97=AD=E9=9D=A2=E6=9D=BF=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/AllowAuthorityEditAction.java | 11 ++------ .../actions/help/replace/ITReplaceHelper.java | 19 ++++++++++++++ .../actions/help/replace/ITReplaceUtils.java | 26 +++++++++++++++++++ .../fr/design/preview/DeveloperPreview.java | 9 +++---- .../SearchCommit2DBJSFormulaAction.java | 4 +-- .../replace/ui/ITReplaceMainDialog.java | 11 ++++---- .../actions/replace/utils/ShowValueUtils.java | 10 +++++-- 7 files changed, 65 insertions(+), 25 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java create mode 100644 designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java diff --git a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java index bb26e17118..c7287ad838 100644 --- a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java @@ -1,17 +1,14 @@ package com.fr.design.actions; -import com.fr.base.svg.IconUtils; import com.fr.base.vcs.DesignerMode; +import com.fr.design.actions.help.replace.ITReplaceUtils; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; -import com.fr.design.module.DesignModuleFactory; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; -import com.fr.invoke.Reflect; -import com.fr.log.FineLoggerFactory; /** * Author : daisy @@ -64,11 +61,7 @@ public class AllowAuthorityEditAction extends TemplateComponentAction { DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().removeParameterPane(); - try { - Reflect.on(DesignModuleFactory.getReplacePane().newInstance()).call("close"); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + ITReplaceUtils.close(); //画虚线 return true; diff --git a/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java new file mode 100644 index 0000000000..755a69ef63 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java @@ -0,0 +1,19 @@ +package com.fr.design.actions.help.replace; + + +/** + * 定义一些底层操作 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-09-27 + */ +public interface ITReplaceHelper { + + + /** + * 关闭面板 + */ + void close(); + +} diff --git a/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java new file mode 100644 index 0000000000..fe7ba9d8c3 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java @@ -0,0 +1,26 @@ +package com.fr.design.actions.help.replace; + +import com.fr.design.module.DesignModuleFactory; +import com.fr.log.FineLoggerFactory; + +/** + * 工具类 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-09-27 + */ +public class ITReplaceUtils { + + + /** + * 进入权限编辑&开发者调试时要关闭面板 + */ + public static void close(){ + try { + DesignModuleFactory.getReplacePane().newInstance().close(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java index 5c0a623857..e8be79b641 100644 --- a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java +++ b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java @@ -1,5 +1,7 @@ package com.fr.design.preview; +import com.fr.design.actions.help.replace.ITReplaceHelper; +import com.fr.design.actions.help.replace.ITReplaceUtils; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.MutilTempalteTabPane; import com.fr.design.fun.impl.AbstractPreviewProvider; @@ -10,7 +12,6 @@ import com.fr.design.module.DesignModuleFactory; import com.fr.design.worker.WorkerManager; import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.general.web.ParameterConstants; -import com.fr.invoke.Reflect; import com.fr.log.FineLoggerFactory; import java.util.HashMap; @@ -50,11 +51,7 @@ public class DeveloperPreview extends AbstractPreviewProvider { @Override public void onClick(JTemplate jt) { super.onClick(jt); - try { - Reflect.on(DesignModuleFactory.getReplacePane().newInstance()).call("close"); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + ITReplaceUtils.close(); SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId()); if (worker instanceof CallbackSaveWorker) { CallbackSaveWorker callbackSaveWorker = (CallbackSaveWorker) worker; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java index dec08034ab..946dc0d31c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java @@ -52,7 +52,7 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula { } private void dealWithColumnValue(List formulaInfos, ITContent content, DMLConfig dmlConfig) { - for (int i = 0; i < dmlConfig.getColumnConfigCount(); i++) { + for (int i = 0, len = dmlConfig.getColumnConfigCount(); i < len; i++) { ColumnConfig columnConfig = dmlConfig.getColumnConfig(i); if (columnConfig.getColumnValue() instanceof Formula) { ITContent configContent = ITContent.copy(content); @@ -64,7 +64,7 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula { } private void dealWithSubmitJob(List formulaInfos, ITContent content, DMLConfig dmlConfig) { - for (int i = 0; i < dmlConfig.getSubmitJobCount(); i++) { + for (int i = 0, len = dmlConfig.getColumnConfigCount(); i < len; i++) { //这边自定义事件不需要处理,只处理提交事件 if (dmlConfig.getSubmitJob(i) instanceof DMLConfigJob) { ITContent newContent = ITContent.copy(content); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 2a922902f7..f6c82d8890 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -1,16 +1,14 @@ package com.fr.design.actions.replace.ui; +import com.fr.design.actions.help.replace.ITReplaceHelper; import com.fr.design.actions.replace.action.ShowSearchResultAction; import com.fr.design.actions.replace.info.Info; -import com.fr.design.actions.replace.utils.ShowValueUtils; - import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.UIDialog; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; @@ -41,7 +39,7 @@ import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable; * @version 11.0 * created by Destiny.Lin on 2022-08-10 */ -public class ITReplaceMainDialog extends UIDialog { +public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper { List searchResultList = new ArrayList<>(); private static boolean ITReplaceFlag = false; private static boolean matched = false; @@ -315,7 +313,7 @@ public class ITReplaceMainDialog extends UIDialog { * 面板是否存在 * @return */ - public static boolean isExisted() { + public boolean isExisted() { return existed; } @@ -327,7 +325,8 @@ public class ITReplaceMainDialog extends UIDialog { /** * 进入权限编辑状态&开发者调试时关闭面板 */ - public static void close(){ + @Override + public void close(){ if (isExisted()){ getInstance().dispose(); setExisted(false); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index fa28c6de8b..7ea1bdbbd0 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -140,7 +140,7 @@ public class ShowValueUtils { int index = 0; StringBuilder builder = new StringBuilder(str); while (matcher.find()) { - builder.replace(matcher.start() + index, matcher.end() + index, head + matcher.group() + tail); + builder.replace(matcher.start() + index, matcher.end() + index, head + changeHtmlStr(matcher.group()) + tail); index += size; } return "
" + @@ -148,12 +148,18 @@ public class ShowValueUtils { "
"; } else { return "
" + - replaceAll(str, searchStr, "" + searchStr + "") + + replaceAll(str, searchStr, "" + changeHtmlStr(searchStr) + "") + "
"; } } + private static String changeHtmlStr(String searchStr){ + String showStr = searchStr; + showStr = showStr.replace("<","<"); + showStr = showStr.replace(">", ">"); + return showStr; + } /** * 集合是否不为空