Browse Source

REPORT-75998 修改格式

feature/x
Destiny.Lin 2 years ago
parent
commit
7c846cb187
  1. 8
      designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java
  2. 7
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java
  3. 16
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/SearchComponentAction.java
  4. 30
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java
  5. 2
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/SearchFormula.java
  6. 12
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/SearchFormulaManager.java
  7. 3
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchDSColumnFormulaAction.java
  8. 4
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchRichFormulaAction.java
  9. 2
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/data/DataType.java
  10. 9
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/SearchHighlightFormula.java
  11. 4
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchDateEditorFormulaAction.java
  12. 6
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchTreeEditorFormulaAction.java
  13. 2
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java
  14. 14
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java
  15. 4
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/SearchWidgetAction.java
  16. 7
      designer-realize/src/main/java/com/fr/design/actions/replace/info/FormulaInfo.java
  17. 4
      designer-realize/src/main/java/com/fr/design/actions/replace/info/SQLInfo.java
  18. 4
      designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java
  19. 8
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
  20. 4
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java

8
designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java

@ -103,7 +103,7 @@ public enum ShowSearchResultAction implements ShowValue {
for (Info info : list) { for (Info info : list) {
stringHashMap = info.getValue(); stringHashMap = info.getValue();
if (StringUtils.isEmpty(str)) { if (StringUtils.isEmpty(str)) {
if (!StringUtils.isEmpty(stringHashMap.getOrDefault(objectContentKey, StringUtils.EMPTY))) { if (StringUtils.isNotEmpty(stringHashMap.getOrDefault(objectContentKey, StringUtils.EMPTY))) {
JSInfo contentJSInfo = ((JSInfo) info).copy(); JSInfo contentJSInfo = ((JSInfo) info).copy();
contentJSInfo.getContent().setShowStr(stringHashMap.get(objectContentKey)); contentJSInfo.getContent().setShowStr(stringHashMap.get(objectContentKey));
contentJSInfo.getContent().setOldShowStr(stringHashMap.get(objectContentKey)); contentJSInfo.getContent().setOldShowStr(stringHashMap.get(objectContentKey));
@ -111,7 +111,7 @@ public enum ShowSearchResultAction implements ShowValue {
contentJSInfo.setContentFlag(true); contentJSInfo.setContentFlag(true);
jsInfos.add(contentJSInfo); jsInfos.add(contentJSInfo);
} }
if (!StringUtils.isEmpty(stringHashMap.getOrDefault(objectNameKey, StringUtils.EMPTY))) { if (StringUtils.isNotEmpty(stringHashMap.getOrDefault(objectNameKey, StringUtils.EMPTY))) {
JSInfo nameJSInfo = ((JSInfo) info).copy(); JSInfo nameJSInfo = ((JSInfo) info).copy();
nameJSInfo.getContent().setShowStr(stringHashMap.get(objectNameKey)); nameJSInfo.getContent().setShowStr(stringHashMap.get(objectNameKey));
nameJSInfo.getContent().setOldShowStr(stringHashMap.get(objectNameKey)); nameJSInfo.getContent().setOldShowStr(stringHashMap.get(objectNameKey));
@ -310,7 +310,7 @@ public enum ShowSearchResultAction implements ShowValue {
private void searchMap4Widget(Map<String, String> map, List<WidgetInfo> widgetInfos, WidgetInfo info, String str) { private void searchMap4Widget(Map<String, String> map, List<WidgetInfo> widgetInfos, WidgetInfo info, String str) {
if (map.containsKey(objectNameKey)) { if (map.containsKey(objectNameKey)) {
String name = map.get(objectNameKey); String name = map.get(objectNameKey);
if (!StringUtils.isEmpty(name) && name.contains(str)) { if (StringUtils.isNotEmpty(name) && name.contains(str)) {
WidgetInfo nameInfo = info.copy(info); WidgetInfo nameInfo = info.copy(info);
nameInfo.getContent().setShowStr(ShowValueUtils.getCommonString(name, str)); nameInfo.getContent().setShowStr(ShowValueUtils.getCommonString(name, str));
nameInfo.getContent().setOldShowStr(map.get(objectNameKey)); nameInfo.getContent().setOldShowStr(map.get(objectNameKey));
@ -322,7 +322,7 @@ public enum ShowSearchResultAction implements ShowValue {
} }
if (map.containsKey(objectWaterMarkKey)) { if (map.containsKey(objectWaterMarkKey)) {
String waterMark = map.get(objectWaterMarkKey); String waterMark = map.get(objectWaterMarkKey);
if (!StringUtils.isEmpty(waterMark) && waterMark.contains(str)) { if (StringUtils.isNotEmpty(waterMark) && waterMark.contains(str)) {
WidgetInfo widgetInfo = info.copy(info); WidgetInfo widgetInfo = info.copy(info);
widgetInfo.getContent().setShowStr(ShowValueUtils.getCommonString(waterMark, str)); widgetInfo.getContent().setShowStr(ShowValueUtils.getCommonString(waterMark, str));
widgetInfo.getContent().setOldShowStr(map.get(objectWaterMarkKey)); widgetInfo.getContent().setOldShowStr(map.get(objectWaterMarkKey));

7
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java

@ -252,6 +252,13 @@ public enum ComponentType implements DealWithInfoValue {
return null; return null;
} }
/**
* 添加组件到数组中
*
* @param componentInfos
* @param bodyContent
* @param widget
*/
public void addComponent2Array(List<ComponentInfo> componentInfos, ITContent bodyContent, Widget widget) { public void addComponent2Array(List<ComponentInfo> componentInfos, ITContent bodyContent, Widget widget) {
componentInfos.add(new ComponentInfo(getComponentContent(bodyContent, widget))); componentInfos.add(new ComponentInfo(getComponentContent(bodyContent, widget)));
} }

16
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/SearchComponentAction.java

@ -133,11 +133,22 @@ public class SearchComponentAction implements SearchAction {
content.addTRL(widgetName); content.addTRL(widgetName);
} }
/**
* 对外开放的获取对象的方法
*
* @return
*/
public static SearchComponentAction getInstance() { public static SearchComponentAction getInstance() {
return SearchComponentAction.SearchComponentActionEnum.SINGLETON.getInstance(); return SearchComponentAction.SearchComponentActionEnum.SINGLETON.getInstance();
} }
/**
* 枚举实现单例
*/
enum SearchComponentActionEnum { enum SearchComponentActionEnum {
/**
* 单例
*/
SINGLETON; SINGLETON;
private SearchComponentAction instance; private SearchComponentAction instance;
@ -145,6 +156,11 @@ public class SearchComponentAction implements SearchAction {
instance = new SearchComponentAction(); instance = new SearchComponentAction();
} }
/**
* 获取对象
*
* @return
*/
public SearchComponentAction getInstance() { public SearchComponentAction getInstance() {
return instance; return instance;
} }

30
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java

@ -41,7 +41,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((Formula) o[0]).getContent())) { if (StringUtils.isNotEmpty(((Formula) o[0]).getContent())) {
map.put("content", ((Formula) o[0]).getContent()); map.put("content", ((Formula) o[0]).getContent());
} }
return map; return map;
@ -61,7 +61,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((FormulaCondition) o[0]).getFormula())) { if (StringUtils.isNotEmpty(((FormulaCondition) o[0]).getFormula())) {
map.put("content", ((FormulaCondition) o[0]).getFormula()); map.put("content", ((FormulaCondition) o[0]).getFormula());
} }
return map; return map;
@ -84,7 +84,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((Formula) ((Compare) o[0]).getValue()).getContent())) { if (StringUtils.isNotEmpty(((Formula) ((Compare) o[0]).getValue()).getContent())) {
map.put("content", ((Formula) ((Compare) o[0]).getValue()).getContent()); map.put("content", ((Formula) ((Compare) o[0]).getValue()).getContent());
} }
return map; return map;
@ -109,7 +109,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((RichText) ((CellElement) o[0]).getValue()).getContent())) { if (StringUtils.isNotEmpty(((RichText) ((CellElement) o[0]).getValue()).getContent())) {
map.put("content", ((RichText) ((CellElement) o[0]).getValue()).getContent()); map.put("content", ((RichText) ((CellElement) o[0]).getValue()).getContent());
} }
return map; return map;
@ -128,7 +128,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((Formula) ((com.fr.base.core.KV) o[0]).getValue()).getContent())) { if (StringUtils.isNotEmpty(((Formula) ((com.fr.base.core.KV) o[0]).getValue()).getContent())) {
map.put("content", ((Formula) ((com.fr.base.core.KV) o[0]).getValue()).getContent()); map.put("content", ((Formula) ((com.fr.base.core.KV) o[0]).getValue()).getContent());
} }
return map; return map;
@ -150,7 +150,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((Formula) (((CellInsertPolicyAttr) o[0]).getDefaultInsertValue())).getContent())) { if (StringUtils.isNotEmpty(((Formula) (((CellInsertPolicyAttr) o[0]).getDefaultInsertValue())).getContent())) {
map.put("content", ((Formula) (((CellInsertPolicyAttr) o[0]).getDefaultInsertValue())).getContent()); map.put("content", ((Formula) (((CellInsertPolicyAttr) o[0]).getDefaultInsertValue())).getContent());
} }
return map; return map;
@ -171,7 +171,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((FormulaPresent) o[0]).getFormulaContent())) { if (StringUtils.isNotEmpty(((FormulaPresent) o[0]).getFormulaContent())) {
map.put("content", ((FormulaPresent) o[0]).getFormulaContent()); map.put("content", ((FormulaPresent) o[0]).getFormulaContent());
} }
return map; return map;
@ -193,7 +193,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((SingleJavaScript) o[0]).getFileName())) { if (StringUtils.isNotEmpty(((SingleJavaScript) o[0]).getFileName())) {
map.put("content", ((SingleJavaScript) o[0]).getFileName()); map.put("content", ((SingleJavaScript) o[0]).getFileName());
} }
return map; return map;
@ -215,7 +215,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((Formula) (((ParameterProvider) o[0]).getValue())).getContent())) { if (StringUtils.isNotEmpty(((Formula) (((ParameterProvider) o[0]).getValue())).getContent())) {
map.put("content", ((Formula) (((ParameterProvider) o[0]).getValue())).getContent()); map.put("content", ((Formula) (((ParameterProvider) o[0]).getValue())).getContent());
} }
return map; return map;
@ -237,7 +237,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((FormulaProvider) o[0]).getContent())) { if (StringUtils.isNotEmpty(((FormulaProvider) o[0]).getContent())) {
map.put("content", ((FormulaProvider) o[0]).getContent()); map.put("content", ((FormulaProvider) o[0]).getContent());
} }
return map; return map;
@ -259,7 +259,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((Formula) (((Parameter) o[0]).getValue())).getContent())) { if (StringUtils.isNotEmpty(((Formula) (((Parameter) o[0]).getValue())).getContent())) {
map.put("content", ((Formula) (((Parameter) o[0]).getValue())).getContent()); map.put("content", ((Formula) (((Parameter) o[0]).getValue())).getContent());
} }
return map; return map;
@ -281,7 +281,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((DSColumn) o[0]).getResult())) { if (StringUtils.isNotEmpty(((DSColumn) o[0]).getResult())) {
map.put("content", ((DSColumn) o[0]).getResult()); map.put("content", ((DSColumn) o[0]).getResult());
} }
return map; return map;
@ -303,7 +303,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((BaseFormula) o[0]).getContent())) { if (StringUtils.isNotEmpty(((BaseFormula) o[0]).getContent())) {
map.put("content", ((BaseFormula) o[0]).getContent()); map.put("content", ((BaseFormula) o[0]).getContent());
} }
return map; return map;
@ -325,7 +325,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((Formula) ((StoreProcedureParameter) o[0]).getValue()).getContent())) { if (StringUtils.isNotEmpty(((Formula) ((StoreProcedureParameter) o[0]).getValue()).getContent())) {
map.put("content", ((Formula) ((StoreProcedureParameter) o[0]).getValue()).getContent()); map.put("content", ((Formula) ((StoreProcedureParameter) o[0]).getValue()).getContent());
} }
return map; return map;
@ -347,7 +347,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
@Override @Override
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
if (!StringUtils.isEmpty(((WatermarkAttr) o[0]).getText())) { if (StringUtils.isNotEmpty(((WatermarkAttr) o[0]).getText())) {
map.put("content", ((WatermarkAttr) o[0]).getText()); map.put("content", ((WatermarkAttr) o[0]).getText());
} }
return map; return map;

