Browse Source

REPORT-75998 完善注释,增加单元格属性-排序中的公式

feature/x
Destiny.Lin 2 years ago
parent
commit
c1c17b8593
  1. 1
      designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
  2. 4
      designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
  3. 1
      designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
  4. 1
      designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java
  5. 30
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java
  6. 14
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
  7. 22
      designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java

1
designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java

@ -61,6 +61,7 @@ public class AllowAuthorityEditAction extends TemplateComponentAction {
DesignerContext.getDesignerFrame().refreshDottedLine(); DesignerContext.getDesignerFrame().refreshDottedLine();
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
EastRegionContainerPane.getInstance().removeParameterPane(); EastRegionContainerPane.getInstance().removeParameterPane();
//进入时要关闭查找替换面板
DesignModuleFactory.getReplaceOperator().close(); DesignModuleFactory.getReplaceOperator().close();
//画虚线 //画虚线

4
designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java

@ -141,6 +141,10 @@ public class DesignModuleFactory {
replaceHelper = replace; replaceHelper = replace;
} }
/**
* 获取查找替换面板的操作类
* @return
*/
public static ITReplaceHelper getReplaceOperator() { public static ITReplaceHelper getReplaceOperator() {
return replaceHelper; return replaceHelper;
} }

1
designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java

@ -48,6 +48,7 @@ public class DeveloperPreview extends AbstractPreviewProvider {
@Override @Override
public void onClick(JTemplate<?, ?> jt) { public void onClick(JTemplate<?, ?> jt) {
super.onClick(jt); super.onClick(jt);
//进入时要关闭查找替换面板
DesignModuleFactory.getReplaceOperator().close(); DesignModuleFactory.getReplaceOperator().close();
SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId()); SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId());
if (worker instanceof CallbackSaveWorker) { if (worker instanceof CallbackSaveWorker) {

1
designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java

@ -55,6 +55,7 @@ public class ITReplaceAction extends UpdateAction {
*/ */
public void actionPerformed(ActionEvent event) { public void actionPerformed(ActionEvent event) {
ITReplaceMainDialog mainFrame = ITReplaceMainDialog.getInstance(); ITReplaceMainDialog mainFrame = ITReplaceMainDialog.getInstance();
mainFrame.fitScreen();
mainFrame.setVisible(true); mainFrame.setVisible(true);
} }

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

@ -22,6 +22,7 @@ import com.fr.main.impl.WorkBook;
import com.fr.report.cell.cellattr.CellInsertPolicyAttr; import com.fr.report.cell.cellattr.CellInsertPolicyAttr;
import com.fr.report.cell.cellattr.core.RichChar; import com.fr.report.cell.cellattr.core.RichChar;
import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.core.sort.sortexpression.FormulaSortExpression;
import com.fr.stable.FormulaProvider; import com.fr.stable.FormulaProvider;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -495,6 +496,35 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
public boolean check(Info info) { public boolean check(Info info) {
return true; return true;
} }
},
/**
* 排序
*/
FORMULA_SORT_EXPRESSION("FormulaSortExpression"){
@Override
public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>();
if (StringUtils.isNotEmpty(((FormulaSortExpression) o[0]).getFormula())) {
map.put("content", ((FormulaSortExpression) o[0]).getFormula());
}
return map;
}
@Override
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));
}
@Override
public boolean check(Info info) {
if (info.getContent().getReplaceObject() instanceof FormulaSortExpression){
FormulaSortExpression sortExpression = (FormulaSortExpression) info.getContent().getReplaceObject();
return StringUtils.equals(sortExpression.getFormula(), info.getContent().getOldShowStr());
}
return false;
}
} }
; ;

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

@ -52,7 +52,6 @@ public class ITReplaceMainDialog extends UIDialog {
private ITReplaceWestPanel westPanel; private ITReplaceWestPanel westPanel;
private boolean searchFlag; private boolean searchFlag;
private String searchStr; private String searchStr;
private static boolean existed = false;
public ITReplaceMainDialog() { public ITReplaceMainDialog() {
super(DesignerContext.getDesignerFrame()); super(DesignerContext.getDesignerFrame());
@ -67,7 +66,6 @@ public class ITReplaceMainDialog extends UIDialog {
initFrame(); initFrame();
fitScreen(); fitScreen();
ITReplaceFlag = true; ITReplaceFlag = true;
existed = true;
} }
/** /**
@ -83,7 +81,6 @@ public class ITReplaceMainDialog extends UIDialog {
} }
} }
} }
setExisted(true);
return instance; return instance;
} }
@ -312,17 +309,6 @@ public class ITReplaceMainDialog extends UIDialog {
} }
} }
/**
* 面板是否存在
* @return
*/
public static boolean isExisted() {
return existed;
}
public static void setExisted(boolean existed) {
ITReplaceMainDialog.existed = existed;
}

22
designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java

@ -13,29 +13,13 @@ import com.fr.design.actions.replace.ui.ITReplaceMainDialog;
public class ReplaceOperator implements ITReplaceHelper { public class ReplaceOperator implements ITReplaceHelper {
/** /**
* 进入权限编辑状态&开发者调试时关闭面板 * 关闭面板
* (当前关闭时机进入权限编辑状态&开发者调试)
*/ */
@Override @Override
public void close(){ public void close(){
if (isExisted()){ ITReplaceMainDialog.getInstance().dispose();
ITReplaceMainDialog.getInstance().dispose();
setExisted(false);
}
} }
/**
* 面板是否存在
* @return
*/
public boolean isExisted(){
return ITReplaceMainDialog.isExisted();
}
/**
* 设置面板存在属性
* @param existed
*/
public void setExisted(boolean existed){
ITReplaceMainDialog.setExisted(existed);
}
} }

Loading…
Cancel
Save