Browse Source

REPORT-35569 参数面板,添加一个参数控件,撤销之后,再次添加的控件会空一个位置添加

feature/big-screen
Henry.Wang 4 years ago
parent
commit
d0622eae43
  1. 35
      designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java

35
designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java

@ -640,42 +640,13 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
* @return 是否加入 s
*/
public void addingAllParameter2Editor(Parameter[] parameterArray, int currentIndex) {
for (int i = 0; i < parameterArray.length; i++) {
com.fr.form.ui.Label label = new com.fr.form.ui.Label();
label.setWidgetName("Label" + parameterArray[i].getName());
label.setWidgetValue(new WidgetValue(parameterArray[i].getName() + ":"));
XCreator xCreator = XCreatorUtils.createXCreator(label);
if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE)
+ FIRST_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) {
break;
}
// 每行显示5组
EditorHolder editor = new EditorHolder(parameterArray[i]);
editor.setWidgetName(parameterArray[i].getName());
xCreator = XCreatorUtils.createXCreator(editor);
if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE)
+ SECOND_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) {
break;
}
currentIndex++;
}
if (!isWithQueryButton()) {
FormSubmitButton formSubmitButton = new FormSubmitButton();
formSubmitButton.setWidgetName("Search");
formSubmitButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Query"));
XCreator xCreator = XCreatorUtils.createXCreator(formSubmitButton);
if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * 3 + H_GAP, FIRST_V_LOCATION
+ V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) {
return;
}
}
addingAllParameter2EditorWithReturnValue(parameterArray, currentIndex);
}
/**
* @Description: 添加所有的参数并返回当前的currentIndex此方法为addingAllParameter2Editor的兼容方法
* @param parameterArray 参数数组
* @param currentIndex 添加所有参数前的index值
* @param currentIndex 添加所有参数前的index值
* @Description: 添加所有的参数并返回当前的currentIndex此方法为addingAllParameter2Editor的兼容方法
* @return: 添加所有参数后的index值
* @Author: Henry.Wang
* @date: 2020/8/5 19:40

Loading…
Cancel
Save