Browse Source

Pull request #3977: 无jira 处理被冲突合并吞掉的代码

Merge in DESIGN/design from ~HADES/design:feature/x to feature/x

* commit 'd5e754a671b8521ec0d43b2933b973a70026533f':
  无jira 处理被冲突合并吞掉的代码
research/11.0
Hades 4 years ago
parent
commit
74a8d0f264
  1. 23
      designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java
  2. 35
      designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java

23
designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java

@ -11,11 +11,15 @@ import com.fr.form.ui.BaseChartEditor;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.ui.Widget;
import com.fr.script.Calculator;
import com.fr.stable.EmbParaFilter;
import com.fr.stable.ParameterProvider;
import com.fr.stable.js.WidgetName;
import com.fr.util.ParameterApplyHelper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class FormModelAdapter extends DesignModelAdapter<Form, BaseJForm<Form>> {
@ -42,6 +46,16 @@ public class FormModelAdapter extends DesignModelAdapter<Form, BaseJForm<Form>>
jTemplate.populateParameter();
}
@Override
public void tableDataParametersChanged(String oldName, String tdName, TableData tableData) {
Map<String, ParameterProvider> map = new HashMap<>();
addGlobalParameters(map);
updateTableDataParameters(oldName, tdName, tableData, map, parameterProvider -> !EmbParaFilter.isFRLayerTypePara(parameterProvider));
ParameterApplyHelper.addPara2Map(map, this.getBook().getTemplateParameters());
parameters = map.values().toArray(new Parameter[0]);
jTemplate.populateParameter();
}
/**
* 控件配置改变.
*/
@ -135,6 +149,13 @@ public class FormModelAdapter extends DesignModelAdapter<Form, BaseJForm<Form>>
@Override
protected Parameter[] getLatestParameters() {
return this.getBook().getParameters();
Map<String, ParameterProvider> map = new HashMap<>();
addGlobalParameters(map);
addTableDataParameters(map, parameterProvider -> !EmbParaFilter.isFRLayerTypePara(parameterProvider));
ParameterApplyHelper.addPara2Map(map, this.getBook().getTemplateParameters());
return map.values().toArray(new Parameter[0]);
}
}

35
designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java

@ -18,9 +18,12 @@ import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.js.WidgetName;
import com.fr.util.ParameterApplyHelper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* @author zhou
@ -72,6 +75,18 @@ public class WorkBookModelAdapter extends DesignModelAdapter<WorkBook, JWorkBook
jTemplate.populateReportParameterAttr();
}
@Override
public void tableDataParametersChanged(String oldName, String tdName, TableData tableData) {
Map<String, ParameterProvider> map = new HashMap<>();
addGlobalParameters(map);
updateTableDataParameters(oldName, tdName, tableData, map, null);
addReportParameters(map);
parameters = map.values().toArray(new Parameter[0]);
jTemplate.updateReportParameterAttr();
jTemplate.populateReportParameterAttr();
}
/**
* 控件改变.
*/
@ -107,9 +122,27 @@ public class WorkBookModelAdapter extends DesignModelAdapter<WorkBook, JWorkBook
@Override
protected Parameter[] getLatestParameters() {
return this.getBook().getParameters();
Map<String, ParameterProvider> map = new HashMap<>();
addGlobalParameters(map);
addTableDataParameters(map, null);
addReportParameters(map);
return map.values().toArray(new Parameter[0]);
}
private void addReportParameters(Map<String, ParameterProvider> map) {
// 添加模板参数
ReportParameterAttr parameterAttr = this.getBook().getReportParameterAttr();
if (parameterAttr != null) {
ParameterApplyHelper.addPara2Map(map, parameterAttr.getParameters());
}
}
/**
* 返回控件的名字
*

Loading…
Cancel
Save