diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java index 27aebee07d..161aca91f4 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java @@ -246,4 +246,28 @@ public enum CellGroupType { DSColumn column = (DSColumn) cellElement.getValue(); column.setGrouper(grouper); } + + /** + * 是否修改过 + * + * @param info 存储信息的数据结构 + * @param inputStr 用户输入的第一级下拉框内容 + * @param extraStr 用户输入的第二级下拉框内容 + * @return 修改过返回true + */ + public boolean isEverChanged(Info info, String inputStr, String extraStr) { + return !isNeed(getCellElementFromInfo(info), inputStr, extraStr); + } + + /** + * 从Info中获取CellElement + * 能到这一步肯定是单元格数据列类型 + * + * @param info 存储查找替换信息的数据结构 + * @return CellElement + */ + public CellElement getCellElementFromInfo(Info info) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + return cellElement; + } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java index 0b481a1272..676bfba9cb 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java @@ -156,6 +156,15 @@ public enum SettingController implements ShowValue { type.replace(info, firstStr, secondStr); } } + + @Override + public boolean isEverChanged(Info info, String inputStr, String extraStr) { + CellGroupType type = CellGroupType.match(inputStr); + if (type != null) { + return type.isEverChanged(info, inputStr, extraStr); + } + return false; + } }, /** * 单元格-数据列 @@ -224,6 +233,13 @@ public enum SettingController implements ShowValue { dsColumn.setColumn(TableDataColumn.createColumn(secondStr)); } + + @Override + public boolean isEverChanged(Info info, String inputStr, String extraStr) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + DSColumn dsColumn = (DSColumn) cellElement.getValue(); + return !isNeed(dsColumn, inputStr, extraStr); + } }, /** * 数据源-数据连接