Browse Source

REPORT-80695 【模板全局级别查找替换二期】适配表格多出来的替换后内容这一列,以及部分校验内容

feature/x
Destiny.Lin 2 years ago
parent
commit
33d82a0db4
  1. 10
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java
  2. 74
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java
  3. 41
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
  4. 4
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
  5. 15
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/JSCheckTag.java
  6. 65
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/JSCheckType.java
  7. 1
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/FrmWidgetType.java

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

@ -126,7 +126,9 @@ public enum ComponentType implements DealWithInfoValue {
info.updateOldStr(titleLayout.getWidgetName(), findStr);
titleLayout.setWidgetName(ShowValueUtils.replaceAll(titleLayout.getWidgetName(), findStr, replaceStr));
CRBoundsWidget crBoundsWidget = ((CRBoundsWidget) titleLayout.getWidget(0));
crBoundsWidget.getWidget().setWidgetName(ShowValueUtils.replaceAll(crBoundsWidget.getWidget().getWidgetName(), findStr, replaceStr));
String str = crBoundsWidget.getWidget().getWidgetName();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
crBoundsWidget.getWidget().setWidgetName(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
}
},
@ -144,7 +146,9 @@ public enum ComponentType implements DealWithInfoValue {
info.updateOldStr(scaleLayout.getWidgetName(), findStr);
scaleLayout.setWidgetName(ShowValueUtils.replaceAll(scaleLayout.getWidgetName(), findStr, replaceStr));
CRBoundsWidget crBoundsWidget = ((CRBoundsWidget) scaleLayout.getWidget(0));
crBoundsWidget.getWidget().setWidgetName(ShowValueUtils.replaceAll(crBoundsWidget.getWidget().getWidgetName(), findStr, replaceStr));
String str = crBoundsWidget.getWidget().getWidgetName();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
crBoundsWidget.getWidget().setWidgetName(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
}
},
@ -333,7 +337,9 @@ public enum ComponentType implements DealWithInfoValue {
Object replaceObject = info.getContent().getReplaceObject();
if (replaceObject instanceof Widget) {
Widget widget = ((Widget) replaceObject);
String str = widget.getWidgetName();
info.updateOldStr(widget.getWidgetName(), findStr);
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
widget.setWidgetName(widget.getWidgetName().replaceAll(findStr, replaceStr));
}
}

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

