From 7065e55ef02f036fa99c99f1d22fa234688f62a8 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Thu, 3 Nov 2022 09:26:04 +0800 Subject: [PATCH 1/9] =?UTF-8?q?REPORT-80690=20=E6=B7=BB=E5=8A=A0=E9=80=82?= =?UTF-8?q?=E9=85=8D=E9=80=82=E9=85=8D=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cell/AbstractCellElementAction.java | 4 ++ .../actions/columnrow/ColumnWidthAction.java | 5 +- .../actions/columnrow/RowHeightAction.java | 4 ++ .../com/fr/quickeditor/CellQuickEditor.java | 50 +++++++++++++++++++ .../cellquick/CellDSColumnEditor.java | 4 +- 5 files changed, 65 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java index 450c326915..52f3539788 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java @@ -9,6 +9,7 @@ import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.grid.GridUtils; import com.fr.grid.selection.CellSelection; +import com.fr.quickeditor.CellQuickEditor; import com.fr.report.cell.TemplateCellElement; import com.fr.report.core.SheetUtils; import com.fr.report.elementcase.TemplateElementCase; @@ -76,6 +77,9 @@ public abstract class AbstractCellElementAction extends CellSelectionAction { } } } + if (!ePane.isSelectedOneCell()) { + CellQuickEditor.record(CellQuickEditor.multipleOperationType.FILTER); + } ePane.fireTargetModified(); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnWidthAction.java b/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnWidthAction.java index e363ee29e9..8ec7c90331 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnWidthAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnWidthAction.java @@ -4,8 +4,8 @@ package com.fr.design.actions.columnrow; import com.fr.design.mainframe.ElementCasePane; - import com.fr.grid.selection.CellSelection; +import com.fr.quickeditor.CellQuickEditor; import com.fr.report.elementcase.ElementCase; import com.fr.stable.unit.UNIT; @@ -32,6 +32,9 @@ public class ColumnWidthAction extends ColumnRowSizingAction { for (int i = 0; i < columns.length; i++) { report.setColumnWidth(columns[i], len); } + if (columns.length > 1) { + CellQuickEditor.record(CellQuickEditor.multipleOperationType.HEIHT_AND_COLUMN); + } } protected UNIT getIndexLen(int index, ElementCase report){ diff --git a/designer-realize/src/main/java/com/fr/design/actions/columnrow/RowHeightAction.java b/designer-realize/src/main/java/com/fr/design/actions/columnrow/RowHeightAction.java index 9485dc270a..ff4d63a1e9 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/columnrow/RowHeightAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/columnrow/RowHeightAction.java @@ -6,6 +6,7 @@ package com.fr.design.actions.columnrow; import com.fr.design.mainframe.ElementCasePane; import com.fr.grid.selection.CellSelection; +import com.fr.quickeditor.CellQuickEditor; import com.fr.report.elementcase.ElementCase; import com.fr.stable.unit.UNIT; @@ -32,6 +33,9 @@ public class RowHeightAction extends ColumnRowSizingAction { for (int i = 0; i < rows.length; i++) { report.setRowHeight(rows[i], len); } + if (rows.length > 1) { + CellQuickEditor.record(CellQuickEditor.multipleOperationType.HEIHT_AND_COLUMN); + } } @Override diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 6f060b4f06..c84396b483 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -455,6 +455,9 @@ public abstract class CellQuickEditor extends QuickEditor { if (updateStyle) { // 防止频繁触发保存 + if (!tc.isSelectedOneCell()) { + record(multipleOperationType.FORMAT); + } fireTargetModified(); } @@ -469,4 +472,51 @@ public abstract class CellQuickEditor extends QuickEditor { return formatPane; } + + + /** + * 用于适配记录批量操作的埋点数据 + * + * @param type 批量操作修改类型 + * @return 批量修改类型名称 + */ + public static String record(multipleOperationType type) { + return type.getType(); + } + + /** + * 批量操作的类型 + */ + public enum multipleOperationType { + /** + * 批量修改格式 + */ + FORMAT("FORMAT"), + + /** + * 批量修改数据列的数据设置 + */ + TYPE_OF_DATA("type-of-data"), + + /** + * 批量修改过滤条件 + */ + FILTER("filter"), + + /** + * 批量修改行高列宽 + */ + HEIHT_AND_COLUMN("row-height-and-column-width"); + + + private final String type; + + multipleOperationType(String type) { + this.type = type; + } + + public String getType() { + return type; + } + } } diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index bd449de01d..575f89fb07 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -319,10 +319,12 @@ public class CellDSColumnEditor extends CellQuickEditor { public void itemStateChanged(ItemEvent e) { CellSelection selection = (CellSelection) tc.getSelection(); Set allCellElements = selection.getCellElements(); - groupPane.update(allCellElements); if (e == null || e.getStateChange() == ItemEvent.DESELECTED) { //分组-高级-自定义点确定的时候传进来null的e,但是这时候应该触发保存 groupPane.update(allCellElements); + if (!tc.isSelectedOneCell()) { + CellQuickEditor.record(multipleOperationType.TYPE_OF_DATA); + } fireTargetModified(); } } From 66ff36803c2bd10bcae73939bcda361b8f7b400b Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Thu, 3 Nov 2022 11:54:38 +0800 Subject: [PATCH 2/9] =?UTF-8?q?REPORT-80690=20=E4=BF=AE=E6=94=B9=E4=BC=A0?= =?UTF-8?q?=E5=85=A5=E6=A0=BC=E5=BC=8F=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/quickeditor/CellQuickEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index c84396b483..55a3712626 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -491,7 +491,7 @@ public abstract class CellQuickEditor extends QuickEditor { /** * 批量修改格式 */ - FORMAT("FORMAT"), + FORMAT("Format"), /** * 批量修改数据列的数据设置 From cdde517142da265966ac84eb1a5a87501502fe36 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Thu, 3 Nov 2022 14:08:14 +0800 Subject: [PATCH 3/9] =?UTF-8?q?REPORT-80690=20=E4=BF=AE=E6=94=B9=E4=BC=A0?= =?UTF-8?q?=E5=85=A5=E6=A0=BC=E5=BC=8F=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/quickeditor/CellQuickEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 55a3712626..354eb438fc 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -491,7 +491,7 @@ public abstract class CellQuickEditor extends QuickEditor { /** * 批量修改格式 */ - FORMAT("Format"), + FORMAT("format"), /** * 批量修改数据列的数据设置 From b86ab2dbaf2f08b9393bb65f9a4b2a7159799e18 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Thu, 3 Nov 2022 16:18:51 +0800 Subject: [PATCH 4/9] =?UTF-8?q?REPORT-80690=20=E5=A2=9E=E5=8A=A0=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/quickeditor/CellQuickEditor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 354eb438fc..67a65672f1 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -476,9 +476,10 @@ public abstract class CellQuickEditor extends QuickEditor { /** * 用于适配记录批量操作的埋点数据 + * 真正的埋点提交方案在云端运维插件中 * * @param type 批量操作修改类型 - * @return 批量修改类型名称 + * @return 批量修改类型名称,用于云端运维埋点记录 */ public static String record(multipleOperationType type) { return type.getType(); From 4a753e5782e25ee8aca17fdd203783aa9d89a91a Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 4 Nov 2022 09:46:26 +0800 Subject: [PATCH 5/9] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=BA=8C=E6=9C=9F=20=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/action/ITChecker.java | 123 ++++++++++++++++++ .../content/component/ComponentType.java | 2 +- .../actions/replace/info/ComponentInfo.java | 4 +- .../actions/replace/info/WidgetInfo.java | 2 +- .../replace/ui/ITReplaceMainDialog.java | 31 ++++- .../replace/ui/ITReplaceNorthPanel.java | 9 +- 6 files changed, 157 insertions(+), 14 deletions(-) create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java new file mode 100644 index 0000000000..fddee0f038 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java @@ -0,0 +1,123 @@ +package com.fr.design.actions.replace.action; + +import com.fr.design.actions.replace.info.Info; +import com.fr.design.i18n.Toolkit; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 校验JS、公式、控件、组件 + * 比较用户的所有对应类别的改动,不论是否选中要替换,只要整体类别改动过就算模板内容改动过 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-11-03 + */ +public enum ITChecker { + WIDGET_CHECK_TAG(Toolkit.i18nText("Fine-Design_Basic_Widget")), + FORMULA_CHECK_TAG(Toolkit.i18nText("Fine-Design_Basic_Formula")), + JS_CHECK_TAG(Toolkit.i18nText("Fine-Design_Replace_JS")), + COMPONENT_CHECK_TAG(Toolkit.i18nText("Fine-Design_Replace_Component")) + ; + + + String name; + + ITChecker(String name) { + this.name = name; + } + + + /** + * 匹配 + * + * @param name 对应的检查类型 + * @return 对应的检查checker + */ + @Nullable + public static ITChecker match(String name) { + ITChecker[] values = ITChecker.values(); + for (ITChecker value : values) { + if (value.name.equals(name)) { + return value; + } + } + return null; + } + + public static List checkList = new ArrayList<>(); + public static Map appearTimesMap = new HashMap<>(); + + + /** + * 更新对应的check列表 + * + * @param list 查找后的searchList + */ + public static void updateCheckInfo(List list) { + checkList = list; + updateCheckMapFromList(list); + } + + /** + * 根据列表来更新对应元素的匹配Map + * + * @param list 更新后的checkList + */ + private static void updateCheckMapFromList(List list) { + appearTimesMap.clear(); + for (Info info : list) { + String showStr = info.getContent().getOldShowStr(); + if (appearTimesMap.containsKey(showStr)) { + //如果已经存过了就个数+1 + appearTimesMap.put(showStr, appearTimesMap.get(showStr) + 1); + } else { + //没有的话就把个数初始化为1个 + appearTimesMap.put(showStr, 1); + } + } + } + + + /** + * 判断是否修改过 + * + * @param list 重新获取的当前模板最新的list + * @return 修改过返回true + */ + public boolean isChanged(List list) { + if (list.size() != checkList.size()) { + //如果总的数据的数量变了,就说明肯定修改过,没必要再进行下一步 + return true; + } + return isChangedCheckByMap(list); + } + + /** + * 通过检查Map来比较是否修改过 + * + * @param list 传入的用于比较的list + * @return 修改过则返回true + */ + private boolean isChangedCheckByMap(List list) { + for (Info info : list) { + String showStr = info.getContent().getOldShowStr(); + if (appearTimesMap.containsKey(showStr)) { + //如果map中存在对应的值,就抵消,个数-1 + appearTimesMap.put(showStr, appearTimesMap.get(showStr) - 1); + if (appearTimesMap.get(showStr) < 0) { + //如果map中的值小于0了,就说明数量对不上,修改过 + return true; + } + } else { + //如果存在map中没存的值就没必要继续下去了,肯定改过 + return true; + } + } + return false; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java index 13712a570a..de747cbeaa 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java @@ -340,7 +340,7 @@ public enum ComponentType implements DealWithInfoValue { String str = widget.getWidgetName(); info.updateOldStr(widget.getWidgetName(), findStr); ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); - widget.setWidgetName(widget.getWidgetName().replaceAll(findStr, replaceStr)); + widget.setWidgetName(ShowValueUtils.replaceAll(widget.getWidgetName(), findStr, replaceStr)); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ComponentInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ComponentInfo.java index 77993c53db..c5667c7c41 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ComponentInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ComponentInfo.java @@ -3,6 +3,7 @@ package com.fr.design.actions.replace.info; import com.fr.design.actions.replace.action.content.component.ComponentType; import com.fr.design.actions.replace.action.content.component.SearchComponentAction; import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; import com.fr.form.ui.Widget; @@ -92,7 +93,8 @@ public class ComponentInfo implements Info { } SearchComponentAction.getInstance().search4Infos(jTemplate); List list = SearchComponentAction.getInstance().getComponentInfos(); - String replacedName = ((Widget)this.getContent().getReplaceObject()).getWidgetName().replace(searchStr, replaceStr); + + String replacedName = ShowValueUtils.replaceAll(((Widget)this.getContent().getReplaceObject()).getWidgetName(), searchStr, replaceStr); for (ComponentInfo info : list) { String widgetName = ((Widget)info.getContent().getReplaceObject()).getWidgetName(); if (StringUtils.equals(replacedName, widgetName)) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java index 4ebae73da9..051105bfad 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java @@ -156,7 +156,7 @@ public class WidgetInfo implements Info, DealWithInfoValue { return false; } if (!this.isWaterMark() && this.isNeed2Check()) { - String replacedName = ((Widget)this.getContent().getReplaceObject()).getWidgetName().replace(searchStr, replaceStr); + String replacedName = ShowValueUtils.replaceAll(((Widget)this.getContent().getReplaceObject()).getWidgetName(), searchStr, replaceStr); for (WidgetName name : CheckUtils.getNeed2CheckWidgetsName(jTemplate)) { String widgetName = name.getName(); if (StringUtils.equals(replacedName, widgetName)) { 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 78daf0a09f..1990062967 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,6 +1,7 @@ package com.fr.design.actions.replace.ui; +import com.fr.design.actions.replace.action.ITChecker; import com.fr.design.actions.replace.action.ShowSearchResultAction; import com.fr.design.actions.replace.action.setting.SettingController; @@ -37,6 +38,7 @@ import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; +import static com.fr.design.actions.replace.ui.ITTableEditorPane.editTable; import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable; /** @@ -210,10 +212,13 @@ public class ITReplaceMainDialog extends UIDialog { * 模板内容替换相关 */ private void replace4Content() { + String type = ((UITextField) (northPane.getFindCombobox().getEditor().getEditorComponent())).getText(); String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText(); String replaceStr = ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).getText(); clearContentCount(); - if (isITReplaceValid() && checkTemplateChanged(searchContentResultList)) { + if (isITReplaceValid() && checkTemplateChanged(searchContentResultList, type)) { + ShowSearchResultAction searchAction = ShowSearchResultAction.match(GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem())); + ITChecker.updateCheckInfo(searchAction.addMatchResult(searchStr, searchAction.showSearchValue(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()))); if (StringUtils.equals(getSearchStr(), searchStr)) { String str = GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem()); //如果是控件或组件才要进行合法性校验 @@ -257,7 +262,9 @@ public class ITReplaceMainDialog extends UIDialog { if (!info.getContent().isWrongful() && info.getContent().isSelected()) { info.setValue(info, searchStr, replaceStr, info.getContent().getOperatorArray()); } - info.getContent().setReplaced(true); + if (info.getContent().isSelected()) { + info.getContent().setReplaced(true); + } } northPane.getResultLabel().setText(ShowValueUtils.getResultTip(searchContentResultList.size(), contentReplaceCount, contentReplaceFailedCount)); southPanel.getTableEditorPane().update(); @@ -338,10 +345,18 @@ public class ITReplaceMainDialog extends UIDialog { } - private Boolean checkTemplateChanged(List searchResultList) { - for (Info info : searchResultList) { - if (!info.getContent().isReplaced() && !info.checkValid()) { - return false; + private Boolean checkTemplateChanged(List searchResultList, String type) { + ITChecker checker = ITChecker.match(type); + //对于JS、控件、组件、公式进行全量校验,不只针对当前选中的地方,这边先这样处理 + if (checker != null) { + ShowSearchResultAction searchAction = ShowSearchResultAction.match(GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem())); + return !checker.isChanged(searchAction.addMatchResult(searchStr, searchAction.showSearchValue(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()))); + } else { + //其他地方走各自的校验逻辑 + for (Info info : searchResultList) { + if (!info.getContent().isReplaced() && !info.checkValid()) { + return false; + } } } return true; @@ -436,7 +451,9 @@ public class ITReplaceMainDialog extends UIDialog { ShowSearchResultAction searchAction = ShowSearchResultAction.match(GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem())); //搜索 if (searchAction != null) { - searchContentResultList = searchAction.addMatchResult(searchStr, searchAction.showSearchValue(jTemplate)); + List showValueList = searchAction.showSearchValue(jTemplate); + searchContentResultList = searchAction.addMatchResult(searchStr, showValueList); + ITChecker.updateCheckInfo(searchContentResultList); itTableEditor.add(searchContentResultList); northPane.getResultLabel().setText(ShowValueUtils.getResultTip(searchContentResultList.size(), contentReplaceCount, contentReplaceFailedCount)); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java index a11886c2c8..6739d3a42f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java @@ -5,6 +5,7 @@ import com.fr.design.actions.replace.action.setting.SettingContent; import com.fr.design.actions.replace.action.setting.SettingController; import com.fr.design.data.datapane.TableDataComboBox; import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; @@ -51,7 +52,7 @@ public class ITReplaceNorthPanel { private UILabel resultLabel; private UIComboBox findCombobox; private UIComboBox rangeCombobox; - private JCheckBox matchRadioButton; + private UICheckBox matchRadioButton; private UILabel iconLabel; private UIComboBox findInputCombobox; private UIComboBox replaceInputCombobox; @@ -201,7 +202,7 @@ public class ITReplaceNorthPanel { super.setEditor(new ITComboBoxEditor()); } }; - matchRadioButton = new JCheckBox(Toolkit.i18nText("Fine-Design_Replace_WildCard")); + matchRadioButton = new UICheckBox(Toolkit.i18nText("Fine-Design_Replace_WildCard")); matchRadioButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -702,11 +703,11 @@ public class ITReplaceNorthPanel { this.rangeCombobox = rangeCombobox; } - public JCheckBox getMatchRadioButton() { + public UICheckBox getMatchRadioButton() { return matchRadioButton; } - public void setMatchRadioButton(JCheckBox checkBox) { + public void setMatchRadioButton(UICheckBox checkBox) { this.matchRadioButton = checkBox; } From 31c30d8c4fb900e368ee2ef4b6037fe8705f82ad Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 4 Nov 2022 09:51:26 +0800 Subject: [PATCH 6/9] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=BA=8C=E6=9C=9F=20=E4=B8=BA=E4=BA=86=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=A0=A1=E9=AA=8C=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=B8=8B=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/replace/action/ITChecker.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java index fddee0f038..ca15cd1a5b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java @@ -18,9 +18,21 @@ import java.util.Map; * created by Destiny.Lin on 2022-11-03 */ public enum ITChecker { + /** + * 控件 + */ WIDGET_CHECK_TAG(Toolkit.i18nText("Fine-Design_Basic_Widget")), + /** + * 公式 + */ FORMULA_CHECK_TAG(Toolkit.i18nText("Fine-Design_Basic_Formula")), + /** + * JS + */ JS_CHECK_TAG(Toolkit.i18nText("Fine-Design_Replace_JS")), + /** + * 组件 + */ COMPONENT_CHECK_TAG(Toolkit.i18nText("Fine-Design_Replace_Component")) ; From 246f174b2ec6fed8fcd1e97e5cc0c5a42dd3a638 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 4 Nov 2022 14:34:01 +0800 Subject: [PATCH 7/9] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=BA=8C=E6=9C=9F=20=E4=BF=AE=E6=94=B9=E9=92=BB=E5=8F=96?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E7=9A=84=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SearchChartCollectionFormulaAction.java | 5 ++++ .../actions/replace/utils/SearchJSUtils.java | 29 ++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java index 40e5283ce9..69b763248c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java @@ -34,6 +34,7 @@ import com.fr.plugin.chart.custom.CustomPlotFactory; import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.custom.type.CustomPlotType; +import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.stable.StringUtils; @@ -106,6 +107,10 @@ public class SearchChartCollectionFormulaAction { customContent.addOtherPos(CustomPlotFactory.getTitle(CustomPlotFactory.getCustomType(plot.getCustomPlotList().get(i)))); dealPlot(formulaInfos, customContent, plot.getCustomPlotList().get(i)); } + } else if (chart.getPlot() instanceof VanChartDrillMapPlot) { + ITContent drillContent = ITContent.copy(conditionContent); + drillContent.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_Drill_Dir")); + dealNameJavaScriptGroup(formulaInfos, drillContent, ((VanChartDrillMapPlot) chart.getPlot()).getDrillUpHyperLink()); } else if (chart.getPlot() != null) { dealPlot(formulaInfos, conditionContent, chart.getPlot()); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java index 8901f76edb..dbec52eefc 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java @@ -26,6 +26,7 @@ import com.fr.plugin.chart.base.VanChartHtmlLabel; import com.fr.plugin.chart.custom.CustomPlotFactory; import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.custom.type.CustomPlotType; +import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.attr.AttrMapLabel; import com.fr.plugin.chart.map.attr.AttrMapTooltip; @@ -338,6 +339,8 @@ public class SearchJSUtils { VanChart chart = ((VanChart) chartCollection.getChart(i)); if (isCustomMapPlot(chart.getPlot())) { dealMapNameJavaScript(content, chart.getPlot(), jsInfos); + } else if (chart.getPlot() instanceof VanChartDrillMapPlot) { + dealDrillNameJavaScript(content, chart.getPlot(), jsInfos); } else { NameJavaScriptGroup nameJavaScriptGroup = chart.getPlot().getHotHyperLink(); addNameJavaScript2Array(nameJavaScriptArrayList, nameJavaScriptGroup); @@ -347,6 +350,19 @@ public class SearchJSUtils { return nameJavaScriptArrayList; } + private static void dealDrillNameJavaScript(ITContent content, VanChartDrillMapPlot plot, List jsInfos) { + ITContent chartContent = ITContent.copy(content); + chartContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Chart_Chart"), + Toolkit.i18nText("Fine-Design_Chart_Animation_Special"), + Toolkit.i18nText("Fine-Design_Chart_Interactive"), + Toolkit.i18nText("Fine-Design_Chart_Drill_Dir") + ); + List list = new ArrayList<>(); + addNameJavaScript2Array(list, plot.getDrillUpHyperLink()); + addJSInfosFromNameJS(chartContent, list, jsInfos); + } + /** * 是否是组合地图 * @param plot 图表的plot @@ -366,14 +382,19 @@ public class SearchJSUtils { List areaJavaScriptList = new ArrayList<>(); List lineJavaScriptList = new ArrayList<>(); List pointJavaScriptList = new ArrayList<>(); - + ITContent chartContent = ITContent.copy(content); + chartContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Chart_Chart"), + Toolkit.i18nText("Fine-Design_Chart_Animation_Special"), + Toolkit.i18nText("Fine-Design_Chart_Interactive") + ); addNameJavaScript2Array(areaJavaScriptList, plot.getAreaHotHyperLink()); addNameJavaScript2Array(lineJavaScriptList, plot.getLineHotHyperLink()); addNameJavaScript2Array(pointJavaScriptList, plot.getPointHotHyperLink()); - addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(content, Toolkit.i18nText("Fine-Design_Chart_Region_Map")), areaJavaScriptList, jsInfos); - addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(content, Toolkit.i18nText("Fine-Design_Chart_LineMap")), lineJavaScriptList, jsInfos); - addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(content, Toolkit.i18nText("Fine-Design_Chart_PointMap")), pointJavaScriptList, jsInfos); + addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(chartContent, Toolkit.i18nText("Fine-Design_Chart_Region_Map")), areaJavaScriptList, jsInfos); + addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(chartContent, Toolkit.i18nText("Fine-Design_Chart_LineMap")), lineJavaScriptList, jsInfos); + addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(chartContent, Toolkit.i18nText("Fine-Design_Chart_PointMap")), pointJavaScriptList, jsInfos); } private static void addNameJavaScript2Array(List nameJavaScriptArrayList, NameJavaScriptGroup nameJavaScriptGroup) { From 588ee54b08b5f7c8b99155f1c24a55364402e3b9 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 4 Nov 2022 14:42:10 +0800 Subject: [PATCH 8/9] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=BA=8C=E6=9C=9F=20=E4=BF=AE=E6=94=B9=E9=92=BB=E5=8F=96?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E7=9A=84=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/utils/SearchJSUtils.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java index dbec52eefc..2a1a4ef188 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java @@ -64,6 +64,14 @@ public class SearchJSUtils { */ public static final String CATEGORY_LABEL = ShowValueUtils.joinStr4Position(Toolkit.i18nText("Fine-Design_Basic_Style"), Toolkit.i18nText("Fine-Design_Chart_Data_Label"), Toolkit.i18nText("Fine-Design_Chart_Category_Label")); + /** + * 条件属性 + */ + public static final String CONDITION = ShowValueUtils.joinStr4Position( + Toolkit.i18nText("Fine-Design_Chart_Chart"), + Toolkit.i18nText("Fine-Design_Chart_Animation_Special"), + Toolkit.i18nText("Fine-Design_Chart_Interactive")); + /** * 从Listener中获取JS */ @@ -353,9 +361,7 @@ public class SearchJSUtils { private static void dealDrillNameJavaScript(ITContent content, VanChartDrillMapPlot plot, List jsInfos) { ITContent chartContent = ITContent.copy(content); chartContent.addOtherPos( - Toolkit.i18nText("Fine-Design_Chart_Chart"), - Toolkit.i18nText("Fine-Design_Chart_Animation_Special"), - Toolkit.i18nText("Fine-Design_Chart_Interactive"), + CONDITION, Toolkit.i18nText("Fine-Design_Chart_Drill_Dir") ); List list = new ArrayList<>(); @@ -383,11 +389,7 @@ public class SearchJSUtils { List lineJavaScriptList = new ArrayList<>(); List pointJavaScriptList = new ArrayList<>(); ITContent chartContent = ITContent.copy(content); - chartContent.addOtherPos( - Toolkit.i18nText("Fine-Design_Chart_Chart"), - Toolkit.i18nText("Fine-Design_Chart_Animation_Special"), - Toolkit.i18nText("Fine-Design_Chart_Interactive") - ); + chartContent.addOtherPos(CONDITION); addNameJavaScript2Array(areaJavaScriptList, plot.getAreaHotHyperLink()); addNameJavaScript2Array(lineJavaScriptList, plot.getLineHotHyperLink()); addNameJavaScript2Array(pointJavaScriptList, plot.getPointHotHyperLink()); From aa1322dcf050087ac3cc29cc6acc9785e74a8354 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 4 Nov 2022 15:12:11 +0800 Subject: [PATCH 9/9] =?UTF-8?q?REPORT-83876=20=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=863=E6=AC=A1=E4=BD=86=E6=92=A4?= =?UTF-8?q?=E5=9B=9E=E5=8F=98=E6=88=90=E4=BA=862=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/replace/ui/ITReplaceMainDialog.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 1990062967..ba7b4bf445 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 @@ -257,7 +257,6 @@ public class ITReplaceMainDialog extends UIDialog { * @param replaceStr */ public void replace(String searchStr, String replaceStr) { - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); for (Info info : searchContentResultList) { if (!info.getContent().isWrongful() && info.getContent().isSelected()) { info.setValue(info, searchStr, replaceStr, info.getContent().getOperatorArray()); @@ -266,6 +265,7 @@ public class ITReplaceMainDialog extends UIDialog { info.getContent().setReplaced(true); } } + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); northPane.getResultLabel().setText(ShowValueUtils.getResultTip(searchContentResultList.size(), contentReplaceCount, contentReplaceFailedCount)); southPanel.getTableEditorPane().update(); northPane.refreshReplaceInputComboBoxItems(); @@ -529,7 +529,6 @@ public class ITReplaceMainDialog extends UIDialog { if (isInputStrValid(inputStr, extraStr)) { String secondStr = GeneralUtils.objectToString(northPane.getReplaceSettingInputComboBox().getSelectedItem()); String thirdStr = GeneralUtils.objectToString(northPane.getReplaceExtraSettingComboBox().getSelectedItem()); - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); for (Info info : searchSettingResultList) { if (isSupportReplace(info)) { SettingController controller = SettingController.match(firstStr); @@ -540,10 +539,10 @@ public class ITReplaceMainDialog extends UIDialog { } } } + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); northPane.getSettingResultLabel().setText(ShowValueUtils.getResultTip(searchSettingResultList.size(), settingReplaceCount, settingReplaceFailedCount)); southPanel.getTableEditorPane().update(); ITTableEditorPane.getEditTable().repaint(); - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(); } else { search4Setting(); }