2
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/SearchFormula.java

@ -10,6 +10,8 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* 获取公式
*
* @author Destiny.Lin * @author Destiny.Lin
* @version 11.0 * @version 11.0
* created by Destiny.Lin on 2022-08-18 * created by Destiny.Lin on 2022-08-18

12
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/SearchFormulaManager.java

@ -15,6 +15,8 @@ import java.util.List;
import java.util.Set; import java.util.Set;
/** /**
* 管理公式类型搜索的注册
*
* @author Destiny.Lin * @author Destiny.Lin
* @version 11.0 * @version 11.0
* created by Destiny.Lin on 2022-08-17 * created by Destiny.Lin on 2022-08-17
@ -49,6 +51,16 @@ public class SearchFormulaManager implements SearchAction {
formulaProviderSet.add(searchFormula); formulaProviderSet.add(searchFormula);
} }
/**
* 注销对应的SearchFormula
*
* @param searchFormula
*/
public void removeFormula(SearchFormula searchFormula) {
formulaProviderSet.remove(searchFormula);
}
public List<FormulaInfo> getFormulaInfos() { public List<FormulaInfo> getFormulaInfos() {
return formulaInfos; return formulaInfos;
} }

3
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchDSColumnFormulaAction.java

@ -59,7 +59,8 @@ public class SearchDSColumnFormulaAction implements SearchCellFormula {
} }
private void addFormulaInfos2ArrayFromResult(ITContent content, DSColumn dsColumn, List<FormulaInfo> formulaInfos) { private void addFormulaInfos2ArrayFromResult(ITContent content, DSColumn dsColumn, List<FormulaInfo> formulaInfos) {
if (dsColumn.getResult().length() > 0 && dsColumn.getResult().charAt(0) == '=') { char formulaLabel = '=';
if (dsColumn.getResult().length() > 0 && dsColumn.getResult().charAt(0) == formulaLabel) {
ITContent newContent = ITContent.copy(content); ITContent newContent = ITContent.copy(content);
newContent.setReplaceObject(dsColumn); newContent.setReplaceObject(dsColumn);
//高级-显示值 //高级-显示值

4
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchRichFormulaAction.java

@ -16,10 +16,12 @@ import java.util.List;
* created by Destiny.Lin on 2022-08-18 * created by Destiny.Lin on 2022-08-18
*/ */
public class SearchRichFormulaAction implements SearchCellFormula { public class SearchRichFormulaAction implements SearchCellFormula {
@Override @Override
public void searchFormulaFromCellType(List<FormulaInfo> formulaInfos, ITContent content) { public void searchFormulaFromCellType(List<FormulaInfo> formulaInfos, ITContent content) {
//todo 富文本这边直接遍历RichChar来拿公式 //todo 富文本这边直接遍历RichChar来拿公式
if (((RichText) ((CellElement) (content.getReplaceObject())).getValue()).getContent().contains("${")) { String contain = "${";
if (((RichText) ((CellElement) (content.getReplaceObject())).getValue()).getContent().contains(contain)) {
ITContent newContent = ITContent.copy(content); ITContent newContent = ITContent.copy(content);
newContent.setReplaceObject(((CellElement) (content.getReplaceObject())).getValue()); newContent.setReplaceObject(((CellElement) (content.getReplaceObject())).getValue());
newContent.addOtherPos( newContent.addOtherPos(

2
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/data/DataType.java

@ -92,7 +92,7 @@ public enum DataType {
* @param formulaInfos * @param formulaInfos
*/ */
public void dealProvider(ParameterProvider provider, ITContent content, List<FormulaInfo> formulaInfos) { public void dealProvider(ParameterProvider provider, ITContent content, List<FormulaInfo> formulaInfos) {
if (provider.getValue() instanceof Formula && !StringUtils.isEmpty((((Formula) provider.getValue())).getContent())) { if (provider.getValue() instanceof Formula && StringUtils.isNotEmpty((((Formula) provider.getValue())).getContent())) {
ITContent newContent = ITContent.copy(content); ITContent newContent = ITContent.copy(content);
newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Parameter")); newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Parameter"));
newContent.setReplaceObject(provider); newContent.setReplaceObject(provider);

9
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/SearchHighlightFormula.java

@ -17,10 +17,15 @@ import java.util.List;
*/ */
public interface SearchHighlightFormula extends SearchFormula { public interface SearchHighlightFormula extends SearchFormula {
//处理条件属性中各种属性 /**
* 处理条件属性中各种属性
*
* @param content
* @param formulaInfos
* @param highlightAction
*/
default void dealWithHighlightAction(ITContent content, List<FormulaInfo> formulaInfos, HighlightAction highlightAction) { default void dealWithHighlightAction(ITContent content, List<FormulaInfo> formulaInfos, HighlightAction highlightAction) {
} }
} }

4
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchDateEditorFormulaAction.java

@ -29,7 +29,7 @@ public class SearchDateEditorFormulaAction extends AbstractSearchWidgetFormulaAc
private void dealEndDateFormula(ITContent content, List<FormulaInfo> formulaInfos) { private void dealEndDateFormula(ITContent content, List<FormulaInfo> formulaInfos) {
DateEditor dateEditor = (DateEditor) content.getReplaceObject(); DateEditor dateEditor = (DateEditor) content.getReplaceObject();
if (dateEditor.getEndDateFM() != null && !StringUtils.isEmpty(dateEditor.getEndDateFM().getContent())) { if (dateEditor.getEndDateFM() != null && StringUtils.isNotEmpty(dateEditor.getEndDateFM().getContent())) {
ITContent newContent = ITContent.copy(content); ITContent newContent = ITContent.copy(content);
newContent.setReplaceObject(dateEditor.getEndDateFM()); newContent.setReplaceObject(dateEditor.getEndDateFM());
newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_End_Time")); newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_End_Time"));
@ -39,7 +39,7 @@ public class SearchDateEditorFormulaAction extends AbstractSearchWidgetFormulaAc
private void dealStratDateFormula(ITContent content, List<FormulaInfo> formulaInfos) { private void dealStratDateFormula(ITContent content, List<FormulaInfo> formulaInfos) {
DateEditor dateEditor = (DateEditor) content.getReplaceObject(); DateEditor dateEditor = (DateEditor) content.getReplaceObject();
if (dateEditor.getStartDateFM() != null && !StringUtils.isEmpty(dateEditor.getStartDateFM().getContent())) { if (dateEditor.getStartDateFM() != null && StringUtils.isNotEmpty(dateEditor.getStartDateFM().getContent())) {
ITContent newContent = ITContent.copy(content); ITContent newContent = ITContent.copy(content);
newContent.setReplaceObject(dateEditor.getStartDateFM()); newContent.setReplaceObject(dateEditor.getStartDateFM());
newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_Start_Time")); newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_Start_Time"));

6
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchTreeEditorFormulaAction.java

@ -14,6 +14,8 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* 搜索树形结构数据字典的公式
*
* @author Destiny.Lin * @author Destiny.Lin
* @version 11.0 * @version 11.0
* created by Destiny.Lin on 2022-08-22 * created by Destiny.Lin on 2022-08-22
@ -45,7 +47,7 @@ public class SearchTreeEditorFormulaAction extends AbstractSearchWidgetFormulaAc
private void dealWithTreeNodeWrapper(TreeNodeWrapper wrapper, ITContent content, List<FormulaInfo> formulaInfos) { private void dealWithTreeNodeWrapper(TreeNodeWrapper wrapper, ITContent content, List<FormulaInfo> formulaInfos) {
for (TreeNodeAttr attr : wrapper.getTreeNodeAttrs()) { for (TreeNodeAttr attr : wrapper.getTreeNodeAttrs()) {
if (((FormulaDisplayDictionary) attr.getDictionary()).getFormula() != null if (((FormulaDisplayDictionary) attr.getDictionary()).getFormula() != null
&& !StringUtils.isEmpty(((FormulaDisplayDictionary) attr.getDictionary()).getFormula().getContent())) { && StringUtils.isNotEmpty(((FormulaDisplayDictionary) attr.getDictionary()).getFormula().getContent())) {
ITContent newContent = ITContent.copy(content); ITContent newContent = ITContent.copy(content);
newContent.setReplaceObject(((FormulaDisplayDictionary) attr.getDictionary()).getFormula()); newContent.setReplaceObject(((FormulaDisplayDictionary) attr.getDictionary()).getFormula());
newContent.addOtherPos( newContent.addOtherPos(
@ -60,7 +62,7 @@ public class SearchTreeEditorFormulaAction extends AbstractSearchWidgetFormulaAc
private void dealWithLayerConfigs(LayerConfig[] layerConfigs, ITContent content, List<FormulaInfo> formulaInfos) { private void dealWithLayerConfigs(LayerConfig[] layerConfigs, ITContent content, List<FormulaInfo> formulaInfos) {
for (LayerConfig layerConfig : layerConfigs) { for (LayerConfig layerConfig : layerConfigs) {
if (layerConfig.getDictionary().getFormula() != null if (layerConfig.getDictionary().getFormula() != null
&& !StringUtils.isEmpty(layerConfig.getDictionary().getFormula().getContent())) { && StringUtils.isNotEmpty(layerConfig.getDictionary().getFormula().getContent())) {
ITContent newContent = ITContent.copy(content); ITContent newContent = ITContent.copy(content);
newContent.setReplaceObject(layerConfig.getDictionary().getFormula()); newContent.setReplaceObject(layerConfig.getDictionary().getFormula());
newContent.addOtherPos( newContent.addOtherPos(

2
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java

@ -16,6 +16,8 @@ import com.fr.stable.collections.combination.Pair;
import java.util.List; import java.util.List;
/** /**
* 获取图表的JS
*
* @author Destiny.Lin * @author Destiny.Lin
* @version 11.0 * @version 11.0
* created by Destiny.Lin on 2022-09-15 * created by Destiny.Lin on 2022-09-15

14
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java

@ -1,6 +1,5 @@
package com.fr.design.actions.replace.action.content.js; package com.fr.design.actions.replace.action.content.js;
import com.fr.design.actions.replace.action.SearchAction;
import com.fr.design.actions.replace.info.JSInfo; import com.fr.design.actions.replace.info.JSInfo;
import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.actions.replace.info.base.ITContent;
@ -21,6 +20,7 @@ import com.fr.web.attr.ReportWebAttr;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 搜索模板Web属性里的JS * 搜索模板Web属性里的JS
@ -31,16 +31,16 @@ import java.util.List;
*/ */
public class SearchWebJSAction implements SearchJS { public class SearchWebJSAction implements SearchJS {
private final static HashMap<String, String> map = new HashMap<>(); private final static Map<String, String> MAP = new HashMap<>();
private List<WebContent> arrayList = new ArrayList<>(); private List<WebContent> arrayList = new ArrayList<>();
private SearchWebJSAction() { private SearchWebJSAction() {
} }
static { static {
map.put("WebPage", Toolkit.i18nText("Fine-Design_Report_Pagination_Setting")); MAP.put("WebPage", Toolkit.i18nText("Fine-Design_Report_Pagination_Setting"));
map.put("WebWrite", Toolkit.i18nText("Fine-Design_Report_Write_Setting")); MAP.put("WebWrite", Toolkit.i18nText("Fine-Design_Report_Write_Setting"));
map.put("WebView", Toolkit.i18nText("Fine-Design_Report_Data_Analysis_Settings")); MAP.put("WebView", Toolkit.i18nText("Fine-Design_Report_Data_Analysis_Settings"));
} }
@ -68,8 +68,8 @@ public class SearchWebJSAction implements SearchJS {
private void addJSInfos2ListFromArray(ITContent content, List<JSInfo> jsInfos, WebContent webContent) { private void addJSInfos2ListFromArray(ITContent content, List<JSInfo> jsInfos, WebContent webContent) {
ITContent newContent = ITContent.copy(content); ITContent newContent = ITContent.copy(content);
if (map.containsKey(webContent.getClass().getSimpleName())) { if (MAP.containsKey(webContent.getClass().getSimpleName())) {
newContent.addOtherPos(map.get(webContent.getClass().getSimpleName())); newContent.addOtherPos(MAP.get(webContent.getClass().getSimpleName()));
} }
addJSInfos2ListFromWebButton(newContent, jsInfos, webContent); addJSInfos2ListFromWebButton(newContent, jsInfos, webContent);
addJSInfos2ListFromWebListener(newContent, jsInfos, webContent); addJSInfos2ListFromWebListener(newContent, jsInfos, webContent);

4
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/SearchWidgetAction.java

@ -116,8 +116,8 @@ public class SearchWidgetAction implements SearchAction {
ITContent newContent = ITContent.copy(cellInfo.getContent()); ITContent newContent = ITContent.copy(cellInfo.getContent());
Widget widget = ((TemplateCellElement) cellInfo.getContent().getReplaceObject()).getWidget(); Widget widget = ((TemplateCellElement) cellInfo.getContent().getReplaceObject()).getWidget();
newContent.addOtherPos("控件"); newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Widget"));
if (!StringUtils.isEmpty(widget.getWidgetName())) { if (StringUtils.isNotEmpty(widget.getWidgetName())) {
newContent.addOtherPos(widget.getWidgetName()); newContent.addOtherPos(widget.getWidgetName());
} }
newContent.setReplaceObject(widget); newContent.setReplaceObject(widget);

7
designer-realize/src/main/java/com/fr/design/actions/replace/info/FormulaInfo.java

@ -21,7 +21,8 @@ import java.util.Map;
*/ */
public class FormulaInfo implements Info { public class FormulaInfo implements Info {
private ITContent content; private ITContent content;
private static final String DISPLAY = Toolkit.i18nText("Fine-Design_Basic_DS_Dictionary") + "-" + Toolkit.i18nText("Fine-Design_Chart_Formula") + "-" + Toolkit.i18nText("Fine-Design_Basic_Display_Value");
private static final String ACTUAL = Toolkit.i18nText("Fine-Design_Basic_DS_Dictionary") + "-" + Toolkit.i18nText("Fine-Design_Chart_Formula") + "-" + Toolkit.i18nText("Fine-Design_Basic_Actual_Value");
public FormulaInfo(ITContent content) { public FormulaInfo(ITContent content) {
this.content = content; this.content = content;
} }
@ -39,9 +40,9 @@ public class FormulaInfo implements Info {
public Map<String, String> getValue(Object... o) { public Map<String, String> getValue(Object... o) {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
//这边比较特殊,存的都是FormulaDictionary ,特殊判断一下 //这边比较特殊,存的都是FormulaDictionary ,特殊判断一下
if (this.content.getOtherPos().contains(Toolkit.i18nText("Fine-Design_Basic_DS_Dictionary") + "-" + Toolkit.i18nText("Fine-Design_Chart_Formula") + "-" + Toolkit.i18nText("Fine-Design_Basic_Display_Value"))) { if (this.content.getOtherPos().contains(DISPLAY)) {
map.put("content", ((FormulaDictionary) this.getContent().getReplaceObject()).getExcuteFormula()); map.put("content", ((FormulaDictionary) this.getContent().getReplaceObject()).getExcuteFormula());
} else if (this.content.getOtherPos().contains(Toolkit.i18nText("Fine-Design_Basic_DS_Dictionary") + "-" + Toolkit.i18nText("Fine-Design_Chart_Formula") + "-" + Toolkit.i18nText("Fine-Design_Basic_Actual_Value"))) { } else if (this.content.getOtherPos().contains(ACTUAL)) {
map.put("content", ((FormulaDictionary) this.getContent().getReplaceObject()).getProduceFormula()); map.put("content", ((FormulaDictionary) this.getContent().getReplaceObject()).getProduceFormula());
} else { } else {
map = getCommonValue(); map = getCommonValue();

4
designer-realize/src/main/java/com/fr/design/actions/replace/info/SQLInfo.java

@ -41,6 +41,10 @@ public class SQLInfo implements Info {
return new HashMap<>(); return new HashMap<>();
} }
/**
* 复制
* @return
*/
public SQLInfo copy() { public SQLInfo copy() {
ITContent content = ITContent.copy(this.getContent()); ITContent content = ITContent.copy(this.getContent());
return new SQLInfo(content); return new SQLInfo(content);

4
designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java

@ -177,7 +177,7 @@ public class ITContent implements Cloneable {
*/ */
public void addOtherPos(String... otherPoses) { public void addOtherPos(String... otherPoses) {
for (String otherPos : otherPoses) { for (String otherPos : otherPoses) {
if (this.otherPos != null && !StringUtils.isEmpty(this.otherPos)) { if (StringUtils.isNotEmpty(this.otherPos)) {
this.otherPos = this.otherPos + "-" + otherPos; this.otherPos = this.otherPos + "-" + otherPos;
} else { } else {
this.otherPos = otherPos; this.otherPos = otherPos;
@ -191,7 +191,7 @@ public class ITContent implements Cloneable {
* @param trlString * @param trlString
*/ */
public void addTRL(String trlString) { public void addTRL(String trlString) {
if (!StringUtils.isEmpty(trlString)) { if (StringUtils.isNotEmpty(trlString)) {
if (StringUtils.isNotEmpty(this.trlString)) { if (StringUtils.isNotEmpty(this.trlString)) {
this.trlString = this.trlString + ":" + trlString; this.trlString = this.trlString + ":" + trlString;
} else { } else {

8
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java

@ -125,7 +125,7 @@ public class ITReplaceMainDialog extends UIDialog {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
search(); search();
String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText(); String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText();
if (!StringUtils.isEmpty(searchStr)) { if (StringUtils.isNotEmpty(searchStr)) {
((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setEditable(true); ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setEditable(true);
northPane.getReplaceInputCombobox().setEditable(true); northPane.getReplaceInputCombobox().setEditable(true);
} else { } else {
@ -140,7 +140,7 @@ public class ITReplaceMainDialog extends UIDialog {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
search(); search();
String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText(); String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText();
if (!StringUtils.isEmpty(searchStr)) { if (StringUtils.isNotEmpty(searchStr)) {
((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setEditable(true); ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setEditable(true);
northPane.getReplaceInputCombobox().setEditable(true); northPane.getReplaceInputCombobox().setEditable(true);
} else { } else {
@ -225,7 +225,9 @@ public class ITReplaceMainDialog extends UIDialog {
public boolean isITReplaceValid() { public boolean isITReplaceValid() {
if (JTemplate.isValid(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate())) { if (JTemplate.isValid(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate())) {
return StringUtils.equals(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget().getTemplateID(), templateID); return StringUtils.equals(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget().getTemplateID(), templateID);
} else return false; } else {
return false;
}
} }

4
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java

@ -152,7 +152,7 @@ public class ITReplaceNorthPanel {
*/ */
public void refreshFindInputComboBoxItems() { public void refreshFindInputComboBoxItems() {
String text = ((UITextField) (this.getFindInputCombobox().getEditor().getEditorComponent())).getText(); String text = ((UITextField) (this.getFindInputCombobox().getEditor().getEditorComponent())).getText();
if (!StringUtils.isEmpty(text)) { if (StringUtils.isNotEmpty(text)) {
if (findInputItems.contains(text)) { if (findInputItems.contains(text)) {
Collections.swap(findInputItems, 0, findInputItems.indexOf(text)); Collections.swap(findInputItems, 0, findInputItems.indexOf(text));
} else { } else {
@ -173,7 +173,7 @@ public class ITReplaceNorthPanel {
*/ */
public void refreshReplaceInputComboBoxItems() { public void refreshReplaceInputComboBoxItems() {
String text = ((UITextField) (this.getReplaceInputCombobox().getEditor().getEditorComponent())).getText(); String text = ((UITextField) (this.getReplaceInputCombobox().getEditor().getEditorComponent())).getText();
if (!StringUtils.isEmpty(text)) { if (StringUtils.isNotEmpty(text)) {
if (replaceInputItems.contains(text)) { if (replaceInputItems.contains(text)) {
Collections.swap(replaceInputItems, 0, replaceInputItems.indexOf(text)); Collections.swap(replaceInputItems, 0, replaceInputItems.indexOf(text));
} else { } else {

Loading…
Cancel
Save