@ -58,7 +58,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
Object replaceObject = info.getContent().getReplaceObject();
info.updateOldStr(((Formula) replaceObject).getContent(), findStr);
((Formula) replaceObject).setContent(ShowValueUtils.replaceAll(((Formula) replaceObject).getContent(), findStr, replaceStr));
String str = ((Formula) replaceObject).getContent();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
((Formula) replaceObject).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
@Override
@ -88,8 +90,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
Object replaceObject = info.getContent().getReplaceObject();
//更新上一次操作的信息
info.updateOldStr(((FormulaCondition) replaceObject).getFormula(), findStr);
((FormulaCondition) replaceObject).setFormula(ShowValueUtils.replaceAll(((FormulaCondition) replaceObject).getFormula(), findStr, replaceStr));
String str = ((FormulaCondition) replaceObject).getFormula();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
((FormulaCondition) replaceObject).setFormula(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
@Override
@ -120,8 +123,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
if (((Compare) replaceObject).getValue() instanceof Formula) {
Formula formula = (Formula) ((Compare) replaceObject).getValue();
info.updateOldStr(formula.getContent(), findStr);
formula.setContent(ShowValueUtils.replaceAll(formula.getContent(), findStr, replaceStr));
String str = formula.getContent();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
formula.setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
}
@ -151,8 +155,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
Object replaceObject = info.getContent().getReplaceObject();
info.updateOldStr(((Formula) ((com.fr.base.core.KV) replaceObject).getValue()).getContent(), findStr);
((Formula) ((com.fr.base.core.KV) replaceObject).getValue()).setContent(ShowValueUtils.replaceAll(((Formula) ((com.fr.base.core.KV) replaceObject).getValue()).getContent(), findStr, replaceStr));
String str = ((Formula) ((com.fr.base.core.KV) replaceObject).getValue()).getContent();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
((Formula) ((com.fr.base.core.KV) replaceObject).getValue()).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
@Override
@ -181,7 +186,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
Object replaceObject = info.getContent().getReplaceObject();
info.updateOldStr(((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).getContent(), findStr);
((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).setContent(ShowValueUtils.replaceAll(((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).getContent(), findStr, replaceStr));
String str = ((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).getContent();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
@Override
@ -210,8 +217,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
Object replaceObject = info.getContent().getReplaceObject();
info.updateOldStr(((FormulaPresent) replaceObject).getFormulaContent(), findStr);
((FormulaPresent) replaceObject).setFormulaContent(ShowValueUtils.replaceAll(((FormulaPresent) replaceObject).getFormulaContent(), findStr, replaceStr));
String str = ((FormulaPresent) replaceObject).getFormulaContent();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
((FormulaPresent) replaceObject).setFormulaContent(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
@Override
@ -240,7 +248,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
Object replaceObject = info.getContent().getReplaceObject();
info.updateOldStr(((SingleJavaScript) replaceObject).getFileName(), findStr);
((SingleJavaScript) replaceObject).setFileName(ShowValueUtils.replaceAll(((SingleJavaScript) replaceObject).getFileName(), findStr, replaceStr));
String str = ((SingleJavaScript) replaceObject).getFileName();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
((SingleJavaScript) replaceObject).setFileName(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
@Override
@ -269,8 +279,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
Object replaceObject = info.getContent().getReplaceObject();
info.updateOldStr(((Formula) (((ParameterProvider) replaceObject).getValue())).getContent(), findStr);
((Formula) (((ParameterProvider) replaceObject).getValue())).setContent(ShowValueUtils.replaceAll(((Formula) (((ParameterProvider) replaceObject).getValue())).getContent(), findStr, replaceStr));
String str = ((Formula) (((ParameterProvider) replaceObject).getValue())).getContent();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
((Formula) (((ParameterProvider) replaceObject).getValue())).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
@Override
@ -301,8 +312,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
Object replaceObject = info.getContent().getReplaceObject();
info.updateOldStr(((FormulaProvider) replaceObject).getContent(), findStr);
((FormulaProvider) replaceObject).setContent(ShowValueUtils.replaceAll(((FormulaProvider) replaceObject).getContent(), findStr, replaceStr));
String str = ((FormulaProvider) replaceObject).getContent();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
((FormulaProvider) replaceObject).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
@Override
@ -331,8 +343,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
Object replaceObject = info.getContent().getReplaceObject();
info.updateOldStr(((Formula) (((Parameter) replaceObject).getValue())).getContent(), findStr);
((Formula) (((Parameter) replaceObject).getValue())).setContent(ShowValueUtils.replaceAll(((Formula) (((Parameter) replaceObject).getValue())).getContent(), findStr, replaceStr));
String str = ((Formula) (((Parameter) replaceObject).getValue())).getContent();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
((Formula) (((Parameter) replaceObject).getValue())).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
@Override
@ -363,8 +376,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
Object replaceObject = info.getContent().getReplaceObject();
info.updateOldStr(((DSColumn) replaceObject).getResult(), findStr);
((DSColumn) replaceObject).setResult(ShowValueUtils.replaceAll(((DSColumn) replaceObject).getResult(), findStr, replaceStr));
String str = ((DSColumn) replaceObject).getResult();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
((DSColumn) replaceObject).setResult(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
@Override
@ -393,8 +407,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
Object replaceObject = info.getContent().getReplaceObject();
info.updateOldStr(((BaseFormula) replaceObject).getContent(), findStr);
((BaseFormula) replaceObject).setContent(ShowValueUtils.replaceAll(((BaseFormula) replaceObject).getContent(), findStr, replaceStr));
String str = ((BaseFormula) replaceObject).getContent();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
((BaseFormula) replaceObject).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
@Override
@ -423,8 +438,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
Object replaceObject = info.getContent().getReplaceObject();
info.updateOldStr(((Formula) ((StoreProcedureParameter) replaceObject).getValue()).getContent(), findStr);
((Formula) ((StoreProcedureParameter) replaceObject).getValue()).setContent(ShowValueUtils.replaceAll(((Formula) ((StoreProcedureParameter) replaceObject).getValue()).getContent(), findStr, replaceStr));
String str = ((Formula) ((StoreProcedureParameter) replaceObject).getValue()).getContent();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
((Formula) ((StoreProcedureParameter) replaceObject).getValue()).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
@ -457,7 +473,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
WorkBook workBook = (WorkBook) HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget();
WatermarkAttr watermarkAttr = (WatermarkAttr) info.getContent().getReplaceObject();
info.updateOldStr(watermarkAttr.getText(), findStr);
watermarkAttr.setText(ShowValueUtils.replaceAll(watermarkAttr.getText(), findStr, replaceStr));
String str = watermarkAttr.getText();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
watermarkAttr.setText(ShowValueUtils.replaceAll(str, findStr, replaceStr));
workBook.addAttrMark(watermarkAttr);
}
@ -514,7 +532,9 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
Object replaceObject = info.getContent().getReplaceObject();
info.updateOldStr((((FormulaSortExpression) replaceObject).getFormula()), findStr);
((FormulaSortExpression) replaceObject).setFormula(ShowValueUtils.replaceAll((((FormulaSortExpression) replaceObject).getFormula()), findStr, replaceStr));
String str = (((FormulaSortExpression) replaceObject).getFormula());
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
((FormulaSortExpression) replaceObject).setFormula(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
@Override
@ -525,8 +545,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
}
return false;
}
}
;
};
String name;
@ -554,6 +573,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
/**
* 校验内容
*
* @param info
* @return
*/

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

@ -33,7 +33,9 @@ public enum FormulaTag implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
if (info.getContent().getHoldObject() instanceof VanMapReportDefinition) {
VanMapReportDefinition definition = (VanMapReportDefinition) info.getContent().getHoldObject();
definition.setLongitude(ShowValueUtils.replaceAll(GeneralUtils.objectToString(definition.getLongitude()), findStr, replaceStr));
String str = GeneralUtils.objectToString(definition.getLongitude());
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
definition.setLongitude(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
}
},
@ -45,7 +47,9 @@ public enum FormulaTag implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
if (info.getContent().getHoldObject() instanceof VanMapReportDefinition) {
VanMapReportDefinition definition = (VanMapReportDefinition) info.getContent().getHoldObject();
definition.setLatitude(ShowValueUtils.replaceAll(GeneralUtils.objectToString(definition.getLatitude()), findStr, replaceStr));
String str = GeneralUtils.objectToString(definition.getLatitude());
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
definition.setLatitude(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
}
},
@ -57,7 +61,9 @@ public enum FormulaTag implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
if (info.getContent().getHoldObject() instanceof VanMapReportDefinition) {
VanMapReportDefinition definition = (VanMapReportDefinition) info.getContent().getHoldObject();
definition.setCategoryName(ShowValueUtils.replaceAll(GeneralUtils.objectToString(definition.getCategoryName()), findStr, replaceStr));
String str = GeneralUtils.objectToString(definition.getCategoryName());
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
definition.setCategoryName(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
}
},
@ -69,7 +75,9 @@ public enum FormulaTag implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
if (info.getContent().getHoldObject() instanceof VanMapReportDefinition) {
VanMapReportDefinition definition = (VanMapReportDefinition) info.getContent().getHoldObject();
definition.setEndLongitude(ShowValueUtils.replaceAll(GeneralUtils.objectToString(definition.getEndLongitude()), findStr, replaceStr));
String str = GeneralUtils.objectToString(definition.getEndLongitude());
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
definition.setEndLongitude(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
}
},
@ -81,7 +89,9 @@ public enum FormulaTag implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
if (info.getContent().getHoldObject() instanceof VanMapReportDefinition) {
VanMapReportDefinition definition = (VanMapReportDefinition) info.getContent().getHoldObject();
definition.setEndLatitude(ShowValueUtils.replaceAll(GeneralUtils.objectToString(definition.getEndLatitude()), findStr, replaceStr));
String str = GeneralUtils.objectToString(definition.getEndLatitude());
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
definition.setEndLatitude(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
}
},
@ -93,7 +103,9 @@ public enum FormulaTag implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
if (info.getContent().getHoldObject() instanceof VanMapReportDefinition) {
VanMapReportDefinition definition = (VanMapReportDefinition) info.getContent().getHoldObject();
definition.setEndAreaName(ShowValueUtils.replaceAll(GeneralUtils.objectToString(definition.getEndAreaName()), findStr, replaceStr));
String str = GeneralUtils.objectToString(definition.getEndAreaName());
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
definition.setEndAreaName(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
}
},
@ -105,7 +117,9 @@ public enum FormulaTag implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
if (info.getContent().getHoldObject() instanceof VerifyItem) {
VerifyItem item = (VerifyItem) info.getContent().getHoldObject();
item.setMessage(ShowValueUtils.replaceAll(item.getMessage(), findStr, replaceStr));
String str = item.getMessage();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
item.setMessage(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
}
},
@ -119,6 +133,7 @@ public enum FormulaTag implements DealWithInfoValue {
WorkBook workBook = (WorkBook) info.getContent().getHoldObject();
int sheetId = Integer.parseInt(info.getContent().getSheetID());
String name = workBook.getReportName(sheetId);
ShowValueUtils.updateAfterReplaceStr(info, name, findStr, replaceStr);
workBook.setReportName(sheetId, ShowValueUtils.replaceAll(name, findStr, replaceStr));
}
}
@ -131,7 +146,9 @@ public enum FormulaTag implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
if (info.getContent().getHoldObject() instanceof CellGUIAttr) {
CellGUIAttr attr = (CellGUIAttr) info.getContent().getHoldObject();
attr.setTooltipText(ShowValueUtils.replaceAll(attr.getTooltipText(), findStr, replaceStr));
String str = attr.getTooltipText();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
attr.setTooltipText(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
}
},
@ -140,7 +157,9 @@ public enum FormulaTag implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
if (info.getContent().getHoldObject() instanceof FormulaDictionary) {
FormulaDictionary dictionary = (FormulaDictionary) info.getContent().getHoldObject();
dictionary.setExcuteFormula(ShowValueUtils.replaceAll(dictionary.getExcuteFormula(), findStr, replaceStr));
String str = dictionary.getExcuteFormula();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
dictionary.setExcuteFormula(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
}
},
@ -149,7 +168,9 @@ public enum FormulaTag implements DealWithInfoValue {
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
if (info.getContent().getHoldObject() instanceof FormulaDictionary) {
FormulaDictionary dictionary = (FormulaDictionary) info.getContent().getHoldObject();
dictionary.setProduceFormula(ShowValueUtils.replaceAll(dictionary.getProduceFormula(), findStr, replaceStr));
String str = dictionary.getProduceFormula();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
dictionary.setProduceFormula(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
}
};

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

@ -149,8 +149,8 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula {
@Override
public void searchTemplateWaterMarkFormula(JTemplate jTemplate, List<FormulaInfo> formulaInfos, ITContent content) {
WatermarkAttr watermarkAttr = ReportUtils.getWatermarkAttrFromTemplateAndGlobal((AttrMark) jTemplate.getTarget());
if (watermarkAttr != null) {
WatermarkAttr watermarkAttr = ReportUtils.getWatermarkAttrFromTemplate((AttrMark) jTemplate.getTarget());
if (watermarkAttr != null && watermarkAttr.isValid()) {
ITContent waterMarkContent = ITContent.copy(content);
waterMarkContent.addOtherPos(Toolkit.i18nText("Fine-Design_Form_WaterMark"));
waterMarkContent.setReplaceObject(watermarkAttr);

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

@ -0,0 +1,15 @@
package com.fr.design.actions.replace.action.content.js;
/**
* 检查JS的标签
*
* @author Destiny.Lin
* @version 11.0
* created by Destiny.Lin on 2022-10-26
*/
public class JSCheckTag {
/**
* 单元格-超级链接
*/
public static final int CELL_HYPERLINK = 0;
}

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

@ -0,0 +1,65 @@
package com.fr.design.actions.replace.action.content.js;
import com.fr.design.actions.replace.info.Info;
import com.fr.js.NameJavaScript;
import com.fr.js.NameJavaScriptGroup;
import com.fr.report.cell.Elem;
import org.jetbrains.annotations.Nullable;
/**
* 检查JS是否修改过
*
* @author Destiny.Lin
* @version 11.0
* created by Destiny.Lin on 2022-10-26
*/
public enum JSCheckType {
/**
* 单元格-超级链接
*/
CELL_HYPERLINK(JSCheckTag.CELL_HYPERLINK) {
@Override
public boolean check(Info info) {
Elem elem = (Elem) info.getContent().getHoldObject();
NameJavaScriptGroup group = elem.getNameHyperlinkGroup();
int len = group.size();
if (len == 0) {
return false;
}
NameJavaScript javaScript = (NameJavaScript) info.getContent().getReplaceObject();
for (int i = 0; i < len; i++) {
if (group.getNameHyperlink(i).equals(javaScript)) {
return true;
}
}
return false;
}
};
int index;
JSCheckType(int index) {
this.index = index;
}
/**
* 匹配
*
* @param index
* @return
*/
@Nullable
public static JSCheckType match(int index) {
JSCheckType[] values = JSCheckType.values();
for (JSCheckType value : values) {
if (value.index == index) {
return value;
}
}
return null;
}
public abstract boolean check(Info info);
}

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

@ -167,6 +167,7 @@ public enum FrmWidgetType implements SearchFrmWidget, DealWithInfoValue {
if (((WidgetInfo) info).isWaterMark()) {
WaterMark waterMark = (WaterMark) widget;
info.updateOldStr(waterMark.getWaterMark(), findStr);
ShowValueUtils.updateAfterReplaceStr(info, waterMark.getWaterMark(), findStr, replaceStr);
waterMark.setWaterMark(ShowValueUtils.replaceAll(waterMark.getWaterMark(), findStr, replaceStr));
} else {
info.updateOldStr(widget.getWidgetName(), findStr);

Loading…
Cancel
Save